NXGraphicsSubsystem.html 169 KB

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