NXGraphicsSubsystem.html 168 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823
  1. <html>
  2. <head>
  3. <title>NX Graphics Subsystem</title>
  4. <meta name="author" content="Gregory Nutt">
  5. </head>
  6. <body background="backgd.gif">
  7. <hr><hr>
  8. <table width ="100%">
  9. <tr align="center" bgcolor="#e4e4e4">
  10. <td>
  11. <h1><big><font color="#3c34ec">
  12. <i>NX Graphics Subsystem</i>
  13. </font></big></h1>
  14. <p>Last Updated: May 16, 2019</p>
  15. </td>
  16. </tr>
  17. </table>
  18. <hr><hr>
  19. <table width ="100%">
  20. <tr bgcolor="#e4e4e4">
  21. <td>
  22. <h1>Table of Contents</h1>
  23. </td>
  24. </tr>
  25. </table>
  26. <table width="100%">
  27. <tr>
  28. <td align="left" valign="top">
  29. <p>
  30. <big><b>1.0</b> <a href="#Introduction">Introduction</a></big>
  31. </p>
  32. <ul>
  33. <p>
  34. <i><b>1.1</b> <a href="#Overview">Overview</a><br></i>
  35. <i><b>1.2</b> <a href="#Objectives">Objectives</a></i><br>
  36. <i><b>1.3</b> <a href="#Organization">Organization</a></i>
  37. </p>
  38. <p>
  39. <ul>
  40. <i>1.3.1 <a href="#nxgl1">NX Graphics Library (<code>NXGL</code>)</a></i><br>
  41. <i>1.3.2 <a href="#nx1">NX (NXSU and NXMU)</a></i><br>
  42. <i>1.3.3 <a href="#nxtk1">NX Tool Kit (<code>NXTK</code>)</a></i><br>
  43. <i>1.3.4 <a href="#nxfonts1">NX Fonts Support (<code>NXFONTS</code>)</a></i><br>
  44. <i>1.3.5 <a href="#nxwidgets1">NX Widgets (<code>NxWidgets</code>)</a></i><br>
  45. <i>1.3.6 <a href="#nxterm1">NX Terminal Driver (<code>NxTerm</code>)</a></i>
  46. </ul>
  47. </p>
  48. </ul>
  49. <p>
  50. <big><b>2.0</b> <a href="#nxapis">NX User APIs</a></big>
  51. </p>
  52. <ul>
  53. <p>
  54. <i><b>2.1</b> <a href="#nxheaders">NX Header Files</a></i><br>
  55. <i><b>2.2</b> <a href="#nxgl2">NX Graphics Library (<code>NXGL</code>)</a></i>
  56. </p>
  57. <p>
  58. <ul>
  59. <i>2.2.1 <a href="#nxgltypes">NXGL Types</a></i><br>
  60. <i>2.2.1 <a href="#nxglrgb2yuv"><code>nxgl_rgb2yuv()</code></a></i><br>
  61. <i>2.2.2 <a href="#nxglyuv2rgb"><code>nxgl_yuv2rgb()</code></a></i><br>
  62. <i>2.2.3 <a href="#nxglrectcopy"><code>nxgl_rectcopy()</code></a></i><br>
  63. <i>2.2.4 <a href="#nxglrectoffset"><code>nxgl_rectoffset()</code></a></i><br>
  64. <i>2.2.5 <a href="#nxglvectoradd"><code>nxgl_vectoradd()</code></a></i><br>
  65. <i>2.2.6 <a href="#nxglvectorsubtract"><code>nxgl_vectorsubtract()</code></a></i><br>
  66. <i>2.2.7 <a href="#nxglrectintersect"><code>nxgl_rectintersect()</code></a></i><br>
  67. <i>2.2.8 <a href="#nxglrectunion"><code>nxgl_rectunion()</code></a></i><br>
  68. <i>2.2.9 <a href="#nxglnonintersecting"><code>nxgl_nonintersecting()</code></a></i><br>
  69. <i>2.2.10 <a href="#nxglrectoverlap"><code>nxgl_rectoverlap()</code></a></i><br>
  70. <i>2.2.11 <a href="#nxglrectinside"><code>nxgl_rectinside()</code></a></i><br>
  71. <i>2.2.12 <a href="#nxglrectsize"><code>nxgl_rectsize()</code></a></i><br>
  72. <i>2.2.13 <a href="#nxglnullrect"><code>nxgl_nullrect()</code></a></i><br>
  73. <i>2.2.14 <a href="#nxglrunoffset"><code>nxgl_runoffset()</code></a></i><br>
  74. <i>2.2.15 <a href="#nxglruncopy"><code>nxgl_runcopy()</code></a></i><br>
  75. <i>2.2.16 <a href="#nxgltrapoffset"><code>nxgl_trapoffset()</code></a></i><br>
  76. <i>2.2.17 <a href="#nxgltrapcopy"><code>nxgl_trapcopy()</code></a></i><br>
  77. <i>2.2.18 <a href="#nxglcolorcopy"><code>nxgl_colorcopy</code></a></i><br>
  78. <i>2.2.19 <a href="#nxglsplitline"><code>nxgl_splitline()</code></a></i><br>
  79. <i>2.2.20 <a href="#nxglcirclepts"><code>nxgl_circlepts()</code></a></i><br>
  80. <i>2.2.21 <a href="#nxglcircletraps"><code>nxgl_circletraps()</code></a></i>
  81. </ul>
  82. </p>
  83. <p>
  84. <i><b>2.3</b> <a href="#nx2">NX</a></i>
  85. </p>
  86. <p>
  87. <ul>
  88. <i>2.3.1 <a href="#nxppdefs">Pre-Processor Definitions</a></i><br>
  89. <i>2.3.2 <a href="#nxtypes">NX Types</a></i><br>
  90. <i>2.3.3 <a href="#startingnx">Starting the NX Server</a></i>
  91. <p>
  92. <ul>
  93. <i>2.3.3.1 <a href="#nxstart"><code>nxmu_start()</code></a></i><br>
  94. <i>2.3.3.2 <a href="#boardctl"><code>boardctl()</code></a></i><br>
  95. </ul>
  96. <p>
  97. <i>2.3.4 <a href="#nxcallbacks">NX Server Callbacks</a></i>
  98. <p>
  99. <ul>
  100. <i>2.3.4.1 <a href="#nxcbredraw"><code>redraw()</code></a></i><br>
  101. <i>2.3.4.2 <a href="#nxcbposition"><code>position()</code></a></i><br>
  102. <i>2.3.4.3 <a href="#nxcbmousein"><code>mousein()</code></a></i><br>
  103. <i>2.3.4.4 <a href="#nxcbkbdin"><code>kbdin()</code></a></i><br>
  104. <i>2.3.4.5 <a href="#nxcbevent"><code>event()</code></a></i>
  105. </ul>
  106. <p>
  107. <i>2.3.5 <a href="#nxruninstance"><code>nx_runinstance()</code> (and <code>nx_run()<code> macro)</a></i><br>
  108. <i>2.3.6 <a href="#nxconnectinstance"><code>nx_connectinstance()</code> (and <code>nx_connect()</code> macro)</a></i><br>
  109. <i>2.3.7 <a href="#nxdisconnect"><code>nx_disconnect()</code></a></i><br>
  110. <i>2.3.8 <a href="#nxeventhandler"><code>nx_eventhandler()</code></a></i><br>
  111. <i>2.3.9 <a href="#nxeventnotify"><code>nx_eventnotify()</code></a></i><br>
  112. <i>2.3.10 <a href="#nxblock"><code>nx_block()</code></a></i><br>
  113. <i>2.3.11 <a href="#nxsynch"><code>nx_synch()</code></a></i><br>
  114. <i>2.3.12 <a href="#nxopenwindow"><code>nx_openwindow()</code></a></i><br>
  115. <i>2.3.13 <a href="#nxclosewindow"><code>nx_closewindow()</code></a></i><br>
  116. <i>2.3.14 <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a></i><br>
  117. <i>2.3.15 <a href="#nxreleasebkgd"><code>nx_releasebkgd()</code></a></i><br>
  118. <i>2.3.16 <a href="#nxgetposition"><code>nx_getposition()</code></a></i><br>
  119. <i>2.3.17 <a href="#nxsetposition"><code>nx_setposition()</code></a></i><br>
  120. <i>2.3.18 <a href="#nxsetsize"><code>nx_setsize()</code></a></i><br>
  121. <i>2.3.19 <a href="#nxraise"><code>nx_raise()</code></a></i><br>
  122. <i>2.3.20 <a href="#nxlower"><code>nx_lower()</code></a></i><br>
  123. <i>2.3.21 <a href="#nxmodal"><code>nx_modal()</code></a></i><br>
  124. <i>2.3.22 <a href="#nxsetvisibility"><code>nx_setvisibility()</code></a></i><br>
  125. <i>2.3.23 <a href="#nxishidden"><code>nx_ishidden()</code></a></i><br>
  126. <i>2.3.24 <a href="#nxfill"><code>nx_fill()</code></a></i><br>
  127. <i>2.3.25 <a href="#nxgetrectangle"><code>nx_getrectangle()</code></a></i><br>
  128. <i>2.3.26 <a href="#nxfilltrapezoid"><code>nx_filltrapezoid()</code></a></i><br>
  129. <i>2.3.27 <a href="#nxdrawline"><code>nx_drawline()</code></a></i><br>
  130. <i>2.3.28 <a href="#nxdrawcircle"><code>nx_drawcircle()</code></a></i><br>
  131. <i>2.3.29 <a href="#nxfillcircle"><code>nx_fillcircle()</code></a></i><br>
  132. <i>2.3.30 <a href="#nxglrgb2yuv"><code>nx_setbgcolor()</code></a></i><br>
  133. <i>2.3.31 <a href="#nxmove"><code>nx_move()</code></a></i><br>
  134. <i>2.3.32 <a href="#nxbitmap"><code>nx_bitmap()</code></a></i><br>
  135. <i>2.3.33 <a href="#nxkbdin"><code>nx_kbdin()</code></a></i><br>
  136. <i>2.3.34 <a href="#nxmousein"><code>nx_mousein()</code></a></i><br>
  137. </ul>
  138. </p>
  139. </td>
  140. <td align="left" valign="top">
  141. <p>
  142. <i><b>2.4</b> <a href="#nxtk2">NX Tool Kit (<code>NXTK</code>)</a></i>
  143. </p>
  144. <p>
  145. <ul>
  146. <i>2.4.1 <a href="#nxtktypes"><code>NXTK Types()</code></a></i><br>
  147. <i>2.4.2 <a href="#nxtkblock"><code>nxtk_block()</code></a></i><br>
  148. <i>2.4.3 <a href="#nxtksynch"><code>nxtk_synch()</code></a></i><br>
  149. <i>2.4.4 <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a></i><br>
  150. <i>2.4.5 <a href="#nxtkclosewindow"><code>nxtk_closewindow()</code></a></i><br>
  151. <i>2.4.6 <a href="#nxtkgetposition"><code>nxtk_getposition()</code></a></i><br>
  152. <i>2.4.7 <a href="#nxtksetposition"><code>nxtk_setposition()</code></a></i><br>
  153. <i>2.4.8 <a href="#nxtksetsize"><code>nxtk_setsize()</code></a></i><br>
  154. <i>2.4.9 <a href="#nxtkraise"><code>nxtk_raise()</code></a></i><br>
  155. <i>2.4.10 <a href="#nxtklower"><code>nxtk_lower()</code></a></i><br>
  156. <i>2.4.11 <a href="#nxtkmodal"><code>nxtk_modal()</code></a></i><br>
  157. <i>2.4.12 <a href="#nxtksetvisibility"><code>nxtk_setvisibility()</code></a></i><br>
  158. <i>2.4.13 <a href="#nxtkishidden"><code>nxtk_ishidden()</code></a></i><br>
  159. <i>2.4.14 <a href="#nxtkfillwindow"><code>nxtk_fillwindow()</code></a></i><br>
  160. <i>2.4.15 <a href="#nxtkgetwindow"><code>nxtk_getwindow()</code></a></i><br>
  161. <i>2.4.16 <a href="#nxtkfilltrapwindow"><code>nxtk_filltrapwindow()</code></a></i><br>
  162. <i>2.4.17 <a href="#nxtkdrawlinewindow"><code>nxtk_drawlinewindow()</code></a></i><br>
  163. <i>2.4.18 <a href="#nxtkdrawcirclewindow"><code>nxtk_drawcirclewindow()</code></a></i><br>
  164. <i>2.4.19 <a href="#nxtkfillcirclewindow"><code>nxtk_fillcirclewindow()</code></a></i><br>
  165. <i>2.4.20 <a href="#nxtkmovewindow"><code>nxtk_movewindow()</code></a></i><br>
  166. <i>2.4.21 <a href="#nxtkbitmapwindow"><code>nxtk_bitmapwindow()</code></a></i><br>
  167. <i>2.4.22 <a href="#nxtkopentoolbar"><code>nxtk_opentoolbar()</code></a></i><br>
  168. <i>2.4.23 <a href="#nxtkclosetoolbar"><code>nxtk_closetoolbar()</code></a></i><br>
  169. <i>2.4.24 <a href="#nxtkfilltoolbar"><code>nxtk_filltoolbar()</code></a></i><br>
  170. <i>2.4.25 <a href="#nxtkgettoolbar"><code>nxtk_gettoolbar()</code></a></i><br>
  171. <i>2.4.26 <a href="#nxtkfilltraptoolbar"><code>nxtk_filltraptoolbar()</code></a></i><br>
  172. <i>2.4.27 <a href="#nxtkdrawlinetoolbar"><code>nxtk_drawlinetoolbar()</code></a></i><br>
  173. <i>2.4.28 <a href="#nxtkdrawcircletoolbar"><code>nxtk_drawcircletoolbar()</code></a></i><br>
  174. <i>2.4.29 <a href="#nxtkfillcircletoolbar"><code>nxtk_fillcircletoolbar()</code></a></i><br>
  175. <i>2.4.30 <a href="#nxtkmovetoolbar"><code>nxtk_movetoolbar()</code></a></i><br>
  176. <i>2.4.31 <a href="#nxtkbitmaptoolbar"><code>nxtk_bitmaptoolbar()</code></a></i>
  177. </ul>
  178. </p>
  179. <p>
  180. <i><b>2.5</b> <a href="#nxfonts2">NX Fonts Support (<code>NXFONTS</code>)</a></i>
  181. </p>
  182. <p>
  183. <ul>
  184. <i>2.5.1 <a href="#nxfontstypes"><code>NXFONTS Types()</code></a></i><br>
  185. <i>2.5.2 <a href="#nxfgetfonthandle"><code>nxf_getfonthandle()</code></a></i><br>
  186. <i>2.5.3 <a href="#nxfgetfontset"><code>nxf_getfontset()</code></a></i><br>
  187. <i>2.5.4 <a href="#nxfgetbitmap"><code>nxf_getbitmap()</code></a></i><br>
  188. <i>2.5.5 <a href="#nxfconvertbpp"><code>nxf_convert_*bpp()</code></a></i>
  189. </ul>
  190. </p>
  191. <p>
  192. <i><b>2.6</b> <a href="#nxcursor">NX Cursor Support (<code>NXCURSOR</code>)</a></i>
  193. </p>
  194. <p>
  195. <ul>
  196. <i>2.6.1 <a href="#nxcursorenable"><code>nxcursor_enable()</code></a></i><br>
  197. <i>2.6.2 <a href="#nxcursorsetimage"><code>nxcursor_setimage()</code></a></i><br>
  198. <i>2.6.3 <a href="#nxcursorsetposition"><code>nxcursor_setposition()</code></a></i><br>
  199. </ul>
  200. </p>
  201. <p>
  202. <i><b>2.7</b> <a href="#samplecode">Sample Code</a></i>
  203. </p>
  204. </ul>
  205. <p>
  206. <big><b>Appendix A</b> <a href="#grapicsdirs"><code>graphics/</code> Directory Structure</a></big><br>
  207. <big><b>Appendix B</b> <a href="#nxconfigs">NX Configuration Options</a></big>
  208. </p>
  209. <p>
  210. <ul>
  211. <i><b>B.1</b> <a href="#nxgenconfig">General Configuration Settings</a></i><br>
  212. <i><b>B.2</b> <a href="#nxglconfig">NXGL Configuration Settings</a></i><br>
  213. <i><b>B.3</b> <a href="#nxconfig">NX Configuration Settings</a></i><br>
  214. <i><b>B.4</b> <a href="#nxmuconfig">NX Server Configuration Settings</a></i><br>
  215. <i><b>B.5</b> <a href="#nxtkconfig">NXTK Configuration Settings</a></i><br>
  216. <i><b>B.6</b> <a href="#nxfpmtsconfig">NXFONTS Configuration Settings</a></i><br>
  217. <i><b>B.7</b> <a href="#nxtermconfig">NxTerm Configuration Settings</a></i>
  218. </ul>
  219. </p>
  220. <p>
  221. <big><b>Appendix C</b> <a href="#installnewfonts">Installing New Fonts</a></big>
  222. </p>
  223. <p>
  224. <big><b>Appendix D</b> <a href="#testcoverage">NX Test Coverage</a></big>
  225. </p>
  226. <ul>
  227. <i><b>Table D.1:</b> <a href="#nxglibcoverage">NXGLIB API Test Coverage</a></i><br>
  228. <i><b>Table D.2:</b> <a href="#nxcbcoverage">NX Server Callbacks Test Coverage</a></i><br>
  229. <i><b>Table D.3:</b> <a href="#nxcoverage">NX API Test Coverage</a></i><br>
  230. <i><b>Table D.4:</b> <a href="#nxtkcoverage">NXTK API Test Coverage</a></i><br>
  231. <i><b>Table D.5:</b> <a href="#nxfontscoverage">NXFONTS API Test Coverage</a></i><br>
  232. </ul>
  233. </td>
  234. </tr>
  235. </table>
  236. <table width ="100%">
  237. <tr bgcolor="#e4e4e4">
  238. <td>
  239. <h1>1.0 <a name="Introduction">Introduction</a></h1>
  240. </td>
  241. </tr>
  242. </table>
  243. <h2>1.1 <a name="Overview">Overview</a></h2>
  244. <p>
  245. This document describes the tiny graphics support included in NuttX.
  246. It includes an overview description of that graphics support, detailed
  247. descriptions of the NuttX graphics APIs, and discussion of code organization,
  248. and OS configuration options.
  249. </p>
  250. <center><table width="480">
  251. <tr>
  252. <td><a name="screenshot"><img src="NuttXScreenShot.jpg"></a></td>
  253. </tr>
  254. <tr>
  255. <td><small>Figure 1.
  256. This scren shot shows the final frame for the NuttX example at <code>apps/examples/nx</code>
  257. running on the simulated, Linux x86 platform with simulated framebuffer output to
  258. an X window.
  259. This picture shows to framed windows with (blank) toolbars.
  260. Each window has displayed text as received from the NX keyboard interface
  261. The second window has just been raised to the top of the display.
  262. </small>
  263. </tr>
  264. </table></center>
  265. <h2>1.2 <a name="Objectives">Objectives</a></h2>
  266. <p>
  267. The objective of this development was to provide a tiny windowing system in the
  268. spirit of X, but greatly scaled down and appropriate for most resource-limited
  269. embedded environments.
  270. The current NX implementation supports the general following, high-level features:
  271. </p>
  272. <ul>
  273. <li><b>Virtual Vertical Graphics Space</b>.
  274. Windows that reside in a virtual, <i>vertical</i> space so that it makes
  275. sense to talk about one window being on top of another and obscuring the
  276. window below it.
  277. </li>
  278. <li><b>Client/Server Model</b>.
  279. A standard client server/model was adopted. NX may be considered a server
  280. and other logic that presents the windows are NX clients.
  281. </li>
  282. <li><b>Multi-User Support</b>.
  283. NX includes <i>front-end</i> logic to support a separate NX server thread
  284. that can serve multiple NX client threads.
  285. The NX is a server thread/daemon the serializes graphics operations from
  286. multiple clients.
  287. </li>
  288. <li><b>Minimal Graphics Toolset</b>.
  289. The actual implementation of the graphics operations is performed by common,
  290. <i>back-end</i> logic. This back-end supports only a primitive set of graphic
  291. and rendering operations.
  292. </li>
  293. <li><b>Device Interface</b>.
  294. NX supports any graphics device either of two device interfaces:
  295. <ul>
  296. <li>
  297. Any device with random accesss video memory using the NuttX framebuffer driver interface
  298. (see <code>include/nuttx/video/fb.h</code>).
  299. </li>
  300. <li>
  301. Any LCD-like device than can accept raster line <i>runs</i> through a parallel or serial interface
  302. (see <code>include/nuttx/lcd/lcd.h</code>).
  303. By default, NX is configured to use the frame buffer driver unless <code>CONFIG_NX_LCDDRIVER</code> is defined =y in your NuttX configuration file.
  304. </li>
  305. </ul>
  306. </li>
  307. <li><b>Transparent to NX Client</b>.
  308. The window client on &quot;sees&quot; the sub-window that is operates in
  309. and does not need to be concerned with the virtual, vertical space (other
  310. that to respond to <i>redraw</i> requests from NX when needed).
  311. </li>
  312. <li><b>Framed Windows and Toolbars</b>.
  313. NX also adds the capability to support windows with frames and toolbars on
  314. top of the basic windowing support.
  315. These are windows such as those shown in the
  316. <a href="#screenshot">screenshot</a> above.
  317. These framed windows sub-divide one one window into three relatively independent
  318. subwindows: A frame, the contained window and an (optional) toolbar window.
  319. </li>
  320. <li><b>Mouse Support</b>.
  321. NX provides support for a mouse or other X/Y pointing devices.
  322. APIs are provided to allow external devices to give X/Y position information
  323. and mouse button presses to NX.
  324. NX will then provide the mouse input to the relevant window clients via callbacks.
  325. Client windows only receive the mouse input callback if the mouse is positioned over a visible
  326. portion of the client window; X/Y position is provided to the client in the relative
  327. coordinate system of the client window.
  328. </li>
  329. <li><b>Keyboard input</b>.
  330. NX also supports keyboard/keypad devices.
  331. APIs are provided to allow external devices to give keypad information to NX.
  332. NX will then provide the mouse input to the top window on the display (the window
  333. that has the <i>focus</i>) via a callback function.
  334. </li>
  335. </ul>
  336. <h2>1.3 <a name="Organization">Organization</a></h2>
  337. <p>
  338. NX is organized into 6 (and perhaps someday 7 or 8) logical modules.
  339. These logical modules also correspond to the directory organization.
  340. That NuttX directory organization is discussed in
  341. <a href="#grapicsdirs">Appendix B</a> of this document.
  342. The logic modules are discussed in the following sub-paragraphs.
  343. </p>
  344. <p>
  345. <center><img src="NXOrganization.gif" width="60%"></center>
  346. </p>
  347. <h3>1.3.1 <a name="nxgl1">NX Graphics Library (<code>NXGL</code>)</a></h3>
  348. <p>
  349. NXGLIB is a standalone library that contains low-level graphics utilities and
  350. direct framebuffer or LCD rendering logic. NX is built on top NXGLIB.
  351. </p>
  352. <h3>1.3.2 <a name="nx1">NX (<code>NXSU</code> and <code>NXMU</code>)</a></h3>
  353. <p>
  354. NX is the tiny NuttX windowing system for raw windows (i.e., simple regions of
  355. graphics memory).
  356. NX includes a small-footprint, multi-user implentation (NXMU as described below).
  357. NX can be used without NxWidgets and without NXTOOLKIT for raw window displays.
  358. </p>
  359. <p>
  360. <sup>1</sup><small>NXMU and NXSU are interchangeable other than (1) certain start-up
  361. and initialization APIs (as described below), and (2) timing. With NXSU, NX APIs
  362. execute immediately; with NXMU, NX APIs defer and serialize the operations and, hence,
  363. introduce different timing and potential race conditions that you would not experience
  364. with NXSU.</small>
  365. </p>
  366. <p><b>NXNULL?</b>
  367. At one time, I also envisioned a <i>NULL</i> front-end that did not support windowing
  368. at all but, rather, simply provided the entire framebuffer or LCD memory as one dumb window.
  369. This has the advantage that the same NX APIs can be used on the one dumb window as
  370. for the other NX windows.
  371. This would be in the NuttX spirit of scalability.
  372. </p>
  373. <p>
  374. However, the same end result can be obtained by using the
  375. <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a> API.
  376. It still may be possible to reduce the footprint in this usage case by developing
  377. and even thinner NXNULL front-end.
  378. That is a possible future development.
  379. </p>
  380. <h3>1.3.3 <a name="nxtk1">NX Tool Kit (<code>NXTK</code>)</a></h3>
  381. <p>
  382. NXTK is a s set of C graphics tools that provide higher-level window drawing
  383. operations.
  384. This is the module where the framed windows and toolbar logic is implemented.
  385. NXTK is built on top of NX and does not depend on NxWidgets.
  386. </p>
  387. <h3>1.3.4 <a name="nxfonts1">NX Fonts Support (<code>NXFONTS</code>)</a></h3>
  388. <p>
  389. A set of C graphics tools for present (bitmap) font images.
  390. The font implementation is at a very low level or graphics operation,
  391. comparable to the logic in NXGLIB.
  392. NXFONTS does not depend on any NX module other than some utilities and types from NXGLIB.
  393. </p>
  394. <h3>1.3.5 <a name="nxwidgets1">NX Widgets (<code>NxWidgets</code>)</a></h3>
  395. <p>
  396. <a href="NxWidgets.html">NxWidgets</a> is a higher level, C++, object-oriented library for object-oriented access to graphical &quot;widgets.&quot;
  397. NxWidgets is provided as a separate library in the <code>apps/</code> repository
  398. NxWidgets is built on top of the core NuttX graphics subsystem, but is part of the application space rather than part of the core OS graphics subystems.
  399. </p>
  400. <h3>1.3.6 <a name="nxterm1">NX Terminal Driver (<code>NxTerm</code>)</a></h3>
  401. <p>
  402. NxTerm is a write-only character device (not shown) that is built on top of an NX window.
  403. This character device can be used to provide <code>stdout</code> and <code>stderr</code> and, hence, can provide the output side of NuttX console.
  404. </code>).
  405. </p>
  406. <table width ="100%">
  407. <tr bgcolor="#e4e4e4">
  408. <td>
  409. <h1>2.0 <a name="nxapis">NX User APIs</a></h1>
  410. </td>
  411. </tr>
  412. </table>
  413. <h2>2.1 <a name="nxheaders">NX Header Files</a></h2>
  414. <ul><dl>
  415. <dt><code>include/nuttx/nx/nxglib.h</code>
  416. <dd>Describes the NXGLIB C interfaces
  417. <dt><code>include/nuttx/nx/nx.h</code>
  418. <dd>Describes the NX C interfaces
  419. <dt><code>include/nutt/nxtk.h</code>
  420. <dd>Describe the NXTOOLKIT C interfaces
  421. <dt><code>include/nutt/nxfont.h</code>
  422. <dd>Describe sthe NXFONT C interfaces
  423. </dl></ul>
  424. <h2>2.2 <a name="nxgl2">NX Graphics Library (<code>NXGL</code>)</a></h2>
  425. <p>
  426. NXGL provides many APIs, some available for use internally by NX and
  427. others for use by applications as well.
  428. Only those APIs intended for application usage are documented here
  429. See <code>include/nuttx/nx/nxglib.h</code> for the full set of APIs;
  430. those APIs might be of interest if you are rendering directly into
  431. framebuffer or LCD memory.
  432. </p>
  433. <h3>2.2.1 <a name="nxgltypes">NXGL Types</a></h3>
  434. <p>
  435. <code>nxgl_mxpixel_t</code>.
  436. Holds one device pixel.
  437. NXGLIB will select the smallest size for the <code>nxgl_mxpixel_t</code>
  438. that just contains the pixel: <code>byte</code> if 16, 24, and 32 resolution
  439. support is disabled, <code>uint16_t</code> if 24, and 32 resolution
  440. support is disabled, or <code>uint32_t</code>.
  441. </p>
  442. <p>
  443. <code>nxgl_coord_t</code>.
  444. A given coordinate is limited to the screen height an width. If either
  445. of those values exceed 32,767 pixels, then the following will have to need
  446. to change:
  447. </p>
  448. <ul><pre>
  449. typedef int16_t nxgl_coord_t;
  450. </pre></ul>
  451. <p>
  452. <code>struct nxgl_point_s</code>. Describes a point on the display:
  453. </p>
  454. <ul><pre>
  455. struct nxgl_point_s
  456. {
  457. nxgl_coord_t x; /* X position, range: 0 to screen width - 1 */
  458. nxgl_coord_t y; /* Y position, range: 0 to screen height - 1 */
  459. };
  460. </pre></ul>
  461. <p>
  462. <code>struct nxgl_size_s</code>. Describes the size of a rectangular region.
  463. </p>
  464. <ul><pre>
  465. struct nxgl_size_s
  466. {
  467. nxgl_coord_t w; /* Width in pixels */
  468. nxgl_coord_t h; /* Height in rows */
  469. };
  470. </pre></ul>
  471. <p>
  472. <code>struct nxgl_rect_s</code>. Describes a positioned rectangle on the display.
  473. </p>
  474. <ul><pre>
  475. struct nxgl_rect_s
  476. {
  477. struct nxgl_point_s pt1; /* Upper, left-hand corner */
  478. struct nxgl_point_s pt2; /* Lower, right-hand corner */
  479. };
  480. </pre></ul>
  481. <p>
  482. <code>struct nxgl_run_s</code>.
  483. Describes a run, i.e., a horizontal line. Note that the start/end positions
  484. have fractional precision. This is necessary for good joining of trapezoids
  485. when a more complex shape is decomposed into trapezoids
  486. </p>
  487. <ul><pre>
  488. struct nxgl_run_s
  489. {
  490. b16_t x1; /* Left X position, range: 0 to x2 */
  491. b16_t x2; /* Right X position, range: x1 to screen width - 1 */
  492. nxgl_coord_t y; /* Top Y position, range: 0 to screen height - 1 */
  493. };
  494. </pre></ul>
  495. <p>
  496. <code>struct nxgl_trapezoid_s</code>.
  497. Describes a horizontal trapezoid on the display in terms the run at the
  498. top of the trapezoid and the run at the bottom
  499. </p>
  500. <ul><pre>
  501. struct nxgl_trapezoid_s
  502. {
  503. struct nxgl_run_s top; /* Top run */
  504. struct nxgl_run_s bot; /* bottom run */
  505. };
  506. </pre></ul>
  507. <h3>2.2.1 <a name="nxglrgb2yuv"><code>nxgl_rgb2yuv()</code></a></h3>
  508. <p><b>Function Prototype:</b></p>
  509. <ul><pre>
  510. #include &lt;nuttx/nx/nxglib.h&gt;
  511. void nxgl_rgb2yuv(uint8_t r, uint8_t g, uint8_t b, uint8_t *y, uint8_t *u, uint8_t *v);
  512. </pre></ul>
  513. <p>
  514. <b>Description:</b>
  515. Convert 8-bit RGB triplet to 8-bit YUV triplet.
  516. </p>
  517. <h3>2.2.2 <a name="nxglyuv2rgb"><code>nxgl_yuv2rgb()</code></a></h3>
  518. <p><b>Function Prototype:</b></p>
  519. <ul><pre>
  520. #include &lt;nuttx/nx/nxglib.h&gt;
  521. void nxgl_yuv2rgb(uint8_t y, uint8_t u, uint8_t v, uint8_t *r, uint8_t *g, uint8_t *b);
  522. </pre></ul>
  523. <p>
  524. <b>Description:</b>
  525. Convert 8-bit YUV triplet to 8-bit RGB triplet.
  526. </p>
  527. <h3>2.2.3 <a name="nxglrectcopy"><code>nxgl_rectcopy()</code></a></h3>
  528. <p><b>Function Prototype:</b></p>
  529. <ul><pre>
  530. #include &lt;nuttx/nx/nxglib.h&gt;
  531. void nxgl_rectcopy(FAR struct nxgl_rect_s *dest,
  532. FAR const struct nxgl_rect_s *src);
  533. </pre></ul>
  534. <p>
  535. <b>Description:</b>
  536. This is essentially <code>memcpy()</code>for rectangles. We don't do structure
  537. assignments because some compilers are not good at that.
  538. </p>
  539. <h3>2.2.4 <a name="nxglrectoffset"><code>nxgl_rectoffset()</code></a></h3>
  540. <p><b>Function Prototype:</b></p>
  541. <ul><pre>
  542. #include &lt;nuttx/nx/nxglib.h&gt;
  543. void nxgl_rectoffset(FAR struct nxgl_rect_s *dest,
  544. FAR const struct nxgl_rect_s *src,
  545. nxgl_coord_t dx, nxgl_coord_t dy);
  546. </pre></ul>
  547. <p>
  548. <b>Description:</b>
  549. Offset the rectangle position by the specified dx, dy values.
  550. </p>
  551. <h3>2.2.5 <a name="nxglvectoradd"><code>nxgl_vectoradd()</code></a></h3>
  552. <p><b>Function Prototype:</b></p>
  553. <ul><pre>
  554. #include &lt;nuttx/nx/nxglib.h&gt;
  555. void nxgl_vectoradd(FAR struct nxgl_point_s *dest,
  556. FAR const struct nxgl_point_s *v1,
  557. FAR const struct nxgl_point_s *v2);
  558. </pre></ul>
  559. <p>
  560. <b>Description:</b>
  561. Add two 2x1 vectors and save the result to a third.
  562. </p>
  563. <h3>2.2.6 <a name="nxglvectorsubtract"><code>nxgl_vectorsubtract()</code></a></h3>
  564. <p><b>Function Prototype:</b></p>
  565. <ul><pre>
  566. #include &lt;nuttx/nx/nxglib.h&gt;
  567. void nxgl_vectsubtract(FAR struct nxgl_point_s *dest,
  568. FAR const struct nxgl_point_s *v1,
  569. FAR const struct nxgl_point_s *v2);
  570. </pre></ul>
  571. <p>
  572. <b>Description:</b>
  573. Add subtract vector <code>v2</code> from vector <code>v1</code> and return the result in vector dest.
  574. </p>
  575. <h3>2.2.7 <a name="nxglrectintersect"><code>nxgl_rectintersect()</code></a></h3>
  576. <p><b>Function Prototype:</b></p>
  577. <ul><pre>
  578. #include &lt;nuttx/nx/nxglib.h&gt;
  579. void nxgl_rectintersect(FAR struct nxgl_rect_s *dest,
  580. FAR const struct nxgl_rect_s *src1,
  581. FAR const struct nxgl_rect_s *src2);
  582. </pre></ul>
  583. <p>
  584. <b>Description:</b>
  585. Return the rectangle representing the intersection of the two rectangles.
  586. </p>
  587. <h3>2.2.8 <a name="nxglrectunion"><code>nxgl_rectunion()</code></a></h3>
  588. <p><b>Function Prototype:</b></p>
  589. <ul><pre>
  590. #include &lt;nuttx/nx/nxglib.h&gt;
  591. void nxgl_rectunion(FAR struct nxgl_rect_s *dest,
  592. FAR const struct nxgl_rect_s *src1,
  593. FAR const struct nxgl_rect_s *src2);
  594. </pre></ul>
  595. <p>
  596. <b>Description:</b>
  597. Given two rectanges, <code>src1</code> and <code>src2</code>, return the larger rectangle that
  598. contains both, <code>dest</code>.
  599. </p>
  600. <h3>2.2.9 <a name="nxglnonintersecting"><code>nxgl_nonintersecting()</code></a></h3>
  601. <p><b>Function Prototype:</b></p>
  602. <ul><pre>
  603. #include &lt;nuttx/nx/nxglib.h&gt;
  604. nxgl_nonintersecting(FAR struct nxgl_rect_s result[4],
  605. FAR const struct nxgl_rect_s *rect1,
  606. FAR const struct nxgl_rect_s *rect2);
  607. </pre></ul>
  608. <p>
  609. <b>Description:</b>
  610. Return the regions of rectangle <code>rect1</code> that do not intersect with
  611. <code>rect2</code>. This will four rectangles, some of which may be
  612. degenerate (and can be picked off with <a href="#nxglnullrect"><code>nxgl_nullrect()</code></a>).
  613. </p>
  614. <h3>2.2.10 <a name="nxglrectoverlap"><code>nxgl_rectoverlap()</code></a></h3>
  615. <p><b>Function Prototype:</b></p>
  616. <ul><pre>
  617. #include &lt;nuttx/nx/nxglib.h&gt;
  618. bool nxgl_rectoverlap(FAR struct nxgl_rect_s *rect1,
  619. FAR struct nxgl_rect_s *rect2);
  620. </pre></ul>
  621. <p>
  622. <b>Description:</b>
  623. Return true if the two rectangles overlap.
  624. </p>
  625. <h3>2.2.11 <a name="nxglrectinside"><code>nxgl_rectinside()</code></a></h3>
  626. <p><b>Function Prototype:</b></p>
  627. <ul><pre>
  628. #include &lt;nuttx/nx/nxglib.h&gt;
  629. bool nxgl_rectinside(FAR const struct nxgl_rect_s *rect,
  630. FAR const struct nxgl_point_s *pt);
  631. </pre></ul>
  632. <p>
  633. <b>Description:</b>
  634. Return true if the point <code>pt</code> lies within <code>rect</code>.
  635. </p>
  636. <h3>2.2.12 <a name="nxglrectsize"><code>nxgl_rectsize()</code></a></h3>
  637. <p><b>Function Prototype:</b></p>
  638. <ul><pre>
  639. #include &lt;nuttx/nx/nxglib.h&gt;
  640. void nxgl_rectsize(FAR struct nxgl_size_s *size,
  641. FAR const struct nxgl_rect_s *rect);
  642. </pre></ul>
  643. <p>
  644. <b>Description:</b>
  645. Return the size of the specified rectangle.
  646. </p>
  647. <h3>2.2.13 <a name="nxglnullrect"><code>nxgl_nullrect()</code></a></h3>
  648. <p><b>Function Prototype:</b></p>
  649. <ul><pre>
  650. #include &lt;nuttx/nx/nxglib.h&gt;
  651. bool nxgl_nullrect(FAR const struct nxgl_rect_s *rect);
  652. </pre></ul>
  653. <p>
  654. <b>Description:</b>
  655. Return true if the area of the retangle is &lt;= 0.
  656. </p>
  657. <h3>2.2.14 <a name="nxglrunoffset"><code>nxgl_runoffset()</code></a></h3>
  658. <p><b>Function Prototype:</b></p>
  659. <ul><pre>
  660. #include &lt;nuttx/nx/nxglib.h&gt;
  661. void nxgl_runoffset(FAR struct nxgl_run_s *dest,
  662. FAR const struct nxgl_run_s *src,
  663. nxgl_coord_t dx, nxgl_coord_t dy);
  664. </pre></ul>
  665. <p>
  666. <b>Description:</b>
  667. Offset the run position by the specified <code>dx</code>, <code>dy</code> values.
  668. </p>
  669. <h3>2.2.15 <a name="nxglruncopy"><code>nxgl_runcopy()</code></a></h3>
  670. <p><b>Function Prototype:</b></p>
  671. <ul><pre>
  672. #include &lt;nuttx/nx/nxglib.h&gt;
  673. void nxgl_runcopy(FAR struct nxgl_run_s *dest,
  674. FAR const struct nxgl_run_s *src);
  675. </pre></ul>
  676. <p>
  677. <b>Description:</b>
  678. This is essentially <code>memcpy()</code>for runs. We don't do structure assignments
  679. because some compilers are not good at that.
  680. </p>
  681. <h3>2.2.16 <a name="nxgltrapoffset"><code>nxgl_trapoffset()</code></a></h3>
  682. <p><b>Function Prototype:</b></p>
  683. <ul><pre>
  684. #include &lt;nuttx/nx/nxglib.h&gt;
  685. void nxgl_trapoffset(FAR struct nxgl_trapezoid_s *dest,
  686. FAR const struct nxgl_trapezoid_s *src,
  687. nxgl_coord_t dx, nxgl_coord_t dy);
  688. </pre></ul>
  689. <p>
  690. <b>Description:</b>
  691. Offset the trapezoid position by the specified <code>dx</code>, <code>dy</code> values.
  692. </p>
  693. <h3>2.2.17 <a name="nxgltrapcopy"><code>nxgl_trapcopy()</code></a></h3>
  694. <p><b>Function Prototype:</b></p>
  695. <ul><pre>
  696. #include &lt;nuttx/nx/nxglib.h&gt;
  697. void nxgl_trapcopy(FAR struct nxgl_trapezoid_s *dest,
  698. FAR const struct nxgl_trapezoid_s *src);
  699. </pre></ul>
  700. <p>
  701. <b>Description:</b>
  702. This is essentially <code>memcpy()</code>for trapezoids. We don't do structure
  703. assignments because some compilers are not good at that.
  704. </p>
  705. <h3>2.2.18 <a name="nxglcolorcopy"><code>nxgl_colorcopy</code></a></h3>
  706. <p><b>Function Prototype:</b></p>
  707. <ul><pre>
  708. #include &lt;nuttx/nx/nxglib.h&gt;
  709. nxgl_colorcopy(nxgl_mxpixel_t dest[CONFIG_NX_NPLANES],
  710. const nxgl_mxpixel_t src[CONFIG_NX_NPLANES]);
  711. </pre></ul>
  712. <p>
  713. <b>Description:</b>
  714. This is essentially <code>memcpy()</code>for colors. This does very little for us
  715. other than hide all of the conditional compilation for planar colors
  716. in one place.
  717. </p>
  718. <h3>2.2.19 <a name="nxglsplitline"><code>nxgl_splitline</code></a></h3>
  719. <p><b>Function Prototype:</b></p>
  720. <ul><pre>
  721. #include &lt;nuttx/nx/nxglib.h&gt;
  722. int nxgl_splitline(FAR struct nxgl_vector_s *vector, FAR struct nxgl_trapezoid_s *traps,
  723. FAR struct nxgl_rect_s *rect, nxgl_coord_t linewidth);
  724. </pre></ul>
  725. <p>
  726. <b>Description:</b>
  727. In the general case, a line with width can be represented as a parallelogram with a triangle at the top and bottom.
  728. Triangles and parallelograms are both degenerate versions of a trapezoid.
  729. This function breaks a wide line into triangles and trapezoids.
  730. This function also detects other degenerate cases:
  731. </p>
  732. <ol>
  733. <li>
  734. If <code>y1 == y2</code> then the line is horizontal and is better represented as a rectangle.
  735. </li>
  736. <li>
  737. If <code>x1 == x2</code> then the line is vertical and also better represented as a rectangle.
  738. </li>
  739. <li>
  740. If the width of the line is 1, then there are no triangles at the top and bottom
  741. (this may also be the case if the width is narrow and the line is near vertical).
  742. </li>
  743. <li>
  744. If the line is oriented is certain angles, it may consist only of the upper and lower triangles with no trapezoid in between.
  745. In this case, 3 trapezoids will be returned, but traps[1] will be degenerate.
  746. </li>
  747. </ol>
  748. <p>
  749. <b>Input parameters</b>:
  750. <p>
  751. <ul><dl>
  752. <dt><code>vector</code>
  753. <dd>A pointer to the vector described the line to be drawn.
  754. <dt><code>traps</code>
  755. <dd>A pointer to a array of trapezoids (size 3).
  756. <dt><code>rect</code>
  757. <dd> A pointer to a rectangle.
  758. </dl></ul>
  759. <p>
  760. <b>Returned value</b>:
  761. </p>
  762. <ul>
  763. <p>
  764. <code>0</code>: Line successfully broken up into three trapezoids.
  765. Values in <code>traps[0]</code>, <code>traps[1]</code>, and <code>traps[2]</code> are valid.
  766. </p>
  767. <p>
  768. <code>1</code>: Line successfully represented by one trapezoid.
  769. Value in <code>traps[1]</code> is valid.
  770. </p>
  771. <p>
  772. <code>2</code>: Line successfully represented by one rectangle.
  773. Value in <code>rect </code>is valid
  774. </p>
  775. <p>
  776. <code>&lt;0</code>: On errors, a negated <code>errno</code> value is returned.
  777. </p>
  778. <p>
  779. </ul>
  780. <h3>2.2.20 <a name="nxglcirclepts"><code>nxgl_circlepts</code></a></h3>
  781. <ul><pre>
  782. #include &lt;nuttx/nx/nxglib.h&gt;
  783. void nxgl_circlepts(FAR const struct nxgl_point_s *center, nxgl_coord_t radius,
  784. FAR struct nxgl_point_s *circle);
  785. </pre></ul>
  786. <p>
  787. <b>Description:</b>
  788. Given a description of a circle, return a set of 16 points on the circumference of the circle.
  789. These points may then be used by <a href="nxdrawcircle"><code>nx_drawcircle()</code></a> or related APIs to draw a circle outline.
  790. </p>
  791. <p>
  792. <b>Input parameters</b>:
  793. <p>
  794. <ul><dl>
  795. <dt><code>center</code>
  796. <dd>A pointer to the point that is the center of the circle.
  797. <dt><code>radius</code>
  798. <dd>The radius of the circle in pixels.
  799. <dt><code>circle</code>
  800. <dd>A pointer the first entry in an array of 16 points where the circle points will be returned.
  801. </dl></ul>
  802. <p>
  803. <b>Returned value</b>: None
  804. </p>
  805. <h3>2.2.21 <a name="nxglcircletraps"><code>nxgl_circletraps</code></a></h3>
  806. <ul><pre>
  807. #include &lt;nuttx/nx/nxglib.h&gt;
  808. oid nxgl_circletraps(FAR const struct nxgl_point_s *center, nxgl_coord_t radius,
  809. FAR struct nxgl_trapezoid_s *circle);
  810. </pre></ul>
  811. <p>
  812. <b>Description:</b>
  813. Given a description of a a circle, return 8 trapezoids that can be used to fill the circle by <a href="nxfillcircle"><code>nx_fillcircle()</code></a> and other interfaces.
  814. </p>
  815. <p>
  816. <b>Input parameters</b>:
  817. <p>
  818. <ul><dl>
  819. <dt><code>center</code>
  820. <dd>A pointer to the point that is the center of the circle.
  821. <dt><code>radius</code>
  822. <dd>The radius of the circle in pixels.
  823. <dt><code>circle</code>
  824. <dd>A pointer the first entry in an array of 8 trapezoids where the circle description will be returned.
  825. </dl></ul>
  826. <p>
  827. <b>Returned value</b>: None
  828. </p>
  829. <h2>2.3 <a name="nx2">NX</a></h2>
  830. <h3>2.3.1 <a name="nxppdefs">Pre-Processor Definitions</a></h3>
  831. <p>
  832. The default server message queue name used by the
  833. <a href="#nxruninstance"><code>nx_run()</code></a> macro:
  834. </p>
  835. <ul><pre>
  836. #define NX_DEFAULT_SERVER_MQNAME "/dev/nxs"
  837. </pre></ul>
  838. <p>
  839. Mouse button bits:
  840. </p>
  841. <ul><pre>
  842. #define NX_MOUSE_NOBUTTONS 0x00
  843. #define NX_MOUSE_LEFTBUTTON 0x01
  844. #define NX_MOUSE_CENTERBUTTON 0x02
  845. #define NX_MOUSE_RIGHTBUTTON 0x04
  846. </pre></ul>
  847. <h3>2.3.2 <a name="nxtypes">NX Types</a></h3>
  848. <p>
  849. The interface to the NX server is managed using a opaque handle:
  850. </p>
  851. <ul><pre>
  852. typedef FAR void *NXHANDLE;
  853. </pre></ul>
  854. <p>
  855. The interface to a specific window is managed using an opaque handle:
  856. </p>
  857. <ul><pre>
  858. typedef FAR void *NXWINDOW;
  859. </pre></ul>
  860. <p>
  861. These define callbacks that must be provided to <a href="#nxopenwindow"><code>nx_openwindow()</code></a>.
  862. These callbacks will be invoked as part of the processing performed by <a href="#nxeventhandler"><code>nx_eventhandler()</code></a>.
  863. </p>
  864. <ul><pre>
  865. struct nx_callback_s
  866. {
  867. void (*redraw)(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
  868. bool more, FAR void *arg);
  869. void (*position)(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
  870. FAR const struct nxgl_point_s *pos,
  871. FAR const struct nxgl_rect_s *bounds,
  872. FAR void *arg);
  873. #ifdef CONFIG_NX_XYINPUT
  874. void (*mousein)(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
  875. uint8_t buttons, FAR void *arg);
  876. #endif
  877. #ifdef CONFIG_NX_KBD
  878. void (*kbdin)(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch, FAR void *arg);
  879. #endif
  880. };
  881. </pre></ul>
  882. <h3>2.3.3 <a name="startingnx">Starting the NX Server</a></h3>
  883. <p>
  884. The <i>NX Server</i> is a kernel daemon that receives and serializes graphic commands.
  885. Before you can use the NX graphics system, you must first start this daemon.
  886. There are two ways that this can be done:
  887. </p>
  888. <ol>
  889. <li>
  890. <p>
  891. The NX server may be started in your board startup logic by simply calling the function <code> nxmu_start()</code>.
  892. The board startup logic usually resides the the <code>configs/<i>board</i>/src</code> directory.
  893. The board startup logic can run automatically during the early system if <code>CONFIG_BOARD_LATE_INITIALIZE</code> is defined in the configuration.
  894. Or, the board startup logic can execute under control of the application by calling the <code>boardctl(BOARDIOC_INIT, arg)</code> OS interface.
  895. </p>
  896. <p>
  897. The board initialization logic will run in either case and the simple call to <code>nxmu_start()</code> will start the NX server.
  898. </p>
  899. </li>
  900. <li>
  901. The NX server may also be started later by the application via the <code>boardctl(BOARDIOC_NX_START, arg)</code>
  902. </li>
  903. </ol>
  904. <h4>2.3.3.1 <a name="nxstart"><code>nxmu_start()</code></a></h4>
  905. <p><b>Function Prototype:</b></p>
  906. <ul><pre>
  907. #include &lt;nuttx/nx/nx.h&gt;
  908. int nxmu_start(int display, int plane);
  909. </pre></ul>
  910. <p>
  911. <b>Description:</b>
  912. <code>nxmu_start()</code> provides a wrapper function to simplify and standardize the starting of the NX server.
  913. </p>
  914. <p>
  915. <b>Input Parameters:</b>
  916. <ul><dl>
  917. <dt><code>display</code>
  918. <dd>The display number to be served by this new NXMU instance.
  919. <dt><code>plane</code>
  920. <dd>The plane number to use to get information about the display geometry and color format.
  921. </dl></ul>
  922. </p>
  923. <p>
  924. <b>Returned Value:</b>
  925. Zero (<code>OK</code>) is returned on success.
  926. This indicates that the NX server has been successfully started, is running, and waiting to accept connections from NX clients.
  927. </p>
  928. <p>
  929. A negated <code>errno</code> value is returned on failure.
  930. The <code>errno</code> value indicates the nature of the failure.
  931. </p>
  932. <h4>2.3.3.1 <a name="boardctl"><code>boardctl()</code></a></h4>
  933. <p><b>Function Prototype:</b></p>
  934. <ul><pre>
  935. #include &lt;sys/boardctl.h&gt;
  936. </pre></ul>
  937. <p>
  938. <b>Description:</b>
  939. <code>boardctl()</code> is a generic NuttX interface that among many of it functions, may also be used to start the NX server.
  940. </p>
  941. In a small embedded system, there will typically be a much greater interaction between application and low-level board features.
  942. The canonically correct to implement such interactions is by implementing a character driver and performing the interactions via low level <code>ioctl()</code> calls.
  943. This, however, may not be practical in many cases and will lead to &quot;correct&quot; but awkward implementations.
  944. </p>
  945. <p>
  946. <code>boardctl()</code> is non-standard OS interface to alleviate the problem.
  947. It basically circumvents the normal device driver ioctl interlace and allows the application to perform direction IOCTL-like calls to the board-specific logic.
  948. In it is especially useful for setting up board operational and test configurations.
  949. </p>
  950. <p>
  951. When called with the <code>cmd</code> of <code>BOARDIOC_NX_START</code>, then the <code>boardctl()</code> will call <code>nxmu_start</code> indirectly on behalf of the appication.
  952. In this case the <code>arg</code> parameter is ignored.
  953. </p>
  954. <p>
  955. <b>Input Parameters:</b>
  956. <ul><dl>
  957. <dt><code>cmd</code>
  958. <dd> Identifies the board command to be executed
  959. <dt><code>arg</code>
  960. <dd>The argument that accompanies the command. The nature of the argument is determined by the specific command.
  961. </dl></ul>
  962. </p>
  963. <p>
  964. <b>Returned Value:</b>
  965. On success zero (<code>OK</code) is returned; -1 (<code>ERROR</code>) is returned on failure with the <code>errno</code> variable to to indicate the nature of the failure.
  966. </p>
  967. <h3>2.3.4 <a name="nxcallbacks">NX Server Callbacks</a></h3>
  968. <h4>2.3.4.1 <a name="nxcbredraw"><code>redraw()</code></a></h4>
  969. <p><b>Callback Function Prototype:</b></p>
  970. <ul><pre>
  971. void redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
  972. bool more, FAR void *arg);
  973. </pre></ul>
  974. <p>
  975. <b>Description:</b>
  976. NX requests that the client re-draw the portion of the window within
  977. with rectangle.
  978. </p>
  979. <p>
  980. <b>Input Parameters:</b>
  981. <ul><dl>
  982. <dt><code>hwnd</code>
  983. <dd>The handle created by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  984. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  985. <dt><code>rect</code>
  986. <dd>The rectangle that needs to be re-drawn (in window relative coordinates)
  987. <dt><code>more</code>
  988. <dd>true: More re-draw requests will follow
  989. <dt><code>arg</code>
  990. <dd>User provided argument (see <a href="#nxopenwindow"><code>nx_openwindow()</code></a>)
  991. </dl></ul>
  992. </p>
  993. <p>
  994. <b>Returned Value:</b> None
  995. </p>
  996. <h4>2.3.4.2 <a name="nxcbposition"><code>position()</code></a></h4>
  997. <p><b>Callback Function Prototype:</b></p>
  998. <ul><pre>
  999. void position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
  1000. FAR const struct nxgl_point_s *pos,
  1001. FAR const struct nxgl_rect_s *bounds,
  1002. FAR void *arg);
  1003. </pre></ul>
  1004. <p>
  1005. <b>Description:</b>
  1006. The size or position of the window has changed (or the window was
  1007. just created with zero size.
  1008. </p>
  1009. <p>
  1010. <b>Input Parameters:</b>
  1011. <ul><dl>
  1012. <dt><code>hwnd</code>
  1013. <dd>The handle created by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  1014. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  1015. <dt><code>size</code>
  1016. <dd>The size of the window
  1017. <dt><code>pos</code>
  1018. <dd>The position of the upper left hand corner of the window on
  1019. the overall display
  1020. <dt><code>bounds</code>
  1021. <dd>The bounding rectangle that the describes the entire display
  1022. <dt><code>arg</code>
  1023. <dd>User provided argument (see <a href="#nxopenwindow"><code>nx_openwindow()</code></a>)
  1024. </dl></ul>
  1025. </p>
  1026. <p>
  1027. <b>Returned Value:</b> None
  1028. </p>
  1029. <h4>2.3.4.3 <a name="nxcbmousein"><code>mousein()</code></a></h4>
  1030. <p><b>Callback Function Prototype:</b></p>
  1031. <ul><pre>
  1032. #ifdef CONFIG_NX_XYINPUT
  1033. void mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
  1034. uint8_t buttons, FAR void *arg);
  1035. #endif
  1036. </pre></ul>
  1037. <p>
  1038. <b>Description:</b>
  1039. New mouse data is available for the window
  1040. </p>
  1041. <p>
  1042. <b>Input Parameters:</b>
  1043. <ul><dl>
  1044. <dt><code>hwnd</code>
  1045. <dd>The handle created by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  1046. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  1047. <dt><code>pos</code>
  1048. <dd>The (x,y) position of the mouse
  1049. <dt><code>buttons</code>
  1050. <dd>See <code>NX_MOUSE_*</code> definitions
  1051. <dt><code>arg</code>
  1052. <dd>User provided argument (see <a href="#nxopenwindow"><code>nx_openwindow()</code></a>)
  1053. </dl></ul>
  1054. </p>
  1055. <p>
  1056. <b>Returned Value:</b> None
  1057. </p>
  1058. <h4>2.3.4.4 <a name="nxcbkbdin"><code>kbdin()</code></a></h4>
  1059. <p><b>Callback Function Prototype:</b></p>
  1060. <ul><pre>
  1061. #ifdef CONFIG_NX_KBD
  1062. void (*kbdin)(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch, FAR void *arg);
  1063. #endif
  1064. </pre></ul>
  1065. <p>
  1066. <b>Description:</b>
  1067. New keyboard/keypad data is available for the window.
  1068. </p>
  1069. <p>
  1070. <b>Input Parameters:</b>
  1071. <ul><dl>
  1072. <dt><code>hwnd</code>
  1073. <dd>The handle created by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  1074. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  1075. <dt><code>nch</code>
  1076. <dd>The number of characters that are available in ch[]
  1077. <dt><code>ch</code>
  1078. <dd>The array of characters
  1079. <dt><code>arg</code>
  1080. <dd>User provided argument (see <a href="#nxopenwindow"><code>nx_openwindow()</code></a>)
  1081. </dl></ul>
  1082. </p>
  1083. <p>
  1084. <b>Returned Value:</b> None
  1085. </p>
  1086. <i>2.3.4.5 <a href="#"><code>event()</code></a></i>
  1087. <h4>2.3.4.5 <a name="nxcbevent"><code>event()</code></a></h4>
  1088. <p><b>Callback Function Prototype:</b></p>
  1089. <ul><pre>
  1090. void (*event)(NXWINDOW hwnd, enum nx_event_e event, FAR void *arg1, FAR void *arg2);
  1091. </pre></ul>
  1092. <p>
  1093. <b>Description:</b>
  1094. This callback is used to communicate server events to the window listener.
  1095. </p>
  1096. <dl>
  1097. <dt>NXEVENT_BLOCKED - Window messages are blocked.
  1098. <dd>This callback is the response from <a href="#nxblock"><code>nx_block()</code></a>, <a href="#nxtkblock"><code>nxtk_block()</code></a>. 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 <i>defunct</i> and will receive no further callbacks.
  1099. This callback supports coordinated destruction of a window. In the multi-user 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.
  1100. <dt>NXEVENT_SYNCHED - Synchronization handshake
  1101. <dd>This completes the handshake started by <a href="#nxsynch"><code>nx_synch()</code></a>, or <a href="#nxtksynch"><code>nxtk_synch()</code></a>. Those interfaces send a synchronization messages to the NX server which responds with this event. The sleeping client is awakened and continues graphics processing, completing the handshake.
  1102. Due to the highly asynchronous nature of client-server communications, synchronization is sometimes necessary to assure that the client and server are working together properly.
  1103. </dl>
  1104. <p>
  1105. <b>Input Parameters:</b>
  1106. <ul><dl>
  1107. <dt><code>hwnd</code>
  1108. <dd>TWindow handle of window receiving the event
  1109. <dt><code>event</code>
  1110. <dd>The server event
  1111. <dt><code>arg1</code>
  1112. <dd>User provided argument (see <a href="#nxopenwindow"><code>nx_openwindow()</code></a>, <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>, or <a href="#nxtkopentoolbar"><code>nxtk_opentoolbar()</code></a>)
  1113. <dt><code>arg2</code>
  1114. <dd>TUser provided argument (see <a href="#nxblock"><code>nx_block()</code></a>, <a href="#nxtkblock"><code>nxtk_block()</code></a>, <a href="#nxsynch"><code>nx_synch()</code></a>, or <a href="#nxtksynch"><code>nxtk_synch()</code></a>)
  1115. </dl></ul>
  1116. </p>
  1117. <p>
  1118. <b>Returned Value:</b> None
  1119. </p>
  1120. <h3>2.3.5 <a name="nxruninstance"><code>nx_runinstance()</code> (and <code>nx_run()</code> macro)</a></h3>
  1121. <p><b>Function Prototype:</b></p>
  1122. <ul><pre>
  1123. #include &lt;nuttx/nx/nxglib.h&gt;
  1124. #include &lt;nuttx/nx/nx.h&gt;
  1125. int nx_runinstance(FAR const char *mqname, FAR struct fb_vtable_s *fb);
  1126. #define nx_run(fb) nx_runinstance(NX_DEFAULT_SERVER_MQNAME, dev)
  1127. </pre></ul>
  1128. <p>
  1129. <b>Description:</b>
  1130. This is the server entry point. It does not return; the calling thread
  1131. is dedicated to supporting NX server.
  1132. </p>
  1133. <p>
  1134. NOTE that multiple instances of the NX server may run at the same time,
  1135. with different callback and message queue names.
  1136. <code>nx_run()</code> is simply a macro that can be used when only one
  1137. server instance is required.
  1138. In that case, a default server name is used.
  1139. </p>
  1140. <p>
  1141. <b>Input Parameters:</b>
  1142. <ul><dl>
  1143. <dt><code>mqname</code>
  1144. <dd>
  1145. - The name for the server incoming message queue
  1146. <dt><code>dev</code>
  1147. <dd>Framebuffer or LCD driver &quot;object&quot; to be used
  1148. </dl></ul>
  1149. </p>
  1150. <p>
  1151. <b>Returned Value:</b>
  1152. This function usually does not return. If it does return, it will
  1153. return <code>ERROR</code> and <code>errno</code> will be set appropriately.
  1154. </p>
  1155. <h3>2.3.6 <a name="nxconnectinstance"><code>nx_connectinstance()</code> (and <code>nx_connect()</code> macro)</a></h3>
  1156. <p><b>Function Prototype:</b></p>
  1157. <ul><pre>
  1158. #include &lt;nuttx/nx/nxglib.h&gt;
  1159. #include &lt;nuttx/nx/nx.h&gt;
  1160. NXHANDLE nx_connectinstance(FAR const char *svrmqname);
  1161. #define nx_connect(cb) nx_connectinstance(NX_DEFAULT_SERVER_MQNAME)
  1162. </pre></ul>
  1163. <p>
  1164. <b>Description:</b>
  1165. Open a connection from a client to the NX server. One one client
  1166. connection is normally needed per thread as each connection can host
  1167. multiple windows.
  1168. </p>
  1169. <p>
  1170. NOTES:
  1171. </p>
  1172. <ul>
  1173. <li>
  1174. This function returns before the connection is fully instantiated.
  1175. it is necessary to wait for the connection event before using the
  1176. returned handle.
  1177. </li>
  1178. <li>
  1179. Multiple instances of the NX server may run at the same time,
  1180. each with different message queue names.
  1181. </li>
  1182. <li>
  1183. <code>nx_connect()</code> is simply a macro that can be used when only one
  1184. server instance is required. In that case, a default server name
  1185. is used.
  1186. </li>
  1187. </ul>
  1188. <p>
  1189. <b>Input Parameters:</b>
  1190. <ul><dl>
  1191. <dt><code>svrmqname</code>
  1192. <dd>The name for the server incoming message queue
  1193. </dl></ul>
  1194. </p>
  1195. <p>
  1196. <b>Returned Value:</b>
  1197. </p>
  1198. <ul>
  1199. Success: A non-NULL handle used with subsequent NX accesses<br>
  1200. Failure: NULL is returned and <code>errno</code> is set appropriately.
  1201. </ul>
  1202. <h3>2.3.7 <a name="nxdisconnect"><code>nx_disconnect()</code></a></h3>
  1203. <p><b>Function Prototype:</b></p>
  1204. <ul><pre>
  1205. #include &lt;nuttx/nx/nxglib.h&gt;
  1206. #include &lt;nuttx/nx/nx.h&gt;
  1207. void nx_disconnect(NXHANDLE handle);
  1208. </pre></ul>
  1209. <p>
  1210. <b>Description:</b>
  1211. Disconnect a client from the NX server and/or free resources reserved
  1212. by <a href="#nxconnectinstance"><code>nx_connect()</code>/<code>nx_connectinstance()</code></a>.
  1213. </p>
  1214. <p>
  1215. <b>Input Parameters:</b>
  1216. <ul><dl>
  1217. <dt><code>handle</code>
  1218. <dd>The handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
  1219. </dl></ul>
  1220. </p>
  1221. <p>
  1222. <b>Returned Value:</b> None.
  1223. </p>
  1224. <h3>2.3.8 <a name="nxeventhandler"><code>nx_eventhandler()</code></a></h3>
  1225. <p><b>Function Prototype:</b></p>
  1226. <ul><pre>
  1227. #include &lt;nuttx/nx/nxglib.h&gt;
  1228. #include &lt;nuttx/nx/nx.h&gt;
  1229. int nx_eventhandler(NXHANDLE handle);
  1230. </pre></ul>
  1231. <p>
  1232. <b>Description:</b>
  1233. The client code must call this function periodically to process
  1234. incoming messages from the server. If <code>CONFIG_NX_BLOCKING</code> is defined,
  1235. then this function not return until a server message is received.
  1236. </p>
  1237. <p>
  1238. When <code>CONFIG_NX_BLOCKING</code> is not defined, the client must exercise
  1239. caution in the looping to assure that it does not eat up all of
  1240. the CPU bandwidth calling nx_eventhandler repeatedly.
  1241. <a href="#nxeventnotify"><code>nx_eventnotify()</code></a>
  1242. may be called to get a signal event whenever a new incoming server
  1243. event is avaiable.
  1244. </p>
  1245. <p>
  1246. <b>Input Parameters:</b>
  1247. <ul><dl>
  1248. <dt><code>handle</code>
  1249. <dd>The handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
  1250. </dl></ul>
  1251. </p>
  1252. <p>
  1253. <b>Returned Value:</b>
  1254. </p>
  1255. <ul>
  1256. <li>
  1257. <code>OK</code>: No errors occurred. If <code>CONFIG_NX_BLOCKING</code> is defined,
  1258. then one or more server messages were processed.
  1259. </li>
  1260. <li>
  1261. <code>ERROR</code>: An error occurred and <code>errno</code> has been set appropriately.
  1262. Of particular interest, it will return <code>errno == EHOSTDOWN</code> when the
  1263. server is disconnected. After that event, the handle can no longer be used.
  1264. </li>
  1265. </ul>
  1266. <h3>2.3.9 <a name="nxeventnotify"><code>nx_eventnotify()</code></a></h3>
  1267. <p><b>Function Prototype:</b></p>
  1268. <ul><pre>
  1269. #include &lt;nuttx/nx/nxglib.h&gt;
  1270. #include &lt;nuttx/nx/nx.h&gt;
  1271. int nx_eventnotify(NXHANDLE handle, int signo);
  1272. </pre></ul>
  1273. <p>
  1274. <b>Description:</b>
  1275. Rather than calling <a href="#nxeventhandler"><code>nx_eventhandler()</code></a> periodically,
  1276. the client may register to receive a signal when a server event is available.
  1277. The client can then call <a href="#nxeventhandler"><code>nv_eventhandler()</code></a> only when
  1278. incoming events are available.
  1279. </p>
  1280. <p>
  1281. The underlying implementation used <code>mq_notifiy()</code> and, as a result,
  1282. the client must observe the rules for using <code>mq_notifiy()</code>:
  1283. <ul>
  1284. <li>
  1285. Only one event is signalled. Upon receipt of the signal, if the client
  1286. wishes further notifications, it must call <code>nx_eventnotify()</code> again.
  1287. </li>
  1288. <li>
  1289. The signal will only be issued when the message queue transitions from empty to
  1290. not empty.
  1291. </li>
  1292. </ul>
  1293. </p>
  1294. <p>
  1295. <b>Input Parameters:</b>
  1296. <ul><dl>
  1297. <dt><code>handle</code>
  1298. <dd>The handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
  1299. </dl></ul>
  1300. </p>
  1301. <p>
  1302. <b>Returned Value:</b>
  1303. <code>OK</code> on success;
  1304. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1305. </p>
  1306. <h3>2.3.10 <a name="nxblock"><code>nx_block()</code></a></h3>
  1307. <p><b>Function Prototype:</b></p>
  1308. <ul><pre>
  1309. #include &lt;nuttx/nx/nx.h&gt;
  1310. int nx_block(NXWINDOW hwnd, FAR void *arg);
  1311. </pre></ul>
  1312. <p>
  1313. <b>Description:</b>
  1314. The response to this function call is two things: (1) any queued callback messages to the window are 'blocked' and then (2) also subsequent window messaging is blocked.
  1315. </p>
  1316. <p>
  1317. The <code>event</code> callback with the <code>NXEVENT_BLOCKED</code> event is the response from <code>nx_block()</code>. This blocking interface is used to assure that no further messages are are directed to the window. Receipt of the <code>NXEVENT_BLOCKED</code> event signifies that (1) there are no further pending callbacks and (2) that the window is now <i>defunct</i> and will receive no further callbacks.
  1318. </p>
  1319. <p>
  1320. This callback supports coordinated destruction of a window. 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.
  1321. </p>
  1322. <p>
  1323. <b>Input Parameters:</b>
  1324. <ul>
  1325. <dl>
  1326. <dt><code>wnd</code>
  1327. <dd>The window to be blocked
  1328. <dt><code>arg</code>
  1329. <dd>An argument that will accompany the block messages (This is <code>arg2</code> in the event callback).
  1330. </ul>
  1331. </p>
  1332. <p>
  1333. <b>Returned Value:</b>
  1334. OK on success; ERROR on failure with errno set appropriately.
  1335. </p>
  1336. <h3>2.3.11 <a name="nxsynch"><code>nx_synch()</code></a></h3>
  1337. <p><b>Function Prototype:</b></p>
  1338. <ul><pre>
  1339. #include &lt;nuttx/nx/nx.h&gt;
  1340. int nx_synch(NXWINDOW hwnd, FAR void *arg);
  1341. </pre></ul>
  1342. <p>
  1343. <b>Description:</b>
  1344. This interface can be used to synchronize the window client with the NX server. It really just implements an <i>echo</i>: A synch message is sent from the window client to the server which then responds immediately by sending the <code>NXEVENT_SYNCHED</code> back to the windows client.
  1345. </p>
  1346. <p>
  1347. Due to the highly asynchronous nature of client-server communications, <code>nx_synch()</code> is sometimes necessary to assure that the client and server are fully synchronized in time.
  1348. </p>
  1349. <p>
  1350. Usage by the window client might be something like this:
  1351. </p>
  1352. <ul><pre>
  1353. extern bool g_synched;
  1354. extern sem_t g_synch_sem;
  1355. g_synched = false;
  1356. ret = nx_synch(hwnd, handle);
  1357. if (ret &lt; 0)
  1358. {
  1359. -- Handle the error --
  1360. }
  1361. while (!g_synched)
  1362. {
  1363. ret = sem_wait(&g_sync_sem);
  1364. if (ret &lt; 0)
  1365. {
  1366. -- Handle the error --
  1367. }
  1368. }
  1369. </pre></ul>
  1370. <p>
  1371. When the window listener thread receives the <code>NXEVENT_SYNCHED</code> event, it would set <code>g_synched</code> to <code>true</code> and post <code>g_synch_sem</code>, waking up the above loop.
  1372. </p>
  1373. <p>
  1374. <b>Input Parameters:</b>
  1375. <ul><dl>
  1376. <dt><code>wnd</code>
  1377. <dd>The window to be synched
  1378. <dt><code>arg</code>
  1379. <dd>An argument that will accompany the synch messages (This is <code>arg2</code> in the event callback).
  1380. </dl></ul>
  1381. </p>
  1382. <p>
  1383. <b>Returned Value:</b>
  1384. OK on success; ERROR on failure with errno set appropriately
  1385. </p>
  1386. <h3>2.3.12 <a name="nxopenwindow"><code>nx_openwindow()</code></a></h3>
  1387. <p><b>Function Prototype:</b></p>
  1388. <ul><pre>
  1389. #include &lt;nuttx/nx/nxglib.h&gt;
  1390. #include &lt;nuttx/nx/nx.h&gt;
  1391. NXWINDOW nx_openwindow(NXHANDLE handle, uint8_t flags,
  1392. FAR const struct nx_callback_s *cb,
  1393. FAR void *arg);
  1394. </pre></ul>
  1395. <p>
  1396. <b>Description:</b> Create a new window.
  1397. </p>
  1398. <p>
  1399. <b>Input Parameters:</b>
  1400. <ul><dl>
  1401. <dt><code>handle</code>
  1402. <dd>The handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
  1403. <dt><code>flags</code>
  1404. <dd>Optional flags.
  1405. These include:
  1406. <ul>
  1407. <li><code>NXBE_WINDOW_RAMBACKED</code>: Creates a RAM backed window.
  1408. This option is only valid if <code>CONFIG_NX_RAMBACKED</code> is enabled.
  1409. </li>
  1410. <li><code>NXBE_WINDOW_HIDDEN</code>: The window is create in the HIDDEN state and can be made visible later with <code>nx_setvisibility()</code>.
  1411. </li>
  1412. </ul>
  1413. <dt><code>cb</code>
  1414. <dd>Callbacks used to process window events
  1415. <dt><code>arg</code>
  1416. <dd>User provided value that will be returned with NX callbacks.
  1417. </dl></ul>
  1418. </p>
  1419. <p>
  1420. <b>Returned Value:</b>
  1421. </p>
  1422. <ul>
  1423. Success: A non-NULL handle used with subsequent NX accesses<br>
  1424. Failure: NULL is returned and <code>errno</code> is set appropriately.
  1425. </ul>
  1426. <h3>2.3.13 <a name="nxclosewindow"><code>nx_closewindow()</code></a></h3>
  1427. <p><b>Function Prototype:</b></p>
  1428. <ul><pre>
  1429. #include &lt;nuttx/nx/nxglib.h&gt;
  1430. #include &lt;nuttx/nx/nx.h&gt;
  1431. int nx_closewindow(NXWINDOW hwnd);
  1432. </pre></ul>
  1433. <p>
  1434. <b>Description:</b>
  1435. Destroy a window created by <a href="#nxopenwindow"><code>nx_openwindow()</code></a> window.
  1436. </p>
  1437. <p>
  1438. <b>Input Parameters:</b>
  1439. <ul><dl>
  1440. <dt><code>hwnd</code>
  1441. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  1442. that identifies the window to be destroyed.
  1443. This handle must not have been one returned by
  1444. <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>.
  1445. </dl></ul>
  1446. </p>
  1447. <p>
  1448. <b>Returned Value:</b>
  1449. <code>OK</code> on success;
  1450. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1451. </p>
  1452. <h3>2.3.14 <a name="nxrequestbkgd"><code>nx_requestbkgd()</code></a></h3>
  1453. <p><b>Function Prototype:</b></p>
  1454. <ul><pre>
  1455. #include &lt;nuttx/nx/nxglib.h&gt;
  1456. #include &lt;nuttx/nx/nx.h&gt;
  1457. int nx_requestbkgd(NXHANDLE handle,
  1458. FAR const struct nx_callback_s *cb,
  1459. FAR void *arg);
  1460. </pre></ul>
  1461. <p>
  1462. <b>Description:</b>
  1463. NX normally controls a separate window called the background window.
  1464. It repaints the window as necessary using only a solid color fill. The
  1465. background window always represents the entire screen and is always
  1466. below other windows. It is useful for an application to control the
  1467. background window in the following conditions:
  1468. </p>
  1469. <ul>
  1470. <li>
  1471. If you want to implement a windowless solution. The single screen
  1472. can be used to create a truly simple graphic environment.
  1473. </li>
  1474. <li>
  1475. When you want more on the background than a solid color. For
  1476. example, if you want an image in the background, or animations in the
  1477. background, or live video, etc.
  1478. </li>
  1479. </ul>
  1480. <p>
  1481. This API only requests the handle of the background window. That
  1482. handle will be returned asynchronously in a subsequent position and
  1483. redraw callbacks.
  1484. </p>
  1485. <p>
  1486. Cautions:
  1487. </p>
  1488. <ul>
  1489. <li>
  1490. The following should never be called using the background window.
  1491. They are guaranteed to cause severe crashes:
  1492. <a href="#nxsetposition"><code>nx_setposition()</code></a>,
  1493. <a href="#nxsetsize"><code>nx_setsize()</code></a>,
  1494. <a href="#nxraise"><code>nx_raise()</code></a>, or
  1495. <a href="#nxlower"><code>nx_lower()</code></a>.
  1496. <a href="#nxmodal"><code>nx_modal()</code></a>.
  1497. <a href="#nxsetvisibility"><code>nx_setvisibility()</code></a>.
  1498. </li>
  1499. <li>
  1500. Neither <code>nx_requestbkgd()</code> nor
  1501. <a href="#nxreleasebkgd"><code>nx_releasebkgd ()</code></a> should be called more than once.
  1502. Multiple instances of the background window are not supported.
  1503. </li>
  1504. </ul>
  1505. </p>
  1506. <p>
  1507. <b>Input Parameters:</b>
  1508. <ul><dl>
  1509. <dt><code>handle</code>
  1510. <dd>The handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
  1511. <dt><code>cb</code>
  1512. <dd>Callbacks to use for processing background window events
  1513. <dt><code>arg</code>
  1514. <dd>User provided argument (see <a href="#nxopenwindow"><code>nx_openwindow()</code></a>)
  1515. </dl></ul>
  1516. </p>
  1517. <p>
  1518. <b>Returned Value:</b>
  1519. <code>OK</code> on success;
  1520. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1521. </p>
  1522. <h3>2.3.15 <a name="nxreleasebkgd"><code>nx_releasebkgd()</code></a></h3>
  1523. <p><b>Function Prototype:</b></p>
  1524. <ul><pre>
  1525. #include &lt;nuttx/nx/nxglib.h&gt;
  1526. #include &lt;nuttx/nx/nx.h&gt;
  1527. int nx_releasebkgd(NXWINDOW hwnd);
  1528. </pre></ul>
  1529. <p>
  1530. <b>Description:</b>
  1531. Release the background window previously acquired using
  1532. <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  1533. and return control of the background to NX.
  1534. </p>
  1535. <p>
  1536. <b>Input Parameters:</b>
  1537. <ul><dl>
  1538. <dt><code>handle</code>
  1539. <dd>The handle returned indirectly by
  1540. <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>.
  1541. This handle must not have been one created by
  1542. <a href="#nxopenwindow"><code>nx_openwindow()</code></a>.
  1543. </dl></ul>
  1544. </p>
  1545. <p>
  1546. <b>Returned Value:</b>
  1547. <code>OK</code> on success;
  1548. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1549. </p>
  1550. <h3>2.3.16 <a name="nxgetposition"><code>nx_getposition()</code></a></h3>
  1551. <p><b>Function Prototype:</b></p>
  1552. <ul><pre>
  1553. #include &lt;nuttx/nx/nxglib.h&gt;
  1554. #include &lt;nuttx/nx/nx.h&gt;
  1555. int nx_getposition(NXWINDOW hwnd);
  1556. </pre></ul>
  1557. <p>
  1558. <b>Description:</b>
  1559. Request the position and size information for the selected window. The
  1560. values will be return asynchronously through the client callback function
  1561. pointer.
  1562. </p>
  1563. <p>
  1564. <b>Input Parameters:</b>
  1565. <ul><dl>
  1566. <dt><code>hwnd</code>
  1567. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a> or
  1568. <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>.
  1569. </dl></ul>
  1570. </p>
  1571. <p>
  1572. <b>Returned Value:</b>
  1573. <code>OK</code> on success;
  1574. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1575. </p>
  1576. <h3>2.3.17 <a name="nxsetposition"><code>nx_setposition()</code></a></h3>
  1577. <p><b>Function Prototype:</b></p>
  1578. <ul><pre>
  1579. #include &lt;nuttx/nx/nxglib.h&gt;
  1580. #include &lt;nuttx/nx/nx.h&gt;
  1581. int nx_setposition(NXWINDOW hwnd, FAR struct nxgl_point_s *pos);
  1582. </pre></ul>
  1583. <p>
  1584. <b>Description:</b>
  1585. Set the position and size for the selected window.
  1586. </p>
  1587. <p>
  1588. <b>Input Parameters:</b>
  1589. <ul><dl>
  1590. <dt><code>hwnd</code>
  1591. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>.
  1592. This handle must not have been created by
  1593. <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>.
  1594. <dt><code>pos</code>
  1595. <dd>The new position of the window
  1596. </dl></ul>
  1597. </p>
  1598. <p>
  1599. <b>Returned Value:</b>
  1600. <code>OK</code> on success;
  1601. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1602. </p>
  1603. <h3>2.3.18 <a name="nxsetsize"><code>nx_setsize()</code></a></h3>
  1604. <p><b>Function Prototype:</b></p>
  1605. <ul><pre>
  1606. #include &lt;nuttx/nx/nxglib.h&gt;
  1607. #include &lt;nuttx/nx/nx.h&gt;
  1608. int nx_setsize(NXWINDOW hwnd, FAR struct nxgl_size_s *size);
  1609. </pre></ul>
  1610. <p>
  1611. <b>Description:</b> Set the size of the selected window.
  1612. </p>
  1613. <p>
  1614. <b>Input Parameters:</b>
  1615. <ul><dl>
  1616. <dt><code>hwnd</code>
  1617. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>.
  1618. This handle must not have been created by
  1619. <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>.
  1620. <dt><code>size</code>
  1621. <dd>The new size of the window (in pixels).
  1622. </dl></ul>
  1623. </p>
  1624. <p>
  1625. <b>Returned Value:</b>
  1626. <code>OK</code> on success;
  1627. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1628. </p>
  1629. <h3>2.3.19 <a name="nxraise"><code>nx_raise()</code></a></h3>
  1630. <p><b>Function Prototype:</b></p>
  1631. <ul><pre>
  1632. #include &lt;nuttx/nx/nxglib.h&gt;
  1633. #include &lt;nuttx/nx/nx.h&gt;
  1634. int nx_raise(NXWINDOW hwnd);
  1635. </pre></ul>
  1636. <p>
  1637. <b>Description:</b> Bring the specified window to the top of the display.
  1638. </p>
  1639. <p>
  1640. <b>Input Parameters:</b>
  1641. <ul><dl>
  1642. <dt><code>hwnd</code>
  1643. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>.
  1644. This handle must not have been created by
  1645. <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>.
  1646. <dt><code></code>
  1647. <dd>
  1648. </dl></ul>
  1649. </p>
  1650. <p>
  1651. <b>Returned Value:</b>
  1652. <code>OK</code> on success;
  1653. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1654. </p>
  1655. <h3>2.3.20 <a name="nxlower"><code>nx_lower()</code></a></h3>
  1656. <p><b>Function Prototype:</b></p>
  1657. <ul><pre>
  1658. #include &lt;nuttx/nx/nxglib.h&gt;
  1659. #include &lt;nuttx/nx/nx.h&gt;
  1660. int nx_lower(NXWINDOW hwnd);
  1661. </pre></ul>
  1662. <p>
  1663. <b>Description:</b> Lower the specified window to the bottom of the display.
  1664. </p>
  1665. <p>
  1666. <b>Input Parameters:</b>
  1667. <ul><dl>
  1668. <dt><code>hwnd</code>
  1669. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>.
  1670. This handle must not have been created by
  1671. <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>.
  1672. <dt><code></code>
  1673. <dd>
  1674. </dl></ul>
  1675. </p>
  1676. <p>
  1677. <b>Returned Value:</b>
  1678. <code>OK</code> on success;
  1679. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1680. </p>
  1681. <h3>2.3.21 <a name="nxmodal"><code>nx_modal()</code></a></h3>
  1682. <p><b>Function Prototype:</b></p>
  1683. <ul><pre>
  1684. #include &lt;nuttx/nx/nxglib.h&gt;
  1685. #include &lt;nuttx/nx/nx.h&gt;
  1686. int nx_modal(NXWINDOW hwnd, bool modal);
  1687. </pre></ul>
  1688. <p>
  1689. <b>Description:</b> May be used to either (1) raise a window to the top of the display and select modal behavior, or (2) disable modal behavior.
  1690. </p>
  1691. <p>
  1692. <b>Input Parameters:</b>
  1693. <ul><dl>
  1694. <dt><code>hwnd</code>
  1695. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>.
  1696. This handle must not have been created by
  1697. <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>.
  1698. <dt><code>modal</code>
  1699. <dd>True: enter modal state; False: leave modal state
  1700. </dl></ul>
  1701. </p>
  1702. <p>
  1703. <b>Returned Value:</b>
  1704. <code>OK</code> on success;
  1705. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1706. </p>
  1707. <h3>2.3.22 <a name="nxsetvisibility"><code>nx_setvisibility()</code></a></h3>
  1708. <p><b>Function Prototype:</b></p>
  1709. <ul><pre>
  1710. #include &lt;nuttx/nx/nxglib.h&gt;
  1711. #include &lt;nuttx/nx/nx.h&gt;
  1712. int nx_setvisibility(NXWINDOW hwnd, bool hide);
  1713. </pre></ul>
  1714. <p>
  1715. <b>Description:</b> Select if the window is visible or hidden.
  1716. A hidden window is still present and will update normally, but will not be visible on the display until it is unhidden.
  1717. </p>
  1718. <p>
  1719. <b>Input Parameters:</b>
  1720. <ul><dl>
  1721. <dt><code>hwnd</code>
  1722. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>.
  1723. This handle must not have been created by
  1724. <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>.
  1725. <dt><code>hide</code>
  1726. <dd>True: Window will be hidden; false: Window will be visible
  1727. </dl></ul>
  1728. </p>
  1729. <p>
  1730. <b>Returned Value:</b>
  1731. <code>OK</code> on success;
  1732. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1733. </p>
  1734. <h3>2.3.23 <a name="nxishidden"><code>nx_ishidden()</code></a></h3>
  1735. <p><b>Function Prototype:</b></p>
  1736. <ul><pre>
  1737. #include &lt;nuttx/nx/nx.h&gt;
  1738. bool nx_ishidden(NXWINDOW hwnd);
  1739. </pre></ul>
  1740. <p>
  1741. <b>Description:</b> Return true if the window is hidden.
  1742. </p>
  1743. <p>
  1744. <b>NOTE</b>: There will be a delay between the time that the visibility of the window is changed via <a href="#nxsetvisibility"><code>nx_setvisibily()</code></a> before that new setting is reported by <code>nx_ishidden()</code>.
  1745. <code>nx_synch()</code> may be used if temporal synchronization is required.
  1746. </p>
  1747. <p>
  1748. <b>Input Parameters:</b>
  1749. <ul><dl>
  1750. <dt><code>hwnd</code>
  1751. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a> that indentifies the window to be queried.
  1752. </dl></ul>
  1753. </p>
  1754. <p>
  1755. <b>Returned Value:</b>
  1756. <i>True</i>: the window is hidden, <i>false</i>: the window is visible
  1757. </p>
  1758. <h3>2.3.24 <a name="nxfill"><code>nx_fill()</code></a></h3>
  1759. <p><b>Function Prototype:</b></p>
  1760. <ul><pre>
  1761. #include &lt;nuttx/nx/nxglib.h&gt;
  1762. #include &lt;nuttx/nx/nx.h&gt;
  1763. int nx_fill(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
  1764. nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  1765. </pre></ul>
  1766. <p>
  1767. <b>Description:</b>
  1768. Fill the specified rectangle in the window with the specified color.
  1769. </p>
  1770. <p>
  1771. <b>Input Parameters:</b>
  1772. <ul><dl>
  1773. <dt><code>hwnd</code>
  1774. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  1775. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  1776. <dt><code>rect</code>
  1777. <dd>The location to be filled
  1778. <dt><code>color</code>
  1779. <dd>The color to use in the fill
  1780. </dl></ul>
  1781. </p>
  1782. <p>
  1783. <b>Returned Value:</b>
  1784. <code>OK</code> on success;
  1785. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1786. </p>
  1787. <h3>2.3.25 <a name="nxgetrectangle"><code>nx_getrectangle()</code></a></h3>
  1788. <p><b>Function Prototype:</b></p>
  1789. <ul><pre>
  1790. #include &lt;nuttx/nx/nxglib.h&gt;
  1791. #include &lt;nuttx/nx/nx.h&gt;
  1792. void nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
  1793. unsigned int plane, FAR uint8_t *dest,
  1794. unsigned int deststride);
  1795. </pre></ul>
  1796. <p>
  1797. <b>Description:</b>
  1798. Get the raw contents of graphic memory within a rectangular region. NOTE:
  1799. Since raw graphic memory is returned, the returned memory content may be
  1800. the memory of windows above this one and may not necessarily belong to
  1801. this window unless you assure that this is the top window.
  1802. </p>
  1803. <p>
  1804. <b>Input Parameters:</b>
  1805. <ul><dl>
  1806. <dt><code>hwnd</code>
  1807. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  1808. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  1809. <dt><code>rect</code>
  1810. <dd>The location to be copied
  1811. <dt><code>plane</code>
  1812. <dd>Specifies the color plane to get from
  1813. <dt><code>dest</code>
  1814. <dd>The location to copy the memory region
  1815. <dt><code>deststride</code>
  1816. <dd>The width, in bytes, of the dest memory
  1817. </dl></ul>
  1818. </p>
  1819. <p>
  1820. <b>Returned Value:</b>
  1821. <code>OK</code> on success;
  1822. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1823. </p>
  1824. <h3>2.3.26 <a name="nxfilltrapezoid"><code>nx_filltrapezoid()</code></a></h3>
  1825. <p><b>Function Prototype:</b></p>
  1826. <ul><pre>
  1827. #include &lt;nuttx/nx/nxglib.h&gt;
  1828. #include &lt;nuttx/nx/nx.h&gt;
  1829. int nx_filltrapezoid(NXWINDOW hwnd, FAR const struct nxgl_rect_s *clip,
  1830. FAR const struct nxgl_trapezoid_s *trap,
  1831. nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  1832. </pre></ul>
  1833. <p>
  1834. <b>Description:</b>
  1835. Fill the specified trapezoidal region in the window with the specified color.
  1836. </p>
  1837. <p>
  1838. <b>Input Parameters:</b>
  1839. <ul><dl>
  1840. <dt><code>hwnd</code>
  1841. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  1842. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  1843. <dt><code>clip</code>
  1844. <dd>Clipping rectangle relative to window (may be null)
  1845. <dt><code>trap</code>
  1846. <dd>The trapezoidal region to be filled
  1847. <dt><code>color</code>
  1848. <dd>The color to use in the fill
  1849. </dl></ul>
  1850. </p>
  1851. <p>
  1852. <b>Returned Value:</b>
  1853. <code>OK</code> on success;
  1854. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1855. </p>
  1856. <h3>2.3.27 <a name="nxdrawline"><code>nx_drawline()</code></a></h3>
  1857. <p><b>Function Prototype:</b></p>
  1858. <ul><pre>
  1859. #include &lt;nuttx/nx/nxglib.h&gt;
  1860. #include &lt;nuttx/nx/nx.h&gt;
  1861. int nx_drawline(NXWINDOW hwnd, FAR struct nxgl_vector_s *vector,
  1862. nxgl_coord_t width, nxgl_mxpixel_t color[CONFIG_NX_NPLANES],
  1863. uint8_t caps);
  1864. </pre></ul>
  1865. <p>
  1866. <b>Description:</b>
  1867. Fill the specified trapezoidal region in the window with the specified color.
  1868. Fill the specified line in the window with the specified color.
  1869. This is simply a wrapper that uses <code>nxgl_splitline()</code> to break the line into
  1870. trapezoids and then calls <code>nx_filltrapezoid()</code> to render the line.
  1871. </p>
  1872. <p>
  1873. <b>Input Parameters:</b>
  1874. <ul><dl>
  1875. <dt><code>hwnd</code>
  1876. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  1877. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  1878. <dt><code>vector</code>
  1879. <dd>Describes the line to be drawn.
  1880. <dt><code>width</code>
  1881. <dd>The width of the line
  1882. <dt><code>color</code>
  1883. <dd>The color to use to fill the line
  1884. <dt><code>caps</code>
  1885. <dd>Draw a circular cap on the ends of the line to support better line joins.
  1886. One of:
  1887. <ul><pre>
  1888. /* Line caps */
  1889. #define NX_LINECAP_NONE 0x00, /* No line caps */
  1890. #define NX_LINECAP_PT1 0x01 /* Line cap on pt1 on of the vector only */
  1891. #define NX_LINECAP_PT2 0x02 /* Line cap on pt2 on of the vector only */
  1892. #define NX_LINECAP_BOTH 0x03 /* Line cap on both ends of the vector only */
  1893. </pre></ul>
  1894. </dl></ul>
  1895. </p>
  1896. <p>
  1897. <b>Returned Value:</b>
  1898. <code>OK</code> on success;
  1899. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1900. </p>
  1901. <h3>2.3.28 <a name="nxdrawcircle"><code>nx_drawcircle()</code></a></h3>
  1902. <p><b>Function Prototype:</b></p>
  1903. <ul><pre>
  1904. #include &lt;nuttx/nx/nxglib.h&gt;
  1905. #include &lt;nuttx/nx/nx.h&gt;
  1906. int nx_drawcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
  1907. nxgl_coord_t radius, nxgl_coord_t width,
  1908. nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  1909. </pre></ul>
  1910. <p>
  1911. <b>Description:</b>
  1912. Draw a circular outline using the specified line thickness and color.
  1913. </p>
  1914. <p>
  1915. <b>Input Parameters:</b>
  1916. <ul><dl>
  1917. <dt><code>hwnd</code>
  1918. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  1919. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  1920. <dt><code>center</code>
  1921. <dd>A pointer to the point that is the center of the circle.
  1922. <dt><code>radius</code>
  1923. <dd>The radius of the circle in pixels.
  1924. <dt><code>width</code>
  1925. <dd>The width of the line
  1926. <dt><code>color</code>
  1927. <dd>The color to use to fill the line
  1928. </dl></ul>
  1929. </p>
  1930. <p>
  1931. <b>Returned Value:</b>
  1932. <code>OK</code> on success;
  1933. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1934. </p>
  1935. <h3>2.3.29 <a name="nxfillcircle"><code>nx_fillcircle()</code></a></h3>
  1936. <p><b>Function Prototype:</b></p>
  1937. <ul><pre>
  1938. #include &lt;nuttx/nx/nxglib.h&gt;
  1939. #include &lt;nuttx/nx/nx.h&gt;
  1940. int nx_fillcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
  1941. nxgl_coord_t radius, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  1942. </pre></ul>
  1943. <p>
  1944. <b>Description:</b>
  1945. Fill a circular region using the specified color.
  1946. </p>
  1947. <p>
  1948. <b>Input Parameters:</b>
  1949. <ul><dl>
  1950. <dt><code>hwnd</code>
  1951. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  1952. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  1953. <dt><code>center</code>
  1954. <dd>A pointer to the point that is the center of the circle.
  1955. <dt><code>radius</code>
  1956. <dd>The width of the line
  1957. <dt><code>color</code>
  1958. <dd>The color to use to fill the circle
  1959. </dl></ul>
  1960. </p>
  1961. <p>
  1962. <b>Returned Value:</b>
  1963. <code>OK</code> on success;
  1964. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1965. </p>
  1966. <h3>2.3.30 <a name="nxglrgb2yuv"><code>nx_setbgcolor()</code></a></h3>
  1967. <p><b>Function Prototype:</b></p>
  1968. <ul><pre>
  1969. #include &lt;nuttx/nx/nxglib.h&gt;
  1970. #include &lt;nuttx/nx/nx.h&gt;
  1971. int nx_setbgcolor(NXHANDLE handle,
  1972. nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  1973. </pre></ul>
  1974. <p>
  1975. <b>Description:</b> Set the color of the background.
  1976. </p>
  1977. <p>
  1978. <b>Input Parameters:</b>
  1979. <ul><dl>
  1980. <dt><code>handle</code>
  1981. <dd>The handle created by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  1982. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a>
  1983. <dt><code>color</code>
  1984. <dd>The color to use in the background
  1985. </dl></ul>
  1986. </p>
  1987. <p>
  1988. <b>Returned Value:</b>
  1989. <code>OK</code> on success;
  1990. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  1991. </p>
  1992. <h3>2.3.31 <a name="nxmove"><code>nx_move()</code></a></h3>
  1993. <p><b>Function Prototype:</b></p>
  1994. <ul><pre>
  1995. #include &lt;nuttx/nx/nxglib.h&gt;
  1996. #include &lt;nuttx/nx/nx.h&gt;
  1997. int nx_move(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
  1998. FAR const struct nxgl_point_s *offset);
  1999. </pre></ul>
  2000. <p>
  2001. <b>Description:</b> Move a rectangular region within the window.
  2002. </p>
  2003. <p>
  2004. <b>Input Parameters:</b>
  2005. <ul><dl>
  2006. <dt><code>hwnd</code>
  2007. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  2008. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a> that specifies
  2009. the window within which the move is to be done
  2010. <dt><code>rect</code>
  2011. <dd>Describes the (source) rectangular region to move
  2012. <dt><code>offset</code>
  2013. <dd>The offset to move the region
  2014. </dl></ul>
  2015. </p>
  2016. <p>
  2017. <b>Returned Value:</b>
  2018. <code>OK</code> on success;
  2019. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2020. </p>
  2021. <h3>2.3.32 <a name="nxbitmap"><code>nx_bitmap()</code></a></h3>
  2022. <p><b>Function Prototype:</b></p>
  2023. <ul><pre>
  2024. #include &lt;nuttx/nx/nxglib.h&gt;
  2025. #include &lt;nuttx/nx/nx.h&gt;
  2026. int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
  2027. FAR const void *src[CONFIG_NX_NPLANES],
  2028. FAR const struct nxgl_point_s *origin,
  2029. unsigned int stride);
  2030. </pre></ul>
  2031. <p>
  2032. <b>Description:</b>
  2033. Copy a rectangular region of a larger image into the rectangle in the
  2034. specified window.
  2035. </p>
  2036. <p>
  2037. <b>Input Parameters:</b>
  2038. <ul><dl>
  2039. <dt><code>hwnd</code>
  2040. <dd>The handle returned by <a href="#nxopenwindow"><code>nx_openwindow()</code></a>
  2041. or <a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a> that specifies the
  2042. window that will receive the bitmap image.
  2043. <dt><code>dest</code>
  2044. <dd> Describes the rectangular on the display that will receive the bit map.
  2045. <dt><code>src</code>
  2046. <dd>The start of the source image. This is an array source images of size
  2047. <code>CONFIG_NX_NPLANES</code> (probably 1).
  2048. <dt><code>origin</code>
  2049. <dd>The origin of the upper, left-most corner of the full bitmap.
  2050. Both dest and origin are in window coordinates, however, the origin
  2051. may lie outside of the display.
  2052. <dt><code>stride</code>
  2053. <dd>The width of the full source image in bytes.
  2054. </dl></ul>
  2055. </p>
  2056. <p>
  2057. <b>Returned Value:</b>
  2058. <code>OK</code> on success;
  2059. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2060. </p>
  2061. <h3>2.3.33 <a name="nxkbdin"><code>nx_kbdin()</code></a></h3>
  2062. <p><b>Function Prototype:</b></p>
  2063. <ul><pre>
  2064. #include &lt;nuttx/nx/nxglib.h&gt;
  2065. #include &lt;nuttx/nx/nx.h&gt;
  2066. #ifdef CONFIG_NX_KBD
  2067. int nx_kbdchin(NXHANDLE handle, uint8_t ch);
  2068. int nx_kbdin(NXHANDLE handle, uint8_t nch, FAR const uint8_t *ch);
  2069. #endif
  2070. </pre></ul>
  2071. <p>
  2072. <b>Description:</b>
  2073. Used by a thread or interrupt handler that manages some kind of keypad
  2074. hardware to report text information to the NX server. That text
  2075. data will be routed by the NX server to the appropriate window client.
  2076. </p>
  2077. <p>
  2078. <b>Returned Value:</b>
  2079. <code>OK</code> on success;
  2080. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2081. </p>
  2082. <h3>2.3.34 <a name="nxmousein"><code>nx_mousein()</code></a></h3>
  2083. <p><b>Function Prototype:</b></p>
  2084. <ul><pre>
  2085. #include &lt;nuttx/nx/nxglib.h&gt;
  2086. #include &lt;nuttx/nx/nx.h&gt;
  2087. #ifdef CONFIG_NX_XYINPUT
  2088. int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons);
  2089. #endif
  2090. </pre></ul>
  2091. <p>
  2092. <b>Description:</b>
  2093. Used by a thread or interrupt handler that manages some kind of pointing
  2094. hardware to report new positional data to the NX server. That positional
  2095. data will be routed by the NX server to the appropriate window client.
  2096. </p>
  2097. <p>
  2098. <b>Input Parameters:</b>
  2099. <ul><dl>
  2100. <dt><code></code>
  2101. <dd>
  2102. </dl></ul>
  2103. </p>
  2104. <p>
  2105. <b>Returned Value:</b>
  2106. <code>OK</code> on success;
  2107. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2108. </p>
  2109. <h2>2.4 <a name="nxtk2">NX Tool Kit (<code>NXTK</code>)</a></h2>
  2110. <p>
  2111. NXTK implements where the <i>framed window</i>.
  2112. NX framed windows consist of three components within one NX window:
  2113. </p>
  2114. <ol>
  2115. <li>The window <i>border</i>,</li>
  2116. <li>The main <i>client window</i> area, and</li>
  2117. <li>A <i>toolbar</i> area</li>
  2118. </ol>
  2119. <p>
  2120. Each sub-window represents a region within one window.
  2121. <a href="#screenshot">Figure 1</a> shows some simple NX framed windows.
  2122. NXTK allows these sub-windows to be managed more-or-less independently:
  2123. </p>
  2124. <ul>
  2125. <li>
  2126. Each component has its own callbacks for redraw and position events
  2127. as well as mouse and keyboard inputs.
  2128. The client sub-window callbacks are registered when the framed window is
  2129. created with a call to <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>;
  2130. Separate toolbar sub-window callbakcs are reigistered when the toolbar
  2131. is added using <a href="#nxtkopentoolbar"><code>nxtk_opentoolbar()</code></a>.
  2132. (NOTES: (1) only the client sub-window receives keyboard input and,
  2133. (2) border callbacks are not currently accessible by the user).
  2134. <li>
  2135. </li>
  2136. All position informational provided within the callback is relative
  2137. to the specific sub-window.
  2138. That is, the origin (0,0) of the coordinate system for each sub-window
  2139. begins at the top left corner of the subwindow.
  2140. This means that toolbar logic need not be concerned about client window
  2141. geometry (and vice versa) and, for example, common toolbar logic can
  2142. be used with different windows.
  2143. </li>
  2144. </ul>
  2145. <h3>2.4.1 <a name="nxtktypes"><code>NXTK Types()</code></a></h3>
  2146. <p>
  2147. This is the handle that can be used to access the window data region.
  2148. </p>
  2149. <ul><pre>
  2150. typedef FAR void *NXTKWINDOW;
  2151. </pre></ul>
  2152. <h3>2.4.2 <a name="nxtkblock"><code>nxtk_block()</code></a></h3>
  2153. <p><b>Function Prototype:</b></p>
  2154. <ul><pre>
  2155. #include &lt;nuttx/nx/nxtk.h&gt;
  2156. int nxtk_block(NXWINDOW hwnd, FAR void *arg);
  2157. </pre></ul>
  2158. <p>
  2159. <b>Description:</b>
  2160. The response to this function call is two things: (1) any queued callback messages to the window are 'blocked' and then (2) also subsequent window messaging is blocked.
  2161. </p>
  2162. <p>
  2163. The <code>event</code> callback with the <code>NXEVENT_BLOCKED</code> event is the response from <code>nxtk_block()</code>. This blocking interface is used to assure that no further messages are are directed to the window. Receipt of the <code>NXEVENT_BLOCKED</code> event signifies that (1) there are no further pending callbacks and (2) that the window is now <i>defunct</i> and will receive no further callbacks.
  2164. </p>
  2165. <p>
  2166. This callback supports coordinated destruction of a window. 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.
  2167. </p>
  2168. <p>
  2169. <b>Input Parameters:</b>
  2170. <ul>
  2171. <dl>
  2172. <dt><code>wnd</code>
  2173. <dd>The window to be blocked
  2174. <dt><code>arg</code>
  2175. <dd>An argument that will accompany the block messages (This is <code>arg2</code> in the event callback).
  2176. </ul>
  2177. </p>
  2178. <p>
  2179. <b>Returned Value:</b>
  2180. OK on success; ERROR on failure with errno set appropriately.
  2181. </p>
  2182. <h3>2.4.3 <a name="nxtksynch"><code>nxtk_synch()</code></a></h3>
  2183. <p><b>Function Prototype:</b></p>
  2184. <ul><pre>
  2185. #include &lt;nuttx/nx/nxtk.h&gt;
  2186. int nxtk_synch(NXWINDOW hwnd, FAR void *arg);
  2187. </pre></ul>
  2188. <p>
  2189. <b>Description:</b>
  2190. This interface can be used to synchronize the window client with the NX server. It really just implements an <i>echo</i>: A synch message is sent from the window client to the server which then responds immediately by sending the <code>NXEVENT_SYNCHED</code> back to the windows client.
  2191. </p>
  2192. <p>
  2193. Due to the highly asynchronous nature of client-server communications, <code>nx_synch()</code> is sometimes necessary to assure that the client and server are fully synchronized in time.
  2194. </p>
  2195. <p>
  2196. Usage by the window client might be something like this:
  2197. </p>
  2198. <ul><pre>
  2199. extern bool g_synched;
  2200. extern sem_t g_synch_sem;
  2201. g_synched = false;
  2202. ret = nxtk_synch(hfwnd, handle);
  2203. if (ret &lt; 0)
  2204. {
  2205. -- Handle the error --
  2206. }
  2207. while (!g_synched)
  2208. {
  2209. ret = sem_wait(&g_sync_sem);
  2210. if (ret &lt; 0)
  2211. {
  2212. -- Handle the error --
  2213. }
  2214. }
  2215. </pre></ul>
  2216. <p>
  2217. When the window listener thread receives the <code>NXEVENT_SYNCHED</code> event, it would set <code>g_synched</code> to <code>true</code> and post <code>g_synch_sem</code>, waking up the above loop.
  2218. </p>
  2219. <p>
  2220. <b>Input Parameters:</b>
  2221. <ul><dl>
  2222. <dt><code>wnd</code>
  2223. <dd>The window to be synched
  2224. <dt><code>arg</code>
  2225. <dd>An argument that will accompany the synch messages (This is <code>arg2</code> in the event callback).
  2226. </dl></ul>
  2227. </p>
  2228. <p>
  2229. <b>Returned Value:</b>
  2230. OK on success; ERROR on failure with errno set appropriately
  2231. </p>
  2232. <h3>2.4.4 <a name="nxtkopenwindow"><code>nxtk_openwindow()</code></a></h3>
  2233. <p><b>Function Prototype:</b></p>
  2234. <ul><pre>
  2235. #include &lt;nuttx/nx/nxglib.h&gt;
  2236. #include &lt;nuttx/nx/nx.h&gt;
  2237. #include &lt;nuttx/nx/nxtk.h&gt;
  2238. NXTKWINDOW nxtk_openwindow(NXHANDLE handle, uint8_t flags,
  2239. FAR const struct nx_callback_s *cb,
  2240. FAR void *arg);
  2241. </pre></ul>
  2242. <p>
  2243. <b>Description:</b> Create a new, framed window.
  2244. </p>
  2245. <p>
  2246. <b>Input Parameters:</b>
  2247. <dl>
  2248. <dt><code>handle</code>
  2249. <dd>The handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
  2250. <dt><code>flags</code>
  2251. <dd>Optional flags.
  2252. These include:
  2253. <ul>
  2254. <li><code>NXBE_WINDOW_RAMBACKED</code>: Creates a RAM backed window.
  2255. This option is only valid if <code>CONFIG_NX_RAMBACKED</code> is enabled.
  2256. </li>
  2257. <li><code>NXBE_WINDOW_HIDDEN</code>: The window is create in the HIDDEN state and can be made visible later with <code>nxtk_setvisibility()</code>.
  2258. </li>
  2259. </ul>
  2260. <dt><code>cb</code>
  2261. <dd>Callbacks used to process window events
  2262. <dt><code>arg</code>
  2263. <dd>User provided argument (see <a href="#nxopenwindow"><code>nx_openwindow()</code></a>)
  2264. </dl>
  2265. </p>
  2266. <p>
  2267. <b>Returned Value:</b>
  2268. </p>
  2269. <ul>
  2270. Success: A non-NULL handle used with subsequent NXTK window accesses<br>
  2271. Failure: NULL is returned and <code>errno</code> is set appropriately.
  2272. </ul>
  2273. <h3>2.4.5 <a name="nxtkclosewindow"><code>nxtk_closewindow()</code></a></h3>
  2274. <p><b>Function Prototype:</b></p>
  2275. <ul><pre>
  2276. #include &lt;nuttx/nx/nxglib.h&gt;
  2277. #include &lt;nuttx/nx/nx.h&gt;
  2278. #include &lt;nuttx/nx/nxtk.h&gt;
  2279. int nxtk_closewindow(NXTKWINDOW hfwnd);
  2280. </pre></ul>
  2281. <p>
  2282. <b>Description:</b>
  2283. Close the window opened by <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2284. </p>
  2285. <p>
  2286. <b>Input Parameters:</b>
  2287. <dl>
  2288. <dt><code>hfwnd</code>
  2289. <dd>A handle previously returned by
  2290. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2291. </dl>
  2292. </p>
  2293. <p>
  2294. <b>Returned Value:</b>
  2295. <code>OK</code> on success;
  2296. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2297. </p>
  2298. <h3>2.4.6 <a name="nxtkgetposition"><code>nxtk_getposition()</code></a></h3>
  2299. <p><b>Function Prototype:</b></p>
  2300. <ul><pre>
  2301. #include &lt;nuttx/nx/nxglib.h&gt;
  2302. #include &lt;nuttx/nx/nx.h&gt;
  2303. #include &lt;nuttx/nx/nxtk.h&gt;
  2304. int nxtk_getposition(NXTKWINDOW hfwnd);
  2305. </pre></ul>
  2306. <p>
  2307. <b>Description:</b>
  2308. Request the position and size information for the selected framed window.
  2309. The size/position for the client window and toolbar will be return
  2310. asynchronously through the client callback function pointer.
  2311. </p>
  2312. <p>
  2313. <b>Input Parameters:</b>
  2314. <dl>
  2315. <dt><code>hfwnd</code>
  2316. <dd>A handle previously returned by
  2317. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2318. </dl>
  2319. </p>
  2320. <p>
  2321. <b>Returned Value:</b>
  2322. <code>OK</code> on success;
  2323. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2324. </p>
  2325. <h3>2.4.7 <a name="nxtksetposition"><code>nxtk_setposition()</code></a></h3>
  2326. <p><b>Function Prototype:</b></p>
  2327. <ul><pre>
  2328. #include &lt;nuttx/nx/nxglib.h&gt;
  2329. #include &lt;nuttx/nx/nx.h&gt;
  2330. #include &lt;nuttx/nx/nxtk.h&gt;
  2331. int nxtk_setposition(NXTKWINDOW hfwnd, FAR struct nxgl_point_s *pos);
  2332. </pre></ul>
  2333. <p>
  2334. <b>Description:</b>
  2335. Set the position for the selected client window. This position does not
  2336. include the offsets for the borders nor for any toolbar. Those offsets
  2337. will be added in to set the full window position.
  2338. </p>
  2339. <p>
  2340. <b>Input Parameters:</b>
  2341. <dl>
  2342. <dt><code>hfwnd</code>
  2343. <dd>A handle previously returned by
  2344. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2345. <dt><code>pos</code>
  2346. <dd>The new position of the client sub-window
  2347. </dl>
  2348. </p>
  2349. <p>
  2350. <b>Returned Value:</b>
  2351. <code>OK</code> on success;
  2352. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2353. </p>
  2354. <h3>2.4.8 <a name="nxtksetsize"><code>nxtk_setsize()</code></a></h3>
  2355. <p><b>Function Prototype:</b></p>
  2356. <ul><pre>
  2357. #include &lt;nuttx/nx/nxglib.h&gt;
  2358. #include &lt;nuttx/nx/nx.h&gt;
  2359. #include &lt;nuttx/nx/nxtk.h&gt;
  2360. int nxtk_setsize(NXTKWINDOW hfwnd, FAR struct nxgl_size_s *size);
  2361. </pre></ul>
  2362. <p>
  2363. <b>Description:</b>
  2364. Set the size for the selected client window. This size does not
  2365. include the sizes of the borders nor for any toolbar. Those sizes
  2366. will be added in to set the full window size.
  2367. </p>
  2368. <p>
  2369. <b>Input Parameters:</b>
  2370. <dl>
  2371. <dt><code>hfwnd</code>
  2372. <dd>A handle previously returned by
  2373. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2374. <dt><code>size</code>
  2375. <dd>The new size of the client sub-window.
  2376. </dl>
  2377. </p>
  2378. <p>
  2379. <b>Returned Value:</b>
  2380. <code>OK</code> on success;
  2381. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2382. </p>
  2383. <h3>2.4.9 <a name="nxtkraise"><code>nxtk_raise()</code></a></h3>
  2384. <p><b>Function Prototype:</b></p>
  2385. <ul><pre>
  2386. #include &lt;nuttx/nx/nxglib.h&gt;
  2387. #include &lt;nuttx/nx/nx.h&gt;
  2388. #include &lt;nuttx/nx/nxtk.h&gt;
  2389. int nxtk_raise(NXTKWINDOW hfwnd);
  2390. </pre></ul>
  2391. <p>
  2392. <b>Description:</b>
  2393. Bring the window containing the specified client sub-window to the top
  2394. of the display.
  2395. </p>
  2396. <p>
  2397. <b>Input Parameters:</b>
  2398. <dl>
  2399. <dt><code>hfwnd</code>
  2400. <dd>A handle previously returned by
  2401. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>
  2402. specifying the window to be raised.
  2403. <dt><code></code>
  2404. <dd>
  2405. </dl>
  2406. </p>
  2407. <p>
  2408. <b>Returned Value:</b>
  2409. <code>OK</code> on success;
  2410. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2411. </p>
  2412. <h3>2.4.10 <a name="nxtklower"><code>nxtk_lower()</code></a></h3>
  2413. <p><b>Function Prototype:</b></p>
  2414. <ul><pre>
  2415. #include &lt;nuttx/nx/nxglib.h&gt;
  2416. #include &lt;nuttx/nx/nx.h&gt;
  2417. #include &lt;nuttx/nx/nxtk.h&gt;
  2418. int nxtk_lower(NXTKWINDOW hfwnd);
  2419. </pre></ul>
  2420. <p>
  2421. <b>Description:</b>
  2422. Lower the window containing the specified client sub-window to the
  2423. bottom of the display.
  2424. </p>
  2425. <p>
  2426. <b>Input Parameters:</b>
  2427. <dl>
  2428. <dt><code>hfwnd</code>
  2429. <dd>A handle previously returned by
  2430. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>
  2431. specifying the window to be lowered.
  2432. <dt><code></code>
  2433. <dd>
  2434. </dl>
  2435. </p>
  2436. <p>
  2437. <b>Returned Value:</b>
  2438. <code>OK</code> on success;
  2439. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2440. </p>
  2441. <h3>2.4.11 <a name="nxtkmodal"><code>nxtk_modal()</code></a></h3>
  2442. <p><b>Function Prototype:</b></p>
  2443. <ul><pre>
  2444. #include &lt;nuttx/nx/nxglib.h&gt;
  2445. #include &lt;nuttx/nx/nx.h&gt;
  2446. #include &lt;nuttx/nx/nxtk.h&gt;
  2447. int nxtk_modal(NXWINDOW hwnd, bool modal);
  2448. </pre></ul>
  2449. <p>
  2450. <b>Description:</b> May be used to either (1) raise a window to the top of the display and select modal behavior, or (2) disable modal behavior.
  2451. </p>
  2452. <p>
  2453. <b>Input Parameters:</b>
  2454. <ul><dl>
  2455. <dt><code>hwnd</code>
  2456. <dd>The handle returned by <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a> specifying the window to be modified.
  2457. <dt><code>modal</code>
  2458. <dd>True: enter modal state; False: leave modal state
  2459. </dl></ul>
  2460. </p>
  2461. <p>
  2462. <b>Returned Value:</b>
  2463. <code>OK</code> on success;
  2464. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2465. </p>
  2466. <h3>2.4.12 <a name="nxtksetvisibility"><code>nxtk_setvisibility()</code></a></h3>
  2467. <p><b>Function Prototype:</b></p>
  2468. <ul><pre>
  2469. #include &lt;nuttx/nx/nxglib.h&gt;
  2470. #include &lt;nuttx/nx/nx.h&gt;
  2471. #include &lt;nuttx/nx/nxtk.h&gt;
  2472. int nxtk_setvisibility(NXWINDOW hwnd, bool hide);
  2473. </pre></ul>
  2474. <p>
  2475. <b>Description:</b> Select if the window is visible or hidden.
  2476. A hidden window is still present and will update normally, but will not be visible on the display until it is unhidden.
  2477. </p>
  2478. <p>
  2479. <b>Input Parameters:</b>
  2480. <ul><dl>
  2481. <dt><code>hwnd</code>
  2482. <dd>The handle returned by <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a> specifying the window to be modified.
  2483. <dt><code>hide</code>
  2484. <dd>True: Window will be hidden; false: Window will be visible
  2485. </dl></ul>
  2486. </p>
  2487. <p>
  2488. <b>Returned Value:</b>
  2489. <code>OK</code> on success;
  2490. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2491. </p>
  2492. <h3>2.4.13 <a name="nxtkishidden"><code>nxtk_ishidden()</code></a></h3>
  2493. <p><b>Function Prototype:</b></p>
  2494. <ul><pre>
  2495. #include &lt;nuttx/nx/nxtk.h&gt;
  2496. bool nxtk_ishidden(NXTKWINDOW hfwnd);
  2497. </pre></ul>
  2498. <p>
  2499. <b>Description:</b> Return true if the window is hidden.
  2500. </p>
  2501. <p>
  2502. <b>NOTE</b>: There will be a delay between the time that the visibility of the window is changed via <a href="#nxtksetvisibility"><code>nxtk_setvisibily()</code></a> before that new setting is reported by <code>nxtk_ishidden()</code>.
  2503. <code>nxtk_synch()</code> may be used if temporal synchronization is required.
  2504. </p>
  2505. <p>
  2506. <b>Input Parameters:</b>
  2507. <ul><dl>
  2508. <dt><code>hfwnd</code>
  2509. <dd>The handle returned by <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a> that indentifies the window to be queried.
  2510. </dl></ul>
  2511. </p>
  2512. <p>
  2513. <b>Returned Value:</b>
  2514. <i>True</i>: the window is hidden, <i>false</i>: the window is visible
  2515. </p>
  2516. <h3>2.4.14 <a name="nxtkfillwindow"><code>nxtk_fillwindow()</code></a></h3>
  2517. <p><b>Function Prototype:</b></p>
  2518. <ul><pre>
  2519. #include &lt;nuttx/nx/nxglib.h&gt;
  2520. #include &lt;nuttx/nx/nx.h&gt;
  2521. #include &lt;nuttx/nx/nxtk.h&gt;
  2522. int nxtk_fillwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
  2523. nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  2524. </pre></ul>
  2525. <p>
  2526. <b>Description:</b>
  2527. Fill the specified rectangle in the client window with the specified color.
  2528. </p>
  2529. <p>
  2530. <b>Input Parameters:</b>
  2531. <dl>
  2532. <dt><code>hfwnd</code>
  2533. <dd>A handle previously returned by
  2534. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2535. <dt><code>rect</code>
  2536. <dd>The location within the client window to be filled
  2537. <dt><code>color</code>
  2538. <dd>The color to use in the fill
  2539. </dl>
  2540. </p>
  2541. <p>
  2542. <b>Returned Value:</b>
  2543. <code>OK</code> on success;
  2544. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2545. </p>
  2546. <h3>2.4.15 <a name="nxtkgetwindow"><code>nxtk_getwindow()</code></a></h3>
  2547. <p><b>Function Prototype:</b></p>
  2548. <ul><pre>
  2549. #include &lt;nuttx/nx/nxglib.h&gt;
  2550. #include &lt;nuttx/nx/nx.h&gt;
  2551. #include &lt;nuttx/nx/nxtk.h&gt;
  2552. void nxtk_getwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
  2553. unsigned int plane, FAR uint8_t *dest,
  2554. unsigned int deststride);
  2555. </pre></ul>
  2556. <p>
  2557. <b>Description:</b>
  2558. Get the raw contents of graphic memory within a rectangular region. NOTE:
  2559. Since raw graphic memory is returned, the returned memory content may be
  2560. the memory of windows above this one and may not necessarily belong to
  2561. this window unless you assure that this is the top window.</p>
  2562. <p>
  2563. <b>Input Parameters:</b>
  2564. <dl>
  2565. <dt><code>hfwnd</code>
  2566. <dd>A handle previously returned by
  2567. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2568. <dt><code>rect</code>
  2569. <dd>The location within the client window to be retrieved.
  2570. <dt><code>plane</code>
  2571. <dd>Specifies the color plane to get from.
  2572. <dt><code>dest</code>
  2573. <dd>The location to copy the memory region
  2574. <dt><code>deststride</code>
  2575. <dd>The width, in bytes, of the dest memory
  2576. </dl>
  2577. </p>
  2578. <p>
  2579. <b>Returned Value:</b>
  2580. <code>OK</code> on success;
  2581. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2582. </p>
  2583. <h3>2.4.16 <a name="nxtkfilltrapwindow"><code>nxtk_filltrapwindow()</code></a></h3>
  2584. <p><b>Function Prototype:</b></p>
  2585. <ul><pre>
  2586. #include &lt;nuttx/nx/nxglib.h&gt;
  2587. #include &lt;nuttx/nx/nx.h&gt;
  2588. #include &lt;nuttx/nx/nxtk.h&gt;
  2589. int nxtk_filltrapwindow(NXTKWINDOW hfwnd,
  2590. FAR const struct nxgl_trapezoid_s *trap,
  2591. nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  2592. </pre></ul>
  2593. <p>
  2594. <b>Description:</b>
  2595. Fill the specified trapezoid in the client window with the specified color
  2596. </p>
  2597. <p>
  2598. <b>Input Parameters:</b>
  2599. <dl>
  2600. <dt><code>hfwnd</code>
  2601. <dd>A handle previously returned by
  2602. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2603. <dt><code>trap</code>
  2604. <dd>The trapezoidal region to be filled.
  2605. <dt><code>color</code>
  2606. <dd>The color to use in the fill.
  2607. </dl>
  2608. </p>
  2609. <p>
  2610. <b>Returned Value:</b>
  2611. <code>OK</code> on success;
  2612. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2613. </p>
  2614. <h3>2.4.17 <a name="nxtkdrawlinewindow"><code>nxtk_drawlinewindow()</code></a></h3>
  2615. <p><b>Function Prototype:</b></p>
  2616. <ul><pre>
  2617. #include &lt;nuttx/nx/nxglib.h&gt;
  2618. #include &lt;nuttx/nx/nx.h&gt;
  2619. #include &lt;nuttx/nx/nxtk.h&gt;
  2620. int nxtk_drawlinewindow(NXTKWINDOW hfwnd, FAR struct nxgl_vector_s *vector,
  2621. nxgl_coord_t width, nxgl_mxpixel_t color[CONFIG_NX_NPLANES],
  2622. uint8_t caps);
  2623. </pre></ul>
  2624. <p>
  2625. <b>Description:</b>
  2626. Fill the specified trapezoidal region in the window with the specified color.
  2627. Fill the specified line in the window with the specified color.
  2628. This is simply a wrapper that uses <code>nxgl_splitline()</code> to break the line into
  2629. trapezoids and then calls <code>nxtk_filltrapwindow()</code> to render the line.
  2630. </p>
  2631. <p>
  2632. <b>Input Parameters:</b>
  2633. <ul><dl>
  2634. <dt><code>hfwnd</code>
  2635. <dd>A handle previously returned by
  2636. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2637. <dt><code>vector</code>
  2638. <dd>Describes the line to be drawn.
  2639. <dt><code>width</code>
  2640. <dd>The width of the line
  2641. <dt><code>color</code>
  2642. <dd>The color to use to fill the line
  2643. <dt><code>caps</code>
  2644. <dd>Draw a circular cap on the ends of the line to support better line joins.
  2645. One of:
  2646. <ul><pre>
  2647. /* Line caps */
  2648. #define NX_LINECAP_NONE 0x00, /* No line caps */
  2649. #define NX_LINECAP_PT1 0x01 /* Line cap on pt1 on of the vector only */
  2650. #define NX_LINECAP_PT2 0x02 /* Line cap on pt2 on of the vector only */
  2651. #define NX_LINECAP_BOTH 0x03 /* Line cap on both ends of the vector only */
  2652. </pre></ul>
  2653. </dl></ul>
  2654. </p>
  2655. <p>
  2656. <b>Returned Value:</b>
  2657. <code>OK</code> on success;
  2658. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2659. </p>
  2660. <h3>2.4.18 <a name="nxtkdrawcirclewindow"><code>nxtk_drawcirclewindow()</code></a></h3>
  2661. <p><b>Function Prototype:</b></p>
  2662. <ul><pre>
  2663. #include &lt;nuttx/nx/nxglib.h&gt;
  2664. #include &lt;nuttx/nx/nxtk.h&gt;
  2665. int nxtk_drawcirclewindow(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *center,
  2666. nxgl_coord_t radius, nxgl_coord_t width,
  2667. nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  2668. </pre></ul>
  2669. <p>
  2670. <b>Description:</b>
  2671. Draw a circular outline using the specified line thickness and color.
  2672. </p>
  2673. <p>
  2674. <b>Input Parameters:</b>
  2675. <ul><dl>
  2676. <dt><code>hfwnd</code>
  2677. <dd>A handle previously returned by
  2678. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2679. <dt><code>center</code>
  2680. <dd>A pointer to the point that is the center of the circle.
  2681. <dt><code>radius</code>
  2682. <dd>The radius of the circle in pixels.
  2683. <dt><code>width</code>
  2684. <dd>The width of the line
  2685. <dt><code>color</code>
  2686. <dd>The color to use to fill the line
  2687. </dl></ul>
  2688. </p>
  2689. <p>
  2690. <b>Returned Value:</b>
  2691. <code>OK</code> on success;
  2692. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2693. </p>
  2694. <h3>2.4.19 <a name="nxtkfillcirclewindow"><code>nxtk_fillcirclewindow()</code></a></h3>
  2695. <p><b>Function Prototype:</b></p>
  2696. <ul><pre>
  2697. #include &lt;nuttx/nx/nxglib.h&gt;
  2698. #include &lt;nuttx/nx/nxtk.h&gt;
  2699. int nxtk_fillcirclewindow(NXWINDOW hfwnd, FAR const struct nxgl_point_s *center,
  2700. nxgl_coord_t radius, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  2701. </pre></ul>
  2702. <p>
  2703. <b>Description:</b>
  2704. Fill a circular region using the specified color.
  2705. </p>
  2706. <p>
  2707. <b>Input Parameters:</b>
  2708. <ul><dl>
  2709. <dt><code>hfwnd</code>
  2710. <dd>A handle previously returned by
  2711. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2712. <dt><code>center</code>
  2713. <dd>A pointer to the point that is the center of the circle.
  2714. <dt><code>radius</code>
  2715. <dd>The width of the line
  2716. <dt><code>color</code>
  2717. <dd>The color to use to fill the circle
  2718. </dl></ul>
  2719. </p>
  2720. <p>
  2721. <b>Returned Value:</b>
  2722. <code>OK</code> on success;
  2723. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2724. </p>
  2725. <h3>2.4.20 <a name="nxtkmovewindow"><code>nxtk_movewindow()</code></a></h3>
  2726. <p><b>Function Prototype:</b></p>
  2727. <ul><pre>
  2728. #include &lt;nuttx/nx/nxglib.h&gt;
  2729. #include &lt;nuttx/nx/nx.h&gt;
  2730. #include &lt;nuttx/nx/nxtk.h&gt;
  2731. int nxtk_movewindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
  2732. FAR const struct nxgl_point_s *offset);
  2733. </pre></ul>
  2734. <p>
  2735. <b>Description:</b>
  2736. Move a rectangular region within the client sub-window of a framed window.
  2737. </p>
  2738. <p>
  2739. <b>Input Parameters:</b>
  2740. <dl>
  2741. <dt><code>hfwnd</code>
  2742. <dd>A handle previously returned by
  2743. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>
  2744. specifying the client sub-window within which the move is to be done.
  2745. <dt><code>rect</code>
  2746. <dd>Describes the rectangular region relative to the client sub-window to move.
  2747. <dt><code>offset</code>
  2748. <dd>The offset to move the region
  2749. </dl>
  2750. </p>
  2751. <p>
  2752. <b>Returned Value:</b>
  2753. <code>OK</code> on success;
  2754. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2755. </p>
  2756. <h3>2.4.21 <a name="nxtkbitmapwindow"><code>nxtk_bitmapwindow()</code></a></h3>
  2757. <p><b>Function Prototype:</b></p>
  2758. <ul><pre>
  2759. #include &lt;nuttx/nx/nxglib.h&gt;
  2760. #include &lt;nuttx/nx/nx.h&gt;
  2761. #include &lt;nuttx/nx/nxtk.h&gt;
  2762. int nxtk_bitmapwindow(NXTKWINDOW hfwnd,
  2763. FAR const struct nxgl_rect_s *dest,
  2764. FAR const void *src[CONFIG_NX_NPLANES],
  2765. FAR const struct nxgl_point_s *origin,
  2766. unsigned int stride);
  2767. </pre></ul>
  2768. <p>
  2769. <b>Description:</b>
  2770. Copy a rectangular region of a larger image into the rectangle in the
  2771. specified client sub-window.
  2772. </p>
  2773. <p>
  2774. <b>Input Parameters:</b>
  2775. <dl>
  2776. <dt><code>hfwnd</code>
  2777. <dd>A handle previously returned by
  2778. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>
  2779. specifying the client sub-window that will receive the bitmap.
  2780. <dt><code>dest</code>
  2781. <dd>Describes the rectangular region on in the client sub-window
  2782. will receive the bit map.
  2783. <dt><code>src</code>
  2784. <dd>The start of the source image(s). This is an array source
  2785. images of size <code>CONFIG_NX_NPLANES</code> (probably 1).
  2786. <dt><code>origin</code>
  2787. <dd>The origin of the upper, left-most corner of the full bitmap.
  2788. Both dest and origin are in sub-window coordinates, however, the
  2789. origin may lie outside of the sub-window display.
  2790. <dt><code>stride</code>
  2791. <dd>The width of the full source image in pixels.
  2792. </dl>
  2793. </p>
  2794. <p>
  2795. <b>Returned Value:</b>
  2796. <code>OK</code> on success;
  2797. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2798. </p>
  2799. <h3>2.4.22 <a name="nxtkopentoolbar"><code>nxtk_opentoolbar()</code></a></h3>
  2800. <p><b>Function Prototype:</b></p>
  2801. <ul><pre>
  2802. #include &lt;nuttx/nx/nxglib.h&gt;
  2803. #include &lt;nuttx/nx/nx.h&gt;
  2804. #include &lt;nuttx/nx/nxtk.h&gt;
  2805. int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height,
  2806. FAR const struct nx_callback_s *cb,
  2807. FAR void *arg);
  2808. </pre></ul>
  2809. <p>
  2810. <b>Description:</b>
  2811. Create a tool bar at the top of the specified framed window.
  2812. </p>
  2813. <p>
  2814. <b>Input Parameters:</b>
  2815. <dl>
  2816. <dt><code>hfwnd</code>
  2817. <dd>A handle previously returned by
  2818. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2819. <dt><code>height</code>
  2820. <dd>The requested height of the toolbar in pixels.
  2821. <dt><code>cb</code>
  2822. <dd>Callbacks used to process toolbar events.
  2823. <dt><code>arg</code>
  2824. <dd>User provided value that will be returned with toolbar callbacks.
  2825. </dl>
  2826. </p>
  2827. <p>
  2828. <b>Returned Value:</b>
  2829. <code>OK</code> on success;
  2830. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2831. </p>
  2832. <h3>2.4.23 <a name="nxtkclosetoolbar"><code>nxtk_closetoolbar()</code></a></h3>
  2833. <p><b>Function Prototype:</b></p>
  2834. <ul><pre>
  2835. #include &lt;nuttx/nx/nxglib.h&gt;
  2836. #include &lt;nuttx/nx/nx.h&gt;
  2837. #include &lt;nuttx/nx/nxtk.h&gt;
  2838. int nxtk_closetoolbar(NXTKWINDOW hfwnd);
  2839. </pre></ul>
  2840. <p>
  2841. <b>Description:</b>
  2842. Remove the tool bar at the top of the specified framed window.
  2843. </p>
  2844. <p>
  2845. <b>Input Parameters:</b>
  2846. <dl>
  2847. <dt><code>hfwnd</code>
  2848. <dd>A handle previously returned by
  2849. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2850. <dt><code></code>
  2851. <dd>
  2852. </dl>
  2853. </p>
  2854. <p>
  2855. <b>Returned Value:</b>
  2856. <code>OK</code> on success;
  2857. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2858. </p>
  2859. <h3>2.4.24 <a name="nxtkfilltoolbar"><code>nxtk_filltoolbar()</code></a></h3>
  2860. <p><b>Function Prototype:</b></p>
  2861. <ul><pre>
  2862. #include &lt;nuttx/nx/nxglib.h&gt;
  2863. #include &lt;nuttx/nx/nx.h&gt;
  2864. #include &lt;nuttx/nx/nxtk.h&gt;
  2865. int nxtk_filltoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
  2866. nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  2867. </pre></ul>
  2868. <p>
  2869. <b>Description:</b>
  2870. Fill the specified rectangle in the toolbar sub-window with the specified color.
  2871. </p>
  2872. <p>
  2873. <b>Input Parameters:</b>
  2874. <dl>
  2875. <dt><code>hfwnd</code>
  2876. <dd>A handle previously returned by
  2877. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2878. <dt><code>rect</code>
  2879. <dd>The location within the toolbar window to be filled.
  2880. <dt><code>color</code>
  2881. <dd>The color to use in the fill.
  2882. </dl>
  2883. </p>
  2884. <p>
  2885. <b>Returned Value:</b>
  2886. <code>OK</code> on success;
  2887. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2888. </p>
  2889. <h3>2.4.25 <a name="nxtkgettoolbar"><code>nxtk_gettoolbar()</code></a></h3>
  2890. <p><b>Function Prototype:</b></p>
  2891. <ul><pre>
  2892. #include &lt;nuttx/nx/nxglib.h&gt;
  2893. #include &lt;nuttx/nx/nx.h&gt;
  2894. #include &lt;nuttx/nx/nxtk.h&gt;
  2895. int nxtk_gettoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
  2896. unsigned int plane, FAR uint8_t *dest,
  2897. unsigned int deststride);
  2898. </pre></ul>
  2899. <p>
  2900. <b>Description:</b>
  2901. Get the raw contents of graphic memory within a rectangular region. NOTE:
  2902. Since raw graphic memory is returned, the returned memory content may be
  2903. the memory of windows above this one and may not necessarily belong to
  2904. this window unless you assure that this is the top window.
  2905. </p>
  2906. <p>
  2907. <b>Input Parameters:</b>
  2908. <dl>
  2909. <dt><code>hfwnd</code>
  2910. <dd>A handle previously returned by
  2911. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2912. <dt><code>rect</code>
  2913. <dd>The location within the toolbar window to be retrieved.
  2914. <dt><code>plane</code>
  2915. <dd>TSpecifies the color plane to get from.
  2916. <dt><code>dest</code>
  2917. <dd>TThe location to copy the memory region.
  2918. <dt><code>deststride</code>
  2919. <dd>The width, in bytes, of the dest memory.
  2920. </dl>
  2921. </p>
  2922. <p>
  2923. <b>Returned Value:</b>
  2924. <code>OK</code> on success;
  2925. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2926. </p>
  2927. <h3>2.4.26 <a name="nxtkfilltraptoolbar"><code>nxtk_filltraptoolbar()</code></a></h3>
  2928. <p><b>Function Prototype:</b></p>
  2929. <ul><pre>
  2930. #include &lt;nuttx/nx/nxglib.h&gt;
  2931. #include &lt;nuttx/nx/nx.h&gt;
  2932. #include &lt;nuttx/nx/nxtk.h&gt;
  2933. int nxtk_filltraptoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *trap,
  2934. nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  2935. </pre></ul>
  2936. <p>
  2937. <b>Description:</b>
  2938. Fill the specified trapezoid in the toolbar sub-window with the specified color.
  2939. </p>
  2940. <p>
  2941. <b>Input Parameters:</b>
  2942. <dl>
  2943. <dt><code>hfwnd</code>
  2944. <dd>A handle previously returned by
  2945. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2946. <dt><code>trap</code>
  2947. <dd>The trapezoidal region to be filled
  2948. <dt><code>color</code>
  2949. <dd>The color to use in the fill
  2950. </dl>
  2951. </p>
  2952. <p>
  2953. <b>Returned Value:</b>
  2954. <code>OK</code> on success;
  2955. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  2956. </p>
  2957. <h3>2.4.27 <a name="nxtkdrawlinetoolbar"><code>nxtk_drawlinetoolbar()</code></a></h3>
  2958. <p><b>Function Prototype:</b></p>
  2959. <ul><pre>
  2960. #include &lt;nuttx/nx/nxglib.h&gt;
  2961. #include &lt;nuttx/nx/nx.h&gt;
  2962. #include &lt;nuttx/nx/nxtk.h&gt;
  2963. int nxtk_drawlinetoolbar(NXTKWINDOW hfwnd, FAR struct nxgl_vector_s *vector,
  2964. nxgl_coord_t width, nxgl_mxpixel_t color[CONFIG_NX_NPLANES],
  2965. uint8_t caps);
  2966. </pre></ul>
  2967. <p>
  2968. <b>Description:</b>
  2969. Fill the specified line in the toolbar sub-window with the specified color.
  2970. This is simply a wrapper that uses <code>nxgl_splitline()</code> to break the line into
  2971. trapezoids and then calls <code>nxtk_filltraptoolbar()</code> to render the line.
  2972. </p>
  2973. <p>
  2974. <b>Input Parameters:</b>
  2975. <ul><dl>
  2976. <dt><code>hfwnd</code>
  2977. <dd>A handle previously returned by
  2978. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  2979. <dt><code>vector</code>
  2980. <dd>Describes the line to be drawn.
  2981. <dt><code>width</code>
  2982. <dd>The width of the line
  2983. <dt><code>color</code>
  2984. <dd>The color to use to fill the line
  2985. <dt><code>caps</code>
  2986. <dd>Draw a circular cap on the ends of the line to support better line joins.
  2987. One of:
  2988. <ul><pre>
  2989. /* Line caps */
  2990. #define NX_LINECAP_NONE 0x00, /* No line caps */
  2991. #define NX_LINECAP_PT1 0x01 /* Line cap on pt1 on of the vector only */
  2992. #define NX_LINECAP_PT2 0x02 /* Line cap on pt2 on of the vector only */
  2993. #define NX_LINECAP_BOTH 0x03 /* Line cap on both ends of the vector only */
  2994. </pre></ul>
  2995. </dl></ul>
  2996. </p>
  2997. <p>
  2998. <b>Returned Value:</b>
  2999. <code>OK</code> on success;
  3000. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  3001. </p>
  3002. <h3>2.4.28 <a name="nxtkdrawcircletoolbar"><code>nxtk_drawcircletoolbar()</code></a></h3>
  3003. <p><b>Function Prototype:</b></p>
  3004. <ul><pre>
  3005. #include &lt;nuttx/nx/nxglib.h&gt;
  3006. #include &lt;nuttx/nx/nxtk.h&gt;
  3007. int nxtk_drawcircletoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *center,
  3008. nxgl_coord_t radius, nxgl_coord_t width,
  3009. nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  3010. </pre></ul>
  3011. <p>
  3012. <b>Description:</b>
  3013. Draw a circular outline using the specified line thickness and color.
  3014. </p>
  3015. <p>
  3016. <b>Input Parameters:</b>
  3017. <ul><dl>
  3018. <dt><code>hfwnd</code>
  3019. <dd>A handle previously returned by
  3020. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  3021. <dt><code>center</code>
  3022. <dd>A pointer to the point that is the center of the circle.
  3023. <dt><code>radius</code>
  3024. <dd>The radius of the circle in pixels.
  3025. <dt><code>width</code>
  3026. <dd>The width of the line
  3027. <dt><code>color</code>
  3028. <dd>The color to use to fill the line
  3029. </dl></ul>
  3030. </p>
  3031. <p>
  3032. <b>Returned Value:</b>
  3033. <code>OK</code> on success;
  3034. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  3035. </p>
  3036. <h3>2.4.29 <a name="nxtkfillcircletoolbar"><code>nxtk_fillcircletoolbar()</code></a></h3>
  3037. <p><b>Function Prototype:</b></p>
  3038. <ul><pre>
  3039. #include &lt;nuttx/nx/nxglib.h&gt;
  3040. #include &lt;nuttx/nx/nxtk.h&gt;
  3041. int nxtk_fillcircletoolbar(NXWINDOW hfwnd, FAR const struct nxgl_point_s *center,
  3042. nxgl_coord_t radius, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
  3043. </pre></ul>
  3044. <p>
  3045. <b>Description:</b>
  3046. Fill a circular region using the specified color.
  3047. </p>
  3048. <p>
  3049. <b>Input Parameters:</b>
  3050. <ul><dl>
  3051. <dt><code>hfwnd</code>
  3052. <dd>A handle previously returned by
  3053. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  3054. <dt><code>center</code>
  3055. <dd>A pointer to the point that is the center of the circle.
  3056. <dt><code>radius</code>
  3057. <dd>The width of the line
  3058. <dt><code>color</code>
  3059. <dd>The color to use to fill the circle
  3060. </dl></ul>
  3061. </p>
  3062. <p>
  3063. <b>Returned Value:</b>
  3064. <code>OK</code> on success;
  3065. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  3066. </p>
  3067. <h3>2.4.30 <a name="nxtkmovetoolbar"><code>nxtk_movetoolbar()</code></a></h3>
  3068. <p><b>Function Prototype:</b></p>
  3069. <ul><pre>
  3070. #include &lt;nuttx/nx/nxglib.h&gt;
  3071. #include &lt;nuttx/nx/nx.h&gt;
  3072. #include &lt;nuttx/nx/nxtk.h&gt;
  3073. int nxtk_movetoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
  3074. FAR const struct nxgl_point_s *offset);
  3075. </pre></ul>
  3076. <p>
  3077. <b>Description:</b>
  3078. Move a rectangular region within the toolbar sub-window of a framed window.
  3079. </p>
  3080. <p>
  3081. <b>Input Parameters:</b>
  3082. <dl>
  3083. <dt><code>hfwnd</code>
  3084. <dd>A handle identifying sub-window containing the toolbar within which the move is
  3085. to be done.
  3086. This handle must have previously been returned by
  3087. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  3088. <dt><code>rect</code>
  3089. <dd>Describes the rectangular region relative to the toolbar sub-window to move.
  3090. <dt><code>offset</code>
  3091. <dd>The offset to move the region
  3092. </dl>
  3093. </p>
  3094. <p>
  3095. <b>Returned Value:</b>
  3096. <code>OK</code> on success;
  3097. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  3098. </p>
  3099. <h3>2.4.31 <a name="nxtkbitmaptoolbar"><code>nxtk_bitmaptoolbar()</code></a></h3>
  3100. <p><b>Function Prototype:</b></p>
  3101. <ul><pre>
  3102. #include &lt;nuttx/nx/nxglib.h&gt;
  3103. #include &lt;nuttx/nx/nx.h&gt;
  3104. #include &lt;nuttx/nx/nxtk.h&gt;
  3105. int nxtk_bitmaptoolbar(NXTKWINDOW hfwnd,
  3106. FAR const struct nxgl_rect_s *dest,
  3107. FAR const void *src[CONFIG_NX_NPLANES],
  3108. FAR const struct nxgl_point_s *origin,
  3109. unsigned int stride);
  3110. </pre></ul>
  3111. <p>
  3112. <b>Description:</b>
  3113. Copy a rectangular region of a larger image into the rectangle in the
  3114. specified toolbar sub-window.
  3115. </p>
  3116. <p>
  3117. <b>Input Parameters:</b>
  3118. <dl>
  3119. <dt><code>hfwnd</code>
  3120. <dd>A handle previously returned by
  3121. <a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a>.
  3122. <dt><code>dest</code>
  3123. <dd>Describes the rectangular region on in the toolbar sub-window
  3124. will receive the bit map.
  3125. <dt><code>src</code>
  3126. <dd>The start of the source image.
  3127. <dt><code>origin</code>
  3128. <dd>The origin of the upper, left-most corner of the full bitmap.
  3129. Both dest and origin are in sub-window coordinates, however, the
  3130. origin may lie outside of the sub-window display.
  3131. <dt><code>stride</code>
  3132. <dd>The width of the full source image in bytes.
  3133. </dl>
  3134. </p>
  3135. <p>
  3136. <b>Returned Value:</b>
  3137. <code>OK</code> on success;
  3138. <code>ERROR</code> on failure with <code>errno</code> set appropriately
  3139. </p>
  3140. <h2>2.5 <a name="nxfonts2">NX Fonts Support (<code>NXFONTS</code>)</a></h2>
  3141. <h3>2.5.1 <a name="nxfontstypes"><code>NXFONTS Types()</code></a></h3>
  3142. <p>
  3143. This structures provides the metrics for one glyph:
  3144. </p>
  3145. <ul><pre>
  3146. struct nx_fontmetric_s
  3147. {
  3148. uint32_t stride : 2; /* Width of one font row in bytes */
  3149. uint32_t width : 6; /* Width of the font in bits */
  3150. uint32_t height : 6; /* Height of the font in rows */
  3151. uint32_t xoffset : 6; /* Top, left-hand corner X-offset in pixels */
  3152. uint32_t yoffset : 6; /* Top, left-hand corner y-offset in pixels */
  3153. uint32_t unused : 6;
  3154. };
  3155. </pre></ul>
  3156. <p>
  3157. This structure binds the glyph metrics to the glyph bitmap:
  3158. </p>
  3159. <ul><pre>
  3160. struct nx_fontbitmap_s
  3161. {
  3162. struct nx_fontmetric_s metric; /* Character metrics */
  3163. FAR const uint8_t *bitmap; /* Pointer to the character bitmap */
  3164. };
  3165. </pre></ul>
  3166. <p>
  3167. This structure describes one contiguous grouping of glyphs that
  3168. can be described by an array starting with encoding <code>first</code> and
  3169. extending through (<code>first</code> + <code>nchars</code> - 1).
  3170. </p>
  3171. <ul><pre>
  3172. struct nx_fontset_s
  3173. {
  3174. uint8_t first; /* First bitmap character code */
  3175. uint8_t nchars; /* Number of bitmap character codes */
  3176. FAR const struct nx_fontbitmap_s *bitmap;
  3177. };
  3178. </pre></ul>
  3179. <p>
  3180. This structure describes the overall fontset:
  3181. </p>
  3182. <ul><pre>
  3183. struct nx_font_s
  3184. {
  3185. uint8_t mxheight; /* Max height of one glyph in rows */
  3186. uint8_t mxwidth; /* Max width of any glyph in pixels */
  3187. uint8_t mxbits; /* Max number of bits per character code */
  3188. uint8_t spwidth; /* The width of a space in pixels */
  3189. };
  3190. </pre></ul>
  3191. <h3>2.5.2 <a name="nxfgetfonthandle"><code>nxf_getfonthandle()</code></a></h3>
  3192. <p><b>Function Prototype:</b></p>
  3193. <ul><pre>
  3194. #include &lt;nuttx/nx/nxfonts.h&gt;
  3195. NXHANDLE nxf_getfonthandle(enum nx_fontid_e fontid);
  3196. </pre></ul>
  3197. <p>
  3198. <b>Description:</b>
  3199. Given a numeric font ID, return a handle that may be subsequently be used to access the font data sets.
  3200. </p>
  3201. <p>
  3202. <b>Input Parameters:</b>
  3203. <ul><dl>
  3204. <dt><code>fontid</code>
  3205. <dd>Identifies the font set to use
  3206. </dl></ul>
  3207. </p>
  3208. <p>
  3209. <b>Returned Value:</b>
  3210. A handle that may be subsequently be used to access the font data sets.
  3211. </p>
  3212. <h3>2.5.3 <a name="nxfgetfontset"><code>nxf_getfontset()</code></a></h3>
  3213. <p><b>Function Prototype:</b></p>
  3214. <ul><pre>
  3215. #include &lt;nuttx/nx/nxglib.h&gt;
  3216. #include &lt;nuttx/nx/nxfonts.h&gt;
  3217. FAR const struct nx_font_s *nxf_getfontset(NXHANDLE handle);
  3218. </pre></ul>
  3219. <p>
  3220. <b>Description:</b>
  3221. Return information about the current font set.
  3222. </p>
  3223. <p>
  3224. <b>Input Parameters:</b>
  3225. <ul><dl>
  3226. <dt><code>handle</code>
  3227. <dd>A font handle previously returned by <a href="#nxfgetfonthandle"><code>nxf_getfonthandle()</code></a>.
  3228. </dl></ul>
  3229. </p>
  3230. <p>
  3231. <b>Returned Value:</b>
  3232. An instance of <code>struct nx_font_s</code> describing the font set.
  3233. </p>
  3234. <h3>2.5.4 <a name="nxfgetbitmap"><code>nxf_getbitmap()</code></a></h3>
  3235. <p><b>Function Prototype:</b></p>
  3236. <ul><pre>
  3237. #include &lt;nuttx/nx/nxglib.h&gt;
  3238. #include &lt;nuttx/nx/nxfonts.h&gt;
  3239. FAR const struct nx_fontbitmap_s *nxf_getbitmap(NXHANDLE handle, uint16_t ch);
  3240. </pre></ul>
  3241. <p>
  3242. <b>Description:</b>
  3243. Return font bitmap information for the selected character encoding.
  3244. </p>
  3245. <p>
  3246. <b>Input Parameters:</b>
  3247. <ul><dl>
  3248. <dt><code>ch</code>
  3249. <dd>The char code for the requested bitmap.
  3250. <dt><code>handle</code>
  3251. <dd>A font handle previously returned by <a href="#nxfgetfonthandle"><code>nxf_getfonthandle()</code></a>.
  3252. </dl></ul>
  3253. </p>
  3254. <p>
  3255. <b>Returned Value:</b>
  3256. An instance of <code>struct nx_fontbitmap_s</code> describing the glyph.
  3257. </p>
  3258. <h3>2.5.5 <a name="nxfconvertbpp"><code>nxf_convert_*bpp()</code></a></h3>
  3259. <p><b>Function Prototype:</b></p>
  3260. <ul><pre>
  3261. #include &lt;nuttx/nx/nxglib.h&gt;
  3262. #include &lt;nuttx/nx/nxfonts.h&gt;
  3263. int nxf_convert_2bpp(FAR uint8_t *dest, uint16_t height,
  3264. uint16_t width, uint16_t stride,
  3265. FAR const struct nx_fontbitmap_s *bm,
  3266. nxgl_mxpixel_t color);
  3267. int nxf_convert_4bpp(FAR uint8_t *dest, uint16_t height,
  3268. uint16_t width, uint16_t stride,
  3269. FAR const struct nx_fontbitmap_s *bm,
  3270. nxgl_mxpixel_t color);
  3271. int nxf_convert_8bpp(FAR uint8_t *dest, uint16_t height,
  3272. uint16_t width, uint16_t stride,
  3273. FAR const struct nx_fontbitmap_s *bm,
  3274. nxgl_mxpixel_t color);
  3275. int nxf_convert_16bpp(FAR uint16_t *dest, uint16_t height,
  3276. uint16_t width, uint16_t stride,
  3277. FAR const struct nx_fontbitmap_s *bm,
  3278. nxgl_mxpixel_t color);
  3279. int nxf_convert_24bpp(FAR uint32_t *dest, uint16_t height,
  3280. uint16_t width, uint16_t stride,
  3281. FAR const struct nx_fontbitmap_s *bm,
  3282. nxgl_mxpixel_t color);
  3283. int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height,
  3284. uint16_t width, uint16_t stride,
  3285. FAR const struct nx_fontbitmap_s *bm,
  3286. nxgl_mxpixel_t color);
  3287. </pre></ul>
  3288. <p>
  3289. <b>Description:</b> Convert the 1BPP font to a new pixel depth.
  3290. </p>
  3291. <p>
  3292. <b>Input Parameters:</b>
  3293. <ul><dl>
  3294. <dt><code>dest</code>
  3295. <dd>The destination buffer provided by the caller.
  3296. <dt><code>height</code>
  3297. <dd>The max height of the returned char in rows.
  3298. <dt><code>width</code>
  3299. <dd>The max width of the returned char in pixels.
  3300. <dt><code>stride</code>
  3301. <dd>The width of the destination buffer in bytes.
  3302. <dt><code>bm</code>
  3303. <dd>Describes the character glyph to convert
  3304. <dt><code>color</code>
  3305. <dd>The color to use for '1' bits in the font bitmap (0 bits are transparent).
  3306. </dl></ul>
  3307. </p>
  3308. <p>
  3309. <b>Returned Value:</b>
  3310. <code>OK</code> on success;
  3311. <code>ERROR</code> on failure with <code>errno</code> set appropriately.
  3312. </p>
  3313. <p>
  3314. <i><b>2.6</b> <a href="#nxcursor"</a></i>
  3315. </p>
  3316. <p>
  3317. <ul>
  3318. <i>2.6.1 <a href="#"><code>()</code></a></i><br>
  3319. <i>2.6.2 <a href="#"><code>()</code></a></i><br>
  3320. <i>2.6.3 <a href="#"><code>()</code></a></i><br>
  3321. </ul>
  3322. </p>
  3323. <h2>2.6 <a name="nxcursor">NX Cursor Support (<code>NXCURSOR</code>)</a></h2>
  3324. <h3>2.6.1 <a name="nxcursorenable"><code>nxcursor_enable()</code></a></h3>
  3325. <p><b>Function Prototype:</b></p>
  3326. <ul><pre>
  3327. #include &lt;nuttx/nx/nxcursor.h&gt;
  3328. #ifdef CONFIG_NX_SWCURSOR
  3329. int nxcursor_enable(NXHANDLE hnd, bool enable);
  3330. #endif
  3331. </pre></ul>
  3332. <p>
  3333. <b>Description:</b>
  3334. Enable/disable presentation of the cursor. The disabled cursor still exits and still may be controlled, but is not visible on the display.
  3335. </p>
  3336. <p>
  3337. <b>Input Parameters:</b>
  3338. <ul><dl>
  3339. <dt><code>hnd</code>
  3340. <dd>The server handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
  3341. <dt><code>enable</code>
  3342. <dd>The new cursor position
  3343. </dl></ul>
  3344. </p>
  3345. <p>
  3346. <b>Returned Value:</b>
  3347. OK on success; ERROR on failure with errno set appropriately.
  3348. </p>
  3349. <h3>2.6.2 <a name="nxcursorsetimage"><code>nxcursor_setimage()</code></a></h3>
  3350. <p><b>Function Prototype:</b></p>
  3351. <ul><pre>
  3352. #include &lt;nuttx/nx/nxcursor.h&gt;
  3353. #ifdef CONFIG_NX_SWCURSOR
  3354. int nxcursor_setimage(NXHANDLE hnd, FAR const struct nx_cursorimage_s *image);
  3355. #endif
  3356. </pre></ul>
  3357. <p>
  3358. <b>Description:</b>
  3359. Set the cursor image.
  3360. </p>
  3361. <p>
  3362. The image is provided a a 2-bits-per-pixel image. The two bit incoding is as followings:
  3363. </p>
  3364. <ul>
  3365. 00 - The transparent background.<br>
  3366. 01 - Color1: The main color of the cursor.<br>
  3367. 10 - Color2: The color of any border.<br>
  3368. 11 - Color3: A blend color for better imaging (fake anti-aliasing).<br>
  3369. </ul>
  3370. <p>
  3371. <b>NOTE:</b> The NX logic will reference the user image buffer repeatedly. That image buffer must persist for as long as the NX server connection persists.
  3372. </p>
  3373. <p>
  3374. <b>Input Parameters:</b>
  3375. <ul><dl>
  3376. <dt><code>hnd</code>
  3377. <dd>The server handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
  3378. <dt><code>image</code>
  3379. <dd>An instance of <code>struct struct nx_cursorimage_s</code> that describes the cursor image. See <code> &lt;nuttx/nx/nxcursor.h&gt;</code> for the full description of this structure.
  3380. </dl></ul>
  3381. </p>
  3382. <p>
  3383. <b>Returned Value:</b>
  3384. OK on success; ERROR on failure with errno set appropriately.
  3385. </p>
  3386. <h3>2.6.3 <a name="nxcursorsetposition"><code>nxcursor_setposition()</code></a></h3>
  3387. <p><b>Function Prototype:</b></p>
  3388. <ul><pre>
  3389. #include &lt;nuttx/nx/nxcursor.h&gt;
  3390. #ifdef CONFIG_NX_SWCURSOR
  3391. int nxcursor_setposition(NXHANDLE hnd, FAR const struct nxgl_point_s *pos);
  3392. #endif
  3393. </pre></ul>
  3394. <p>
  3395. <b>Description:</b>
  3396. Move the cursor to the specified position.
  3397. </p>
  3398. <p>
  3399. <b>Input Parameters:</b>
  3400. <ul><dl>
  3401. <dt><code>hnd</code>
  3402. <dd>The server handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
  3403. <dt><code>pos</code>
  3404. <dd>The new cursor position
  3405. </dl></ul>
  3406. </p>
  3407. <p>
  3408. <b>Returned Value:</b>
  3409. OK on success; ERROR on failure with errno set appropriately.
  3410. </p>
  3411. <h2>2.7 <a name="samplecode">Sample Code</a></h2>
  3412. <p><b><code>apps/examples/nx*</code></b>.
  3413. No sample code is provided in this document.
  3414. However, examples can be found in the NuttX source tree at the follow locations:
  3415. That example code is intended to test NX.
  3416. Since it is test code, it is designed to exercise functionality and does not necessarily represent best NX coding practices.
  3417. </p>
  3418. <ul>
  3419. <li><code>apps/examples/nx</code>.
  3420. This is a test of windows, optionally with toolbars.
  3421. Two windows are created, re-sized, moved, raise lowered.
  3422. Simulated mouse and keyboard input is provided.
  3423. </li>
  3424. <li><code>apps/examples/nxhello</code>.
  3425. This is intended to be simplest NX test:
  3426. It simply displays the words &quot;Hello, World!&quot; centered on the display.
  3427. </li>
  3428. <li><code>apps/examples/nxtext</code>.
  3429. This illustrates how fonts may be managed to provide scrolling text windows.
  3430. Pop-up windows are included to verify the clipping and re-drawing of the text display.
  3431. </li>
  3432. </ul>
  3433. <p>
  3434. In its current form, the NX graphics system provides a low level of graphics and window
  3435. support.
  3436. Most of the complexity of manage redrawing and handling mouse and keyboard events must
  3437. be implemented by the NX client code.
  3438. </p>
  3439. <p><b>Building <code>apps/examples/nx</code></b>.
  3440. Testing was performed using the Linux/Cygwin-based NuttX simulator.
  3441. Instructions are provided for building that simulation are provided in
  3442. <a href="#testcoverage">Appendix C</a> of this document.
  3443. </p>
  3444. <table width ="100%">
  3445. <tr bgcolor="#e4e4e4">
  3446. <td>
  3447. <h1>Appendix A <a name="grapicsdirs"><code>graphics/</code> Directory Structure</a></h1>
  3448. </td>
  3449. </tr>
  3450. </table>
  3451. <p>
  3452. The graphics capability consist both of components internal to the RTOS and of user-callable interfaces.
  3453. In the NuttX kernel mode build there are some components of the graphics subsystem are callable in user mode and other components that are internal to the RTOS.
  3454. The directory <code>nuttx/graphics</code> contains only those components that are internal to the RTOS.
  3455. User callable functions must be part of a library that can be linked against user applications.
  3456. This user callable interfaces are provided in sub-directories under <code>nuttx/libnx</code>.
  3457. <p>
  3458. <ul>
  3459. <dl>
  3460. <dt><code>libnx/nx</code>
  3461. <dd>Common callable interfaces that are, logically, part of both nxmu and nxsu.
  3462. <dt><code>graphics/nxglib</code> and <code>libnx/nxglib</code>
  3463. <dd>The NuttX tiny graphics library.
  3464. The directory contains generic utilities support operations on primitive graphics objects
  3465. and logic to rasterize directly into a framebuffer or through an LCD driver interface.
  3466. It has no concept of windows (other than the one, framebuffer or LCD window).
  3467. <dt><code>graphics/nxbe</code>
  3468. <dd>This is the <i>back-end</i> of a tiny windowing system.
  3469. It can be used with either of two front-ends to complete a windowing system (see
  3470. <code>nxmu</code> and <code>nxsu</code> below).
  3471. It contains most of the important window management logic: clipping, window controls,
  3472. window drawing, etc.
  3473. <dt><code>graphics/nxmu</code> and <code>libnx/nxmu</code>
  3474. <dd>This is the NX multi user <i>front end</i>.
  3475. When combined with the generic <i>back-end</i> (<code>nxbe</code>), it implements a
  3476. multi-threaded, multi-user windowing system.
  3477. The files in this directory present the window APIs described in
  3478. <code>include/nuttx/nx/nx.h</code>.
  3479. The multi-user front end includes a graphics server that executes on its own thread;
  3480. multiple graphics clients then communicate with the server via a POSIX message
  3481. queue to serialize window operations from many threads.
  3482. <dt><code>libnx/nxfonts</code>
  3483. <dd>This is where the NXFONTS implementation resides.
  3484. This is a relatively low-level set of charset set/glyph management APIs.
  3485. See <code>include/nuttx/nx/nxfonts.h</code>.
  3486. <dt><code>libnx/nxtk</code>
  3487. <dd>This is where the NXTOOLKIT implementation resides.
  3488. This toolkit is built on top of NX and works with the multi-user NX front-end.
  3489. See <code>include/nuttx/nx/nxtk.h</code>.
  3490. <dt><code>apps/graphics/NxWidgets</code>
  3491. <dd>The <a href="NxWidgets.html">NxWidgets</a> code is provided as a separate package provided in the <code>apps/</code> repository.
  3492. <dt><code>graphics/nxterm</code>
  3493. <dd>The NxTerm driver is built on top of NX and works with the multi-user NX front-end.
  3494. See <code>include/nuttx/nx/nxterm.h</code>.
  3495. </dl>
  3496. </ul>
  3497. <table width ="100%">
  3498. <tr bgcolor="#e4e4e4">
  3499. <td>
  3500. <h1>Appendix B <a name="nxconfigs">NX Configuration Options</a></h1>
  3501. </td>
  3502. </tr>
  3503. </table>
  3504. <h2>B.1 <a name="nxgenconfig">General Configuration Settings</a></h2>
  3505. <ul>
  3506. <dl>
  3507. <dt><code>CONFIG_NX</code>
  3508. <dd>Enables overall support for graphics library and NX
  3509. <dt><code>CONFIG_NX_RAMBACKED</code>
  3510. <dd>Enables RAM backed window support.
  3511. If this option is selected, then windows may be optionally created with a RAM frambuffer backing up the window content.
  3512. Rending into the window will result in rending into the backup framebuffer, then updating the physical display from the framebuffer.
  3513. <p>
  3514. The advantage of this option is that the application that manages window will no longer receive redraw() callbacks.
  3515. Those calls normally occur, for example, when a window "above" moves exposing a portion of the window below.
  3516. If this option is selected, then the system will redraw the exposed portion of the window from the backup framebuffer without intervention of the window applications.
  3517. This greatly reduces the complexity of the application and performance of the window at the expense of increased memory usage.
  3518. </p>
  3519. <p>
  3520. An exception is the case when the window is resized to a wider and/or taller size.
  3521. In that case, the redraw callback will till occur.
  3522. It is necessary in that case to provide new graphic content for the extended window area.
  3523. </p>
  3524. <p>
  3525. Redraw requests in other cases are also suppressed: Changes to window position, size, etc.
  3526. </p>
  3527. </dl>
  3528. </ul>
  3529. <h2>B.2 <a name="nxglconfig">NXGL Configuration Settings</a></h2>
  3530. <ul>
  3531. <dl>
  3532. <dt><code>CONFIG_NX_NPLANES</code>:
  3533. <dd>Some YUV color formats requires support for multiple planes,
  3534. one for each color component. Unless you have such special
  3535. hardware, this value should be undefined or set to 1.
  3536. <dt><code>CONFIG_NX_DISABLE_1BPP</code>, <code>CONFIG_NX_DISABLE_2BPP</code>,
  3537. <code>CONFIG_NX_DISABLE_4BPP</code>, <code>CONFIG_NX_DISABLE_8BPP</code>
  3538. <code>CONFIG_NX_DISABLE_16BPP</code>, <code>CONFIG_NX_DISABLE_24BPP</code>, and
  3539. <code>CONFIG_NX_DISABLE_32BPP</code>:
  3540. <dd>NX supports a variety of pixel depths. You can save some
  3541. memory by disabling support for unused color depths.
  3542. <dt><code>CONFIG_NX_PACKEDMSFIRST</code>:
  3543. <dd>If a pixel depth of less than 8-bits is used, then NX needs
  3544. to know if the pixels pack from the MS to LS or from LS to MS
  3545. <dt><code>CONFIG_NX_LCDDRIVER</code>:
  3546. <dd>By default, NX builds to use a framebuffer driver (see <code>include/nuttx/video/fb.h</code>).
  3547. If this option is defined, NX will build to use an LCD driver (see <code>include/nuttx/lcd/lcd.h</code>).
  3548. <dt><code>CONFIG_NX_ANTIALIASING</code>:
  3549. <dd>Enable support for anti-aliasing when rendering lines as various
  3550. orientations.
  3551. This option is only available for use with frame buffer drivers and
  3552. only with 16-, 24-, or 32-bit RGB color formats.
  3553. </li>
  3554. </dl>
  3555. </ul>
  3556. <h2>B.3 <a name="nxconfig">NX Configuration Settings</a></h2>
  3557. <ul>
  3558. <dl>
  3559. <dt><code>CONFIG_NX_XYINPUT</code>:
  3560. <dd>Build in support for an X/Y input such as a mouse or a touscreen.
  3561. <dt><code>CONFIG_NX_KBD</code>:
  3562. <dd>Build in support of keypad/keyboard input.
  3563. <dt><code>CONFIG_NX_WRITEONLY</code>:
  3564. <dd>Define if the underlying graphics device does not support read operations.
  3565. Automatically defined if <code>CONFIG_NX_LCDDRIVER</code> and <code>CONFIG_LCD_NOGETRUN</code>
  3566. are defined.
  3567. </dl>
  3568. </ul>
  3569. <h2>B.4 <a name="nxmuconfig">NX Server Configuration Settings</a></h2>
  3570. <ul>
  3571. <dl>
  3572. <dt><code>CONFIG_NX_BLOCKING</code>
  3573. <dd>Open the client message queues in blocking mode. In this case,
  3574. <code>nx_eventhandler()</code> will not return until a message is received and processed.
  3575. <dt><code>CONFIG_NX_MXSERVERMSGS</code> and <code>CONFIG_NX_MXCLIENTMSGS</code>
  3576. <dd>Specifies the maximum number of messages that can fit in
  3577. the message queues. No additional resources are allocated, but
  3578. this can be set to prevent flooding of the client or server with
  3579. too many messages (<code>CONFIG_PREALLOC_MQ_MSGS</code> controls how many
  3580. messages are pre-allocated).
  3581. </dl>
  3582. </ul>
  3583. <h2>B.5 <a name="nxtkconfig">NXTK Configuration Settings</a></h2>
  3584. <ul>
  3585. <dl>
  3586. <dt><code>CONFIG_NXTK_BORDERWIDTH</code>:
  3587. <dd>Specifies with with of the border (in pixels) used with
  3588. framed windows. The default is 4.
  3589. <dt><code>CONFIG_NXTK_BORDERCOLOR1</code>, <code>CONFIG_NXTK_BORDERCOLOR2</code>, and <code>CONFIG_NXTK_BORDERCOLOR3</code>:
  3590. <dd>Specify the colors of the border used with framed windows.
  3591. <dt><code>CONFIG_NXTK_BORDERCOLOR2</code>
  3592. <dd>The shadow side color and so is normally darker.
  3593. <dt><code>CONFIG_NXTK_BORDERCOLOR3</code>
  3594. <dd>The shiny side color and so is normally brighter.
  3595. The default is medium, dark, and light grey, respectively
  3596. <dt><code>CONFIG_NXTK_AUTORAISE</code>:
  3597. <dd>If set, a window will be raised to the top if the mouse position
  3598. is over a visible portion of the window. Default: A mouse
  3599. button must be clicked over a visible portion of the window.
  3600. </dl>
  3601. </ul>
  3602. <h2>B.6 <a name="nxfpmtsconfig">NXFONTS Configuration Settings</a></h2>
  3603. <ul>
  3604. <dl>
  3605. <dt><code>CONFIG_NXFONTS_CHARBITS</code>:
  3606. <dd>The number of bits in the character set. Current options are
  3607. only 7 and 8. The default is 7.
  3608. <dt><code>CONFIG_NXFONT_SANS17X22</code>:
  3609. <dd>This option enables support for a tiny, 17x22 san serif font
  3610. (font <code>ID FONTID_SANS17X22</code> == 14).
  3611. <dt><code>CONFIG_NXFONT_SANS20X26</code>:
  3612. <dd>This option enables support for a tiny, 20x26 san serif font
  3613. (font <code>ID FONTID_SANS20X26</code> == 15).
  3614. <dt><code>CONFIG_NXFONT_SANS23X27</code>:
  3615. <dd>This option enables support for a tiny, 23x27 san serif font
  3616. (font <code>ID FONTID_SANS23X27</code> == 1).
  3617. <dt><code>CONFIG_NXFONT_SANS22X29</code>:
  3618. <dd>This option enables support for a small, 22x29 san serif font
  3619. (font <code>ID FONTID_SANS22X29</code> == 2).
  3620. <dt><code>CONFIG_NXFONT_SANS28X37</code>:
  3621. <dd>This option enables support for a medium, 28x37 san serif font
  3622. (font <code>ID FONTID_SANS28X37</code> == 3).
  3623. <dt><code>CONFIG_NXFONT_SANS39X48</code>:
  3624. <dd>This option enables support for a large, 39x48 san serif font
  3625. (font <code>ID FONTID_SANS39X48</code> == 4).
  3626. <dt><code>CONFIG_NXFONT_SANS17X23B</code>:
  3627. <dd>This option enables support for a tiny, 17x23 san serif bold font
  3628. (font <code>ID FONTID_SANS17X23B</code> == 16).
  3629. <dt><code>CONFIG_NXFONT_SANS20X27B</code>:
  3630. <dd>This option enables support for a tiny, 20x27 san serif bold font
  3631. (font <code>ID FONTID_SANS20X27B</code> == 17).
  3632. <dt><code>CONFIG_NXFONT_SANS22X29B</code>:
  3633. <dd>This option enables support for a small, 22x29 san serif bold font
  3634. (font ID <code>FONTID_SANS22X29B</code> == 5).
  3635. <dt><code>CONFIG_NXFONT_SANS28X37B</code>:
  3636. <dd>This option enables support for a medium, 28x37 san serif bold font
  3637. (font ID <code>FONTID_SANS28X37B</code> == 6).
  3638. <dt><code>CONFIG_NXFONT_SANS40X49B</code>:
  3639. <dd>This option enables support for a large, 40x49 san serif bold font
  3640. (font ID <code>FONTID_SANS40X49B</code> == 7).
  3641. <dt><code>CONFIG_NXFONT_SERIF22X29</code>:
  3642. <dd>This option enables support for a small, 22x29 font (with serifs)
  3643. (font ID <code>FONTID_SERIF22X29</code> == 8).
  3644. <dt><code>CONFIG_NXFONT_SERIF29X37</code>:
  3645. <dd>This option enables support for a medium, 29x37 font (with serifs)
  3646. (font ID <code>FONTID_SERIF29X37</code> == 9).
  3647. <dt><code>CONFIG_NXFONT_SERIF38X48</code>:
  3648. <dd>This option enables support for a large, 38x48 font (with serifs)
  3649. (font ID <code>FONTID_SERIF38X48</code> == 10).
  3650. <dt><code>CONFIG_NXFONT_SERIF22X28B</code>:
  3651. <dd>This option enables support for a small, 27x38 bold font (with serifs)
  3652. (font ID <code>FONTID_SERIF22X28B</code> == 11).
  3653. <dt><code>CONFIG_NXFONT_SERIF27X38B</code>:
  3654. <dd>This option enables support for a medium, 27x38 bold font (with serifs)
  3655. (font ID <code>FONTID_SERIF27X38B</code> == 12).
  3656. <dt><code>CONFIG_NXFONT_SERIF38X49B</code>:
  3657. <dd>This option enables support for a large, 38x49 bold font (with serifs)
  3658. (font ID <code>FONTID_SERIF38X49B</code> == 13).
  3659. </dl>
  3660. </ul>
  3661. <h2>B.7 <a name="nxtermconfig">NxTerm Configuration Settings</a></h2>
  3662. <p>General NxTerm settings.</p>
  3663. <ul>
  3664. <dl>
  3665. <dt><code>CONFIG_NXTERM</code>:
  3666. <dd>Enables building of the NxTerm driver.
  3667. </dl>
  3668. </ul>
  3669. <p>NxTerm output text/graphics options:</p>
  3670. <ul>
  3671. <dl>
  3672. <dt><code>CONFIG_NXTERM_BPP</code>:
  3673. <dd>Currently, NxTerm supports only a single pixel depth.
  3674. This configuration setting must be provided to support that single pixel depth.
  3675. Default: The smallest enabled pixel depth. (see <code>CONFIG_NX_DISABLE_*BPP</code>)
  3676. <dt><code>CONFIG_NXTERM_CURSORCHAR</code>:
  3677. <dd>The bitmap code to use as the cursor. Default '_'
  3678. <dt><code>CONFIG_NXTERM_MXCHARS</code>:
  3679. <dd>NxTerm needs to remember every character written to the console so that it can redraw the window.
  3680. This setting determines the size of some internal memory allocations used to hold the character data.
  3681. Default: 128.
  3682. <dt><code>CONFIG_NXTERM_CACHESIZE</code>:
  3683. <dd>
  3684. NxTerm supports caching of rendered fonts.
  3685. This font caching is required for two reasons:
  3686. (1) First, it improves text performance, but more importantly
  3687. (2) it preserves the font memory.
  3688. Since the NX server runs on a separate server thread, it requires that the rendered font memory persist until the server has a chance to render the font.
  3689. Unfortunately, the font cache would be quite large if all fonts were saved.
  3690. The <code>CONFIG_NXTERM_CACHESIZE</code> setting will control the size of the font cache (in number of glyphs).
  3691. Only that number of the most recently used glyphs will be retained.
  3692. Default: 16.
  3693. <blockquote>
  3694. NOTE: There can still be a race condition between the NxTerm driver and the
  3695. NX task. If you every see character corruption (especially when printing
  3696. a lot of data or scrolling), then increasing the value of <code>CONFIG_NXTERM_CACHESIZE</code>
  3697. is something that you should try.
  3698. Alternatively, you can reduce the size of <code>CONFIG_MQ_MAXMSGSIZE</code> which will force NxTerm task to pace the server task.
  3699. <code>CONFIG_NXTERM_CACHESIZE</code> should be larger than <code>CONFIG_MQ_MAXMSGSIZE</code> in any event.
  3700. </blockquote>
  3701. <dt><code>CONFIG_NXTERM_LINESEPARATION</code>:
  3702. <dd>This the space (in rows) between each row of test. Default: 0
  3703. <dt><code>CONFIG_NXTERM_NOWRAP</code>:
  3704. <dd>By default, lines will wrap when the test reaches the right hand side of the window.
  3705. This setting can be defining to change this behavior so that the text is simply truncated until a new line is encountered.
  3706. </dl>
  3707. </ul>
  3708. <p>NxTerm input options:</p>
  3709. <ul>
  3710. <dl>
  3711. <dt><code>CONFIG_NXTERM_NXKBDIN</code>:
  3712. <dd>Take input from the NX keyboard input callback.
  3713. By default, keyboard input is taken from stdin (<code>/dev/console</code>).
  3714. If this option is set, then the interface<code>nxterm_kdbin()</code> is enabled.
  3715. That interface may be driven by window callback functions so that keyboard input <i>only</i> goes to the top window.
  3716. <dt><code>CONFIG_NXTERM_KBDBUFSIZE</code>:
  3717. <dd>If <code>CONFIG_NXTERM_NXKBDIN</code> is enabled, then this value may be used to
  3718. define the size of the per-window keyboard input buffer. Default: 16
  3719. <dt><code>CONFIG_NXTERM_NPOLLWAITERS</code>:
  3720. <dd>The number of threads that can be waiting for read data available.
  3721. Default: 4
  3722. </dl>
  3723. </ul>
  3724. <table width ="100%">
  3725. <tr bgcolor="#e4e4e4">
  3726. <td>
  3727. <h1>Appendix C <a name="installnewfonts">Installing New Fonts</a></h1>
  3728. </td>
  3729. </tr>
  3730. </table>
  3731. <p><b>The BDF Font Converter</b>.
  3732. There is a tool called <i>bdf-converter</i> in the directory <code>tools/.</code>.
  3733. The <i>bdf-converter</i> program be used to convert fonts in Bitmap Distribution Format (BDF) into fonts that can be used in the NX graphics system.
  3734. The BDF format most well known as a font format traditionally used for X-11 bitmap fonts.
  3735. </p>
  3736. <blockquote><small>
  3737. A Note about Font Copyrights:
  3738. My understanding is that the underlying bitmap font data for traditional fonts cannot be copyrighted (the same is not true for scalable fonts).
  3739. This is because a copyright covers only the form of delivery of the font and not the underlying font content and, at least for the traditional typefaces, the underlying font designs are ancient.
  3740. There could be issues, however, if you convert from modern, trademarked images.
  3741. However, remember that I am a programmer not an attorney and that my knowledge of font copyright issues is limited to what I glean by Googling.
  3742. </small></blockquote>
  3743. <p>
  3744. <b>Font Installation Steps</b>,
  3745. Below are general instructions for creating and installing a new font in the NX graphic system.
  3746. The first two steps only appy if you are using the BDF font converter program.
  3747. </p>
  3748. <ol start="1">
  3749. <li>
  3750. <p>
  3751. Locate a font in BDF format.
  3752. There are many good BDF bitmap fonts bundled with X-11.
  3753. See <a href="http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html">this link</a>, as an example,
  3754. </p>
  3755. </li>
  3756. <li>
  3757. <p>
  3758. Use the <i>bdf-converter</i> program to convert the BDF font to the NuttX font format.
  3759. This will result in a C header file containing definitions.
  3760. That header file should be installed at, for example, <code>graphics/nxfonts/nxfonts_myfont.h</code>.
  3761. </p>
  3762. </li>
  3763. </ol>
  3764. <p>
  3765. The remaining steps apply however you managed to create the NuttX C font header file.
  3766. After you have your C font header file, the next thing to do is to create a new NuttX configuration variable to select the font.
  3767. For example, suppose you define the following variable: <code>CONFIG_NXFONT_MYFONT</code>.
  3768. Then you would need to:
  3769. </p>
  3770. <ol start="3">
  3771. <li>
  3772. <p>
  3773. Define <code>CONFIG_NXFONT_MYFONT=y</code> in your NuttX configuration file.
  3774. </p>
  3775. </li>
  3776. </ol>
  3777. <p>
  3778. A font ID number has to be assigned for each new font.
  3779. The font IDs are defined in the file <code>include/nuttx/nx/nxfonts.h</code>.
  3780. Those definitions have to be extended to support your new font.
  3781. Look at how the font ID enabled by <code>CONFIG_NXFONT_SANS23X27</code> is defined and add an ID for yournew font in a similar fashion:
  3782. </p>
  3783. <ol start="4">
  3784. <li>
  3785. <p>
  3786. <b><code>include/nuttx/nx/nxfonts.h</code></b>. Add you new font as a possible system default font:
  3787. </p>
  3788. <ul><pre>
  3789. #if defined(CONFIG_NXFONT_SANS23X27)
  3790. # define NXFONT_DEFAULT FONTID_SANS23X27
  3791. #elif defined(CONFIG_NXFONT_MYFONT)
  3792. # define NXFONT_DEFAULT FONTID_MYFONT
  3793. #endif
  3794. </pre></ul>
  3795. <p>
  3796. Then define the actual font ID.
  3797. Make sure that the font ID value is unique:
  3798. </p>
  3799. <ul><pre>
  3800. enum nx_fontid_e
  3801. {
  3802. FONTID_DEFAULT = 0 /* The default font */
  3803. #ifdef CONFIG_NXFONT_SANS23X27
  3804. , FONTID_SANS23X27 = 1 /* The 23x27 sans serif font */
  3805. #endif
  3806. #ifdef CONFIG_NXFONT_MYFONT
  3807. , FONTID_MYFONT = 2 /* My shiny, new font */
  3808. #endif
  3809. ...
  3810. </pre></ul>
  3811. </li>
  3812. </ol>
  3813. <p>
  3814. New Add the font to the NX build system.
  3815. There are several files that you have to modify to to this.
  3816. Look how the build system uses the font CONFIG_NXFONT_SANS23X27 for examaples:
  3817. </p>
  3818. <ol start="5">
  3819. <li>
  3820. <p>
  3821. <b><code>nuttx/graphics/Makefile</code></b>.
  3822. This file needs logic to auto-generate a C source file from the header file that you generated with the <i>bdf-converter</i> program.
  3823. Notice <code>NXFONTS_FONTID=2</code>; this must be set to the same font ID value that you defined in the <code>include/nuttx/nx/nxfonts.h</code> file.
  3824. </p>
  3825. <ul><pre>
  3826. genfontsources:
  3827. ifeq ($(CONFIG_NXFONT_SANS23X27),y)
  3828. @$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=1 EXTRADEFINES=$(EXTRADEFINES)
  3829. endif
  3830. ifeq ($(CONFIG_NXFONT_MYFONT),y)
  3831. @$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=2 EXTRADEFINES=$(EXTRADEFINES)
  3832. endif
  3833. </pre></ul>
  3834. </li>
  3835. <li>
  3836. <p>
  3837. <b><code>nuttx/graphics/nxfonts/Make.defs</code></b>.
  3838. Set the make variable <code>NXFSET_CSRCS</code>.
  3839. <code>NXFSET_CSRCS</code> determines the name of the font C file to build when <code>NXFONTS_FONTID=2</code>:
  3840. </p>
  3841. <ul><pre>
  3842. ifeq ($(CONFIG_NXFONT_SANS23X27),y)
  3843. NXFSET_CSRCS += nxfonts_bitmaps_sans23x27.c
  3844. endif
  3845. ifeq ($(CONFIG_NXFONT_MYFONT),y)
  3846. NXFSET_CSRCS += nxfonts_bitmaps_myfont.c
  3847. endif
  3848. </pre></ul>
  3849. </li>
  3850. <li>
  3851. <p>
  3852. <b><code>nuttx/graphics/nxfonts/Makefile.sources</code></b>.
  3853. This is the Makefile used in step 5 that will actually generate the font C file.
  3854. So, given your </code>NXFONTS_FONTID=2</code>, it needs to determine a prefix to use for auto-generated variable and function names and (again) the name of the autogenerated file to create (this must be the same name that was used in <code>nuttx/graphics/nxfonts/Make.defs</code>):
  3855. </p>
  3856. <ul><pre>
  3857. ifeq ($(NXFONTS_FONTID),1)
  3858. NXFONTS_PREFIX := g_sans23x27_
  3859. GEN_CSRC = nxfonts_bitmaps_sans23x27.c
  3860. endif
  3861. ifeq ($(NXFONTS_FONTID),2)
  3862. NXFONTS_PREFIX := g_myfont_
  3863. GEN_CSRC = nxfonts_bitmaps_myfont.c
  3864. endif
  3865. </pre></ul>
  3866. </li>
  3867. <li>
  3868. <p>
  3869. <b><code>graphics/nxfonts/nxfonts_bitmaps.c</code></b>.
  3870. This is the file that contains the generic font structures.
  3871. It is used as a &quot;template&qout; file by <code>nuttx/graphics/nxfonts/Makefile.sources </code>to create your customized font data set at build time.
  3872. </p>
  3873. <ul><pre>
  3874. #if NXFONTS_FONTID == 1
  3875. # include "nxfonts_sans23x27.h"
  3876. #elif NXFONTS_FONTID == 2
  3877. # include "nxfonts_myfont.h"
  3878. #else
  3879. # error "No font ID specified"
  3880. #endif
  3881. </pre></ul>
  3882. <p>
  3883. Where <code>nxfonts_myfont.h</code> is the NuttX font file that we generated in
  3884. step 2 using the <i>bdf-converter</i> tool.
  3885. </p>
  3886. <li>
  3887. <p>
  3888. <b><code>graphics/nxfonts/nxfonts_getfont.c</code></b>.
  3889. Finally, we need to extend the logic that does the run-time font lookups so that can find our new font.
  3890. The lookup function is <a href="#nxfgetfonthandle"><code>NXHANDLE nxf_getfonthandle(enum nx_fontid_e fontid)</code></a>.
  3891. Note that the lookup is based on the font ID that was defined in step 4.
  3892. The new font information needs to be added to data structures used by that function:
  3893. </p>
  3894. <ul><pre>
  3895. #ifdef CONFIG_NXFONT_SANS23X27
  3896. extern const struct nx_fontpackage_s g_sans23x27_package;
  3897. #endif
  3898. #ifdef CONFIG_NXFONT_MYFONT
  3899. extern const struct nx_fontpackage_s g_myfont_package;
  3900. #endif
  3901. static FAR const struct nx_fontpackage_s *g_fontpackages[] =
  3902. {
  3903. #ifdef CONFIG_NXFONT_SANS23X27
  3904. &g_sans23x27_package,
  3905. #endif
  3906. #ifdef CONFIG_NXFONT_MYFONT
  3907. &g_myfont_package,
  3908. #endif
  3909. NULL
  3910. };
  3911. </pre></ul>
  3912. </li>
  3913. </ol>
  3914. <table width ="100%">
  3915. <tr bgcolor="#e4e4e4">
  3916. <td>
  3917. <h1>Appendix D <a name="testcoverage">NX Test Coverage</a></h1>
  3918. </td>
  3919. </tr>
  3920. </table>
  3921. <p><b><code>apps/examples/nx</code></b>.
  3922. The primary test tool for debugging NX resides at <code>apps/examples/nx</code>.
  3923. </p>
  3924. <p><b>Building <code>apps/examples/nx</code></b>.
  3925. NX testing was performed using <code>apps/examples/nx</code> with the
  3926. Linux/Cygwin-based NuttX simulator.
  3927. Configuration files for building this test can be found in <code>configs/sim/nx</code>
  3928. and <code>configs/sim/nx11</code>.
  3929. There are two alternative configurations for building the simulation:
  3930. </p>
  3931. <ol>
  3932. <li>
  3933. The configuration using the configuration file at <code>configs/sim/nx/defconfig</code>.
  3934. This default configuration exercises the NX logic a 8 BPP but provides no visual feedback.
  3935. In this configuration, a very simple, simulated framebuffer driver is used that is
  3936. based upon a simple region of memory posing as video memory.
  3937. That default configuration can be built as follows:
  3938. <ul><pre>
  3939. cd &lt;NuttX-Directory&gt;/tools
  3940. ./configure sim/nx
  3941. cd &lt;NuttX-Directory&gt;
  3942. make
  3943. ./nuttx
  3944. </pre></ul>
  3945. </li>
  3946. <li>
  3947. <p>
  3948. The preferred configuration is at <code>configs/sim/nx11/defconfig</code>.
  3949. This configuration extends the test with a simulated framebuffer driver
  3950. that uses an X window as a framebuffer.
  3951. This is a superior test configuration because the X window appears at your desktop
  3952. and you can see the NX output.
  3953. This preferred configuration can be built as follows:
  3954. </p>
  3955. <ul><pre>
  3956. cd &lt;NuttX-Directory&gt;/tools
  3957. ./configure sim/nx11
  3958. cd &lt;NuttX-Directory&gt;
  3959. make
  3960. ./nuttx
  3961. </pre></ul>
  3962. <p>
  3963. <i>Update:</i>
  3964. The sim target has suffered some bit-rot over the years and so the following caveats need to be added:
  3965. <ul>
  3966. <li><p>
  3967. The X target builds under recent Cygwin configurations, but does not execute.
  3968. (It fails inside of <code>XOpenDisplay()</code>.
  3969. </p></li>
  3970. <li><p>
  3971. The X target does not build under current (9.09) Ubuntu distributions.
  3972. I needed to make the following changes:
  3973. </p>
  3974. <ul></pre>
  3975. cd /usr/lib/
  3976. sudo ln -s libXext.so.6.4.0 libXext.so
  3977. </pre></ul>
  3978. <p>
  3979. The build will also fail to locate the X header files unless you install an X11 development package.
  3980. </p></li>
  3981. <li><p>
  3982. The sim target itself is broken under 64-bit Linux.
  3983. This is because the sim target is based upon some assembly language setjmp/longjmp logic that only works on 32-bit systems.
  3984. </p>
  3985. <p><small>
  3986. <b>NOTE</b>: There is a workaround in this case:
  3987. You can build for 32-bit execution on a 64-bit machine by adding <code>-m3</code> to the <code>CFLAGS</code> and <code>-m32 -m elf_i386</code> to the <code>LDFLAGS</code>.
  3988. The configuration/build system will do this for you;
  3989. you simply need to select <code>CONFIG_SIM_M32=y</code> in your configuration file.
  3990. </small></p>
  3991. </li>
  3992. <li><p>
  3993. Refer to the readme file in sim configuration
  3994. <a href="https://bitbucket.org/nuttx/nuttx/configs/src/master/sim/README.txt" target="_blank">README.txt</a> file for additional information.
  3995. </p></li>
  3996. </ul>
  3997. </p>
  3998. </li>
  3999. </ol>
  4000. <p><b>Test Coverage</b>.
  4001. At present, <code>apps/examples/nx</code>t only exercises a subset of NX;
  4002. the remainder is essentially untested.
  4003. The following table describes the testing performed on each NX API:
  4004. </p>
  4005. <center><h2>Table D.1: <a name="nxglibcoverage">NXGLIB API Test Coverage</a></h2></center>
  4006. <center><table border="1" width="80%">
  4007. <tr>
  4008. <th width="40%">Function</th>
  4009. <th width="60%">Special Setup/Notes</th>
  4010. <th width="5%">Verified</th></tr>
  4011. </tr>
  4012. <tr>
  4013. <td align="left" valign="top"><a href="#nxglrgb2yuv"><code>nxgl_rgb2yuv()</code></a></td>
  4014. <td><br></td>
  4015. <td align="center" bgcolor="lightgrey">NO</td>
  4016. </tr>
  4017. <tr>
  4018. <td align="left" valign="top"><a href="#nxglyuv2rgb"><code>nxgl_yuv2rgb()</code></a></td>
  4019. <td><br></td>
  4020. <td align="center" bgcolor="lightgrey">NO</td>
  4021. </tr>
  4022. <tr>
  4023. <td align="left" valign="top"><a href="#nxglrectcopy"><code>nxgl_rectcopy()</code></a></td>
  4024. <td><br></td>
  4025. <td align="center" bgcolor="skyblue">YES</td>
  4026. </tr>
  4027. <tr>
  4028. <td align="left" valign="top"><a href="#nxglrectoffset"><code>nxgl_rectoffset()</code></a></td>
  4029. <td><br></td>
  4030. <td align="center" bgcolor="skyblue">YES</td>
  4031. </tr>
  4032. <tr>
  4033. <td align="left" valign="top"><a href="#nxglvectoradd"><code>nxgl_vectoradd()</code></a></td>
  4034. <td><br></td>
  4035. <td align="center" bgcolor="skyblue">YES</td>
  4036. </tr>
  4037. <tr>
  4038. <td align="left" valign="top"><a href="#nxglvectorsubtract"><code>nxgl_vectorsubtract()</code></a></td>
  4039. <td><br></td>
  4040. <td align="center" bgcolor="skyblue">YES</td>
  4041. </tr>
  4042. <tr>
  4043. <td align="left" valign="top"><a href="#nxglrectintersect"><code>nxgl_rectintersect()</code></a></td>
  4044. <td><br></td>
  4045. <td align="center" bgcolor="skyblue">YES</td>
  4046. </tr>
  4047. <tr>
  4048. <td align="left" valign="top"><a href="#nxglrectunion"><code>nxgl_rectunion()</code></a></td>
  4049. <td><br></td>
  4050. <td align="center" bgcolor="skyblue">YES</td>
  4051. </tr>
  4052. <tr>
  4053. <td align="left" valign="top"><a href="#nxglnonintersecting"><code>nxgl_nonintersecting()</code></a></td>
  4054. <td><br></td>
  4055. <td align="center" bgcolor="skyblue">YES</td>
  4056. </tr>
  4057. <tr>
  4058. <td align="left" valign="top"><a href="#nxglrectoverlap"><code>nxgl_rectoverlap()</code></a></td>
  4059. <td><br></td>
  4060. <td align="center" bgcolor="skyblue">YES</td>
  4061. </tr>
  4062. <tr>
  4063. <td align="left" valign="top"><a href="#nxglrectinside"><code>nxgl_rectinside()</code></a></td>
  4064. <td><br></td>
  4065. <td align="center" bgcolor="skyblue">YES</td>
  4066. </tr>
  4067. <tr>
  4068. <td align="left" valign="top"><a href="#nxglrectsize"><code>nxgl_rectsize()</code></a></td>
  4069. <td><br></td>
  4070. <td align="center" bgcolor="skyblue">YES</td>
  4071. </tr>
  4072. <tr>
  4073. <td align="left" valign="top"><a href="#nxglnullrect"><code>nxgl_nullrect()</code></a></td>
  4074. <td><br></td>
  4075. <td align="center" bgcolor="skyblue">YES</td>
  4076. </tr>
  4077. <tr>
  4078. <td align="left" valign="top"><a href="#nxglrunoffset"><code>nxgl_runoffset()</code></a></td>
  4079. <td>
  4080. Verified by <code>apps/examples/nxlines</code>.
  4081. </td>
  4082. <td align="center" bgcolor="skyblue">YES</td>
  4083. </tr>
  4084. <tr>
  4085. <td align="left" valign="top"><a href="#nxglruncopy"><code>nxgl_runcopy()</code></a></td>
  4086. <td><br></td>
  4087. <td align="center" bgcolor="lightgrey">NO</td>
  4088. </tr>
  4089. <tr>
  4090. <td align="left" valign="top"><a href="#nxgltrapoffset"><code>nxgl_trapoffset()</code></a></td>
  4091. <td>
  4092. Verified by <code>apps/examples/nxlines</code>.
  4093. </td>
  4094. <td align="center" bgcolor="skyblue">YES</td>
  4095. </tr>
  4096. <tr>
  4097. <td align="left" valign="top"><a href="#nxgltrapcopy"><code>nxgl_trapcopy()</code></a></td>
  4098. <td>
  4099. Verified by <code>apps/examples/nxlines</code>.
  4100. </td>
  4101. <td align="center" bgcolor="skyblue">YES</td>
  4102. </tr>
  4103. <tr>
  4104. <td align="left" valign="top"><a href="#nxglcolorcopy"><code>nxgl_colorcopy</code></a></td>
  4105. <td><br></td>
  4106. <td align="center" bgcolor="skyblue">YES</td>
  4107. </tr>
  4108. <tr>
  4109. <td align="left" valign="top"><a href="#nxglsplitline"><code>nxgl_splitline</code></a></td>
  4110. <td bgcolor="lightgreen">
  4111. Verified using <code>apps/examples/nxlines</code>.
  4112. Generally works well, but has some accuracy/overflow problems wide lines
  4113. that are nearly horizontal.
  4114. There is a &quot;fudge factor&quot; that seems to eliminate the problem,
  4115. but there could still be issues in some configurations.
  4116. </td>
  4117. <td align="center" bgcolor="lightgreen">YES</td>
  4118. </tr>
  4119. <tr>
  4120. <td align="left" valign="top"><a href="#nxglcirclepts"><code>nxgl_circlepts</code></a></td>
  4121. <td>
  4122. Verified by <code>apps/examples/nxlines</code>.
  4123. </td>
  4124. <td align="center" bgcolor="skyblue">YES</td>
  4125. </tr>
  4126. <tr>
  4127. <td align="left" valign="top"><a href="#nxglcircletraps"><code>nxgl_circletraps</code></a></td>
  4128. <td>
  4129. Verified by <code>apps/examples/nxlines</code>.
  4130. </td>
  4131. <td align="center" bgcolor="skyblue">YES</td>
  4132. </tr>
  4133. </table></center>
  4134. <center><h2>Table D.2: <a name="nxcbcoverage">NX Server Callbacks Test Coverage</a></h2></center>
  4135. <center><table border="1" width="80%">
  4136. <tr>
  4137. <th width="40%">Function</th>
  4138. <th width="60%">Special Setup/Notes</th>
  4139. <th width="5%">Verified</th></tr>
  4140. </tr>
  4141. <tr>
  4142. <td align="left" valign="top"><a href="#nxcbredraw"><code>redraw()</code></a></td>
  4143. <td><br></td>
  4144. <td align="center" bgcolor="skyblue">YES</td>
  4145. </tr>
  4146. <tr>
  4147. <td align="left" valign="top"><a href="#nxcbposition"><code>position()</code></a></td>
  4148. <td><br></td>
  4149. <td align="center" bgcolor="skyblue">YES</td>
  4150. </tr>
  4151. <tr>
  4152. <td align="left" valign="top"><a href="#nxcbmousein"><code>mousein()</code></a></td>
  4153. <td><br></td>
  4154. <td align="center" bgcolor="skyblue">YES</td>
  4155. </tr>
  4156. <tr>
  4157. <td align="left" valign="top"><a href="#nxcbkbdin"><code>kbdin()</code></a></td>
  4158. <td><br></td>
  4159. <td align="center" bgcolor="skyblue">YES</td>
  4160. </tr>
  4161. </table></center>
  4162. <center><h2>Table D.3: <a name="nxcoverage">NX API Test Coverage</a></h2></center>
  4163. <center><table border="1" width="80%">
  4164. <tr>
  4165. <th width="40%">Function</th>
  4166. <th width="60%">Special Setup/Notes</th>
  4167. <th width="5%">Verified</th></tr>
  4168. </tr>
  4169. <tr>
  4170. <td align="left" valign="top"><a href="#nxruninstance"><code>nx_runinstance()</code></a></td>
  4171. <td><br></td>
  4172. <td align="center" bgcolor="skyblue">YES</td>
  4173. </tr>
  4174. <tr>
  4175. <td align="left" valign="top"><a href="#nxconnectinstance"><code>nx_connectinstance()</code></a></td>
  4176. <td><br></td>
  4177. <td align="center" bgcolor="skyblue">YES</td>
  4178. </tr>
  4179. <tr>
  4180. <td align="left" valign="top"><a href="#nxdisconnect"><code>nx_disconnect()</code></a></td>
  4181. <td><br></td>
  4182. <td align="center" bgcolor="skyblue">YES</td>
  4183. </tr>
  4184. <tr>
  4185. <td align="left" valign="top"><a href="#nxeventhandler"><code>nx_eventhandler()</code></a></td>
  4186. <td><br></td>
  4187. <td align="center" bgcolor="skyblue">YES</td>
  4188. </tr>
  4189. <tr>
  4190. <td align="left" valign="top"><a href="#nxeventnotify"><code>nx_eventnotify()</code></a></td>
  4191. <td>This is not used in the current version of <code>apps/examples/nx</code>,
  4192. was tested in a previous version)</td>
  4193. <td align="center" bgcolor="lightgrey">NO</td>
  4194. </tr>
  4195. <tr>
  4196. <td align="left" valign="top"><a href="#nxopenwindow"><code>nx_openwindow()</code></a></td>
  4197. <td>Change to <code>CONFIG_EXAMPLES_NX_RAWWINDOWS=y</code> in the
  4198. <code>&lt;NuttX-Directory&gt;/.config</code> file</td>
  4199. </td>
  4200. <td align="center" bgcolor="skyblue">YES</td>
  4201. </tr>
  4202. <tr>
  4203. <td align="left" valign="top"><a href="#nxclosewindow"><code>nx_closewindow()</code></a></td>
  4204. <td>Change to <code>CONFIG_EXAMPLES_NX_RAWWINDOWS=y</code> in the
  4205. <code>&lt;NuttX-Directory&gt;/.config</code> file</td>
  4206. <td align="center" bgcolor="skyblue">YES</td>
  4207. </tr>
  4208. <tr>
  4209. <td align="left" valign="top"><a href="#nxrequestbkgd"><code>nx_requestbkgd()</code></a></td>
  4210. <td>
  4211. Verified by <code>apps/examples/nxtext</code> and <code>apps/examples/nxhello</code>.
  4212. </td>
  4213. <td align="center" bgcolor="skyblue">YES</td>
  4214. </tr>
  4215. <tr>
  4216. <td align="left" valign="top"><a href="#nxreleasebkgd"><code>nx_releasebkgd()</code></a></td>
  4217. <td>
  4218. Verified by <code>apps/examples/nxtext</code> and <code>apps/examples/nxhello</code>.
  4219. </td>
  4220. <td align="center" bgcolor="skyblue">YES</td>
  4221. </tr>
  4222. <tr>
  4223. <td align="left" valign="top"><a href="#nxgetposition"><code>nx_getposition()</code></a></td>
  4224. <td><br></td>
  4225. <td align="center" bgcolor="lightgrey">NO</td>
  4226. </tr>
  4227. <tr>
  4228. <td align="left" valign="top"><a href="#nxsetposition"><code>nx_setposition()</code></a></td>
  4229. <td>Change to <code>CONFIG_EXAMPLES_NX_RAWWINDOWS=y</code> in the
  4230. <code>&lt;NuttX-Directory&gt;/.config</code> file</td>
  4231. <td align="center" bgcolor="skyblue">YES</td>
  4232. </tr>
  4233. <tr>
  4234. <td align="left" valign="top"><a href="#nxsetsize"><code>nx_setsize()</code></a></td>
  4235. <td>Change to <code>CONFIG_EXAMPLES_NX_RAWWINDOWS=y</code> in the
  4236. <code>&lt;NuttX-Directory&gt;/.config</code> file</td>
  4237. <td align="center" bgcolor="skyblue">YES</td>
  4238. </tr>
  4239. <tr>
  4240. <td align="left" valign="top"><a href="#nxraise"><code>nx_raise()</code></a></td>
  4241. <td>Change to <code>CONFIG_EXAMPLES_NX_RAWWINDOWS=y</code> in the
  4242. <code>&lt;NuttX-Directory&gt;/.config</code> file</td>
  4243. <td align="center" bgcolor="skyblue">YES</td>
  4244. </tr>
  4245. <tr>
  4246. <td align="left" valign="top"><a href="#nxlower"><code>nx_lower()</code></a></td>
  4247. <td>Change to <code>CONFIG_EXAMPLES_NX_RAWWINDOWS=y</code> in the
  4248. <code>&lt;NuttX-Directory&gt;/.config</code> file</td>
  4249. <td align="center" bgcolor="skyblue">YES</td>
  4250. </tr>
  4251. <tr>
  4252. <td align="left" valign="top"><a href="#nxmodal"><code>nx_modal()</code></a></td>
  4253. <td>&nbsp;</td>
  4254. <td align="center" bgcolor="lightgrey">NO</td>
  4255. </tr>
  4256. <tr>
  4257. <td align="left" valign="top"><a href="#nxsetvisibility"><code>nx_setvisibility()</code></a></td>
  4258. <td>Exercized using Twm4Nx</td>
  4259. <td align="center" bgcolor="skyblue">YES, Informally</td>
  4260. </tr>
  4261. <tr>
  4262. <td align="left" valign="top"><a href="#nxishidden"><code>nx_ishidden()</code></a></td>
  4263. <td>Exercized using Twm4Nx</td>
  4264. <td align="center" bgcolor="skyblue">YES, Informally</td>
  4265. </tr>
  4266. <tr>
  4267. <td align="left" valign="top"><a href="#nxfill"><code>nx_fill()</code></a></td>
  4268. <td>Change to <code>CONFIG_EXAMPLES_NX_RAWWINDOWS=y</code> in the
  4269. <code>&lt;NuttX-Directory&gt;/.config</code> file</td>
  4270. <td align="center" bgcolor="skyblue">YES</td>
  4271. </tr>
  4272. <tr>
  4273. <td align="left" valign="top"><a href="#nxgetrectangle"><code>nx_getrectangle()</code></a></td>
  4274. <td><br></td>
  4275. <td align="center" bgcolor="skyblue">YES</td>
  4276. </tr>
  4277. <tr>
  4278. <td align="left" valign="top"><a href="#nxfilltrapezoid"><code>nx_filltrapezoid()</code></a></td>
  4279. <td>
  4280. Verified by <code>apps/examples/nxlines</code>.
  4281. </td>
  4282. <td align="center" bgcolor="skyblue">YES</td>
  4283. </tr>
  4284. <tr>
  4285. <td align="left" valign="top"><a href="#nxdrawline"><code>nx_drawline()</code></a></td>
  4286. <td>
  4287. Verified by <code>apps/examples/nxlines</code>.
  4288. </td>
  4289. <td align="center" bgcolor="skyblue">YES</td>
  4290. </tr>
  4291. <tr>
  4292. <td align="left" valign="top"><a href="#nxdrawcircle"><code>nx_drawcircle()</code></a></td>
  4293. <td>
  4294. Verified by <code>apps/examples/nxlines</code>.
  4295. </td>
  4296. <td align="center" bgcolor="skyblue">YES</td>
  4297. </tr>
  4298. <tr>
  4299. <td align="left" valign="top"><a href="#nxfillcircle"><code>nx_fillcircle()</code></a></td>
  4300. <td>
  4301. Verified by <code>apps/examples/nxlines</code>.
  4302. </td>
  4303. <td align="center" bgcolor="skyblue">YES</td>
  4304. </tr>
  4305. <tr>
  4306. <td align="left" valign="top"><a href="#nxglrgb2yuv"><code>nx_setbgcolor()</code></a></td>
  4307. <td><br></td>
  4308. <td align="center" bgcolor="skyblue">YES</td>
  4309. </tr>
  4310. <tr>
  4311. <td align="left" valign="top"><a href="#nxmove"><code>nx_move()</code></a></td>
  4312. <td>Change to <code>CONFIG_EXAMPLES_NX_RAWWINDOWS=y</code> in the
  4313. <code>&lt;NuttX-Directory&gt;/.config</code> file</td>
  4314. <td align="center" bgcolor="skyblue">YES</td>
  4315. </tr>
  4316. <tr>
  4317. <td align="left" valign="top"><a href="#nxbitmap"><code>nx_bitmap()</code></a></td>
  4318. <td>Change to <code>CONFIG_EXAMPLES_NX_RAWWINDOWS=y</code> in the
  4319. <code>&lt;NuttX-Directory&gt;/.config</code> file.</td>
  4320. <td align="center" bgcolor="skyblue">YES</td>
  4321. </tr>
  4322. <tr>
  4323. <td align="left" valign="top"><a href="#nxkbdin"><code>nx_kbdin()</code></a></td>
  4324. <td><br></td>
  4325. <td align="center" bgcolor="skyblue">YES</td>
  4326. </tr>
  4327. <tr>
  4328. <td align="left" valign="top"><a href="#nxmousein"><code>nx_mousein()</code></a></td>
  4329. <td><br></td>
  4330. <td align="center" bgcolor="skyblue">YES</td>
  4331. </tr>
  4332. </table></center>
  4333. <center><h2>Table D.4: <a name="nxtkcoverage">NXTK API Test Coverage</a></h2></center>
  4334. <center><table border="1" width="80%">
  4335. <tr>
  4336. <th width="40%">Function</th>
  4337. <th width="60%">Special Setup/Notes</th>
  4338. <th width="5%">Verified</th></tr>
  4339. </tr>
  4340. <tr>
  4341. <td align="left" valign="top"><a href="#nxtkopenwindow"><code>nxtk_openwindow()</code></a></td>
  4342. <td><br></td>
  4343. <td align="center" bgcolor="skyblue">YES</td>
  4344. </tr>
  4345. <tr>
  4346. <td align="left" valign="top"><a href="#nxtkclosewindow"><code>nxtk_closewindow()</code></a></td>
  4347. <td><br></td>
  4348. <td align="center" bgcolor="skyblue">YES</td>
  4349. </tr>
  4350. <tr>
  4351. <td align="left" valign="top"><a href="#nxtkgetposition"><code>nxtk_getposition()</code></a></td>
  4352. <td><br></td>
  4353. <td align="center" bgcolor="lightgrey">NO</td>
  4354. </tr>
  4355. <tr>
  4356. <td align="left" valign="top"><a href="#nxtksetposition"><code>nxtk_setposition()</code></a></td>
  4357. <td><br></td>
  4358. <td align="center" bgcolor="skyblue">YES</td>
  4359. </tr>
  4360. <tr>
  4361. <td align="left" valign="top"><a href="#nxtksetsize"><code>nxtk_setsize()</code></a></td>
  4362. <td><br></td>
  4363. <td align="center" bgcolor="skyblue">YES</td>
  4364. </tr>
  4365. <tr>
  4366. <td align="left" valign="top"><a href="#nxtkraise"><code>nxtk_raise()</code></a></td>
  4367. <td><br></td>
  4368. <td align="center" bgcolor="skyblue">YES</td>
  4369. </tr>
  4370. <tr>
  4371. <td align="left" valign="top"><a href="#nxtklower"><code>nxtk_lower()</code></a></td>
  4372. <td><br></td>
  4373. <td align="center" bgcolor="skyblue">YES</td>
  4374. </tr>
  4375. <tr>
  4376. <td align="left" valign="top"><a href="#nxtkmodal"><code>nxtk_modal()</code></a></td>
  4377. <td><br></td>
  4378. <td align="center" bgcolor="lightgrey">NO</td>
  4379. </tr>
  4380. <tr>
  4381. <td align="left" valign="top"><a href="#nxtksetvisibility"><code>nxtk_setvisibility()</code></a></td>
  4382. <td>Exercized using Twm4Nx</td>
  4383. <td align="center" bgcolor="skyblue">YES, informally</td>
  4384. </tr>
  4385. <tr>
  4386. <td align="left" valign="top"><a href="#nxtkishidden"><code>nxtk_ishidden()</code></a></td>
  4387. <td>Exercized using Twm4Nx</td>
  4388. <td align="center" bgcolor="skyblue">YES, informally</td>
  4389. </tr>
  4390. <tr>
  4391. <td align="left" valign="top"><a href="#nxtkfillwindow"><code>nxtk_fillwindow()</code></a></td>
  4392. <td><br></td>
  4393. <td align="center" bgcolor="skyblue">YES</td>
  4394. </tr>
  4395. <tr>
  4396. <td align="left" valign="top"><a href="#nxtkgetwindow"><code>nxtk_getwindow()</code></a></td>
  4397. <td><br></td>
  4398. <td align="center" bgcolor="lightgrey">NO</td>
  4399. </tr>
  4400. <tr>
  4401. <td align="left" valign="top"><a href="#nxtkfilltrapwindow"><code>nxtk_filltrapwindow()</code></a></td>
  4402. <td><br></td>
  4403. <td align="center" bgcolor="lightgrey">NO</td>
  4404. </tr>
  4405. <tr>
  4406. <td align="left" valign="top"><a href="#nxtkdrawlinewindow"><code>nxtk_drawlinewindow()</code></a></td>
  4407. <td><br></td>
  4408. <td align="center" bgcolor="skyblue">YES</td>
  4409. </tr>
  4410. <tr>
  4411. <td align="left" valign="top"><a href="#nxtkdrawcirclewindow"><code>nxtk_drawcirclewindow()</code></a></td>
  4412. <td><br></td>
  4413. <td align="center" bgcolor="skyblue">YES</td>
  4414. </tr>
  4415. <tr>
  4416. <td align="left" valign="top"><a href="#nxtkfillcirclewindow"><code>nxtk_fillcirclewindow()</code></a></td>
  4417. <td><br></td>
  4418. <td align="center" bgcolor="skyblue">YES</td>
  4419. </tr>
  4420. <tr>
  4421. <td align="left" valign="top"><a href="#nxtkmovewindow"><code>nxtk_movewindow()</code></a></td>
  4422. <td><br></td>
  4423. <td align="center" bgcolor="lightgrey">NO</td>
  4424. </tr>
  4425. <tr>
  4426. <td align="left" valign="top"><a href="#nxtkbitmapwindow"><code>nxtk_bitmapwindow()</code></a></td>
  4427. <td><br></td>
  4428. <td align="center" bgcolor="skyblue">YES</td>
  4429. </tr>
  4430. <tr>
  4431. <td align="left" valign="top"><a href="#nxtkopentoolbar"><code>nxtk_opentoolbar()</code></a></td>
  4432. <td><br></td>
  4433. <td align="center" bgcolor="skyblue">YES</td>
  4434. </tr>
  4435. <tr>
  4436. <td align="left" valign="top"><a href="#nxtkclosetoolbar"><code>nxtk_closetoolbar()</code></a></td>
  4437. <td><br></td>
  4438. <td align="center" bgcolor="skyblue">YES</td>
  4439. </tr>
  4440. <tr>
  4441. <td align="left" valign="top"><a href="#nxtkfilltoolbar"><code>nxtk_filltoolbar()</code></a></td>
  4442. <td><br></td>
  4443. <td align="center" bgcolor="skyblue">YES</td>
  4444. </tr>
  4445. <tr>
  4446. <td align="left" valign="top"><a href="#nxtkgettoolbar"><code>nxtk_gettoolbar()</code></a></td>
  4447. <td><br></td>
  4448. <td align="center" bgcolor="lightgrey">NO</td>
  4449. </tr>
  4450. <tr>
  4451. <td align="left" valign="top"><a href="#nxtkfilltraptoolbar"><code>nxtk_filltraptoolbar()</code></a></td>
  4452. <td><br></td>
  4453. <td align="center" bgcolor="lightgrey">NO</td>
  4454. </tr>
  4455. <tr>
  4456. <td align="left" valign="top"><a href="#nxtkdrawlinetoolbar"><code>nxtk_drawlinetoolbar()</code></a></td>
  4457. <td><br></td>
  4458. <td align="center" bgcolor="lightgrey">NO</td>
  4459. </tr>
  4460. <tr>
  4461. <td align="left" valign="top"><a href="#nxtkdrawcircletoolbar"><code>nxtk_drawcircletoolbar()</code></a></td>
  4462. <td><br></td>
  4463. <td align="center" bgcolor="lightgrey">NO</td>
  4464. </tr>
  4465. <tr>
  4466. <td align="left" valign="top"><a href="#nxtkfillcircletoolbar"><code>nxtk_fillcircletoolbar()</code></a></td>
  4467. <td><br></td>
  4468. <td align="center" bgcolor="lightgrey">NO</td>
  4469. </tr>
  4470. <tr>
  4471. <td align="left" valign="top"><a href="#nxtkmovetoolbar"><code>nxtk_movetoolbar()</code></a></td>
  4472. <td><br></td>
  4473. <td align="center" bgcolor="lightgrey">NO</td>
  4474. </tr>
  4475. <tr>
  4476. <td align="left" valign="top"><a href="#nxtkbitmaptoolbar"><code>nxtk_bitmaptoolbar()</code></a></td>
  4477. <td><br></td>
  4478. <td align="center" bgcolor="lightgrey">NO</td>
  4479. </tr>
  4480. </table></center>
  4481. <center><h2>Table D.5: <a name="nxfontscoverage">NXFONTS API Test Coverage</a></h2></center>
  4482. <center><table border="1" width="80%">
  4483. <tr>
  4484. <th width="40%">Function</th>
  4485. <th width="60%">Special Setup/Notes</th>
  4486. <th width="5%">Verified</th></tr>
  4487. </tr>
  4488. <tr>
  4489. <td align="left" valign="top"><a href="#nxfgetfonthandle"><code>nxf_getfonthandle()</code></a></td>
  4490. <td><br></td>
  4491. <td align="center" bgcolor="skyblue">YES</td>
  4492. </tr>
  4493. <tr>
  4494. <td align="left" valign="top"><a href="#nxfgetfontset"><code>nxf_getfontset()</code></a></td>
  4495. <td><br></td>
  4496. <td align="center" bgcolor="skyblue">YES</td>
  4497. </tr>
  4498. <tr>
  4499. <td align="left" valign="top"><a href="#nxfgetbitmap"><code>nxf_getbitmap()</code></a></td>
  4500. <td><br></td>
  4501. <td align="center" bgcolor="skyblue">YES</td>
  4502. </tr>
  4503. <tr>
  4504. <td align="left" valign="top"><a href="#nxfconvertbpp"><code>nxf_convert_2bpp()</code></a></td>
  4505. <td><br></td>
  4506. <td align="center" bgcolor="lightgrey">NO</td>
  4507. </tr>
  4508. <tr>
  4509. <td align="left" valign="top"><a href="#nxfconvertbpp"><code>nxf_convert_4bpp()</code></a></td>
  4510. <td><br></td>
  4511. <td align="center" bgcolor="lightgrey">NO</td>
  4512. </tr>
  4513. <tr>
  4514. <td align="left" valign="top"><a href="#nxfconvertbpp"><code>nxf_convert_8bpp()</code></a></td>
  4515. <td>Use <code>defconfig</code> when building.</td>
  4516. <td align="center" bgcolor="skyblue">YES</td>
  4517. </tr>
  4518. <tr>
  4519. <td align="left" valign="top"><a href="#nxfconvertbpp"><code>nxf_convert_16bpp()</code></a></td>
  4520. <td><br></td>
  4521. <td align="center" bgcolor="skyblue">YES</td>
  4522. </tr>
  4523. <tr>
  4524. <td align="left" valign="top"><a href="#nxfconvertbpp"><code>nxf_convert_24bpp()</code></a></td>
  4525. <td><br></td>
  4526. <td align="center" bgcolor="lightgrey">NO</td>
  4527. </tr>
  4528. <tr>
  4529. <td align="left" valign="top"><a href="#nxfconvertbpp"><code>nxf_convert_32bpp()</code></a></td>
  4530. <td><br></td>
  4531. <td align="center" bgcolor="skyblue">YES</td>
  4532. </tr>
  4533. </table></center>
  4534. </body>
  4535. </html>