•SiUvdALFVPKONSOTXGRLAIDBURAARTYESCHOOL SoNTEHEV.CAUFORN.AG^^ CURITYCLASSIFICATIONOFTHISPAGE REPORT DOCUMENTATION PAGE REPORTSECURITYCLASSIFICATION UNCLASSIFIED 1b.RESTRICTIVEMARKINGS a SECURITYCLASSIPICATI6MAUTH6RITV 3.bisTRiBuTi6N7AVAlLABiUTY6PREP5RT Approvedforpublicrelease; b.dECLAssIFICATIoN/doWNgRADINgSCHEDULE distributionisunlimited PERFORMINGORGANIZATIONREP6RTNUM&ER(S) 5.M6niT6Ring6Rgani2aTi6nrep6rTnumbER(S) *.NAME6FPERFORMING6R6ANIZATI6N 6b OFFICESYMBOL 7a.NAME6EM6NIT6R1NGORGANIZATION vdministrativeSciencesDepartment (ifapplicable) NavalPostgraduateSchool JavalPostgraduateSchool AS :.ADDRESS(City,State,andZIPCode) 7b.ADDRESS(City,State,andZIPCode) /lonterey,CA 93943-5000 Monterey,CA 93943-5000 ONRAGMAENIOZFATFIUONNDING/SPONSORING 8b.O(FifFaIpCplEicSabYlMe)BOL gPROCUREMENTINSTRUMENTIDENTIFICATIONNUMBER 6.ADDRESS(City,State,andZIPCode) P10R.OSGORUARMCEOFFUPNRD6IJNEGCNTUMBERSTTa^R" WoRkUNiT ELEMENTNO. 1NO. NO. ACCESSIONNO. ^1.NTIITLNET(IRncOluDdeUSeCcuTriItyOCNlassTifOicatXionW) INDOWAPPLICATIONDEVELOPMENT(U) 2 PERSONALAUTHOR(S) lust,DavidM. 3a.typeofreport 13b.timecovered 14.DATEOFREPORT(Year,Month,Day) 16.PAGECOUNT Master'sThesis from 10/90 to 03/92 1992^,March,23 70 6 supplementarynotation Theviewsexpressedinthis^sis thoseoftheauthormddonotreflecttheofficial policyorpositionoftheDepartmentofDefenseortheUnited StatesGovernment. COSATICODES 18.SUBJECTTERMS(Continueonreverseifnecessaryandidentifybyblocknumber) FIELD GROUP SUB-GROUP tCooomlkpiutts,erwiPdrgeotg,rawmimnidnogw,,GwrianpdhiocwailngUsseyrstIenmte,rfXalcieb,,pXorWtaibnldeoswystems, 9 ABSTRACT(Continueonreverseifnecessaryandidentifybyblocknumber) Thechallengetodevelopingapplicationsforcomputer-basedwindowingsystemsisgeneratingcodeforthegraph- ;alinterfaceelements. Eachwindowingsystemoffersitsownsetofprotocolsforbuildingthegraphicalunits,but leseprotocolsarerarelyportableacrossdifferenthardwareplatforms.TheXWindowSystemtranscendsmanyof leseincompatibilitiesandoffersastandardforcreatinggraphics.Itisoperatingsystemandnetworkindependent, lowever,thebasicprogramminglibraryforXWindowofferslittlesophisticationforanapplication'sgraphicalin- ^rfacedevelopment. HigherleveltoolsmakeupfortheshortcomingsofthegenericXWindowSystem, 'histhesisconvertsanExpertSystemKnowledgeAcquisitionandPolicyEvaluationprogramusingCognitiveFeed- ack(ESKAPE/CF)fromtheSunViewwindowingsystemtoXWindow.Thenewapplication,calledXESKAPE/CF, ontainsthesamefunctionalityastheoriginalprogrameven thoughthemigrationfromSunViewtoXWindowre- uiredanextensivereworkingoftheprogram'sinterfacecode.ThethesisalsoextendsthebasicXWindowlibrary ffunctionswithmoreadvancedobjects.TheseobjectsofferadditionalfunctionalitytotheXESKAPE/CFapplica- on'sinterface. )X]DIUSNTCRLIABSUSTIIFOINE/DA/VUAINLLAIBMIILTIETDYOQFASBASTMREAACSTRPT. [JDTICUSERS 21U.NACBSLTARSACSTISFEICUERDITYCLASSIFICATION a.NAMEOFRESPONSIBLEINDIVIDUAL 22b.TELEPHONE(IncludeAreaCode) 22c.OFFICESYMBOL ishoreSengupta (408)646-3212 AS/Se )FORM1473,84MAR 83APReditionmaybeuseduntilexhausted SECURITYCLASSIFICATIONOFTHISPAGE Allothereditionsareobsolete UNCLASSIFIED torQ LL 1 Approvedforpublicrelease;distributionisunlimited AnIntroductiontoXWindowApplicationDevelopment by DavidMichaelRust Lieutenant,UnitedStatesNavy B.S.,RiceUniversity, 1986 Submittedinpartialfulfillmentofthe requirementsforthedegreeof MASTER OFSCIENCEININFORMATIONSYSTEMS fromthe NAVALPOSTGRADUATESCHOOL March 1992 ABSTRACT The challengeto developing applications forcomputer-basedwindowing systemsis generating code for the graphical interface elements. Each windowing system offers its ownsetofprotocolsforbuildingthegraphicalunits,buttheseprotocolsarerarelyportable across different hardware platforms. The X Window System transcends many of these incompatibilities and offers a standard for creating graphics. It is operating system and networkindependent. However,thebasicprogramminglibraryforXWindowofferslittle sophistication for an application's graphical interface development. Higher level tools makeupfortheshortcomingsofthegenericXWindow System. ThisthesisconvertsanExpertSystemKnowledgeAcquisitionandPolicyEvaluation program using CognitiveFeedback (ESKAPE/CF) fromthe SunViewwindowing system toXWindow.Thenewapplication,calledXESKAPE/CF,containsthesamefunctionality as the originalprogrameven though themigration from SunView toXWindowrequired an extensivereworkingoftheprogram'sinterfacecode. Thethesis alsoextendsthebasic XWindowlibraryoffunctionswithmoreadvancedobjects.Theseobjectsofferadditional functionalitytotheXESKAPE/CFapplication'sinterface. TABLE OFCONTENTS INTRODUCTION I. 1 A. THESIS OBJECTIVESANDSCOPE 1 B. BACKGROUND 2 C. ORGANIZATIONOFTHESTUDY 2 D. DISCLAIMER 3 II. XWINDOWPROGRAMMINGLAYERS 4 A. PROGRAMMINGINXWINDOW 4 1. Widgets 4 2. ToolkitHierarchy 4 B. XLIB:THEXWINDOWLIBRARY 5 C. MIDDLELEVELTOOKITS 5 1. Intrinsics 6 a. Xt: TheXToolkit 6 b. Xaw:TheAthenaWidgetSet 6 2. XView 6 D. HIGHLEVELTOOLKITS 7 1. OpenLookIntrinsicsToolkit(OLIT) 7 2. Motif 7 III. ANINTRODUCTIONTOXLIBPROGRAMMINGTECHNIQUES 8 A. GETTING STARTED 9 1. ConnectingtheClienttotheServer 9 2. LinkingtoaScreen 9 .lUDLbYKNOXLIBRARY NAVALPOSTGRADUATESCHOOL MONTEREY.CALIFORNIA93943-5002 3. LoadingFonts 10 B. USINGWINDOWS 10 1. CreatingWindows 10 2. TheGraphicsContext 12 3. MappingWindows 12 4. DrawingInsidetheWindow 13 C. EVENTLOOPPROCESSING 13 1. HandlingUserInput 14 2. RefreshingtheScreen 15 IV. XESKAPE/CF:THEXWINDOWVERSIONOFESKAPE/CF 16 A. FUNCTIONALCOMPARISONTOESKAPE/CF 16 B. MOTIVATIONFORTHEPROGRAMCONVERSION 19 C. INITIALAPPROACHTOTHEPROGRAMCONVERSION 19 D. MAINPROGRAMCONTROL:THEEVENTLOOP 20 E. BUILDINGWIDGETS 23 1. InteractiveText 23 a. CreatingtheWidget 25 b. TyingtheWidgettotheEventLoop 26 c. UsingtheWidgetIntheXESKAPE/CFProgTam 32 2. StaticText 35 3. Buttons 37 V. CONCLUSIONSANDRECOMMENDATIONS 39 A. ENVIRONMENTALCONSIDERATIONS 39 1. Portability 39 V 2. InterfaceConsistency 39 B. APPLICATIONCONSIDERATIONS 40 1. Application Size 40 2. ProgrammingExperience 40 APPENDIXA: THEHISTORYOFXWINDOW 41 APPENDIXB:THESTRUCTUREOFXWINDOW 43 APPENDIXC: THEGETTEXTWIDGET 47 APPENDIXD: GLOSSARYOFTERMS 57 LISTOFREFERENCES 60 BIBLIOGRAPHY 62 INITIALDISTRIBUTIONLIST 63