intuition.pas 180 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu>
  4. intuition.library interface unit for MorphOS/PowerPC
  5. Based on work of Nils Sjoholm member of the Amiga RTL
  6. development team.
  7. MorphOS port was done on a free Pegasos II/G4 machine
  8. provided by Genesi S.a.r.l. <www.genesi.lu>
  9. See the file COPYING.FPC, included in this distribution,
  10. for details about the copyright.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. **********************************************************************}
  15. {$PACKRECORDS 2}
  16. unit intuition;
  17. interface
  18. uses
  19. exec, graphics, utility, inputevent, timer, layers;
  20. {
  21. * NOTE: intuition/iobsolete.h is included at the END of this file!
  22. }
  23. { ======================================================================== }
  24. { === IntuiText ========================================================== }
  25. { ================================= ======================================= }
  26. { IntuiText is a series of strings that start with a screen location
  27. * (always relative to the upper-left corner of something) and then the
  28. * text of the string. The text is null-terminated.
  29. }
  30. Type
  31. pIntuiText = ^tIntuiText;
  32. tIntuiText = record
  33. FrontPen,
  34. BackPen : Byte; { the pen numbers for the rendering }
  35. DrawMode : Byte; { the mode for rendering the text }
  36. LeftEdge : smallint; { relative start location for the text }
  37. TopEdge : smallint; { relative start location for the text }
  38. ITextFont : pTextAttr; { if NULL, you accept the default }
  39. IText : PChar; { pointer to null-terminated text }
  40. NextText : pIntuiText; { continuation to TxWrite another text }
  41. end;
  42. { ======================================================================== }
  43. { === Border ============================================================= }
  44. { ======================================================================== }
  45. { Data type Border, used for drawing a series of lines which is intended for
  46. * use as a border drawing, but which may, in fact, be used to render any
  47. * arbitrary vector shape.
  48. * The routine DrawBorder sets up the RastPort with the appropriate
  49. * variables, then does a Move to the first coordinate, then does Draws
  50. * to the subsequent coordinates.
  51. * After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  52. * recursively
  53. }
  54. Type
  55. pBorder = ^tBorder;
  56. tBorder = record
  57. LeftEdge,
  58. TopEdge : smallint; { initial offsets from the origin }
  59. FrontPen,
  60. BackPen : Byte; { pens numbers for rendering }
  61. DrawMode : Byte; { mode for rendering }
  62. Count : Shortint; { number of XY pairs }
  63. XY : Pointer; { vector coordinate pairs rel to LeftTop}
  64. NextBorder : pBorder; { pointer to any other Border too }
  65. end;
  66. { ======================================================================== }
  67. { === MenuItem =========================================================== }
  68. { ======================================================================== }
  69. Type
  70. pMenuItem = ^tMenuItem;
  71. tMenuItem = record
  72. NextItem : pMenuItem; { pointer to next in chained list }
  73. LeftEdge,
  74. TopEdge : smallint; { position of the select box }
  75. Width,
  76. Height : smallint; { dimensions of the select box }
  77. Flags : Word; { see the defines below }
  78. MutualExclude : Longint; { set bits mean this item excludes that }
  79. ItemFill : Pointer; { points to Image, IntuiText, or NULL }
  80. { when this item is pointed to by the cursor and the items highlight
  81. * mode HIGHIMAGE is selected, this alternate image will be displayed
  82. }
  83. SelectFill : Pointer; { points to Image, IntuiText, or NULL }
  84. Command : Char; { only if appliprog sets the COMMSEQ flag }
  85. SubItem : pMenuItem; { if non-zero, DrawMenu shows "->" }
  86. { The NextSelect field represents the menu number of next selected
  87. * item (when user has drag-selected several items)
  88. }
  89. NextSelect : Word;
  90. end;
  91. Const
  92. { FLAGS SET BY THE APPLIPROG }
  93. CHECKIT = $0001; { whether to check this item if selected }
  94. ITEMTEXT = $0002; { set if textual, clear if graphical item }
  95. COMMSEQ = $0004; { set if there's an command sequence }
  96. MENUTOGGLE = $0008; { set to toggle the check of a menu item }
  97. ITEMENABLED = $0010; { set if this item is enabled }
  98. { these are the SPECIAL HIGHLIGHT FLAG state meanings }
  99. HIGHFLAGS = $00C0; { see definitions below for these bits }
  100. HIGHIMAGE = $0000; { use the user's "select image" }
  101. HIGHCOMP = $0040; { highlight by complementing the selectbox }
  102. HIGHBOX = $0080; { highlight by "boxing" the selectbox }
  103. HIGHNONE = $00C0; { don't highlight }
  104. { FLAGS SET BY BOTH APPLIPROG AND INTUITION }
  105. CHECKED = $0100; { if CHECKIT, then set this when selected }
  106. { FLAGS SET BY INTUITION }
  107. ISDRAWN = $1000; { this item's subs are currently drawn }
  108. HIGHITEM = $2000; { this item is currently highlighted }
  109. MENUTOGGLED = $4000; { this item was already toggled }
  110. { ======================================================================== }
  111. { === Menu =============================================================== }
  112. { ======================================================================== }
  113. Type
  114. pMenu = ^tMenu;
  115. tMenu = record
  116. NextMenu : pMenu; { same level }
  117. LeftEdge,
  118. TopEdge : smallint; { position of the select box }
  119. Width,
  120. Height : smallint; { dimensions of the select box }
  121. Flags : Word; { see flag definitions below }
  122. MenuName : PChar; { text for this Menu Header }
  123. FirstItem : pMenuItem; { pointer to first in chain }
  124. { these mysteriously-named variables are for internal use only }
  125. JazzX,
  126. JazzY,
  127. BeatX,
  128. BeatY : smallint;
  129. end;
  130. CONST
  131. { FLAGS SET BY BOTH THE APPLIPROG AND INTUITION }
  132. MENUENABLED = $0001; { whether or not this menu is enabled }
  133. { FLAGS SET BY INTUITION }
  134. MIDRAWN = $0100; { this menu's items are currently drawn }
  135. { ======================================================================== }
  136. { === Gadget ============================================================= }
  137. { ======================================================================== }
  138. Type
  139. pGadget = ^tGadget;
  140. tGadget = record
  141. NextGadget : pGadget; { next gadget in the list }
  142. LeftEdge,
  143. TopEdge : smallint; { "hit box" of gadget }
  144. Width,
  145. Height : smallint; { "hit box" of gadget }
  146. Flags : Word; { see below for list of defines }
  147. Activation : Word; { see below for list of defines }
  148. GadgetType : Word; { see below for defines }
  149. { appliprog can specify that the Gadget be rendered as either as Border
  150. * or an Image. This variable points to which (or equals NULL if there's
  151. * nothing to be rendered about this Gadget)
  152. }
  153. GadgetRender : Pointer;
  154. { appliprog can specify "highlighted" imagery rather than algorithmic
  155. * this can point to either Border or Image data
  156. }
  157. SelectRender : Pointer;
  158. GadgetText : pIntuiText; { text for this gadget }
  159. { by using the MutualExclude word, the appliprog can describe
  160. * which gadgets mutually-exclude which other ones. The bits
  161. * in MutualExclude correspond to the gadgets in object containing
  162. * the gadget list. If this gadget is selected and a bit is set
  163. * in this gadget's MutualExclude and the gadget corresponding to
  164. * that bit is currently selected (e.g. bit 2 set and gadget 2
  165. * is currently selected) that gadget must be unselected.
  166. * Intuition does the visual unselecting (with checkmarks) and
  167. * leaves it up to the program to unselect internally
  168. }
  169. MutualExclude : Longint; { set bits mean this gadget excludes that gadget }
  170. { pointer to a structure of special data required by Proportional,
  171. * String and Longint Gadgets
  172. }
  173. SpecialInfo : Pointer;
  174. GadgetID : Word; { user-definable ID field }
  175. UserData : Pointer; { ptr to general purpose User data (ignored by In) }
  176. end;
  177. pExtGadget = ^tExtGadget;
  178. tExtGadget = record
  179. { The first fields match struct Gadget exactly }
  180. NextGadget : pExtGadget; { Matches struct Gadget }
  181. LeftEdge, TopEdge, { Matches struct Gadget }
  182. Width, Height : smallint; { Matches struct Gadget }
  183. Flags, { Matches struct Gadget }
  184. Activation, { Matches struct Gadget }
  185. GadgetType : WORD; { Matches struct Gadget }
  186. GadgetRender, { Matches struct Gadget }
  187. SelectRender : Pointer; { Matches struct Gadget }
  188. GadgetText : pIntuiText; { Matches struct Gadget }
  189. MutualExclude : Longint; { Matches struct Gadget }
  190. SpecialInfo : Pointer; { Matches struct Gadget }
  191. GadgetID : WORD; { Matches struct Gadget }
  192. UserData : Pointer; { Matches struct Gadget }
  193. { These fields only exist under V39 and only if GFLG_EXTENDED is set }
  194. MoreFlags : Cardinal; { see GMORE_ flags below }
  195. BoundsLeftEdge, { Bounding extent for gadget, valid }
  196. BoundsTopEdge, { only if GMORE_BOUNDS is set. The }
  197. BoundsWidth, { GFLG_RELxxx flags affect these }
  198. BoundsHeight : smallint; { coordinates as well. }
  199. end;
  200. CONST
  201. { --- Gadget.Flags values --- }
  202. { combinations in these bits describe the highlight technique to be used }
  203. GFLG_GADGHIGHBITS = $0003;
  204. GFLG_GADGHCOMP = $0000; { Complement the select box }
  205. GFLG_GADGHBOX = $0001; { Draw a box around the image }
  206. GFLG_GADGHIMAGE = $0002; { Blast in this alternate image }
  207. GFLG_GADGHNONE = $0003; { don't highlight }
  208. GFLG_GADGIMAGE = $0004; { set IF GadgetRender AND SelectRender
  209. * point to an Image structure, clear
  210. * if they point to Border structures
  211. }
  212. { combinations in these next two bits specify to which corner the gadget's
  213. * Left & Top coordinates are relative. If relative to Top/Left,
  214. * these are "normal" coordinates (everything is relative to something in
  215. * this universe).
  216. *
  217. * Gadget positions and dimensions are relative to the window or
  218. * requester which contains the gadget
  219. }
  220. GFLG_RELBOTTOM = $0008; { vert. pos. is relative to bottom edge }
  221. GFLG_RELRIGHT = $0010; { horiz. pos. is relative to right edge }
  222. GFLG_RELWIDTH = $0020; { width is relative to req/window }
  223. GFLG_RELHEIGHT = $0040; { height is relative to req/window }
  224. { New for V39: GFLG_RELSPECIAL allows custom gadget implementors to
  225. * make gadgets whose position and size depend in an arbitrary way
  226. * on their window's dimensions. The GM_LAYOUT method will be invoked
  227. * for such a gadget (or any other GREL_xxx gadget) at suitable times,
  228. * such as when the window opens or the window's size changes.
  229. }
  230. GFLG_RELSPECIAL = $4000; { custom gadget has special relativity.
  231. * Gadget box values are absolutes, but
  232. * can be changed via the GM_LAYOUT method.
  233. }
  234. GFLG_SELECTED = $0080; { you may initialize AND look at this }
  235. { the GFLG_DISABLED flag is initialized by you and later set by Intuition
  236. * according to your calls to On/OffGadget(). It specifies whether or not
  237. * this Gadget is currently disabled from being selected
  238. }
  239. GFLG_DISABLED = $0100;
  240. { These flags specify the type of text field that Gadget.GadgetText
  241. * points to. In all normal (pre-V36) gadgets which you initialize
  242. * this field should always be zero. Some types of gadget objects
  243. * created from classes will use these fields to keep track of
  244. * types of labels/contents that different from IntuiText, but are
  245. * stashed in GadgetText.
  246. }
  247. GFLG_LABELMASK = $3000;
  248. GFLG_LABELITEXT = $0000; { GadgetText points to IntuiText }
  249. GFLG_LABELSTRING = $1000; { GadgetText points to (UBYTE *) }
  250. GFLG_LABELIMAGE = $2000; { GadgetText points to Image (object) }
  251. { New for V37: GFLG_TABCYCLE }
  252. GFLG_TABCYCLE = $0200; { (string OR custom) gadget participates in
  253. * cycling activation with Tab or Shift-Tab
  254. }
  255. { New for V37: GFLG_STRINGEXTEND. We discovered that V34 doesn't properly
  256. * ignore the value we had chosen for the Gadget->Activation flag
  257. * GACT_STRINGEXTEND. NEVER SET THAT FLAG WHEN RUNNING UNDER V34.
  258. * The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
  259. * safe under V34, and equivalent to GACT_STRINGEXTEND under V37.
  260. * (Note that the two flags are not numerically equal)
  261. }
  262. GFLG_STRINGEXTEND = $0400; { this String Gadget has StringExtend }
  263. { New for V39: GFLG_IMAGEDISABLE. This flag is automatically set if
  264. * the custom image of this gadget knows how to do disabled rendering
  265. * (more specifically, if its IA_SupportsDisable attribute is TRUE).
  266. * Intuition uses this to defer the ghosting to the image-class,
  267. * instead of doing it itself (the old compatible way).
  268. * Do not set this flag yourself - Intuition will do it for you.
  269. }
  270. GFLG_IMAGEDISABLE = $0800; { Gadget's image knows how to do disabled
  271. * rendering
  272. }
  273. { New for V39: If set, this bit means that the Gadget is actually
  274. * a struct ExtGadget, with new fields and flags. All V39 boopsi
  275. * gadgets are ExtGadgets. Never ever attempt to read the extended
  276. * fields of a gadget if this flag is not set.
  277. }
  278. GFLG_EXTENDED = $8000; { Gadget is extended }
  279. { --- Gadget.Activation flag values --- }
  280. { Set GACT_RELVERIFY if you want to verify that the pointer was still over
  281. * the gadget when the select button was released. Will cause
  282. * an IDCMP_GADGETUP message to be sent if so.
  283. }
  284. GACT_RELVERIFY = $0001;
  285. { the flag GACT_IMMEDIATE, when set, informs the caller that the gadget
  286. * was activated when it was activated. This flag works in conjunction with
  287. * the GACT_RELVERIFY flag
  288. }
  289. GACT_IMMEDIATE = $0002;
  290. { the flag GACT_ENDGADGET, when set, tells the system that this gadget,
  291. * when selected, causes the Requester to be ended. Requesters
  292. * that are ended are erased and unlinked from the system.
  293. }
  294. GACT_ENDGADGET = $0004;
  295. { the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive
  296. * reports on mouse movements while this gadget is active.
  297. * You probably want to set the GACT_IMMEDIATE flag when using
  298. * GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
  299. * learning why Intuition is suddenly sending you a stream of mouse
  300. * movement events. If you don't set GACT_RELVERIFY, you'll get at
  301. * least one Mouse Position event.
  302. }
  303. GACT_FOLLOWMOUSE = $0008;
  304. { if any of the BORDER flags are set in a Gadget that's included in the
  305. * Gadget list when a Window is opened, the corresponding Border will
  306. * be adjusted to make room for the Gadget
  307. }
  308. GACT_RIGHTBORDER = $0010;
  309. GACT_LEFTBORDER = $0020;
  310. GACT_TOPBORDER = $0040;
  311. GACT_BOTTOMBORDER= $0080;
  312. GACT_BORDERSNIFF = $8000; { neither set nor rely on this bit }
  313. GACT_TOGGLESELECT= $0100; { this bit for toggle-select mode }
  314. GACT_BOOLEXTEND = $2000; { this Boolean Gadget has a BoolInfo }
  315. { should properly be in StringInfo, but aren't }
  316. GACT_STRINGLEFT = $0000; { NOTE WELL: that this has value zero }
  317. GACT_STRINGCENTER= $0200;
  318. GACT_STRINGRIGHT = $0400;
  319. GACT_LONGINT = $0800; { this String Gadget is for Long Ints }
  320. GACT_ALTKEYMAP = $1000; { this String has an alternate keymap }
  321. GACT_STRINGEXTEND= $2000; { this String Gadget has StringExtend }
  322. { NOTE: NEVER SET GACT_STRINGEXTEND IF YOU
  323. * ARE RUNNING ON LESS THAN V36! SEE
  324. * GFLG_STRINGEXTEND (ABOVE) INSTEAD
  325. }
  326. GACT_ACTIVEGADGET = $4000; { this gadget is "active". This flag
  327. * is maintained by Intuition, and you
  328. * cannot count on its value persisting
  329. * while you do something on your program's
  330. * task. It can only be trusted by
  331. * people implementing custom gadgets
  332. }
  333. { note $8000 is used above (GACT_BORDERSNIFF);
  334. * all Activation flags defined }
  335. { --- GADGET TYPES ------------------------------------------------------- }
  336. { These are the Gadget Type definitions for the variable GadgetType
  337. * gadget number type MUST start from one. NO TYPES OF ZERO ALLOWED.
  338. * first comes the mask for Gadget flags reserved for Gadget typing
  339. }
  340. GTYP_GADGETTYPE = $FC00; { all Gadget Global Type flags (padded) }
  341. GTYP_SYSGADGET = $8000; { 1 = Allocated by the system, 0 = by app. }
  342. GTYP_SCRGADGET = $4000; { 1 = ScreenGadget, 0 = WindowGadget }
  343. GTYP_GZZGADGET = $2000; { 1 = for WFLG_GIMMEZEROZERO borders }
  344. GTYP_REQGADGET = $1000; { 1 = this is a Requester Gadget }
  345. { system gadgets }
  346. GTYP_SIZING = $0010;
  347. GTYP_WDRAGGING = $0020;
  348. GTYP_SDRAGGING = $0030;
  349. GTYP_WUPFRONT = $0040;
  350. GTYP_SUPFRONT = $0050;
  351. GTYP_WDOWNBACK = $0060;
  352. GTYP_SDOWNBACK = $0070;
  353. GTYP_CLOSE = $0080;
  354. { application gadgets }
  355. GTYP_BOOLGADGET = $0001;
  356. GTYP_GADGET0002 = $0002;
  357. GTYP_PROPGADGET = $0003;
  358. GTYP_STRGADGET = $0004;
  359. GTYP_CUSTOMGADGET = $0005;
  360. {* GTYP_GTYPEMASK is a mask you can apply to tell what class
  361. * of gadget this is. The possible classes follow.
  362. *}
  363. GTYP_GTYPEMASK = $0007;
  364. { This bit in GadgetType is reserved for undocumented internal use
  365. * by the Gadget Toolkit, and cannot be used nor relied on by
  366. * applications: $0100;
  367. }
  368. { New for V39. Gadgets which have the GFLG_EXTENDED flag set are
  369. * actually ExtGadgets, which have more flags. The GMORE_xxx
  370. * identifiers describe those flags. For GMORE_SCROLLRASTER, see
  371. * important information in the ScrollWindowRaster() autodoc.
  372. * NB: GMORE_SCROLLRASTER must be set before the gadget is
  373. * added to a window.
  374. }
  375. GMORE_BOUNDS = $00000001; { ExtGadget has valid Bounds }
  376. GMORE_GADGETHELP = $00000002; { This gadget responds to gadget help }
  377. GMORE_SCROLLRASTER = $00000004; { This (custom) gadget uses ScrollRaster }
  378. { ======================================================================== }
  379. { === BoolInfo======================================================= }
  380. { ======================================================================== }
  381. { This is the special data needed by an Extended Boolean Gadget
  382. * Typically this structure will be pointed to by the Gadget field SpecialInfo
  383. }
  384. Type
  385. pBoolInfo = ^tBoolInfo;
  386. tBoolInfo = record
  387. Flags : Word; { defined below }
  388. Mask : Pointer; { bit mask for highlighting and selecting
  389. * mask must follow the same rules as an Image
  390. * plane. It's width and height are determined
  391. * by the width and height of the gadget's
  392. * select box. (i.e. Gadget.Width and .Height).
  393. }
  394. Reserved : Cardinal; { set to 0 }
  395. end;
  396. Const
  397. { set BoolInfo.Flags to this flag bit.
  398. * in the future, additional bits might mean more stuff hanging
  399. * off of BoolInfo.Reserved.
  400. }
  401. BOOLMASK = $0001; { extension is for masked gadget }
  402. { ======================================================================== }
  403. { === PropInfo =========================================================== }
  404. { ======================================================================== }
  405. { this is the special data required by the proportional Gadget
  406. * typically, this data will be pointed to by the Gadget variable SpecialInfo
  407. }
  408. Type
  409. pPropInfo = ^tPropInfo;
  410. tPropInfo = record
  411. Flags : Word; { general purpose flag bits (see defines below) }
  412. { You initialize the Pot variables before the Gadget is added to
  413. * the system. Then you can look here for the current settings
  414. * any time, even while User is playing with this Gadget. To
  415. * adjust these after the Gadget is added to the System, use
  416. * ModifyProp(); The Pots are the actual proportional settings,
  417. * where a value of zero means zero and a value of MAXPOT means
  418. * that the Gadget is set to its maximum setting.
  419. }
  420. HorizPot : WORD; { 16-bit FixedPoint horizontal quantity percentage }
  421. VertPot : WORD; { 16-bit FixedPoint vertical quantity percentage }
  422. { the 16-bit FixedPoint Body variables describe what percentage of
  423. * the entire body of stuff referred to by this Gadget is actually
  424. * shown at one time. This is used with the AUTOKNOB routines,
  425. * to adjust the size of the AUTOKNOB according to how much of
  426. * the data can be seen. This is also used to decide how far
  427. * to advance the Pots when User hits the Container of the Gadget.
  428. * For instance, if you were controlling the display of a 5-line
  429. * Window of text with this Gadget, and there was a total of 15
  430. * lines that could be displayed, you would set the VertBody value to
  431. * (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  432. * Therefore, the AUTOKNOB would fill 1/3 of the container, and
  433. * if User hits the Cotainer outside of the knob, the pot would
  434. * advance 1/3 (plus or minus) If there's no body to show, or
  435. * the total amount of displayable info is less than the display area,
  436. * set the Body variables to the MAX. To adjust these after the
  437. * Gadget is added to the System, use ModifyProp();
  438. }
  439. HorizBody : Word; { horizontal Body }
  440. VertBody : Word; { vertical Body }
  441. { these are the variables that Intuition sets and maintains }
  442. CWidth : Word; { Container width (with any relativity absoluted) }
  443. CHeight : Word; { Container height (with any relativity absoluted) }
  444. HPotRes,
  445. VPotRes : Word; { pot increments }
  446. LeftBorder : Word; { Container borders }
  447. TopBorder : Word; { Container borders }
  448. end;
  449. CONST
  450. { --- FLAG BITS ---------------------------------------------------------- }
  451. AUTOKNOB = $0001; { this flag sez: gimme that old auto-knob }
  452. { NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  453. * you are currently limited to using a single Image of your own
  454. * design: Intuition won't handle a linked list of images as
  455. * a proportional gadget knob.
  456. }
  457. FREEHORIZ = $0002; { IF set, the knob can move horizontally }
  458. FREEVERT = $0004; { IF set, the knob can move vertically }
  459. PROPBORDERLESS = $0008; { IF set, no border will be rendered }
  460. KNOBHIT = $0100; { set when this Knob is hit }
  461. PROPNEWLOOK = $0010; { set this IF you want to get the new
  462. * V36 look
  463. }
  464. KNOBHMIN = 6; { minimum horizontal size of the Knob }
  465. KNOBVMIN = 4; { minimum vertical size of the Knob }
  466. MAXBODY = $FFFF; { maximum body value }
  467. MAXPOT = $FFFF; { maximum pot value }
  468. { ======================================================================== }
  469. { === StringInfo ========================================================= }
  470. { ======================================================================== }
  471. { this is the special data required by the string Gadget
  472. * typically, this data will be pointed to by the Gadget variable SpecialInfo
  473. }
  474. Type
  475. pStringInfo = ^tStringInfo;
  476. tStringInfo = record
  477. { you initialize these variables, and then Intuition maintains them }
  478. Buffer : PChar; { the buffer containing the start and final string }
  479. UndoBuffer : PChar; { optional buffer for undoing current entry }
  480. BufferPos : smallint; { character position in Buffer }
  481. MaxChars : smallint; { max number of chars in Buffer (including NULL) }
  482. DispPos : smallint; { Buffer position of first displayed character }
  483. { Intuition initializes and maintains these variables for you }
  484. UndoPos : smallint; { character position in the undo buffer }
  485. NumChars : smallint; { number of characters currently in Buffer }
  486. DispCount : smallint; { number of whole characters visible in Container }
  487. CLeft,
  488. CTop : smallint; { topleft offset of the container }
  489. { you can initialize this variable before the gadget is submitted to
  490. * Intuition, and then examine it later to discover what Longint
  491. * the user has entered (if the user never plays with the gadget,
  492. * the value will be unchanged from your initial setting)
  493. }
  494. Extension : Pointer;
  495. _LongInt : Longint;
  496. { If you want this Gadget to use your own Console keymapping, you
  497. * set the ALTKEYMAP bit in the Activation flags of the Gadget, and then
  498. * set this variable to point to your keymap. If you don't set the
  499. * ALTKEYMAP, you'll get the standard ASCII keymapping.
  500. }
  501. AltKeyMap : Pointer;
  502. end;
  503. { ======================================================================== }
  504. { === Requester ========================================================== }
  505. { ======================================================================== }
  506. Type
  507. pRequester = ^tRequester;
  508. tRequester = record
  509. { the ClipRect and BitMap and used for rendering the requester }
  510. OlderRequest : pRequester;
  511. LeftEdge,
  512. TopEdge : smallint; { dimensions of the entire box }
  513. Width,
  514. Height : smallint; { dimensions of the entire box }
  515. RelLeft,
  516. RelTop : smallint; { for Pointer relativity offsets }
  517. ReqGadget : pGadget; { pointer to a list of Gadgets }
  518. ReqBorder : pBorder; { the box's border }
  519. ReqText : pIntuiText; { the box's text }
  520. Flags : Word; { see definitions below }
  521. { pen number for back-plane fill before draws }
  522. BackFill : Byte;
  523. { Layer in place of clip rect }
  524. ReqLayer : pLayer;
  525. ReqPad1 : Array [0..31] of Byte;
  526. { If the BitMap plane pointers are non-zero, this tells the system
  527. * that the image comes pre-drawn (if the appliprog wants to define
  528. * it's own box, in any shape or size it wants!); this is OK by
  529. * Intuition as long as there's a good correspondence between
  530. * the image and the specified Gadgets
  531. }
  532. ImageBMap : pBitMap; { points to the BitMap of PREDRAWN imagery }
  533. RWindow : Pointer; { added. points back to Window }
  534. ReqImage : Pointer;
  535. ReqPad2 : Array [0..31] of Shortint;
  536. end;
  537. Const
  538. { FLAGS SET BY THE APPLIPROG }
  539. POINTREL = $0001; { if POINTREL set, TopLeft is relative to pointer}
  540. PREDRAWN = $0002; { if ReqBMap points to predrawn Requester imagery }
  541. NOISYREQ = $0004; { if you don't want requester to filter input }
  542. SIMPLEREQ = $0010;
  543. { to use SIMPLEREFRESH layer (recommended) }
  544. { New for V36 }
  545. USEREQIMAGE = $0020;
  546. { render linked list ReqImage after BackFill
  547. * but before gadgets and text
  548. }
  549. NOREQBACKFILL = $0040;
  550. { don't bother filling requester with Requester.BackFill pen }
  551. { FLAGS SET BY INTUITION }
  552. REQOFFWINDOW = $1000; { part of one of the Gadgets was offwindow }
  553. REQACTIVE = $2000; { this requester is active }
  554. SYSREQUEST = $4000; { this requester caused by system }
  555. DEFERREFRESH = $8000; { this Requester stops a Refresh broadcast }
  556. { ======================================================================== }
  557. { === Image ============================================================== }
  558. { ======================================================================== }
  559. { This is a brief image structure for very simple transfers of
  560. * image data to a RastPort
  561. }
  562. Type
  563. pImage = ^tImage;
  564. tImage = record
  565. LeftEdge : smallint; { starting offset relative to some origin }
  566. TopEdge : smallint; { starting offsets relative to some origin }
  567. Width : smallint; { pixel size (though data is word-aligned) }
  568. Height,
  569. Depth : smallint; { pixel sizes }
  570. ImageData : Pointer; { pointer to the actual word-aligned bits }
  571. { the PlanePick and PlaneOnOff variables work much the same way as the
  572. * equivalent GELS Bob variables. It's a space-saving
  573. * mechanism for image data. Rather than defining the image data
  574. * for every plane of the RastPort, you need define data only
  575. * for the planes that are not entirely zero or one. As you
  576. * define your Imagery, you will often find that most of the planes
  577. * ARE just as color selectors. For instance, if you're designing
  578. * a two-color Gadget to use colors two and three, and the Gadget
  579. * will reside in a five-plane display, bit plane zero of your
  580. * imagery would be all ones, bit plane one would have data that
  581. * describes the imagery, and bit planes two through four would be
  582. * all zeroes. Using these flags allows you to avoid wasting all
  583. * that memory in this way: first, you specify which planes you
  584. * want your data to appear in using the PlanePick variable. For
  585. * each bit set in the variable, the next "plane" of your image
  586. * data is blitted to the display. For each bit clear in this
  587. * variable, the corresponding bit in PlaneOnOff is examined.
  588. * If that bit is clear, a "plane" of zeroes will be used.
  589. * If the bit is set, ones will go out instead. So, for our example:
  590. * Gadget.PlanePick = $02;
  591. * Gadget.PlaneOnOff = $01;
  592. * Note that this also allows for generic Gadgets, like the
  593. * System Gadgets, which will work in any number of bit planes.
  594. * Note also that if you want an Image that is only a filled
  595. * rectangle, you can get this by setting PlanePick to zero
  596. * (pick no planes of data) and set PlaneOnOff to describe the pen
  597. * color of the rectangle.
  598. }
  599. PlanePick,
  600. PlaneOnOff : Byte;
  601. { if the NextImage variable is not NULL, Intuition presumes that
  602. * it points to another Image structure with another Image to be
  603. * rendered
  604. }
  605. NextImage : pImage;
  606. end;
  607. { New for V39, Intuition supports the IESUBCLASS_NEWTABLET subclass
  608. * of the IECLASS_NEWPOINTERPOS event. The ie_EventAddress of such
  609. * an event points to a TabletData structure (see below).
  610. *
  611. * The TabletData structure contains certain elements including a taglist.
  612. * The taglist can be used for special tablet parameters. A tablet driver
  613. * should include only those tag-items the tablet supports. An application
  614. * can listen for any tag-items that interest it. Note: an application
  615. * must set the WA_TabletMessages attribute to TRUE to receive this
  616. * extended information in its IntuiMessages.
  617. *
  618. * The definitions given here MUST be followed. Pay careful attention
  619. * to normalization and the interpretation of signs.
  620. *
  621. * TABLETA_TabletZ: the current value of the tablet in the Z direction.
  622. * This unsigned value should typically be in the natural units of the
  623. * tablet. You should also provide TABLETA_RangeZ.
  624. *
  625. * TABLETA_RangeZ: the maximum value of the tablet in the Z direction.
  626. * Normally specified along with TABLETA_TabletZ, this allows the
  627. * application to scale the actual Z value across its range.
  628. *
  629. * TABLETA_AngleX: the angle of rotation or tilt about the X-axis. This
  630. * number should be normalized to fill a signed long Longint. Positive
  631. * values imply a clockwise rotation about the X-axis when viewing
  632. * from +X towards the origin.
  633. *
  634. * TABLETA_AngleY: the angle of rotation or tilt about the Y-axis. This
  635. * number should be normalized to fill a signed long Longint. Positive
  636. * values imply a clockwise rotation about the Y-axis when viewing
  637. * from +Y towards the origin.
  638. *
  639. * TABLETA_AngleZ: the angle of rotation or tilt about the Z axis. This
  640. * number should be normalized to fill a signed long Longint. Positive
  641. * values imply a clockwise rotation about the Z-axis when viewing
  642. * from +Z towards the origin.
  643. *
  644. * Note: a stylus that supports tilt should use the TABLETA_AngleX
  645. * and TABLETA_AngleY attributes. Tilting the stylus so the tip
  646. * points towards increasing or decreasing X is actually a rotation
  647. * around the Y-axis. Thus, if the stylus tip points towards
  648. * positive X, then that tilt is represented as a negative
  649. * TABLETA_AngleY. Likewise, if the stylus tip points towards
  650. * positive Y, that tilt is represented by positive TABLETA_AngleX.
  651. *
  652. * TABLETA_Pressure: the pressure reading of the stylus. The pressure
  653. * should be normalized to fill a signed long Longint. Typical devices
  654. * won't generate negative pressure, but the possibility is not precluded.
  655. * The pressure threshold which is considered to cause a button-click is
  656. * expected to be set in a Preferences program supplied by the tablet
  657. * vendor. The tablet driver would send IECODE_LBUTTON-type events as
  658. * the pressure crossed that threshold.
  659. *
  660. * TABLETA_ButtonBits: ti_Data is a long Longint whose bits are to
  661. * be interpreted at the state of the first 32 buttons of the tablet.
  662. *
  663. * TABLETA_InProximity: ti_Data is a boolean. For tablets that support
  664. * proximity, they should send the (TABLETA_InProximity,FALSE) tag item
  665. * when the stylus is out of proximity. One possible use we can forsee
  666. * is a mouse-blanking commodity which keys off this to blank the
  667. * mouse. When this tag is absent, the stylus is assumed to be
  668. * in proximity.
  669. *
  670. * TABLETA_ResolutionX: ti_Data is an unsigned long Longint which
  671. * is the x-axis resolution in dots per inch.
  672. *
  673. * TABLETA_ResolutionY: ti_Data is an unsigned long Longint which
  674. * is the y-axis resolution in dots per inch.
  675. }
  676. const
  677. TABLETA_Dummy = (TAG_USER + $3A000) ;
  678. TABLETA_TabletZ = (TABLETA_Dummy + $01);
  679. TABLETA_RangeZ = (TABLETA_Dummy + $02);
  680. TABLETA_AngleX = (TABLETA_Dummy + $03);
  681. TABLETA_AngleY = (TABLETA_Dummy + $04);
  682. TABLETA_AngleZ = (TABLETA_Dummy + $05);
  683. TABLETA_Pressure = (TABLETA_Dummy + $06);
  684. TABLETA_ButtonBits = (TABLETA_Dummy + $07);
  685. TABLETA_InProximity = (TABLETA_Dummy + $08);
  686. TABLETA_ResolutionX = (TABLETA_Dummy + $09);
  687. TABLETA_ResolutionY = (TABLETA_Dummy + $0A);
  688. { If your window sets WA_TabletMessages to TRUE, then it will receive
  689. * extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData
  690. * field points at a TabletData structure. This structure contains
  691. * additional information about the input event.
  692. }
  693. Type
  694. pTabletData = ^tTabletData;
  695. tTabletData = record
  696. { Sub-pixel position of tablet, in screen coordinates,
  697. * scaled to fill a UWORD fraction:
  698. }
  699. td_XFraction, td_YFraction : WORD;
  700. { Current tablet coordinates along each axis: }
  701. td_TabletX, td_TabletY : Cardinal;
  702. { Tablet range along each axis. For example, if td_TabletX
  703. * can take values 0-999, td_RangeX should be 1000.
  704. }
  705. td_RangeX, td_RangeY : Cardinal;
  706. { Pointer to tag-list of additional tablet attributes.
  707. * See <intuition/intuition.h> for the tag values.
  708. }
  709. td_TagList : pTagItem;
  710. end;
  711. { If a tablet driver supplies a hook for ient_CallBack, it will be
  712. * invoked in the standard hook manner. A0 will point to the Hook
  713. * itself, A2 will point to the InputEvent that was sent, and
  714. * A1 will point to a TabletHookData structure. The InputEvent's
  715. * ie_EventAddress field points at the IENewTablet structure that
  716. * the driver supplied.
  717. *
  718. * Based on the thd_Screen, thd_Width, and thd_Height fields, the driver
  719. * should scale the ient_TabletX and ient_TabletY fields and store the
  720. * result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and
  721. * ient_ScaledYFraction.
  722. *
  723. * The tablet hook must currently return NULL. This is the only
  724. * acceptable return-value under V39.
  725. }
  726. pTabletHookData = ^tTabletHookData;
  727. tTabletHookData = record
  728. { Pointer to the active screen:
  729. * Note: if there are no open screens, thd_Screen will be NULL.
  730. * thd_Width and thd_Height will then describe an NTSC 64$400
  731. * screen. Please scale accordingly.
  732. }
  733. thd_Screen : Pointer;
  734. { The width and height (measured in pixels of the active screen)
  735. * that your are to scale to:
  736. }
  737. thd_Width,
  738. thd_Height : Cardinal;
  739. { Non-zero if the screen or something about the screen
  740. * changed since the last time you were invoked:
  741. }
  742. thd_ScreenChanged : Longint;
  743. end;
  744. { ======================================================================== }
  745. { === IntuiMessage ======================================================= }
  746. { ======================================================================== }
  747. Type
  748. pIntuiMessage = ^tIntuiMessage;
  749. tIntuiMessage = record
  750. ExecMessage : tMessage;
  751. { the Class bits correspond directly with the IDCMP Flags, except for the
  752. * special bit LONELYMESSAGE (defined below)
  753. }
  754. IClass : Cardinal;
  755. { the Code field is for special values like MENU number }
  756. Code : Word;
  757. { the Qualifier field is a copy of the current InputEvent's Qualifier }
  758. Qualifier : Word;
  759. { IAddress contains particular addresses for Intuition functions, like
  760. * the pointer to the Gadget or the Screen
  761. }
  762. IAddress : Pointer;
  763. { when getting mouse movement reports, any event you get will have the
  764. * the mouse coordinates in these variables. the coordinates are relative
  765. * to the upper-left corner of your Window (GIMMEZEROZERO notwithstanding)
  766. }
  767. MouseX,
  768. MouseY : smallint;
  769. { the time values are copies of the current system clock time. Micros
  770. * are in units of microseconds, Seconds in seconds.
  771. }
  772. Seconds,
  773. Micros : Cardinal;
  774. { the IDCMPWindow variable will always have the Pointer of the Window of
  775. * this IDCMP
  776. }
  777. IDCMPWindow : Pointer;
  778. { system-use variable }
  779. SpecialLink : pIntuiMessage;
  780. end;
  781. { New for V39:
  782. * All IntuiMessages are now slightly extended. The ExtIntuiMessage
  783. * structure has an additional field for tablet data, which is usually
  784. * NULL. If a tablet driver which is sending IESUBCLASS_NEWTABLET
  785. * events is installed in the system, windows with the WA_TabletMessages
  786. * property set will find that eim_TabletData points to the TabletData
  787. * structure. Applications must first check that this field is non-NULL;
  788. * it will be NULL for certain kinds of message, including mouse activity
  789. * generated from other than the tablet (i.e. the keyboard equivalents
  790. * or the mouse itself).
  791. *
  792. * NEVER EVER examine any extended fields when running under pre-V39!
  793. *
  794. * NOTE: This structure is subject to grow in the future. Making
  795. * assumptions about its size is A BAD IDEA.
  796. }
  797. pExtIntuiMessage = ^tExtIntuiMessage;
  798. tExtIntuiMessage = record
  799. eim_IntuiMessage : tIntuiMessage;
  800. eim_TabletData : pTabletData;
  801. end;
  802. CONST
  803. { --- IDCMP Classes ------------------------------------------------------ }
  804. { Please refer to the Autodoc for OpenWindow() and to the Rom Kernel
  805. * Manual for full details on the IDCMP classes.
  806. }
  807. IDCMP_SIZEVERIFY = $00000001;
  808. IDCMP_NEWSIZE = $00000002;
  809. IDCMP_REFRESHWINDOW = $00000004;
  810. IDCMP_MOUSEBUTTONS = $00000008;
  811. IDCMP_MOUSEMOVE = $00000010;
  812. IDCMP_GADGETDOWN = $00000020;
  813. IDCMP_GADGETUP = $00000040;
  814. IDCMP_REQSET = $00000080;
  815. IDCMP_MENUPICK = $00000100;
  816. IDCMP_CLOSEWINDOW = $00000200;
  817. IDCMP_RAWKEY = $00000400;
  818. IDCMP_REQVERIFY = $00000800;
  819. IDCMP_REQCLEAR = $00001000;
  820. IDCMP_MENUVERIFY = $00002000;
  821. IDCMP_NEWPREFS = $00004000;
  822. IDCMP_DISKINSERTED = $00008000;
  823. IDCMP_DISKREMOVED = $00010000;
  824. IDCMP_WBENCHMESSAGE = $00020000; { System use only }
  825. IDCMP_ACTIVEWINDOW = $00040000;
  826. IDCMP_INACTIVEWINDOW = $00080000;
  827. IDCMP_DELTAMOVE = $00100000;
  828. IDCMP_VANILLAKEY = $00200000;
  829. IDCMP_INTUITICKS = $00400000;
  830. { for notifications from "boopsi" gadgets }
  831. IDCMP_IDCMPUPDATE = $00800000; { new for V36 }
  832. { for getting help key report during menu session }
  833. IDCMP_MENUHELP = $01000000; { new for V36 }
  834. { for notification of any move/size/zoom/change window }
  835. IDCMP_CHANGEWINDOW = $02000000; { new for V36 }
  836. IDCMP_GADGETHELP = $04000000; { new for V39 }
  837. { NOTEZ-BIEN: $80000000 is reserved for internal use }
  838. { the IDCMP Flags do not use this special bit, which is cleared when
  839. * Intuition sends its special message to the Task, and set when Intuition
  840. * gets its Message back from the Task. Therefore, I can check here to
  841. * find out fast whether or not this Message is available for me to send
  842. }
  843. IDCMP_LONELYMESSAGE = $80000000;
  844. { --- IDCMP Codes -------------------------------------------------------- }
  845. { This group of codes is for the IDCMP_CHANGEWINDOW message }
  846. CWCODE_MOVESIZE = $0000; { Window was moved and/or sized }
  847. CWCODE_DEPTH = $0001; { Window was depth-arranged (new for V39) }
  848. { This group of codes is for the IDCMP_MENUVERIFY function }
  849. MENUHOT = $0001; { IntuiWants verification OR MENUCANCEL }
  850. MENUCANCEL = $0002; { HOT Reply of this cancels Menu operation }
  851. MENUWAITING = $0003; { Intuition simply wants a ReplyMsg() ASAP }
  852. { These are internal tokens to represent state of verification attempts
  853. * shown here as a clue.
  854. }
  855. OKOK = MENUHOT; { guy didn't care }
  856. OKABORT = $0004; { window rendered question moot }
  857. OKCANCEL = MENUCANCEL; { window sent cancel reply }
  858. { This group of codes is for the IDCMP_WBENCHMESSAGE messages }
  859. WBENCHOPEN = $0001;
  860. WBENCHCLOSE = $0002;
  861. { A data structure common in V36 Intuition processing }
  862. Type
  863. pIBox = ^tIBox;
  864. tIBox = record
  865. Left,
  866. Top,
  867. Width,
  868. Height : smallint;
  869. END;
  870. { ======================================================================== }
  871. { === Window ============================================================= }
  872. { ======================================================================== }
  873. Type
  874. pWindow = ^tWindow;
  875. tWindow = record
  876. NextWindow : pWindow; { for the linked list in a screen }
  877. LeftEdge,
  878. TopEdge : smallint; { screen dimensions of window }
  879. Width,
  880. Height : smallint; { screen dimensions of window }
  881. MouseY,
  882. MouseX : smallint; { relative to upper-left of window }
  883. MinWidth,
  884. MinHeight : smallint; { minimum sizes }
  885. MaxWidth,
  886. MaxHeight : smallint; { maximum sizes }
  887. Flags : Cardinal; { see below for defines }
  888. MenuStrip : pMenu; { the strip of Menu headers }
  889. Title : PChar; { the title text for this window }
  890. FirstRequest : pRequester; { all active Requesters }
  891. DMRequest : pRequester; { double-click Requester }
  892. ReqCount : smallint; { count of reqs blocking Window }
  893. WScreen : Pointer; { this Window's Screen }
  894. RPort : pRastPort; { this Window's very own RastPort }
  895. { the border variables describe the window border. If you specify
  896. * GIMMEZEROZERO when you open the window, then the upper-left of the
  897. * ClipRect for this window will be upper-left of the BitMap (with correct
  898. * offsets when in SuperBitMap mode; you MUST select GIMMEZEROZERO when
  899. * using SuperBitMap). If you don't specify ZeroZero, then you save
  900. * memory (no allocation of RastPort, Layer, ClipRect and associated
  901. * Bitmaps), but you also must offset all your writes by BorderTop,
  902. * BorderLeft and do your own mini-clipping to prevent writing over the
  903. * system gadgets
  904. }
  905. BorderLeft,
  906. BorderTop,
  907. BorderRight,
  908. BorderBottom : Shortint;
  909. BorderRPort : pRastPort;
  910. { You supply a linked-list of Gadgets for your Window.
  911. * This list DOES NOT include system gadgets. You get the standard
  912. * window system gadgets by setting flag-bits in the variable Flags (see
  913. * the bit definitions below)
  914. }
  915. FirstGadget : pGadget;
  916. { these are for opening/closing the windows }
  917. Parent,
  918. Descendant : pWindow;
  919. { sprite data information for your own Pointer
  920. * set these AFTER you Open the Window by calling SetPointer()
  921. }
  922. _Pointer : Pointer; { sprite data }
  923. PtrHeight : Shortint; { sprite height (not including sprite padding) }
  924. PtrWidth : Shortint; { sprite width (must be less than or equal to 16) }
  925. XOffset,
  926. YOffset : Shortint; { sprite offsets }
  927. { the IDCMP Flags and User's and Intuition's Message Ports }
  928. IDCMPFlags : Cardinal; { User-selected flags }
  929. UserPort,
  930. WindowPort : pMsgPort;
  931. MessageKey : pIntuiMessage;
  932. DetailPen,
  933. BlockPen : Byte; { for bar/border/gadget rendering }
  934. { the CheckMark is a pointer to the imagery that will be used when
  935. * rendering MenuItems of this Window that want to be checkmarked
  936. * if this is equal to NULL, you'll get the default imagery
  937. }
  938. CheckMark : pImage;
  939. ScreenTitle : PChar; { if non-null, Screen title when Window is active }
  940. { These variables have the mouse coordinates relative to the
  941. * inner-Window of GIMMEZEROZERO Windows. This is compared with the
  942. * MouseX and MouseY variables, which contain the mouse coordinates
  943. * relative to the upper-left corner of the Window, GIMMEZEROZERO
  944. * notwithstanding
  945. }
  946. GZZMouseX : smallint;
  947. GZZMouseY : smallint;
  948. { these variables contain the width and height of the inner-Window of
  949. * GIMMEZEROZERO Windows
  950. }
  951. GZZWidth : smallint;
  952. GZZHeight : smallint;
  953. ExtData : Pointer;
  954. UserData : Pointer; { general-purpose pointer to User data extension }
  955. {* jimm: NEW: 11/18/85: this pointer keeps a duplicate of what
  956. * Window.RPort->Layer is _supposed_ to be pointing at
  957. }
  958. WLayer : pLayer;
  959. { jimm: NEW 1.2: need to keep track of the font that
  960. * OpenWindow opened, in case user SetFont's into RastPort
  961. }
  962. IFont : pTextFont;
  963. {* (V36) another flag word (the Flags field is used up).
  964. * At present, all flag values are system private.
  965. * Until further notice, you may not change nor use this field.
  966. *}
  967. MoreFlags : Cardinal;
  968. {**** Data beyond this point are Intuition Private. DO NOT USE ****}
  969. end;
  970. CONST
  971. { --- Flags requested at OpenWindow() time by the application --------- }
  972. WFLG_SIZEGADGET = $00000001; { include sizing system-gadget? }
  973. WFLG_DRAGBAR = $00000002; { include dragging system-gadget? }
  974. WFLG_DEPTHGADGET = $00000004; { include depth arrangement gadget? }
  975. WFLG_CLOSEGADGET = $00000008; { include close-box system-gadget? }
  976. WFLG_SIZEBRIGHT = $00000010; { size gadget uses right border }
  977. WFLG_SIZEBBOTTOM = $00000020; { size gadget uses bottom border }
  978. { --- refresh modes ------------------------------------------------------ }
  979. { combinations of the WFLG_REFRESHBITS select the refresh type }
  980. WFLG_REFRESHBITS = $000000C0;
  981. WFLG_SMART_REFRESH = $00000000;
  982. WFLG_SIMPLE_REFRESH= $00000040;
  983. WFLG_SUPER_BITMAP = $00000080;
  984. WFLG_OTHER_REFRESH = $000000C0;
  985. WFLG_BACKDROP = $00000100; { this is a backdrop window }
  986. WFLG_REPORTMOUSE = $00000200; { to hear about every mouse move }
  987. WFLG_GIMMEZEROZERO = $00000400; { a GimmeZeroZero window }
  988. WFLG_BORDERLESS = $00000800; { to get a Window sans border }
  989. WFLG_ACTIVATE = $00001000; { when Window opens, it's Active }
  990. { --- Other User Flags --------------------------------------------------- }
  991. WFLG_RMBTRAP = $00010000; { Catch RMB events for your own }
  992. WFLG_NOCAREREFRESH = $00020000; { not to be bothered with REFRESH }
  993. { - V36 new Flags which the programmer may specify in NewWindow.Flags }
  994. WFLG_NW_EXTENDED = $00040000; { extension data provided }
  995. { see struct ExtNewWindow }
  996. { - V39 new Flags which the programmer may specify in NewWindow.Flags }
  997. WFLG_NEWLOOKMENUS = $00200000; { window has NewLook menus }
  998. { These flags are set only by Intuition. YOU MAY NOT SET THEM YOURSELF! }
  999. WFLG_WINDOWACTIVE = $00002000; { this window is the active one }
  1000. WFLG_INREQUEST = $00004000; { this window is in request mode }
  1001. WFLG_MENUSTATE = $00008000; { Window is active with Menus on }
  1002. WFLG_WINDOWREFRESH = $01000000; { Window is currently refreshing }
  1003. WFLG_WBENCHWINDOW = $02000000; { WorkBench tool ONLY Window }
  1004. WFLG_WINDOWTICKED = $04000000; { only one timer tick at a time }
  1005. { --- V36 Flags to be set only by Intuition ------------------------- }
  1006. WFLG_VISITOR = $08000000; { visitor window }
  1007. WFLG_ZOOMED = $10000000; { identifies "zoom state" }
  1008. WFLG_HASZOOM = $20000000; { windowhas a zoom gadget }
  1009. { --- Other Window Values ---------------------------------------------- }
  1010. DEFAULTMOUSEQUEUE = (5); { no more mouse messages }
  1011. { --- see struct IntuiMessage for the IDCMP Flag definitions ------------- }
  1012. { ======================================================================== }
  1013. { === NewWindow ========================================================== }
  1014. { ======================================================================== }
  1015. Type
  1016. pNewWindow = ^tNewWindow;
  1017. tNewWindow = record
  1018. LeftEdge,
  1019. TopEdge : smallint; { screen dimensions of window }
  1020. Width,
  1021. Height : smallint; { screen dimensions of window }
  1022. DetailPen,
  1023. BlockPen : Byte; { for bar/border/gadget rendering }
  1024. IDCMPFlags : Cardinal; { User-selected IDCMP flags }
  1025. Flags : Cardinal; { see Window struct for defines }
  1026. { You supply a linked-list of Gadgets for your Window.
  1027. * This list DOES NOT include system Gadgets. You get the standard
  1028. * system Window Gadgets by setting flag-bits in the variable Flags (see
  1029. * the bit definitions under the Window structure definition)
  1030. }
  1031. FirstGadget : pGadget;
  1032. { the CheckMark is a pointer to the imagery that will be used when
  1033. * rendering MenuItems of this Window that want to be checkmarked
  1034. * if this is equal to NULL, you'll get the default imagery
  1035. }
  1036. CheckMark : pImage;
  1037. Title : PChar; { the title text for this window }
  1038. { the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  1039. * want this Window to open in it. If so, you pass the Pointer of the
  1040. * Custom Screen structure in this variable. Otherwise, this variable
  1041. * is ignored and doesn't have to be initialized.
  1042. }
  1043. Screen : Pointer;
  1044. { SUPER_BITMAP Window? If so, put the Pointer of your BitMap structure
  1045. * in this variable. If not, this variable is ignored and doesn't have
  1046. * to be initialized
  1047. }
  1048. BitMap : pBitMap;
  1049. { the values describe the minimum and maximum sizes of your Windows.
  1050. * these matter only if you've chosen the WINDOWSIZING Gadget option,
  1051. * which means that you want to let the User to change the size of
  1052. * this Window. You describe the minimum and maximum sizes that the
  1053. * Window can grow by setting these variables. You can initialize
  1054. * any one these to zero, which will mean that you want to duplicate
  1055. * the setting for that dimension (if MinWidth == 0, MinWidth will be
  1056. * set to the opening Width of the Window).
  1057. * You can change these settings later using SetWindowLimits().
  1058. * If you haven't asked for a SIZING Gadget, you don't have to
  1059. * initialize any of these variables.
  1060. }
  1061. MinWidth,
  1062. MinHeight : smallint; { minimums }
  1063. MaxWidth,
  1064. MaxHeight : smallint; { maximums }
  1065. { the type variable describes the Screen in which you want this Window to
  1066. * open. The type value can either be CUSTOMSCREEN or one of the
  1067. * system standard Screen Types such as WBENCHSCREEN. See the
  1068. * type definitions under the Screen structure
  1069. }
  1070. WType : Word; { is "Type" in C includes }
  1071. end;
  1072. { The following structure is the future NewWindow. Compatibility
  1073. * issues require that the size of NewWindow not change.
  1074. * Data in the common part (NewWindow) indicates the the extension
  1075. * fields are being used.
  1076. * NOTE WELL: This structure may be subject to future extension.
  1077. * Writing code depending on its size is not allowed.
  1078. }
  1079. pExtNewWindow = ^tExtNewWindow;
  1080. tExtNewWindow = record
  1081. LeftEdge, TopEdge : smallint;
  1082. Width, Height : smallint;
  1083. DetailPen, BlockPen : Byte;
  1084. IDCMPFlags : Cardinal;
  1085. Flags : Cardinal;
  1086. FirstGadget : pGadget;
  1087. CheckMark : pImage;
  1088. Title : PChar;
  1089. WScreen : Pointer;
  1090. WBitMap : pBitMap;
  1091. MinWidth, MinHeight : smallint;
  1092. MaxWidth, MaxHeight : Word;
  1093. { the type variable describes the Screen in which you want this Window to
  1094. * open. The type value can either be CUSTOMSCREEN or one of the
  1095. * system standard Screen Types such as WBENCHSCREEN. See the
  1096. * type definitions under the Screen structure.
  1097. * A new possible value for this field is PUBLICSCREEN, which
  1098. * defines the window as a 'visitor' window. See below for
  1099. * additional information provided.
  1100. }
  1101. WType : Word;
  1102. { ------------------------------------------------------- *
  1103. * extensions for V36
  1104. * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  1105. * this field is assumed to point to an array ( or chain of arrays)
  1106. * of TagItem structures. See also ExtNewScreen for another
  1107. * use of TagItems to pass optional data.
  1108. *
  1109. * see below for tag values and the corresponding data.
  1110. }
  1111. Extension : pTagItem;
  1112. END;
  1113. {
  1114. * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  1115. * They are values in a TagItem array passed as extension/replacement
  1116. * values for the data in NewWindow. OpenWindowTagList() can actually
  1117. * work well with a NULL NewWindow pointer.
  1118. }
  1119. CONST
  1120. WA_Dummy = (TAG_USER + 99); { $80000063 }
  1121. { these tags simply override NewWindow parameters }
  1122. WA_Left = (WA_Dummy + $01);
  1123. WA_Top = (WA_Dummy + $02);
  1124. WA_Width = (WA_Dummy + $03);
  1125. WA_Height = (WA_Dummy + $04);
  1126. WA_DetailPen = (WA_Dummy + $05);
  1127. WA_BlockPen = (WA_Dummy + $06);
  1128. WA_IDCMP = (WA_Dummy + $07);
  1129. { "bulk" initialization of NewWindow.Flags }
  1130. WA_Flags = (WA_Dummy + $08);
  1131. WA_Gadgets = (WA_Dummy + $09);
  1132. WA_Checkmark = (WA_Dummy + $0A);
  1133. WA_Title = (WA_Dummy + $0B);
  1134. { means you don't have to call SetWindowTitles
  1135. * after you open your window
  1136. }
  1137. WA_ScreenTitle = (WA_Dummy + $0C);
  1138. WA_CustomScreen = (WA_Dummy + $0D);
  1139. WA_SuperBitMap = (WA_Dummy + $0E);
  1140. { also implies WFLG_SUPER_BITMAP property }
  1141. WA_MinWidth = (WA_Dummy + $0F);
  1142. WA_MinHeight = (WA_Dummy + $10);
  1143. WA_MaxWidth = (WA_Dummy + $11);
  1144. WA_MaxHeight = (WA_Dummy + $12);
  1145. { The following are specifications for new features }
  1146. WA_InnerWidth = (WA_Dummy + $13);
  1147. WA_InnerHeight = (WA_Dummy + $14);
  1148. { You can specify the dimensions of the interior
  1149. * region of your window, independent of what
  1150. * the border widths will be. You probably want
  1151. * to also specify WA_AutoAdjust to allow
  1152. * Intuition to move your window or even
  1153. * shrink it so that it is completely on screen.
  1154. }
  1155. WA_PubScreenName = (WA_Dummy + $15);
  1156. { declares that you want the window to open as
  1157. * a visitor on the public screen whose name is
  1158. * pointed to by (UBYTE *) ti_Data
  1159. }
  1160. WA_PubScreen = (WA_Dummy + $16);
  1161. { open as a visitor window on the public screen
  1162. * whose Pointer is in (struct Screen *) ti_Data.
  1163. * To ensure that this screen remains open, you
  1164. * should either be the screen's owner, have a
  1165. * window open on the screen, or use LockPubScreen().
  1166. }
  1167. WA_PubScreenFallBack = (WA_Dummy + $17);
  1168. { A Boolean, specifies whether a visitor window
  1169. * should "fall back" to the default public screen
  1170. * (or Workbench) if the named public screen isn't
  1171. * available
  1172. }
  1173. WA_WindowName = (WA_Dummy + $18);
  1174. { not implemented }
  1175. WA_Colors = (WA_Dummy + $19);
  1176. { a ColorSpec array for colors to be set
  1177. * when this window is active. This is not
  1178. * implemented, and may not be, since the default
  1179. * values to restore would be hard to track.
  1180. * We'd like to at least support per-window colors
  1181. * for the mouse pointer sprite.
  1182. }
  1183. WA_Zoom = (WA_Dummy + $1A);
  1184. { ti_Data points to an array of four WORD's,
  1185. * the initial Left/Top/Width/Height values of
  1186. * the "alternate" zoom position/dimensions.
  1187. * It also specifies that you want a Zoom gadget
  1188. * for your window, whether or not you have a
  1189. * sizing gadget.
  1190. }
  1191. WA_MouseQueue = (WA_Dummy + $1B);
  1192. { ti_Data contains initial value for the mouse
  1193. * message backlog limit for this window.
  1194. }
  1195. WA_BackFill = (WA_Dummy + $1C);
  1196. { unimplemented at present: provides a "backfill
  1197. * hook" for your window's layer.
  1198. }
  1199. WA_RptQueue = (WA_Dummy + $1D);
  1200. { initial value of repeat key backlog limit }
  1201. { These Boolean tag items are alternatives to the NewWindow.Flags
  1202. * boolean flags with similar names.
  1203. }
  1204. WA_SizeGadget = (WA_Dummy + $1E);
  1205. WA_DragBar = (WA_Dummy + $1F);
  1206. WA_DepthGadget = (WA_Dummy + $20);
  1207. WA_CloseGadget = (WA_Dummy + $21);
  1208. WA_Backdrop = (WA_Dummy + $22);
  1209. WA_ReportMouse = (WA_Dummy + $23);
  1210. WA_NoCareRefresh = (WA_Dummy + $24);
  1211. WA_Borderless = (WA_Dummy + $25);
  1212. WA_Activate = (WA_Dummy + $26);
  1213. WA_RMBTrap = (WA_Dummy + $27);
  1214. WA_WBenchWindow = (WA_Dummy + $28); { PRIVATE!! }
  1215. WA_SimpleRefresh = (WA_Dummy + $29);
  1216. { only specify if TRUE }
  1217. WA_SmartRefresh = (WA_Dummy + $2A);
  1218. { only specify if TRUE }
  1219. WA_SizeBRight = (WA_Dummy + $2B);
  1220. WA_SizeBBottom = (WA_Dummy + $2C);
  1221. { New Boolean properties }
  1222. WA_AutoAdjust = (WA_Dummy + $2D);
  1223. { shift or squeeze the window's position and
  1224. * dimensions to fit it on screen.
  1225. }
  1226. WA_GimmeZeroZero = (WA_Dummy + $2E);
  1227. { equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO }
  1228. { New for V37: WA_MenuHelp (ignored by V36) }
  1229. WA_MenuHelp = (WA_Dummy + $2F);
  1230. { Enables IDCMP_MENUHELP: Pressing HELP during menus
  1231. * will return IDCMP_MENUHELP message.
  1232. }
  1233. { New for V39: (ignored by V37 and earlier) }
  1234. WA_NewLookMenus = (WA_Dummy + $30);
  1235. { Set to TRUE if you want NewLook menus }
  1236. WA_AmigaKey = (WA_Dummy + $31);
  1237. { Pointer to image for Amiga-key equiv in menus }
  1238. WA_NotifyDepth = (WA_Dummy + $32);
  1239. { Requests IDCMP_CHANGEWINDOW message when
  1240. * window is depth arranged
  1241. * (imsg->Code = CWCODE_DEPTH)
  1242. }
  1243. { WA_Dummy + $33 is obsolete }
  1244. WA_Pointer = (WA_Dummy + $34);
  1245. { Allows you to specify a custom pointer
  1246. * for your window. ti_Data points to a
  1247. * pointer object you obtained via
  1248. * "pointerclass". NULL signifies the
  1249. * default pointer.
  1250. * This tag may be passed to OpenWindowTags()
  1251. * or SetWindowPointer().
  1252. }
  1253. WA_BusyPointer = (WA_Dummy + $35);
  1254. { ti_Data is boolean. Set to TRUE to
  1255. * request the standard busy pointer.
  1256. * This tag may be passed to OpenWindowTags()
  1257. * or SetWindowPointer().
  1258. }
  1259. WA_PointerDelay = (WA_Dummy + $36);
  1260. { ti_Data is boolean. Set to TRUE to
  1261. * request that the changing of the
  1262. * pointer be slightly delayed. The change
  1263. * will be called off if you call NewSetPointer()
  1264. * before the delay expires. This allows
  1265. * you to post a busy-pointer even if you think
  1266. * the busy-time may be very Word, without
  1267. * fear of a flashing pointer.
  1268. * This tag may be passed to OpenWindowTags()
  1269. * or SetWindowPointer().
  1270. }
  1271. WA_TabletMessages = (WA_Dummy + $37);
  1272. { ti_Data is a boolean. Set to TRUE to
  1273. * request that tablet information be included
  1274. * in IntuiMessages sent to your window.
  1275. * Requires that something (i.e. a tablet driver)
  1276. * feed IESUBCLASS_NEWTABLET InputEvents into
  1277. * the system. For a pointer to the TabletData,
  1278. * examine the ExtIntuiMessage->eim_TabletData
  1279. * field. It is UNSAFE to check this field
  1280. * when running on pre-V39 systems. It's always
  1281. * safe to check this field under V39 and up,
  1282. * though it may be NULL.
  1283. }
  1284. WA_HelpGroup = (WA_Dummy + $38);
  1285. { When the active window has gadget help enabled,
  1286. * other windows of the same HelpGroup number
  1287. * will also get GadgetHelp. This allows GadgetHelp
  1288. * to work for multi-windowed applications.
  1289. * Use GetGroupID() to get an ID number. Pass
  1290. * this number as ti_Data to all your windows.
  1291. * See also the HelpControl() function.
  1292. }
  1293. WA_HelpGroupWindow = (WA_Dummy + $39);
  1294. { When the active window has gadget help enabled,
  1295. * other windows of the same HelpGroup will also get
  1296. * GadgetHelp. This allows GadgetHelp to work
  1297. * for multi-windowed applications. As an alternative
  1298. * to WA_HelpGroup, you can pass a pointer to any
  1299. * other window of the same group to join its help
  1300. * group. Defaults to NULL, which has no effect.
  1301. * See also the HelpControl() function.
  1302. }
  1303. { HelpControl() flags:
  1304. *
  1305. * HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more
  1306. * windows.
  1307. }
  1308. HC_GADGETHELP = 1;
  1309. { ======================================================================== }
  1310. { === Remember =========================================================== }
  1311. { ======================================================================== }
  1312. { this structure is used for remembering what memory has been allocated to
  1313. * date by a given routine, so that a premature abort or systematic exit
  1314. * can deallocate memory cleanly, easily, and completely
  1315. }
  1316. Type
  1317. pRemember = ^tRemember;
  1318. tRemember = record
  1319. NextRemember : pRemember;
  1320. RememberSize : Cardinal;
  1321. Memory : Pointer;
  1322. end;
  1323. { === Color Spec ====================================================== }
  1324. { How to tell Intuition about RGB values for a color table entry. }
  1325. pColorSpec = ^tColorSpec;
  1326. tColorSpec = record
  1327. ColorIndex : smallint; { -1 terminates an array of ColorSpec }
  1328. Red : Word; { only the _bottom_ 4 bits recognized }
  1329. Green : Word; { only the _bottom_ 4 bits recognized }
  1330. Blue : Word; { only the _bottom_ 4 bits recognized }
  1331. END;
  1332. { === Easy Requester Specification ======================================= }
  1333. { see also autodocs for EasyRequest and BuildEasyRequest }
  1334. { NOTE: This structure may grow in size in the future }
  1335. pEasyStruct = ^tEasyStruct;
  1336. tEasyStruct = record
  1337. es_StructSize : Cardinal; { should be sizeof (struct EasyStruct )}
  1338. es_Flags : Cardinal; { should be 0 for now }
  1339. es_Title : PChar; { title of requester window }
  1340. es_TextFormat : PChar; { 'printf' style formatting string }
  1341. es_GadgetFormat : PChar; { 'printf' style formatting string }
  1342. END;
  1343. { ======================================================================== }
  1344. { === Miscellaneous ====================================================== }
  1345. { ======================================================================== }
  1346. CONST
  1347. { = MENU STUFF =========================================================== }
  1348. NOMENU = $001F;
  1349. NOITEM = $003F;
  1350. NOSUB = $001F;
  1351. MENUNULL = -1;
  1352. { = =RJ='s peculiarities ================================================= }
  1353. { these defines are for the COMMSEQ and CHECKIT menu stuff. If CHECKIT,
  1354. * I'll use a generic Width (for all resolutions) for the CheckMark.
  1355. * If COMMSEQ, likewise I'll use this generic stuff
  1356. }
  1357. CHECKWIDTH = 19;
  1358. COMMWIDTH = 27;
  1359. LOWCHECKWIDTH = 13;
  1360. LOWCOMMWIDTH = 16;
  1361. { these are the AlertNumber defines. if you are calling DisplayAlert()
  1362. * the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1363. * of these patterns
  1364. }
  1365. ALERT_TYPE = $80000000;
  1366. RECOVERY_ALERT = $00000000; { the system can recover from this }
  1367. DEADEND_ALERT = $80000000; { no recovery possible, this is it }
  1368. { When you're defining IntuiText for the Positive and Negative Gadgets
  1369. * created by a call to AutoRequest(), these defines will get you
  1370. * reasonable-looking text. The only field without a define is the IText
  1371. * field; you decide what text goes with the Gadget
  1372. }
  1373. AUTOFRONTPEN = 0;
  1374. AUTOBACKPEN = 1;
  1375. AUTODRAWMODE = JAM2;
  1376. AUTOLEFTEDGE = 6;
  1377. AUTOTOPEDGE = 3;
  1378. { -
  1379. AUTOITEXTFONT = Nil;
  1380. AUTONEXTTEXT = Nil;
  1381. - }
  1382. { --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- }
  1383. SELECTUP = IECODE_LBUTTON + IECODE_UP_PREFIX;
  1384. SELECTDOWN = IECODE_LBUTTON;
  1385. MENUUP = IECODE_RBUTTON + IECODE_UP_PREFIX;
  1386. MENUDOWN = IECODE_RBUTTON;
  1387. ALTLEFT = IEQUALIFIER_LALT;
  1388. ALTRIGHT = IEQUALIFIER_RALT;
  1389. AMIGALEFT = IEQUALIFIER_LCOMMAND;
  1390. AMIGARIGHT = IEQUALIFIER_RCOMMAND;
  1391. AMIGAKEYS = AMIGALEFT + AMIGARIGHT;
  1392. CURSORUP = $4C;
  1393. CURSORLEFT = $4F;
  1394. CURSORRIGHT = $4E;
  1395. CURSORDOWN = $4D;
  1396. KEYCODE_Q = $10;
  1397. KEYCODE_X = $32;
  1398. KEYCODE_N = $36;
  1399. KEYCODE_M = $37;
  1400. KEYCODE_V = $34;
  1401. KEYCODE_B = $35;
  1402. KEYCODE_LESS = $38;
  1403. KEYCODE_GREATER = $39;
  1404. { these are the display modes for which we have corresponding parameter
  1405. * settings in the config arrays
  1406. }
  1407. CONST
  1408. DMODECOUNT = $0002; { how many modes there are }
  1409. HIRESPICK = $0000;
  1410. LOWRESPICK = $0001;
  1411. EVENTMAX = 10; { size of event array }
  1412. { these are the system Gadget defines }
  1413. RESCOUNT = 2;
  1414. HIRESGADGET = 0;
  1415. LOWRESGADGET = 1;
  1416. GADGETCOUNT = 8;
  1417. UPFRONTGADGET = 0;
  1418. DOWNBACKGADGET = 1;
  1419. SIZEGADGET = 2;
  1420. CLOSEGADGET = 3;
  1421. DRAGGADGET = 4;
  1422. SUPFRONTGADGET = 5;
  1423. SDOWNBACKGADGET= 6;
  1424. SDRAGGADGET = 7;
  1425. { ======================================================================== }
  1426. { === DrawInfo ========================================================= }
  1427. { ======================================================================== }
  1428. { This is a packet of information for graphics rendering. It originates
  1429. * with a Screen, and is gotten using GetScreenDrawInfo( screen );
  1430. }
  1431. { If you find dri_Version >= DRI_VERSION, you know this structure
  1432. * has at least the fields defined in this version of the include file
  1433. }
  1434. CONST
  1435. RI_VERSION = (1); { obsolete, will be removed }
  1436. DRI_VERSION = (1);
  1437. Type
  1438. pDrawInfo = ^tDrawInfo;
  1439. tDrawInfo = record
  1440. dri_Version : Word; { will be DRI_VERSION }
  1441. dri_NumPens : Word; { guaranteed to be >= numDrIPens }
  1442. dri_Pens : Pointer; { pointer to pen array }
  1443. dri_Font : pTextFont; { screen default font }
  1444. dri_Depth : Word; { (initial) depth of screen bitmap }
  1445. dri_Resolution : record { from DisplayInfo database for initial display mode }
  1446. x : word;
  1447. y : word;
  1448. end;
  1449. dri_Flags : Cardinal; { defined below }
  1450. { New for V39: dri_CheckMark, dri_AmigaKey. }
  1451. dri_CheckMark : pImage; { ImagePtr } { pointer to scaled checkmark image
  1452. * Will be NULL if DRI_VERSION < 2
  1453. }
  1454. dri_AmigaKey : pImage; { ImagePtr } { pointer to scaled Amiga-key image
  1455. * Will be NULL if DRI_VERSION < 2
  1456. }
  1457. dri_Reserved : Array[0..4] of Cardinal; { avoid recompilation ;^) }
  1458. END;
  1459. CONST
  1460. DRIF_NEWLOOK = $00000001; { specified SA_Pens, full treatment }
  1461. { rendering pen number indexes into DrawInfo.dri_Pens[] }
  1462. DETAILPEN = ($0000); { compatible Intuition rendering pens }
  1463. BLOCKPEN = ($0001); { compatible Intuition rendering pens }
  1464. TEXTPEN = ($0002); { text on background }
  1465. SHINEPEN = ($0003); { bright edge on 3D objects }
  1466. SHADOWPEN = ($0004); { dark edge on 3D objects }
  1467. FILLPEN = ($0005); { active-window/selected-gadget fill }
  1468. FILLTEXTPEN = ($0006); { text over FILLPEN }
  1469. BACKGROUNDPEN = ($0007); { always color 0 }
  1470. HIGHLIGHTTEXTPEN = ($0008); { special color text, on background }
  1471. { New for V39, only present if DRI_VERSION >= 2: }
  1472. BARDETAILPEN = ($0009); { text/detail in screen-bar/menus }
  1473. BARBLOCKPEN = ($000A); { screen-bar/menus fill }
  1474. BARTRIMPEN = ($000B); { trim under screen-bar }
  1475. NUMDRIPENS = ($0009);
  1476. { New for V39: It is sometimes useful to specify that a pen value
  1477. * is to be the complement of color zero to three. The "magic" numbers
  1478. * serve that purpose:
  1479. }
  1480. PEN_C3 = $FEFC; { Complement of color 3 }
  1481. PEN_C2 = $FEFD; { Complement of color 2 }
  1482. PEN_C1 = $FEFE; { Complement of color 1 }
  1483. PEN_C0 = $FEFF; { Complement of color 0 }
  1484. { ======================================================================== }
  1485. { === Screen ============================================================= }
  1486. { ======================================================================== }
  1487. Type
  1488. pScreen = ^tScreen;
  1489. tScreen = record
  1490. NextScreen : pScreen; { linked list of screens }
  1491. FirstWindow : pWindow; { linked list Screen's Windows }
  1492. LeftEdge,
  1493. TopEdge : smallint; { parameters of the screen }
  1494. Width,
  1495. Height : smallint; { parameters of the screen }
  1496. MouseY,
  1497. MouseX : smallint; { position relative to upper-left }
  1498. Flags : Word; { see definitions below }
  1499. Title : PChar; { null-terminated Title text }
  1500. DefaultTitle : PChar; { for Windows without ScreenTitle }
  1501. { Bar sizes for this Screen and all Window's in this Screen }
  1502. BarHeight,
  1503. BarVBorder,
  1504. BarHBorder,
  1505. MenuVBorder,
  1506. MenuHBorder : Shortint;
  1507. WBorTop,
  1508. WBorLeft,
  1509. WBorRight,
  1510. WBorBottom : Shortint;
  1511. Font : pTextAttr; { this screen's default font }
  1512. { the display data structures for this Screen (note the prefix S)}
  1513. ViewPort : tViewPort; { describing the Screen's display }
  1514. RastPort : tRastPort; { describing Screen rendering }
  1515. BitMap : tBitMap; { extra copy of RastPort BitMap }
  1516. LayerInfo : tLayer_Info; { each screen gets a LayerInfo }
  1517. { You supply a linked-list of Gadgets for your Screen.
  1518. * This list DOES NOT include system Gadgets. You get the standard
  1519. * system Screen Gadgets by default
  1520. }
  1521. FirstGadget : pGadget;
  1522. DetailPen,
  1523. BlockPen : Byte; { for bar/border/gadget rendering }
  1524. { the following variable(s) are maintained by Intuition to support the
  1525. * DisplayBeep() color flashing technique
  1526. }
  1527. SaveColor0 : Word;
  1528. { This layer is for the Screen and Menu bars }
  1529. BarLayer : pLayer;
  1530. ExtData : Pointer;
  1531. UserData : Pointer;
  1532. { general-purpose pointer to User data extension }
  1533. {**** Data below this point are SYSTEM PRIVATE ****}
  1534. end;
  1535. Const
  1536. { The screen flags have the suffix "_f" added to avoid conflicts with
  1537. routine names. }
  1538. { --- FLAGS SET BY INTUITION --------------------------------------------- }
  1539. { The SCREENTYPE bits are reserved for describing various Screen types
  1540. * available under Intuition.
  1541. }
  1542. SCREENTYPE_f = $000F; { all the screens types available }
  1543. { --- the definitions for the Screen Type ------------------------------- }
  1544. WBENCHSCREEN_f = $0001; { Ta Da! The Workbench }
  1545. CUSTOMSCREEN_f = $000F; { for that special look }
  1546. SHOWTITLE_f = $0010; { this gets set by a call to ShowTitle() }
  1547. BEEPING_f = $0020; { set when Screen is beeping }
  1548. CUSTOMBITMAP_f = $0040; { if you are supplying your own BitMap }
  1549. SCREENBEHIND_f = $0080; { if you want your screen to open behind
  1550. * already open screens
  1551. }
  1552. SCREENQUIET_f = $0100; { if you do not want Intuition to render
  1553. * into your screen (gadgets, title) }
  1554. SCREENHIRES = $0200; { do no use lowres gadgets (private) }
  1555. NS_EXTENDED = $1000; { ExtNewScreen.Extension is valid }
  1556. { V36 applications can use OpenScreenTagList() instead of NS_EXTENDED }
  1557. { New for V39: }
  1558. PENSHARED = $0400; { Screen opener set (SA_SharePens,TRUE) }
  1559. AUTOSCROLL = $4000; { screen is to autoscoll }
  1560. STDSCREENHEIGHT = -1; { supply in NewScreen.Height }
  1561. STDSCREENWIDTH = -1; { supply in NewScreen.Width }
  1562. {
  1563. * Screen attribute tag ID's. These are used in the ti_Tag field of
  1564. * TagItem arrays passed to OpenScreenTagList() (or in the
  1565. * ExtNewScreen.Extension field).
  1566. }
  1567. { Screen attribute tags. Please use these versions, not those in
  1568. * iobsolete.h.
  1569. }
  1570. CONST
  1571. SA_Dummy = (TAG_USER + 32);
  1572. {
  1573. * these items specify items equivalent to fields in NewScreen
  1574. }
  1575. SA_Left = (SA_Dummy + $0001);
  1576. SA_Top = (SA_Dummy + $0002);
  1577. SA_Width = (SA_Dummy + $0003);
  1578. SA_Height = (SA_Dummy + $0004);
  1579. { traditional screen positions and dimensions }
  1580. SA_Depth = (SA_Dummy + $0005);
  1581. { screen bitmap depth }
  1582. SA_DetailPen= (SA_Dummy + $0006);
  1583. { serves as default for windows, too }
  1584. SA_BlockPen = (SA_Dummy + $0007);
  1585. SA_Title = (SA_Dummy + $0008);
  1586. { default screen title }
  1587. SA_Colors = (SA_Dummy + $0009);
  1588. { ti_Data is an array of struct ColorSpec,
  1589. * terminated by ColorIndex = -1. Specifies
  1590. * initial screen palette colors.
  1591. }
  1592. SA_ErrorCode= (SA_Dummy + $000A);
  1593. { ti_Data points to LONG error code (values below)}
  1594. SA_Font = (SA_Dummy + $000B);
  1595. { equiv. to NewScreen.Font }
  1596. SA_SysFont = (SA_Dummy + $000C);
  1597. { Selects one of the preferences system fonts:
  1598. * 0 - old DefaultFont, fixed-width
  1599. * 1 - WB Screen preferred font
  1600. }
  1601. SA_Type = (SA_Dummy + $000D);
  1602. { equiv. to NewScreen.Type }
  1603. SA_BitMap = (SA_Dummy + $000E);
  1604. { ti_Data is pointer to custom BitMap. This
  1605. * implies type of CUSTOMBITMAP
  1606. }
  1607. SA_PubName = (SA_Dummy + $000F);
  1608. { presence of this tag means that the screen
  1609. * is to be a public screen. Please specify
  1610. * BEFORE the two tags below
  1611. }
  1612. SA_PubSig = (SA_Dummy + $0010);
  1613. SA_PubTask = (SA_Dummy + $0011);
  1614. { Task ID and signal for being notified that
  1615. * the last window has closed on a public screen.
  1616. }
  1617. SA_DisplayID= (SA_Dummy + $0012);
  1618. { ti_Data is new extended display ID from
  1619. * <graphics/displayinfo.h>.
  1620. }
  1621. SA_DClip = (SA_Dummy + $0013);
  1622. { ti_Data points to a rectangle which defines
  1623. * screen display clip region
  1624. }
  1625. SA_Overscan = (SA_Dummy + $0014);
  1626. { was S_STDDCLIP. Set to one of the OSCAN_
  1627. * specifiers below to get a system standard
  1628. * overscan region for your display clip,
  1629. * screen dimensions (unless otherwise specified),
  1630. * and automatically centered position (partial
  1631. * support only so far).
  1632. * If you use this, you shouldn't specify
  1633. * SA_DClip. SA_Overscan is for "standard"
  1634. * overscan dimensions, SA_DClip is for
  1635. * your custom numeric specifications.
  1636. }
  1637. SA_Obsolete1= (SA_Dummy + $0015);
  1638. { obsolete S_MONITORNAME }
  1639. {* booleans *}
  1640. SA_ShowTitle = (SA_Dummy + $0016);
  1641. { boolean equivalent to flag SHOWTITLE }
  1642. SA_Behind = (SA_Dummy + $0017);
  1643. { boolean equivalent to flag SCREENBEHIND }
  1644. SA_Quiet = (SA_Dummy + $0018);
  1645. { boolean equivalent to flag SCREENQUIET }
  1646. SA_AutoScroll = (SA_Dummy + $0019);
  1647. { boolean equivalent to flag AUTOSCROLL }
  1648. SA_Pens = (SA_Dummy + $001A);
  1649. { pointer to ~0 terminated UWORD array, as
  1650. * found in struct DrawInfo
  1651. }
  1652. SA_FullPalette= (SA_Dummy + $001B);
  1653. { boolean: initialize color table to entire
  1654. * preferences palette (32 for V36), rather
  1655. * than compatible pens 0-3, 17-19, with
  1656. * remaining palette as returned by GetColorMap()
  1657. }
  1658. SA_ColorMapEntries = (SA_Dummy + $001C);
  1659. { New for V39:
  1660. * Allows you to override the number of entries
  1661. * in the ColorMap for your screen. Intuition
  1662. * normally allocates (1<<depth) or 32, whichever
  1663. * is more, but you may require even more if you
  1664. * use certain V39 graphics.library features
  1665. * (eg. palette-banking).
  1666. }
  1667. SA_Parent = (SA_Dummy + $001D);
  1668. { New for V39:
  1669. * ti_Data is a pointer to a "parent" screen to
  1670. * attach this one to. Attached screens slide
  1671. * and depth-arrange together.
  1672. }
  1673. SA_Draggable = (SA_Dummy + $001E);
  1674. { New for V39:
  1675. * Boolean tag allowing non-draggable screens.
  1676. * Do not use without good reason!
  1677. * (Defaults to TRUE).
  1678. }
  1679. SA_Exclusive = (SA_Dummy + $001F);
  1680. { New for V39:
  1681. * Boolean tag allowing screens that won't share
  1682. * the display. Use sparingly! Starting with 3.01,
  1683. * attached screens may be SA_Exclusive. Setting
  1684. * SA_Exclusive for each screen will produce an
  1685. * exclusive family. (Defaults to FALSE).
  1686. }
  1687. SA_SharePens = (SA_Dummy + $0020);
  1688. { New for V39:
  1689. * For those pens in the screen's DrawInfo->dri_Pens,
  1690. * Intuition obtains them in shared mode (see
  1691. * graphics.library/ObtainPen()). For compatibility,
  1692. * Intuition obtains the other pens of a public
  1693. * screen as PEN_EXCLUSIVE. Screens that wish to
  1694. * manage the pens themselves should generally set
  1695. * this tag to TRUE. This instructs Intuition to
  1696. * leave the other pens unallocated.
  1697. }
  1698. SA_BackFill = (SA_Dummy + $0021);
  1699. { New for V39:
  1700. * provides a "backfill hook" for your screen's
  1701. * Layer_Info.
  1702. * See layers.library/InstallLayerInfoHook()
  1703. }
  1704. SA_Interleaved = (SA_Dummy + $0022);
  1705. { New for V39:
  1706. * Boolean tag requesting that the bitmap
  1707. * allocated for you be interleaved.
  1708. * (Defaults to FALSE).
  1709. }
  1710. SA_Colors32 = (SA_Dummy + $0023);
  1711. { New for V39:
  1712. * Tag to set the screen's initial palette colors
  1713. * at 32 bits-per-gun. ti_Data is a pointer
  1714. * to a table to be passed to the
  1715. * graphics.library/LoadRGB32() function.
  1716. * This format supports both runs of color
  1717. * registers and sparse registers. See the
  1718. * autodoc for that function for full details.
  1719. * Any color set here has precedence over
  1720. * the same register set by SA_Colors.
  1721. }
  1722. SA_VideoControl = (SA_Dummy + $0024);
  1723. { New for V39:
  1724. * ti_Data is a pointer to a taglist that Intuition
  1725. * will pass to graphics.library/VideoControl(),
  1726. * upon opening the screen.
  1727. }
  1728. SA_FrontChild = (SA_Dummy + $0025);
  1729. { New for V39:
  1730. * ti_Data is a pointer to an already open screen
  1731. * that is to be the child of the screen being
  1732. * opened. The child screen will be moved to the
  1733. * front of its family.
  1734. }
  1735. SA_BackChild = (SA_Dummy + $0026);
  1736. { New for V39:
  1737. * ti_Data is a pointer to an already open screen
  1738. * that is to be the child of the screen being
  1739. * opened. The child screen will be moved to the
  1740. * back of its family.
  1741. }
  1742. SA_LikeWorkbench = (SA_Dummy + $0027);
  1743. { New for V39:
  1744. * Set ti_Data to 1 to request a screen which
  1745. * is just like the Workbench. This gives
  1746. * you the same screen mode, depth, size,
  1747. * colors, etc., as the Workbench screen.
  1748. }
  1749. SA_Reserved = (SA_Dummy + $0028);
  1750. { Reserved for private Intuition use }
  1751. SA_MinimizeISG = (SA_Dummy + $0029);
  1752. { New for V40:
  1753. * For compatibility, Intuition always ensures
  1754. * that the inter-screen gap is at least three
  1755. * non-interlaced lines. If your application
  1756. * would look best with the smallest possible
  1757. * inter-screen gap, set ti_Data to TRUE.
  1758. * If you use the new graphics VideoControl()
  1759. * VC_NoColorPaletteLoad tag for your screen's
  1760. * ViewPort, you should also set this tag.
  1761. }
  1762. { this is an obsolete tag included only for compatibility with V35
  1763. * interim release for the A2024 and Viking monitors
  1764. }
  1765. NSTAG_EXT_VPMODE = (TAG_USER + 1);
  1766. { OpenScreen error codes, which are returned in the (optional) LONG
  1767. * pointed to by ti_Data for the SA_ErrorCode tag item
  1768. }
  1769. OSERR_NOMONITOR = (1); { named monitor spec not available }
  1770. OSERR_NOCHIPS = (2); { you need newer custom chips }
  1771. OSERR_NOMEM = (3); { couldn't get normal memory }
  1772. OSERR_NOCHIPMEM = (4); { couldn't get chipmem }
  1773. OSERR_PUBNOTUNIQUE= (5); { public screen name already used }
  1774. OSERR_UNKNOWNMODE = (6); { don't recognize mode asked for }
  1775. { ======================================================================== }
  1776. { === NewScreen ========================================================== }
  1777. { ======================================================================== }
  1778. Type
  1779. pNewScreen = ^tNewScreen;
  1780. tNewScreen = record
  1781. LeftEdge,
  1782. TopEdge,
  1783. Width,
  1784. Height,
  1785. Depth : smallint; { screen dimensions }
  1786. DetailPen,
  1787. BlockPen : Byte; { for bar/border/gadget rendering }
  1788. ViewModes : Word; { the Modes for the ViewPort (and View) }
  1789. SType : Word; { the Screen type (see defines above) }
  1790. Font : pTextAttr; { this Screen's default text attributes }
  1791. DefaultTitle : PChar; { the default title for this Screen }
  1792. Gadgets : pGadget; { your own Gadgets for this Screen }
  1793. { if you are opening a CUSTOMSCREEN and already have a BitMap
  1794. * that you want used for your Screen, you set the flags CUSTOMBITMAP in
  1795. * the Type field and you set this variable to point to your BitMap
  1796. * structure. The structure will be copied into your Screen structure,
  1797. * after which you may discard your own BitMap if you want
  1798. }
  1799. CustomBitMap : pBitMap;
  1800. end;
  1801. type
  1802. pExtNewScreen = ^tExtNewScreen;
  1803. tExtNewScreen = record
  1804. LeftEdge, TopEdge, Width, Height, Depth : smallint;
  1805. DetailPen, BlockPen : Byte;
  1806. ViewModes : Word;
  1807. ens_Type : Word; { Type in C-Includes }
  1808. Font : pTextAttr;
  1809. DefaultTitle : PChar;
  1810. Gadgets : pGadget;
  1811. CustomBitMap : pBitMap;
  1812. Extension : pTagItem;
  1813. END;
  1814. CONST
  1815. { === Overscan Types === }
  1816. OSCAN_TEXT = (1); { entirely visible }
  1817. OSCAN_STANDARD = (2); { just past edges }
  1818. OSCAN_MAX = (3); { as much as possible }
  1819. OSCAN_VIDEO = (4); { even more than is possible }
  1820. { === Public Shared Screen Node === }
  1821. { This is the representative of a public shared screen.
  1822. * This is an internal data structure, but some functions may
  1823. * present a copy of it to the calling application. In that case,
  1824. * be aware that the screen pointer of the structure can NOT be
  1825. * used safely, since there is no guarantee that the referenced
  1826. * screen will remain open and a valid data structure.
  1827. *
  1828. * Never change one of these.
  1829. }
  1830. Type
  1831. pPubScreenNode = ^tPubScreenNode;
  1832. tPubScreenNode = record
  1833. psn_Node : tNode; { ln_Name is screen name }
  1834. psn_Screen : pScreen;
  1835. psn_Flags : Word; { below }
  1836. psn_Size : smallint; { includes name buffer }
  1837. psn_VisitorCount : smallint; { how many visitor windows }
  1838. psn_SigTask : pTask; { who to signal when visitors gone }
  1839. psn_SigBit : Byte; { which signal }
  1840. END;
  1841. CONST
  1842. PSNF_PRIVATE = ($0001);
  1843. MAXPUBSCREENNAME = (139); { names no longer, please }
  1844. { pub screen modes }
  1845. SHANGHAI = $0001; { put workbench windows on pub screen }
  1846. POPPUBSCREEN = $0002; { pop pub screen to front when visitor opens }
  1847. { New for V39: Intuition has new screen depth-arrangement and movement
  1848. * functions called ScreenDepth() and ScreenPosition() respectively.
  1849. * These functions permit the old behavior of ScreenToFront(),
  1850. * ScreenToBack(), and MoveScreen(). ScreenDepth() also allows
  1851. * independent depth control of attached screens. ScreenPosition()
  1852. * optionally allows positioning screens even though they were opened
  1853. * (SA_Draggable,FALSE).
  1854. }
  1855. { For ScreenDepth(), specify one of SDEPTH_TOFRONT or SDEPTH_TOBACK,
  1856. * and optionally also SDEPTH_INFAMILY.
  1857. *
  1858. * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  1859. * SDEPTH_INFAMILY. Commodities, "input helper" programs,
  1860. * or any other program that did not open a screen should never
  1861. * use that flag. (Note that this is a style-behavior
  1862. * requirement; there is no technical requirement that the
  1863. * task calling this function need be the task which opened
  1864. * the screen).
  1865. }
  1866. SDEPTH_TOFRONT = (0); { Bring screen to front }
  1867. SDEPTH_TOBACK = (1); { Send screen to back }
  1868. SDEPTH_INFAMILY = (2); { Move an attached screen with
  1869. * respect to other screens of
  1870. * its family
  1871. }
  1872. { Here's an obsolete name equivalent to SDEPTH_INFAMILY: }
  1873. SDEPTH_CHILDONLY = SDEPTH_INFAMILY;
  1874. { For ScreenPosition(), specify one of SPOS_RELATIVE, SPOS_ABSOLUTE,
  1875. * or SPOS_MAKEVISIBLE to describe the kind of screen positioning you
  1876. * wish to perform:
  1877. *
  1878. * SPOS_RELATIVE: The x1 and y1 parameters to ScreenPosition() describe
  1879. * the offset in coordinates you wish to move the screen by.
  1880. * SPOS_ABSOLUTE: The x1 and y1 parameters to ScreenPosition() describe
  1881. * the absolute coordinates you wish to move the screen to.
  1882. * SPOS_MAKEVISIBLE: (x1,y1)-(x2,y2) describes a rectangle on the
  1883. * screen which you would like autoscrolled into view.
  1884. *
  1885. * You may additionally set SPOS_FORCEDRAG along with any of the
  1886. * above. Set this if you wish to reposition an (SA_Draggable,FALSE)
  1887. * screen that you opened.
  1888. *
  1889. * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  1890. * SPOS_FORCEDRAG. Commodities, "input helper" programs,
  1891. * or any other program that did not open a screen should never
  1892. * use that flag.
  1893. }
  1894. SPOS_RELATIVE = (0); { Coordinates are relative }
  1895. SPOS_ABSOLUTE = (1); { Coordinates are expressed as
  1896. * absolutes, not relatives.
  1897. }
  1898. SPOS_MAKEVISIBLE = (2); { Coordinates describe a box on
  1899. * the screen you wish to be
  1900. * made visible by autoscrolling
  1901. }
  1902. SPOS_FORCEDRAG = (4); { Move non-draggable screen }
  1903. { New for V39: Intuition supports double-buffering in screens,
  1904. * with friendly interaction with menus and certain gadgets.
  1905. * For each buffer, you need to get one of these structures
  1906. * from the AllocScreenBuffer() call. Never allocate your
  1907. * own ScreenBuffer structures!
  1908. *
  1909. * The sb_DBufInfo field is for your use. See the graphics.library
  1910. * AllocDBufInfo() autodoc for details.
  1911. }
  1912. Type
  1913. pScreenBuffer = ^tScreenBuffer;
  1914. tScreenBuffer = record
  1915. sb_BitMap : pBitMap; { BitMap of this buffer }
  1916. sb_DBufInfo : pDBufInfo; { DBufInfo for this buffer }
  1917. end;
  1918. const
  1919. { These are the flags that may be passed to AllocScreenBuffer().
  1920. }
  1921. SB_SCREEN_BITMAP = 1;
  1922. SB_COPY_BITMAP = 2;
  1923. { ======================================================================== }
  1924. { === Preferences ======================================================== }
  1925. { ======================================================================== }
  1926. Const
  1927. { these are the definitions for the printer configurations }
  1928. FILENAME_SIZE = 30; { Filename size }
  1929. POINTERSIZE = (1 + 16 + 1) * 2; { Size of Pointer data buffer }
  1930. { These defines are for the default font size. These actually describe the
  1931. * height of the defaults fonts. The default font type is the topaz
  1932. * font, which is a fixed width font that can be used in either
  1933. * eighty-column or sixty-column mode. The Preferences structure reflects
  1934. * which is currently selected by the value found in the variable FontSize,
  1935. * which may have either of the values defined below. These values actually
  1936. * are used to select the height of the default font. By changing the
  1937. * height, the resolution of the font changes as well.
  1938. }
  1939. TOPAZ_EIGHTY = 8;
  1940. TOPAZ_SIXTY = 9;
  1941. Type
  1942. pPreferences = ^tPreferences;
  1943. tPreferences = record
  1944. { the default font height }
  1945. FontHeight : Shortint; { height for system default font }
  1946. { constant describing what's hooked up to the port }
  1947. PrinterPort : Byte; { printer port connection }
  1948. { the baud rate of the port }
  1949. BaudRate : Word; { baud rate for the serial port }
  1950. { various timing rates }
  1951. KeyRptSpeed : ttimeval; { repeat speed for keyboard }
  1952. KeyRptDelay : ttimeval; { Delay before keys repeat }
  1953. DoubleClick : ttimeval; { Interval allowed between clicks }
  1954. { Intuition Pointer data }
  1955. PointerMatrix : Array [0..POINTERSIZE-1] of Word;
  1956. { Definition of pointer sprite }
  1957. XOffset : Shortint; { X-Offset for active 'bit' }
  1958. YOffset : Shortint; { Y-Offset for active 'bit' }
  1959. color17 : Word; {*********************************}
  1960. color18 : Word; { Colours for sprite pointer }
  1961. color19 : Word; {*********************************}
  1962. PointerTicks : Word; { Sensitivity of the pointer }
  1963. { Workbench Screen colors }
  1964. color0 : Word; {*********************************}
  1965. color1 : Word; { Standard default colours }
  1966. color2 : Word; { Used in the Workbench }
  1967. color3 : Word; {*********************************}
  1968. { positioning data for the Intuition View }
  1969. ViewXOffset : Shortint; { Offset for top lefthand corner }
  1970. ViewYOffset : Shortint; { X and Y dimensions }
  1971. ViewInitX,
  1972. ViewInitY : smallint; { View initial offset values }
  1973. EnableCLI : Boolean; { CLI availability switch }
  1974. { printer configurations }
  1975. PrinterType : Word; { printer type }
  1976. PrinterFilename : Array [0..FILENAME_SIZE-1] of Char;
  1977. { file for printer }
  1978. { print format and quality configurations }
  1979. PrintPitch : Word; { print pitch }
  1980. PrintQuality : Word; { print quality }
  1981. PrintSpacing : Word; { number of lines per inch }
  1982. PrintLeftMargin : Word; { left margin in characters }
  1983. PrintRightMargin : Word; { right margin in characters }
  1984. PrintImage : Word; { positive or negative }
  1985. PrintAspect : Word; { horizontal or vertical }
  1986. PrintShade : Word; { b&w, half-tone, or color }
  1987. PrintThreshold : smallint; { darkness ctrl for b/w dumps }
  1988. { print paper descriptors }
  1989. PaperSize : Word; { paper size }
  1990. PaperLength : Word; { paper length in number of lines }
  1991. PaperType : Word; { continuous or single sheet }
  1992. { Serial device settings: These are six nibble-fields in three bytes }
  1993. { (these look a little strange so the defaults will map out to zero) }
  1994. SerRWBits : Byte;
  1995. { upper nibble = (8-number of read bits) }
  1996. { lower nibble = (8-number of write bits) }
  1997. SerStopBuf : Byte;
  1998. { upper nibble = (number of stop bits - 1) }
  1999. { lower nibble = (table value for BufSize) }
  2000. SerParShk : Byte;
  2001. { upper nibble = (value for Parity setting) }
  2002. { lower nibble = (value for Handshake mode) }
  2003. LaceWB : Byte; { if workbench is to be interlaced }
  2004. WorkName : Array [0..FILENAME_SIZE-1] of Char;
  2005. { temp file for printer }
  2006. RowSizeChange : Shortint;
  2007. ColumnSizeChange : Shortint;
  2008. PrintFlags : Word; { user preference flags }
  2009. PrintMaxWidth : Word; { max width of printed picture in 10ths/inch }
  2010. PrintMaxHeight : Word; { max height of printed picture in 10ths/inch }
  2011. PrintDensity : Byte; { print density }
  2012. PrintXOffset : Byte; { offset of printed picture in 10ths/inch }
  2013. wb_Width : Word; { override default workbench width }
  2014. wb_Height : Word; { override default workbench height }
  2015. wb_Depth : Byte; { override default workbench depth }
  2016. ext_size : Byte; { extension information -- do not touch! }
  2017. { extension size in blocks of 64 bytes }
  2018. end;
  2019. Const
  2020. { Workbench Interlace (use one bit) }
  2021. LACEWB = $01;
  2022. LW_RESERVED = 1; { internal use only }
  2023. { PrinterPort }
  2024. PARALLEL_PRINTER = $00;
  2025. SERIAL_PRINTER = $01;
  2026. { BaudRate }
  2027. BAUD_110 = $00;
  2028. BAUD_300 = $01;
  2029. BAUD_1200 = $02;
  2030. BAUD_2400 = $03;
  2031. BAUD_4800 = $04;
  2032. BAUD_9600 = $05;
  2033. BAUD_19200 = $06;
  2034. BAUD_MIDI = $07;
  2035. { PaperType }
  2036. FANFOLD = $00;
  2037. SINGLE = $80;
  2038. { PrintPitch }
  2039. PICA = $000;
  2040. ELITE = $400;
  2041. FINE = $800;
  2042. { PrintQuality }
  2043. DRAFT = $000;
  2044. LETTER = $100;
  2045. { PrintSpacing }
  2046. SIX_LPI = $000;
  2047. EIGHT_LPI = $200;
  2048. { Print Image }
  2049. IMAGE_POSITIVE = $00;
  2050. IMAGE_NEGATIVE = $01;
  2051. { PrintAspect }
  2052. ASPECT_HORIZ = $00;
  2053. ASPECT_VERT = $01;
  2054. { PrintShade }
  2055. SHADE_BW = $00;
  2056. SHADE_GREYSCALE = $01;
  2057. SHADE_COLOR = $02;
  2058. { PaperSize }
  2059. US_LETTER = $00;
  2060. US_LEGAL = $10;
  2061. N_TRACTOR = $20;
  2062. W_TRACTOR = $30;
  2063. CUSTOM_PAPER = $40;
  2064. { New PaperSizes for V36: }
  2065. EURO_A0 = $50; { European size A0: 841 x 1189 }
  2066. EURO_A1 = $60; { European size A1: 594 x 841 }
  2067. EURO_A2 = $70; { European size A2: 420 x 594 }
  2068. EURO_A3 = $80; { European size A3: 297 x 420 }
  2069. EURO_A4 = $90; { European size A4: 210 x 297 }
  2070. EURO_A5 = $A0; { European size A5: 148 x 210 }
  2071. EURO_A6 = $B0; { European size A6: 105 x 148 }
  2072. EURO_A7 = $C0; { European size A7: 74 x 105 }
  2073. EURO_A8 = $D0; { European size A8: 52 x 74 }
  2074. { PrinterType }
  2075. CUSTOM_NAME = $00;
  2076. ALPHA_P_101 = $01;
  2077. BROTHER_15XL = $02;
  2078. CBM_MPS1000 = $03;
  2079. DIAB_630 = $04;
  2080. DIAB_ADV_D25 = $05;
  2081. DIAB_C_150 = $06;
  2082. EPSON = $07;
  2083. EPSON_JX_80 = $08;
  2084. OKIMATE_20 = $09;
  2085. QUME_LP_20 = $0A;
  2086. { new printer entries, 3 October 1985 }
  2087. HP_LASERJET = $0B;
  2088. HP_LASERJET_PLUS = $0C;
  2089. { Serial Input Buffer Sizes }
  2090. SBUF_512 = $00;
  2091. SBUF_1024 = $01;
  2092. SBUF_2048 = $02;
  2093. SBUF_4096 = $03;
  2094. SBUF_8000 = $04;
  2095. SBUF_16000 = $05;
  2096. { Serial Bit Masks }
  2097. SREAD_BITS = $F0; { for SerRWBits }
  2098. SWRITE_BITS = $0F;
  2099. SSTOP_BITS = $F0; { for SerStopBuf }
  2100. SBUFSIZE_BITS = $0F;
  2101. SPARITY_BITS = $F0; { for SerParShk }
  2102. SHSHAKE_BITS = $0F;
  2103. { Serial Parity (upper nibble, after being shifted by
  2104. * macro SPARNUM() )
  2105. }
  2106. SPARITY_NONE = 0;
  2107. SPARITY_EVEN = 1;
  2108. SPARITY_ODD = 2;
  2109. { Serial Handshake Mode (lower nibble, after masking using
  2110. * macro SHANKNUM() )
  2111. }
  2112. SHSHAKE_XON = 0;
  2113. SHSHAKE_RTS = 1;
  2114. SHSHAKE_NONE = 2;
  2115. { new defines for PrintFlags }
  2116. CORRECT_RED = $0001; { color correct red shades }
  2117. CORRECT_GREEN = $0002; { color correct green shades }
  2118. CORRECT_BLUE = $0004; { color correct blue shades }
  2119. CENTER_IMAGE = $0008; { center image on paper }
  2120. IGNORE_DIMENSIONS = $0000; { ignore max width/height settings }
  2121. BOUNDED_DIMENSIONS = $0010; { use max width/height as boundaries }
  2122. ABSOLUTE_DIMENSIONS = $0020; { use max width/height as absolutes }
  2123. PIXEL_DIMENSIONS = $0040; { use max width/height as prt pixels }
  2124. MULTIPLY_DIMENSIONS = $0080; { use max width/height as multipliers }
  2125. INTEGER_SCALING = $0100; { force integer scaling }
  2126. ORDERED_DITHERING = $0000; { ordered dithering }
  2127. HALFTONE_DITHERING = $0200; { halftone dithering }
  2128. FLOYD_DITHERING = $0400; { Floyd-Steinberg dithering }
  2129. ANTI_ALIAS = $0800; { anti-alias image }
  2130. GREY_SCALE2 = $1000; { for use with hi-res monitor }
  2131. { masks used for checking bits }
  2132. CORRECT_RGB_MASK = CORRECT_RED + CORRECT_GREEN + CORRECT_BLUE;
  2133. DIMENSIONS_MASK = BOUNDED_DIMENSIONS + ABSOLUTE_DIMENSIONS +
  2134. PIXEL_DIMENSIONS + MULTIPLY_DIMENSIONS;
  2135. DITHERING_MASK = HALFTONE_DITHERING + FLOYD_DITHERING;
  2136. { ======================================================================== }
  2137. { === IntuitionBase ====================================================== }
  2138. { ======================================================================== }
  2139. {
  2140. * Be sure to protect yourself against someone modifying these data as
  2141. * you look at them. This is done by calling:
  2142. *
  2143. * lock = LockIBase(0), which returns an Integer. When done call
  2144. * UnlockIBase(lock) where lock is what LockIBase() returned.
  2145. }
  2146. Type
  2147. pIntuitionBase = ^tIntuitionBase;
  2148. tIntuitionBase = record
  2149. { IntuitionBase should never be directly modified by programs }
  2150. { even a little bit, guys/gals; do you hear me? }
  2151. LibNode : tLibrary;
  2152. ViewLord : tView;
  2153. ActiveWindow : pWindow;
  2154. ActiveScreen : pScreen;
  2155. { the FirstScreen variable points to the frontmost Screen. Screens are
  2156. * then maintained in a front to back order using Screen.NextScreen
  2157. }
  2158. FirstScreen : pScreen; { for linked list of all screens }
  2159. Flags : Cardinal; { see definitions below }
  2160. MouseY,
  2161. MouseX : smallint; { mouse position relative to View }
  2162. Seconds : Cardinal; { timestamp of most current input event }
  2163. Micros : Cardinal; { timestamp of most current input event }
  2164. { I told you this was private.
  2165. * The data beyond this point has changed, is changing, and
  2166. * will continue to change.
  2167. }
  2168. end;
  2169. {
  2170. * Package of information passed to custom and 'boopsi'
  2171. * gadget 'hook' functions. This structure is READ ONLY.
  2172. }
  2173. Type
  2174. pGadgetInfo = ^tGadgetInfo;
  2175. tGadgetInfo = record
  2176. gi_Screen : pScreen; { ScreenPtr }
  2177. gi_Window : pWindow; { null for screen gadgets } { WindowPtr }
  2178. gi_Requester : pRequester; { null IF not GTYP_REQGADGET } { RequesterPtr }
  2179. { rendering information:
  2180. * don't use these without cloning/locking.
  2181. * Official way is to call ObtainRPort()
  2182. }
  2183. gi_RastPort : pRastPort; { RastPortPtr }
  2184. gi_Layer : pLayer; { LayerPtr }
  2185. { copy of dimensions of screen/window/g00/req(/group)
  2186. * that gadget resides in. Left/Top of this box is
  2187. * offset from window mouse coordinates to gadget coordinates
  2188. * screen gadgets: 0,0 (from screen coords)
  2189. * window gadgets (no g00): 0,0
  2190. * GTYP_GZZGADGETs (borderlayer): 0,0
  2191. * GZZ innerlayer gadget: borderleft, bordertop
  2192. * Requester gadgets: reqleft, reqtop
  2193. }
  2194. gi_Domain : tIBox;
  2195. gi_Pens : record
  2196. DetailPen : Byte;
  2197. BlockPen : Byte;
  2198. end;
  2199. { the Detail and Block pens in gi_DrInfo->dri_Pens[] are
  2200. * for the screen. Use the above for window-sensitive
  2201. * colors.
  2202. }
  2203. gi_DrInfo : pDrawInfo; { DrawInfoPtr }
  2204. { reserved space: this structure is extensible
  2205. * anyway, but using these saves some recompilation
  2206. }
  2207. gi_Reserved : Array[0..5] of Cardinal;
  2208. END;
  2209. {** system private data structure for now **}
  2210. { prop gadget extra info }
  2211. pPGX = ^tPGX;
  2212. tPGX = record
  2213. pgx_Container : tIBox;
  2214. pgx_NewKnob : tIBox;
  2215. END;
  2216. { this casts MutualExclude for easy assignment of a hook
  2217. * pointer to the unused MutualExclude field of a custom gadget
  2218. }
  2219. {** User visible handles on objects, classes, messages **}
  2220. Type
  2221. Object_ = Cardinal;
  2222. pObject_ = ^Object_;
  2223. ClassID = ^Byte;
  2224. {
  2225. you can use this type to point to a 'generic' message,
  2226. * in the object-oriented programming parlance. Based on
  2227. * the value of 'MethodID', you dispatch to processing
  2228. * for the various message types. The meaningful parameter
  2229. * packet structure definitions are defined below.
  2230. typedef struct
  2231. Cardinal MethodID;
  2232. method-specific data follows, some examples below
  2233. *Msg; }
  2234. pMsg = ^tMsg;
  2235. tMsg = record
  2236. MethodID : Cardinal;
  2237. end;
  2238. {
  2239. * Class id strings for Intuition classes.
  2240. * There's no real reason to use the uppercase constants
  2241. * over the lowercase strings, but this makes a good place
  2242. * to list the names of the built-in classes.
  2243. }
  2244. CONST
  2245. ROOTCLASS : PChar = 'rootclass' ; { classusr.h }
  2246. IMAGECLASS : PChar = 'imageclass' ; { imageclass.h }
  2247. FRAMEICLASS : PChar = 'frameiclass' ;
  2248. SYSICLASS : PChar = 'sysiclass' ;
  2249. FILLRECTCLASS : PChar = 'fillrectclass';
  2250. GADGETCLASS : PChar = 'gadgetclass' ; { gadgetclass.h }
  2251. PROPGCLASS : PChar = 'propgclass' ;
  2252. STRGCLASS : PChar = 'strgclass' ;
  2253. BUTTONGCLASS : PChar = 'buttongclass' ;
  2254. FRBUTTONCLASS : PChar = 'frbuttonclass';
  2255. GROUPGCLASS : PChar = 'groupgclass' ;
  2256. ICCLASS : PChar = 'icclass' ; { icclass.h }
  2257. MODELCLASS : PChar = 'modelclass' ;
  2258. ITEXTICLASS : PChar = 'itexticlass' ;
  2259. POINTERCLASS : PChar = 'pointerclass' ; { pointerclass.h }
  2260. { Dispatched method ID's
  2261. * NOTE: Applications should use Intuition entry points, not direct
  2262. * DoMethod() calls, for NewObject, DisposeObject, SetAttrs,
  2263. * SetGadgetAttrs, and GetAttr.
  2264. }
  2265. OM_Dummy = ($100);
  2266. OM_NEW = ($101); { 'object' parameter is 'true class' }
  2267. OM_DISPOSE = ($102); { delete self (no parameters) }
  2268. OM_SET = ($103); { set attributes (in tag list) }
  2269. OM_GET = ($104); { return single attribute value }
  2270. OM_ADDTAIL = ($105); { add self to a List (let root do it) }
  2271. OM_REMOVE = ($106); { remove self from list }
  2272. OM_NOTIFY = ($107); { send to self: notify dependents }
  2273. OM_UPDATE = ($108); { notification message from somebody }
  2274. OM_ADDMEMBER = ($109); { used by various classes with lists }
  2275. OM_REMMEMBER = ($10A); { used by various classes with lists }
  2276. { Parameter 'Messages' passed to methods }
  2277. { OM_NEW and OM_SET }
  2278. Type
  2279. popSet = ^topSet;
  2280. topSet = record
  2281. MethodID : Cardinal;
  2282. ops_AttrList : pTagItem; { new attributes }
  2283. ops_GInfo : pGadgetInfo; { always there for gadgets,
  2284. * when SetGadgetAttrs() is used,
  2285. * but will be NULL for OM_NEW
  2286. }
  2287. END;
  2288. { OM_NOTIFY, and OM_UPDATE }
  2289. popUpdate = ^topUpdate;
  2290. topUpdate = record
  2291. MethodID : Cardinal;
  2292. opu_AttrList : pTagItem; { new attributes }
  2293. opu_GInfo : pGadgetInfo; { non-NULL when SetGadgetAttrs OR
  2294. * notification resulting from gadget
  2295. * input occurs.
  2296. }
  2297. opu_Flags : Cardinal; { defined below }
  2298. END;
  2299. { this flag means that the update message is being issued from
  2300. * something like an active gadget, a la GACT_FOLLOWMOUSE. When
  2301. * the gadget goes inactive, it will issue a final update
  2302. * message with this bit cleared. Examples of use are for
  2303. * GACT_FOLLOWMOUSE equivalents for propgadclass, and repeat strobes
  2304. * for buttons.
  2305. }
  2306. CONST
  2307. OPUF_INTERIM = 1;
  2308. { OM_GET }
  2309. Type
  2310. popGet = ^topGet;
  2311. topGet = record
  2312. MethodID,
  2313. opg_AttrID : Cardinal;
  2314. opg_Storage : Pointer; { may be other types, but 'int'
  2315. * types are all Cardinal
  2316. }
  2317. END;
  2318. { OM_ADDTAIL }
  2319. popAddTail = ^topAddTail;
  2320. topAddTail = record
  2321. MethodID : Cardinal;
  2322. opat_List : pList;
  2323. END;
  2324. { OM_ADDMEMBER, OM_REMMEMBER }
  2325. Type
  2326. popMember = ^topMember;
  2327. topMember = record
  2328. MethodID : Cardinal;
  2329. opam_Object : pObject_;
  2330. END;
  2331. {*****************************************}
  2332. {** 'White box' access to struct IClass **}
  2333. {*****************************************}
  2334. { This structure is READ-ONLY, and allocated only by Intuition }
  2335. TYPE
  2336. pIClass = ^tIClass;
  2337. tIClass = record
  2338. cl_Dispatcher : tHook;
  2339. cl_Reserved : Cardinal; { must be 0 }
  2340. cl_Super : pIClass;
  2341. cl_ID : ClassID;
  2342. { where within an object is the instance data for this class? }
  2343. cl_InstOffset : Word;
  2344. cl_InstSize : Word;
  2345. cl_UserData : Cardinal; { per-class data of your choice }
  2346. cl_SubclassCount : Cardinal;
  2347. { how many direct subclasses? }
  2348. cl_ObjectCount : Cardinal;
  2349. { how many objects created of this class? }
  2350. cl_Flags : Cardinal;
  2351. END;
  2352. CONST
  2353. CLF_INLIST = $00000001; { class is in public class list }
  2354. {************************************************}
  2355. {** 'White box' access to struct _Object **}
  2356. {************************************************}
  2357. {
  2358. * We have this, the instance data of the root class, PRECEDING
  2359. * the 'object'. This is so that Gadget objects are Gadget pointers,
  2360. * and so on. If this structure grows, it will always have o_Class
  2361. * at the end, so the macro OCLASS(o) will always have the same
  2362. * offset back from the pointer returned from NewObject().
  2363. *
  2364. * This data structure is subject to change. Do not use the o_Node
  2365. * embedded structure.
  2366. }
  2367. Type
  2368. p_Object = ^t_Object;
  2369. t_Object = record
  2370. o_Node : tMinNode;
  2371. o_Class : pIClass;
  2372. END;
  2373. { BOOPSI class libraries should use this structure as the base for their
  2374. * library data. This allows developers to obtain the class pointer for
  2375. * performing object-less inquiries. }
  2376. PClassLibrary = ^tClassLibrary;
  2377. tClassLibrary = record
  2378. cl_Lib : tLibrary; { Embedded library }
  2379. cl_Pad : Word; { Align the structure }
  2380. cl_Class : PIClass; { Class pointer }
  2381. end;
  2382. {
  2383. * NOTE: <intuition/iobsolete.h> is included at the END of this file!
  2384. }
  2385. { Gadget Class attributes }
  2386. CONST
  2387. GA_Dummy = (TAG_USER +$30000);
  2388. { (LONG) Left edge of the gadget relative to the left edge of
  2389. * the window }
  2390. GA_Left = (GA_Dummy + $0001);
  2391. { (LONG) Left edge of the gadget relative to the right edge of
  2392. * the window }
  2393. GA_RelRight = (GA_Dummy + $0002);
  2394. { (LONG) Top edge of the gadget relative to the top edge of
  2395. * the window }
  2396. GA_Top = (GA_Dummy + $0003);
  2397. { (LONG) Top edge of the gadget relative to the bottom edge
  2398. * of the window }
  2399. GA_RelBottom = (GA_Dummy + $0004);
  2400. { (LONG) Width of the gadget }
  2401. GA_Width = (GA_Dummy + $0005);
  2402. { (LONG) Width of the gadget relative to the width of the
  2403. * window }
  2404. GA_RelWidth = (GA_Dummy + $0006);
  2405. { (LONG) Height of the gadget }
  2406. GA_Height = (GA_Dummy + $0007);
  2407. { (LONG) Height of the gadget relative to the height of
  2408. * the window }
  2409. GA_RelHeight = (GA_Dummy + $0008);
  2410. { (PChar) Gadget imagry is NULL terminated string }
  2411. GA_Text = (GA_Dummy + $0009); { ti_Data is (UBYTE *) }
  2412. { (struct Image *) Gadget imagry is an image }
  2413. GA_Image = (GA_Dummy + $000A);
  2414. { (struct Border *) Gadget imagry is a border }
  2415. GA_Border = (GA_Dummy + $000B);
  2416. { (struct Image *) Selected gadget imagry }
  2417. GA_SelectRender = (GA_Dummy + $000C);
  2418. { (UWORD) One of GFLG_GADGHNONE, GFLG_GADGHBOX, GFLG_GADGHCOMP,
  2419. * or GFLG_GADGHIMAGE }
  2420. GA_Highlight = (GA_Dummy + $000D);
  2421. { (BOOL) Indicate whether gadget is disabled or not.
  2422. * Defaults to FALSE. }
  2423. GA_Disabled = (GA_Dummy + $000E);
  2424. { (BOOL) Indicate whether the gadget is for
  2425. * WFLG_GIMMEZEROZERO window borders or not. Defaults
  2426. * to FALSE. }
  2427. GA_GZZGadget = (GA_Dummy + $000F);
  2428. { (UWORD) Gadget ID assigned by the application }
  2429. GA_ID = (GA_Dummy + $0010);
  2430. { (APTR) Application specific data }
  2431. GA_UserData = (GA_Dummy + $0011);
  2432. { (APTR) Gadget specific data }
  2433. GA_SpecialInfo = (GA_Dummy + $0012);
  2434. { (BOOL) Indicate whether the gadget is selected or not.
  2435. * Defaults to FALSE }
  2436. GA_Selected = (GA_Dummy + $0013);
  2437. { (BOOL) When set tells the system that when this gadget
  2438. * is selected causes the requester that it is in to be
  2439. * ended. Defaults to FALSE. }
  2440. GA_EndGadget = (GA_Dummy + $0014);
  2441. { (BOOL) When set indicates that the gadget is to
  2442. * notify the application when it becomes active. Defaults
  2443. * to FALSE. }
  2444. GA_Immediate = (GA_Dummy + $0015);
  2445. { (BOOL) When set indicates that the application wants to
  2446. * verify that the pointer was still over the gadget when
  2447. * the select button is released. Defaults to FALSE. }
  2448. GA_RelVerify = (GA_Dummy + $0016);
  2449. { (BOOL) When set indicates that the application wants to
  2450. * be notified of mouse movements while the gadget is active.
  2451. * It is recommmended that GA_Immediate and GA_RelVerify are
  2452. * also used so that the active gadget can be tracked by the
  2453. * application. Defaults to FALSE. }
  2454. GA_FollowMouse = (GA_Dummy + $0017);
  2455. { (BOOL) Indicate whether the gadget is in the right border
  2456. * or not. Defaults to FALSE. }
  2457. GA_RightBorder = (GA_Dummy + $0018);
  2458. { (BOOL) Indicate whether the gadget is in the left border
  2459. * or not. Defaults to FALSE. }
  2460. GA_LeftBorder = (GA_Dummy + $0019);
  2461. { (BOOL) Indicate whether the gadget is in the top border
  2462. * or not. Defaults to FALSE. }
  2463. GA_TopBorder = (GA_Dummy + $001A);
  2464. { (BOOL) Indicate whether the gadget is in the bottom border
  2465. * or not. Defaults to FALSE. }
  2466. GA_BottomBorder = (GA_Dummy + $001B);
  2467. { (BOOL) Indicate whether the gadget is toggle-selected
  2468. * or not. Defaults to FALSE. }
  2469. GA_ToggleSelect = (GA_Dummy + $001C);
  2470. { (BOOL) Reserved for system use to indicate that the
  2471. * gadget belongs to the system. Defaults to FALSE. }
  2472. GA_SysGadget = (GA_Dummy + $001D);
  2473. { (UWORD) Reserved for system use to indicate the
  2474. * gadget type. }
  2475. GA_SysGType = (GA_Dummy + $001E);
  2476. { (struct Gadget *) Previous gadget in the linked list.
  2477. * NOTE: This attribute CANNOT be used to link new gadgets
  2478. * into the gadget list of an open window or requester.
  2479. * You must use AddGList(). }
  2480. GA_Previous = (GA_Dummy + $001F);
  2481. { (struct Gadget *) Next gadget in the linked list. }
  2482. GA_Next = (GA_Dummy + $0020);
  2483. { (struct DrawInfo *) Some gadgets need a DrawInfo at creation time }
  2484. GA_DrawInfo = (GA_Dummy + $0021);
  2485. { You should use at most ONE of GA_Text, GA_IntuiText, and GA_LabelImage }
  2486. { (struct IntuiText *) Label is an IntuiText. }
  2487. GA_IntuiText = (GA_Dummy + $0022);
  2488. { (Object *) Label is an image object. }
  2489. GA_LabelImage = (GA_Dummy + $0023);
  2490. { New for V37:
  2491. * Boolean indicates that this gadget is to participate in
  2492. * cycling activation with Tab or Shift-Tab.
  2493. }
  2494. GA_TabCycle = (GA_Dummy + $0024);
  2495. { New for V39:
  2496. * Boolean indicates that this gadget sends gadget-help
  2497. }
  2498. GA_GadgetHelp = (GA_Dummy + $0025);
  2499. { New for V39:
  2500. * ti_Data is a pointer to an IBox structure which is
  2501. * to be copied into the extended gadget's bounds.
  2502. }
  2503. GA_Bounds = (GA_Dummy + $0026);
  2504. { New for V39:
  2505. * Boolean indicates that this gadget has the "special relativity"
  2506. * property, which is useful for certain fancy relativity
  2507. * operations through the GM_LAYOUT method.
  2508. }
  2509. GA_RelSpecial = (GA_Dummy + $0027);
  2510. GA_TextAttr = GA_Dummy + 40;
  2511. { (struct TextAttr ) Indicate the font to use for the gadget.
  2512. New for V42. }
  2513. GA_ReadOnly = GA_Dummy + 41;
  2514. { (BOOL) Indicate that the gadget is read-only (non-selectable).
  2515. Defaults to FALSE. New for V42. }
  2516. GA_Underscore = GA_Dummy + 42;
  2517. { (UBYTE) Underscore/escape character for keyboard shortcuts.
  2518. Defaults to '_' . New for V44. }
  2519. GA_ActivateKey = GA_Dummy + 43;
  2520. { (PChar) Set/Get the gadgets shortcut/activation key(s)
  2521. Defaults to NULL. New for V44. }
  2522. GA_BackFill = GA_Dummy + 44;
  2523. { (struct Hook ) Backfill pattern hook.
  2524. Defaults to NULL. New for V44. }
  2525. GA_GadgetHelpText = GA_Dummy + 45;
  2526. { (PChar) RESERVERD/PRIVATE DO NOT USE
  2527. Defaults to NULL. New for V44. }
  2528. GA_UserInput = GA_Dummy + 46;
  2529. { (BOOL) Notification tag indicates this notification is from the activite
  2530. gadget receiving user input - an attempt to make IDCMPUPDATE more efficient.
  2531. Defaults to FALSE. New for V44. }
  2532. { PROPGCLASS attributes }
  2533. PGA_Dummy = (TAG_USER + $31000);
  2534. PGA_Freedom = (PGA_Dummy + $0001);
  2535. { only one of FREEVERT or FREEHORIZ }
  2536. PGA_Borderless = (PGA_Dummy + $0002);
  2537. PGA_HorizPot = (PGA_Dummy + $0003);
  2538. PGA_HorizBody = (PGA_Dummy + $0004);
  2539. PGA_VertPot = (PGA_Dummy + $0005);
  2540. PGA_VertBody = (PGA_Dummy + $0006);
  2541. PGA_Total = (PGA_Dummy + $0007);
  2542. PGA_Visible = (PGA_Dummy + $0008);
  2543. PGA_Top = (PGA_Dummy + $0009);
  2544. { New for V37: }
  2545. PGA_NewLook = (PGA_Dummy + $000A);
  2546. { STRGCLASS attributes }
  2547. STRINGA_Dummy = (TAG_USER +$32000);
  2548. STRINGA_MaxChars = (STRINGA_Dummy + $0001);
  2549. STRINGA_Buffer = (STRINGA_Dummy + $0002);
  2550. STRINGA_UndoBuffer = (STRINGA_Dummy + $0003);
  2551. STRINGA_WorkBuffer = (STRINGA_Dummy + $0004);
  2552. STRINGA_BufferPos = (STRINGA_Dummy + $0005);
  2553. STRINGA_DispPos = (STRINGA_Dummy + $0006);
  2554. STRINGA_AltKeyMap = (STRINGA_Dummy + $0007);
  2555. STRINGA_Font = (STRINGA_Dummy + $0008);
  2556. STRINGA_Pens = (STRINGA_Dummy + $0009);
  2557. STRINGA_ActivePens = (STRINGA_Dummy + $000A);
  2558. STRINGA_EditHook = (STRINGA_Dummy + $000B);
  2559. STRINGA_EditModes = (STRINGA_Dummy + $000C);
  2560. { booleans }
  2561. STRINGA_ReplaceMode = (STRINGA_Dummy + $000D);
  2562. STRINGA_FixedFieldMode = (STRINGA_Dummy + $000E);
  2563. STRINGA_NoFilterMode = (STRINGA_Dummy + $000F);
  2564. STRINGA_Justification = (STRINGA_Dummy + $0010);
  2565. { GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT }
  2566. STRINGA_LongVal = (STRINGA_Dummy + $0011);
  2567. STRINGA_TextVal = (STRINGA_Dummy + $0012);
  2568. STRINGA_ExitHelp = (STRINGA_Dummy + $0013);
  2569. { STRINGA_ExitHelp is new for V37, and ignored by V36.
  2570. * Set this if you want the gadget to exit when Help is
  2571. * pressed. Look for a code of $5F, the rawkey code for Help
  2572. }
  2573. SG_DEFAULTMAXCHARS = (128);
  2574. { Gadget Layout related attributes }
  2575. LAYOUTA_Dummy = (TAG_USER + $38000);
  2576. LAYOUTA_LayoutObj = (LAYOUTA_Dummy + $0001);
  2577. LAYOUTA_Spacing = (LAYOUTA_Dummy + $0002);
  2578. LAYOUTA_Orientation = (LAYOUTA_Dummy + $0003);
  2579. LAYOUTA_ChildMaxWidth = LAYOUTA_Dummy + $0004;
  2580. { (BOOL) Child objects are of equal width. Should default to TRUE for
  2581. gadgets with a horizontal orientation. New for V42. }
  2582. LAYOUTA_ChildMaxHeight = LAYOUTA_Dummy + $0005;
  2583. { (BOOL) Child objects are of equal height. Should default to TRUE for
  2584. gadgets with a vertical orientation. New for V42. }
  2585. { orientation values }
  2586. LORIENT_NONE = 0;
  2587. LORIENT_HORIZ = 1;
  2588. LORIENT_VERT = 2;
  2589. { Gadget Method ID's }
  2590. GM_Dummy = (-1); { not used for anything }
  2591. GM_HITTEST = (0); { return GMR_GADGETHIT IF you are clicked on
  2592. * (whether or not you are disabled).
  2593. }
  2594. GM_RENDER = (1); { draw yourself, in the appropriate state }
  2595. GM_GOACTIVE = (2); { you are now going to be fed input }
  2596. GM_HANDLEINPUT = (3); { handle that input }
  2597. GM_GOINACTIVE = (4); { whether or not by choice, you are done }
  2598. GM_HELPTEST = (5); { Will you send gadget help if the mouse is
  2599. * at the specified coordinates? See below
  2600. * for possible GMR_ values.
  2601. }
  2602. GM_LAYOUT = (6); { re-evaluate your size based on the GadgetInfo
  2603. * Domain. Do NOT re-render yourself yet, you
  2604. * will be called when it is time...
  2605. }
  2606. { Parameter "Messages" passed to gadget class methods }
  2607. { GM_HITTEST }
  2608. type
  2609. pgpHitTest = ^tgpHitTest;
  2610. tgpHitTest = record
  2611. MethodID : Cardinal;
  2612. gpht_GInfo : pGadgetInfo;
  2613. gpht_Mouse : record
  2614. x : smallint;
  2615. y : smallint;
  2616. end;
  2617. END;
  2618. const
  2619. { For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit,
  2620. * otherwise return zero.
  2621. *
  2622. * For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit.
  2623. * Typically, return GMR_HELPHIT if you were hit.
  2624. * It is possible to pass a UWORD to the application via the Code field
  2625. * of the IDCMP_GADGETHELP message. Return GMR_HELPCODE or'd with
  2626. * the UWORD-sized result you wish to return.
  2627. *
  2628. * GMR_HELPHIT yields a Code value of ((UWORD) ~0), which should
  2629. * mean "nothing particular" to the application.
  2630. }
  2631. GMR_GADGETHIT = ($00000004); { GM_HITTEST hit }
  2632. GMR_NOHELPHIT = ($00000000); { GM_HELPTEST didn't hit }
  2633. GMR_HELPHIT = ($FFFFFFFF); { GM_HELPTEST hit, return code = ~0 }
  2634. GMR_HELPCODE = ($00010000); { GM_HELPTEST hit, return low word as code }
  2635. { GM_RENDER }
  2636. Type
  2637. pgpRender = ^tgpRender;
  2638. tgpRender = record
  2639. MethodID : Cardinal;
  2640. gpr_GInfo : pGadgetInfo; { gadget context }
  2641. gpr_RPort : pRastPort; { all ready for use }
  2642. gpr_Redraw : Longint; { might be a "highlight pass" }
  2643. END;
  2644. { values of gpr_Redraw }
  2645. CONST
  2646. GREDRAW_UPDATE = (2); { incremental update, e.g. prop slider }
  2647. GREDRAW_REDRAW = (1); { redraw gadget }
  2648. GREDRAW_TOGGLE = (0); { toggle highlight, IF applicable }
  2649. { GM_GOACTIVE, GM_HANDLEINPUT }
  2650. Type
  2651. pgpInput = ^tgpInput;
  2652. tgpInput = record
  2653. MethodID : Cardinal;
  2654. gpi_GInfo : pGadgetInfo;
  2655. gpi_IEvent : pInputEvent;
  2656. gpi_Termination : Pointer;
  2657. gpi_Mouse : record
  2658. x : smallint;
  2659. y : smallint;
  2660. end;
  2661. {* (V39) Pointer to TabletData structure, if this event originated
  2662. * from a tablet which sends IESUBCLASS_NEWTABLET events, or NULL if
  2663. * not.
  2664. *
  2665. * DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39!
  2666. * IT WILL BE INVALID!
  2667. *}
  2668. gpi_TabletData : pTabletData;
  2669. END;
  2670. { GM_HANDLEINPUT and GM_GOACTIVE return code flags }
  2671. { return GMR_MEACTIVE (0) alone if you want more input.
  2672. * Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  2673. * GMR_VERIFY.
  2674. }
  2675. CONST
  2676. GMR_MEACTIVE = (0);
  2677. GMR_NOREUSE = (2);
  2678. GMR_REUSE = (4);
  2679. GMR_VERIFY = (8); { you MUST set cgp_Termination }
  2680. { New for V37:
  2681. * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  2682. * which instructs Intuition to activate the next or previous gadget
  2683. * that has GFLG_TABCYCLE set.
  2684. }
  2685. GMR_NEXTACTIVE = (16);
  2686. GMR_PREVACTIVE = (32);
  2687. { GM_GOINACTIVE }
  2688. Type
  2689. pgpGoInactive = ^tgpGoInactive;
  2690. tgpGoInactive = record
  2691. MethodID : Cardinal;
  2692. gpgi_GInfo : pGadgetInfo;
  2693. { V37 field only! DO NOT attempt to read under V36! }
  2694. gpgi_Abort : Cardinal; { gpgi_Abort=1 IF gadget was aborted
  2695. * by Intuition and 0 if gadget went
  2696. * inactive at its own request
  2697. }
  2698. END;
  2699. {* New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when
  2700. * the gadget is added to the window (or when the window opens, if
  2701. * the gadget was part of the NewWindow.FirstGadget or the WA_Gadgets
  2702. * list), or when the window is resized. Your gadget can set the
  2703. * GA_RelSpecial property to get GM_LAYOUT events without Intuition
  2704. * changing the interpretation of your gadget select box. This
  2705. * allows for completely arbitrary resizing/repositioning based on
  2706. * window size.
  2707. *}
  2708. {* GM_LAYOUT *}
  2709. Type
  2710. pgpLayout = ^tgpLayout;
  2711. tgpLayout = record
  2712. MethodID : Cardinal;
  2713. gpl_GInfo : pGadgetInfo;
  2714. gpl_Initial : Cardinal; {* non-zero if this method was invoked
  2715. * during AddGList() or OpenWindow()
  2716. * time. zero if this method was invoked
  2717. * during window resizing.
  2718. *}
  2719. end;
  2720. {***************************************************************************}
  2721. { The GM_DOMAIN method is used to obtain the sizing requirements of an
  2722. * object for a class before ever creating an object. }
  2723. { GM_DOMAIN }
  2724. PgpDomain = ^tgpDomain;
  2725. tgpDomain = record
  2726. MethodID : Cardinal;
  2727. gpd_GInfo : PGadgetInfo;
  2728. gpd_RPort : PRastPort; { RastPort to layout for }
  2729. gpd_Which : LongInt;
  2730. gpd_Domain : tIBox; { Resulting domain }
  2731. gpd_Attrs : PTagItem; { Additional attributes }
  2732. end;
  2733. const
  2734. GDOMAIN_MINIMUM = 0;
  2735. { Minimum size }
  2736. GDOMAIN_NOMINAL = 1;
  2737. { Nominal size }
  2738. GDOMAIN_MAXIMUM = 2;
  2739. { Maximum size }
  2740. {***************************************************************************}
  2741. { The GM_KEYTEST method is used to determin if a key press matches an
  2742. * object's activation key(s). }
  2743. { GM_KEYTEST send this message.
  2744. }
  2745. type
  2746. PgpKeyTest = ^tgpKeyTest;
  2747. tgpKeyTest = record
  2748. MethodID : Cardinal;
  2749. gpkt_GInfo : PGadgetInfo;
  2750. gpkt_IMsg : PIntuiMessage; { The IntuiMessage that triggered this }
  2751. gpkt_VanillaKey : Cardinal;
  2752. end;
  2753. {***************************************************************************}
  2754. { The GM_KEYGOACTIVE method is called to "simulate" a gadget going down.
  2755. * A gadget should render itself in a selected state when receiving
  2756. * this message. If the class supports this method, it must return
  2757. * GMR_KEYACTIVE.
  2758. *
  2759. * If a gadget returns zero for this method, it will subsequently be
  2760. * activated via ActivateGadget() with a NULL IEvent.
  2761. }
  2762. PgpKeyInput = ^tgpKeyInput;
  2763. tgpKeyInput = record
  2764. MethodID : Cardinal; { GM_KEYGOACTIVE }
  2765. gpk_GInfo : PGadgetInfo;
  2766. gpk_IEvent : PInputEvent;
  2767. gpk_Termination : ^LongInt;
  2768. end;
  2769. const
  2770. GMR_KEYACTIVE = 1 shl 4;
  2771. { you MUST set gpk_Termination }
  2772. GMR_KEYVERIFY = 1 shl 5;
  2773. { The GM_KEYGOINACTIVE method is called to simulate the gadget release.
  2774. * Upon receiving this message, the gadget should do everything a
  2775. * normal gadget release would do.
  2776. }
  2777. type
  2778. PgpKeyGoInactive = ^tgpKeyGoInactive;
  2779. tgpKeyGoInactive = record
  2780. MethodID : Cardinal;
  2781. gpki_GInfo : PGadgetInfo;
  2782. gpki_Abort : Cardinal;
  2783. end;
  2784. CONST
  2785. ICM_Dummy = ($0401); { used for nothing }
  2786. ICM_SETLOOP = ($0402); { set/increment loop counter }
  2787. ICM_CLEARLOOP = ($0403); { clear/decrement loop counter }
  2788. ICM_CHECKLOOP = ($0404); { set/increment loop }
  2789. { no parameters for ICM_SETLOOP, ICM_CLEARLOOP, ICM_CHECKLOOP }
  2790. { interconnection attributes used by icclass, modelclass, and gadgetclass }
  2791. ICA_Dummy = (TAG_USER+$40000);
  2792. ICA_TARGET = (ICA_Dummy + 1);
  2793. { interconnection target }
  2794. ICA_MAP = (ICA_Dummy + 2);
  2795. { interconnection map tagitem list }
  2796. ICSPECIAL_CODE = (ICA_Dummy + 3);
  2797. { a "pseudo-attribute", see below. }
  2798. { Normally, the value for ICA_TARGET is some object pointer,
  2799. * but if you specify the special value ICTARGET_IDCMP, notification
  2800. * will be send as an IDCMP_IDCMPUPDATE message to the appropriate window's
  2801. * IDCMP port. See the definition of IDCMP_IDCMPUPDATE.
  2802. *
  2803. * When you specify ICTARGET_IDCMP for ICA_TARGET, the map you
  2804. * specify will be applied to derive the attribute list that is
  2805. * sent with the IDCMP_IDCMPUPDATE message. If you specify a map list
  2806. * which results in the attribute tag id ICSPECIAL_CODE, the
  2807. * lower sixteen bits of the corresponding ti_Data value will
  2808. * be copied into the Code field of the IDCMP_IDCMPUPDATE IntuiMessage.
  2809. }
  2810. ICTARGET_IDCMP = (NOT 0);
  2811. CONST
  2812. CUSTOMIMAGEDEPTH = (-1);
  2813. { if image.Depth is this, it's a new Image class object }
  2814. {****************************************************}
  2815. CONST
  2816. IA_Dummy = (TAG_USER + $20000);
  2817. IA_Left = (IA_Dummy + $01);
  2818. IA_Top = (IA_Dummy + $02);
  2819. IA_Width = (IA_Dummy + $03);
  2820. IA_Height = (IA_Dummy + $04);
  2821. IA_FGPen = (IA_Dummy + $05);
  2822. { IA_FGPen also means "PlanePick" }
  2823. IA_BGPen = (IA_Dummy + $06);
  2824. { IA_BGPen also means "PlaneOnOff" }
  2825. IA_Data = (IA_Dummy + $07);
  2826. { bitplanes, for classic image,
  2827. * other image classes may use it for other things
  2828. }
  2829. IA_LineWidth = (IA_Dummy + $08);
  2830. IA_Pens = (IA_Dummy + $0E);
  2831. { pointer to UWORD pens[],
  2832. * ala DrawInfo.Pens, MUST be
  2833. * terminated by ~0. Some classes can
  2834. * choose to have this, or SYSIA_DrawInfo,
  2835. * or both.
  2836. }
  2837. IA_Resolution = (IA_Dummy + $0F);
  2838. { packed uwords for x/y resolution into a longword
  2839. * ala DrawInfo.Resolution
  2840. }
  2841. {*** see class documentation to learn which ****}
  2842. {*** classes recognize these ****}
  2843. IA_APattern = (IA_Dummy + $10);
  2844. IA_APatSize = (IA_Dummy + $11);
  2845. IA_Mode = (IA_Dummy + $12);
  2846. IA_Font = (IA_Dummy + $13);
  2847. IA_Outline = (IA_Dummy + $14);
  2848. IA_Recessed = (IA_Dummy + $15);
  2849. IA_DoubleEmboss = (IA_Dummy + $16);
  2850. IA_EdgesOnly = (IA_Dummy + $17);
  2851. {*** "sysiclass" attributes ****}
  2852. SYSIA_Size = (IA_Dummy + $0B);
  2853. { 's below }
  2854. SYSIA_Depth = (IA_Dummy + $0C);
  2855. { this is unused by Intuition. SYSIA_DrawInfo
  2856. * is used instead for V36
  2857. }
  2858. SYSIA_Which = (IA_Dummy + $0D);
  2859. { see 's below }
  2860. SYSIA_DrawInfo = (IA_Dummy + $18);
  2861. { pass to sysiclass, please }
  2862. {**** obsolete: don't use these, use IA_Pens ****}
  2863. SYSIA_Pens = IA_Pens;
  2864. IA_ShadowPen = (IA_Dummy + $09);
  2865. IA_HighlightPen = (IA_Dummy + $0A);
  2866. { New for V39: }
  2867. SYSIA_ReferenceFont = (IA_Dummy + $19);
  2868. { Font to use as reference for scaling
  2869. * certain sysiclass images
  2870. }
  2871. IA_SupportsDisable = (IA_Dummy + $1a);
  2872. { By default, Intuition ghosts gadgets itself,
  2873. * instead of relying on IDS_DISABLED or
  2874. * IDS_SELECTEDDISABLED. An imageclass that
  2875. * supports these states should return this attribute
  2876. * as TRUE. You cannot set or clear this attribute,
  2877. * however.
  2878. }
  2879. IA_FrameType = (IA_Dummy + $1b);
  2880. { Starting with V39, FrameIClass recognizes
  2881. * several standard types of frame. Use one
  2882. * of the FRAME_ specifiers below. Defaults
  2883. * to FRAME_DEFAULT.
  2884. }
  2885. IA_Underscore = IA_Dummy + $1c;
  2886. { V44, Indicate underscore keyboard shortcut for image labels.
  2887. (UBYTE) Defaults to '_'
  2888. }
  2889. IA_Scalable = IA_Dummy + $1d;
  2890. { V44, Attribute indicates this image is allowed
  2891. to/can scale its rendering.
  2892. (BOOL) Defaults to FALSE.
  2893. }
  2894. IA_ActivateKey = IA_Dummy + $1e;
  2895. { V44, Used to get an underscored label shortcut.
  2896. Useful for labels attached to string gadgets.
  2897. (UBYTE) Defaults to NULL.
  2898. }
  2899. IA_Screen = IA_Dummy + $1f;
  2900. { V44 Screen pointer, may be useful/required by certain classes.
  2901. (struct Screen )
  2902. }
  2903. IA_Precision = IA_Dummy + $20;
  2904. { V44 Precision value, typically pen precision but may be
  2905. used for similar custom purposes.
  2906. (Cardinal)
  2907. }
  2908. {* next attribute: (IA_Dummy + $1c) *}
  2909. {***********************************************}
  2910. { data values for SYSIA_Size }
  2911. SYSISIZE_MEDRES = (0);
  2912. SYSISIZE_LOWRES = (1);
  2913. SYSISIZE_HIRES = (2);
  2914. {
  2915. * SYSIA_Which tag data values:
  2916. * Specifies which system gadget you want an image for.
  2917. * Some numbers correspond to internal Intuition s
  2918. }
  2919. DEPTHIMAGE = ($00);
  2920. ZOOMIMAGE = ($01);
  2921. SIZEIMAGE = ($02);
  2922. CLOSEIMAGE = ($03);
  2923. SDEPTHIMAGE = ($05); { screen depth gadget }
  2924. LEFTIMAGE = ($0A);
  2925. UPIMAGE = ($0B);
  2926. RIGHTIMAGE = ($0C);
  2927. DOWNIMAGE = ($0D);
  2928. CHECKIMAGE = ($0E);
  2929. MXIMAGE = ($0F); { mutual exclude "button" }
  2930. {* New for V39: *}
  2931. MENUCHECK = ($10); { Menu checkmark image }
  2932. AMIGAKEY = ($11); { Menu Amiga-key image }
  2933. { Data values for IA_FrameType (recognized by FrameIClass)
  2934. *
  2935. * FRAME_DEFAULT: The standard V37-type frame, which has
  2936. * thin edges.
  2937. * FRAME_BUTTON: Standard button gadget frames, having thicker
  2938. * sides and nicely edged corners.
  2939. * FRAME_RIDGE: A ridge such as used by standard string gadgets.
  2940. * You can recess the ridge to get a groove image.
  2941. * FRAME_ICONDROPBOX: A broad ridge which is the standard imagery
  2942. * for areas in AppWindows where icons may be dropped.
  2943. }
  2944. FRAME_DEFAULT = 0;
  2945. FRAME_BUTTON = 1;
  2946. FRAME_RIDGE = 2;
  2947. FRAME_ICONDROPBOX = 3;
  2948. { image message id's }
  2949. IM_DRAW = $202; { draw yourself, with "state" }
  2950. IM_HITTEST = $203; { return TRUE IF click hits image }
  2951. IM_ERASE = $204; { erase yourself }
  2952. IM_MOVE = $205; { draw new AND erase old, smoothly }
  2953. IM_DRAWFRAME= $206; { draw with specified dimensions }
  2954. IM_FRAMEBOX = $207; { get recommended frame around some box}
  2955. IM_HITFRAME = $208; { hittest with dimensions }
  2956. IM_ERASEFRAME= $209; { hittest with dimensions }
  2957. IM_DOMAINFRAME = $20A;{ query image for its domain info (V44) }
  2958. { image draw states or styles, for IM_DRAW }
  2959. IDS_NORMAL = (0);
  2960. IDS_SELECTED = (1); { for selected gadgets }
  2961. IDS_DISABLED = (2); { for disabled gadgets }
  2962. IDS_BUSY = (3); { for future functionality }
  2963. IDS_INDETERMINATE = (4); { for future functionality }
  2964. IDS_INACTIVENORMAL = (5); { normal, in inactive window border }
  2965. IDS_INACTIVESELECTED= (6); { selected, in inactive border }
  2966. IDS_INACTIVEDISABLED= (7); { disabled, in inactive border }
  2967. IDS_SELECTEDDISABLED = 8; { disabled and selected }
  2968. { oops, please forgive spelling error by jimm }
  2969. IDS_INDETERMINANT = IDS_INDETERMINATE;
  2970. { IM_FRAMEBOX }
  2971. Type
  2972. pimpFrameBox = ^timpFrameBox;
  2973. timpFrameBox = record
  2974. MethodID : Cardinal;
  2975. imp_ContentsBox : pIBox; { input: relative box of contents }
  2976. imp_FrameBox : pIBox; { output: rel. box of encl frame }
  2977. imp_DrInfo : pDrawInfo;
  2978. imp_FrameFlags : Cardinal;
  2979. END;
  2980. CONST
  2981. FRAMEF_SPECIFY = (1); { Make do with the dimensions of FrameBox
  2982. * provided.
  2983. }
  2984. { IM_DRAW, IM_DRAWFRAME }
  2985. Type
  2986. pimpDraw = ^timpDraw;
  2987. timpDraw = record
  2988. MethodID : Cardinal;
  2989. imp_RPort : pRastPort;
  2990. imp_Offset : record
  2991. x : Word;
  2992. y : Word;
  2993. end;
  2994. imp_State : Cardinal;
  2995. imp_DrInfo : pDrawInfo;
  2996. { these parameters only valid for IM_DRAWFRAME }
  2997. imp_Dimensions : record
  2998. Width : Word;
  2999. Height : Word;
  3000. end;
  3001. END;
  3002. { IM_ERASE, IM_ERASEFRAME }
  3003. { NOTE: This is a subset of impDraw }
  3004. pimpErase = ^timpErase;
  3005. timpErase = record
  3006. MethodID : Cardinal;
  3007. imp_RPort : pRastPort;
  3008. imp_Offset : record
  3009. x : Word;
  3010. y : Word;
  3011. end;
  3012. { these parameters only valid for IM_ERASEFRAME }
  3013. imp_Dimensions : record
  3014. Width : Word;
  3015. Height : Word;
  3016. end;
  3017. END;
  3018. { IM_HITTEST, IM_HITFRAME }
  3019. pimpHitTest = ^timpHitTest;
  3020. timpHitTest = record
  3021. MethodID : Cardinal;
  3022. imp_Point : record
  3023. x : Word;
  3024. y : Word;
  3025. end;
  3026. { these parameters only valid for IM_HITFRAME }
  3027. imp_Dimensions : record
  3028. Width : Word;
  3029. Height : Word;
  3030. end;
  3031. END;
  3032. { The IM_DOMAINFRAME method is used to obtain the sizing
  3033. * requirements of an image object within a layout group.
  3034. }
  3035. { IM_DOMAINFRAME }
  3036. PimpDomainFrame = ^timpDomainFrame;
  3037. timpDomainFrame = record
  3038. MethodID : Cardinal;
  3039. imp_DrInfo : PDrawInfo;
  3040. imp_RPort : PRastPort;
  3041. imp_Which : LongInt;
  3042. imp_Domain : tIBox;
  3043. imp_Attrs : PTagItem;
  3044. end;
  3045. { Accepted vales for imp_Which.
  3046. }
  3047. const
  3048. IDOMAIN_MINIMUM = 0;
  3049. IDOMAIN_NOMINAL = 1;
  3050. IDOMAIN_MAXIMUM = 2;
  3051. { ** 'boopsi' pointer class interface }
  3052. const
  3053. { The following tags are recognized at NewObject() time by
  3054. * pointerclass:
  3055. *
  3056. * POINTERA_BitMap (struct BitMap *) - Pointer to bitmap to
  3057. * get pointer imagery from. Bitplane data need not be
  3058. * in chip RAM.
  3059. * POINTERA_XOffset (LONG) - X-offset of the pointer hotspot.
  3060. * POINTERA_YOffset (LONG) - Y-offset of the pointer hotspot.
  3061. * POINTERA_WordWidth (Cardinal) - designed width of the pointer in words
  3062. * POINTERA_XResolution (Cardinal) - one of the POINTERXRESN_ flags below
  3063. * POINTERA_YResolution (Cardinal) - one of the POINTERYRESN_ flags below
  3064. *
  3065. }
  3066. POINTERA_Dummy = (TAG_USER + $39000);
  3067. POINTERA_BitMap = (POINTERA_Dummy + $01);
  3068. POINTERA_XOffset = (POINTERA_Dummy + $02);
  3069. POINTERA_YOffset = (POINTERA_Dummy + $03);
  3070. POINTERA_WordWidth = (POINTERA_Dummy + $04);
  3071. POINTERA_XResolution = (POINTERA_Dummy + $05);
  3072. POINTERA_YResolution = (POINTERA_Dummy + $06);
  3073. { These are the choices for the POINTERA_XResolution attribute which
  3074. * will determine what resolution pixels are used for this pointer.
  3075. *
  3076. * POINTERXRESN_DEFAULT (ECS-compatible pointer width)
  3077. * = 70 ns if SUPERHIRES-type mode, 140 ns if not
  3078. *
  3079. * POINTERXRESN_SCREENRES
  3080. * = Same as pixel speed of screen
  3081. *
  3082. * POINTERXRESN_LORES (pointer always in lores-like pixels)
  3083. * = 140 ns in 15kHz modes, 70 ns in 31kHz modes
  3084. *
  3085. * POINTERXRESN_HIRES (pointer always in hires-like pixels)
  3086. * = 70 ns in 15kHz modes, 35 ns in 31kHz modes
  3087. *
  3088. * POINTERXRESN_140NS (pointer always in 140 ns pixels)
  3089. * = 140 ns always
  3090. *
  3091. * POINTERXRESN_70NS (pointer always in 70 ns pixels)
  3092. * = 70 ns always
  3093. *
  3094. * POINTERXRESN_35NS (pointer always in 35 ns pixels)
  3095. * = 35 ns always
  3096. }
  3097. POINTERXRESN_DEFAULT = 0;
  3098. POINTERXRESN_140NS = 1;
  3099. POINTERXRESN_70NS = 2;
  3100. POINTERXRESN_35NS = 3;
  3101. POINTERXRESN_SCREENRES = 4;
  3102. POINTERXRESN_LORES = 5;
  3103. POINTERXRESN_HIRES = 6;
  3104. { These are the choices for the POINTERA_YResolution attribute which
  3105. * will determine what vertical resolution is used for this pointer.
  3106. *
  3107. * POINTERYRESN_DEFAULT
  3108. * = In 15 kHz modes, the pointer resolution will be the same
  3109. * as a non-interlaced screen. In 31 kHz modes, the pointer
  3110. * will be doubled vertically. This means there will be about
  3111. * 200-256 pointer lines per screen.
  3112. *
  3113. * POINTERYRESN_HIGH
  3114. * POINTERYRESN_HIGHASPECT
  3115. * = Where the hardware/software supports it, the pointer resolution
  3116. * will be high. This means there will be about 400-480 pointer
  3117. * lines per screen. POINTERYRESN_HIGHASPECT also means that
  3118. * when the pointer comes out double-height due to hardware/software
  3119. * restrictions, its width would be doubled as well, if possible
  3120. * (to preserve aspect).
  3121. *
  3122. * POINTERYRESN_SCREENRES
  3123. * POINTERYRESN_SCREENRESASPECT
  3124. * = Will attempt to match the vertical resolution of the pointer
  3125. * to the screen's vertical resolution. POINTERYRESN_SCREENASPECT also
  3126. * means that when the pointer comes out double-height due to
  3127. * hardware/software restrictions, its width would be doubled as well,
  3128. * if possible (to preserve aspect).
  3129. *
  3130. }
  3131. POINTERYRESN_DEFAULT = 0;
  3132. POINTERYRESN_HIGH = 2;
  3133. POINTERYRESN_HIGHASPECT = 3;
  3134. POINTERYRESN_SCREENRES = 4;
  3135. POINTERYRESN_SCREENRESASPECT = 5;
  3136. { Compatibility note:
  3137. *
  3138. * The AA chipset supports variable sprite width and resolution, but
  3139. * the setting of width and resolution is global for all sprites.
  3140. * When no other sprites are in use, Intuition controls the sprite
  3141. * width and sprite resolution for correctness based on pointerclass
  3142. * attributes specified by the creator of the pointer. Intuition
  3143. * controls sprite resolution with the VTAG_DEFSPRITERESN_SET tag
  3144. * to VideoControl(). Applications can override this on a per-viewport
  3145. * basis with the VTAG_SPRITERESN_SET tag to VideoControl().
  3146. *
  3147. * If an application uses a sprite other than the pointer sprite,
  3148. * Intuition will automatically regenerate the pointer sprite's image in
  3149. * a compatible width. This might involve BitMap scaling of the imagery
  3150. * you supply.
  3151. *
  3152. * If any sprites other than the pointer sprite were obtained with the
  3153. * old GetSprite() call, Intuition assumes that the owner of those
  3154. * sprites is unaware of sprite resolution, hence Intuition will set the
  3155. * default sprite resolution (VTAG_DEFSPRITERESN_SET) to ECS-compatible,
  3156. * instead of as requested by the various pointerclass attributes.
  3157. *
  3158. * No resolution fallback occurs when applications use ExtSprites.
  3159. * Such applications are expected to use VTAG_SPRITERESN_SET tag if
  3160. * necessary.
  3161. *
  3162. * NB: Under release V39, only sprite width compatibility is implemented.
  3163. * Sprite resolution compatibility was added for V40.
  3164. }
  3165. Type
  3166. pStringExtend = ^tStringExtend;
  3167. tStringExtend = record
  3168. { display specifications }
  3169. Font : pTextFont; { must be an open Font (not TextAttr) }
  3170. Pens : Array[0..1] of Byte; { color of text/backgroun }
  3171. ActivePens : Array[0..1] of Byte; { colors when gadget is active }
  3172. { edit specifications }
  3173. InitialModes : Cardinal; { initial mode flags, below }
  3174. EditHook : pHook; { IF non-NULL, must supply WorkBuffer }
  3175. WorkBuffer : PChar; { must be as large as StringInfo.Buffer}
  3176. Reserved : Array[0..3] of Cardinal; { set to 0 }
  3177. END;
  3178. pSGWork = ^tSGWork;
  3179. tSGWork = record
  3180. { set up when gadget is first activated }
  3181. Gad : pGadget; { the contestant itself } { Gadget in C-Includes }
  3182. StrInfo : pStringInfo; { easy access to sinfo } { StrInfo in C-Includes }
  3183. WorkBuffer : PChar; { intuition's planned result }
  3184. PrevBuffer : PChar; { what was there before }
  3185. Modes : Cardinal; { current mode }
  3186. { modified for each input event }
  3187. IEvent : pInputEvent; { actual event: do not change }
  3188. Code : Word; { character code, IF one byte }
  3189. BufferPos : smallint; { cursor position }
  3190. NumChars : smallint;
  3191. Actions : Cardinal; { what Intuition will do }
  3192. LongInt_ : Longint; { temp storage for longint }
  3193. GInfo : pGadgetInfo; { see cghooks.h } { GadgetInfo in C-Includes }
  3194. EditOp : Word; { from constants below }
  3195. END;
  3196. { SGWork.EditOp -
  3197. * These values indicate what basic type of operation the global
  3198. * editing hook has performed on the string before your gadget's custom
  3199. * editing hook gets called. You do not have to be concerned with the
  3200. * value your custom hook leaves in the EditOp field, only if you
  3201. * write a global editing hook.
  3202. *
  3203. * For most of these general edit operations, you'll want to compare
  3204. * the BufferPos and NumChars of the StringInfo (before global editing)
  3205. * and SGWork (after global editing).
  3206. }
  3207. CONST
  3208. EO_NOOP = ($0001);
  3209. { did nothing }
  3210. EO_DELBACKWARD= ($0002);
  3211. { deleted some chars (maybe 0). }
  3212. EO_DELFORWARD = ($0003);
  3213. { deleted some characters under and in front of the cursor }
  3214. EO_MOVECURSOR = ($0004);
  3215. { moved the cursor }
  3216. EO_ENTER = ($0005);
  3217. { "enter" or "return" key, terminate }
  3218. EO_RESET = ($0006);
  3219. { current Intuition-style undo }
  3220. EO_REPLACECHAR= ($0007);
  3221. { replaced one character and (maybe) advanced cursor }
  3222. EO_INSERTCHAR = ($0008);
  3223. { inserted one char into string or added one at end }
  3224. EO_BADFORMAT = ($0009);
  3225. { didn't like the text data, e.g., Bad LONGINT }
  3226. EO_BIGCHANGE = ($000A); { unused by Intuition }
  3227. { complete or major change to the text, e.g. new string }
  3228. EO_UNDO = ($000B); { unused by Intuition }
  3229. { some other style of undo }
  3230. EO_CLEAR = ($000C);
  3231. { clear the string }
  3232. EO_SPECIAL = ($000D); { unused by Intuition }
  3233. { some operation that doesn't fit into the categories here }
  3234. { Mode Flags definitions (ONLY first group allowed as InitialModes) }
  3235. SGM_REPLACE = (1); { replace mode }
  3236. { please initialize StringInfo with in-range value of BufferPos
  3237. * if you are using SGM_REPLACE mode.
  3238. }
  3239. SGM_FIXEDFIELD = (2); { fixed length buffer }
  3240. { always set SGM_REPLACE, too }
  3241. SGM_NOFILTER = (4); { don't filter control chars }
  3242. { SGM_EXITHELP is new for V37, and ignored by V36: }
  3243. SGM_EXITHELP = (128); { exit with code = $5F IF HELP hit }
  3244. { These Mode Flags are for internal use only }
  3245. SGM_NOCHANGE = (8); { no edit changes yet }
  3246. SGM_NOWORKB = (16); { Buffer == PrevBuffer }
  3247. SGM_CONTROL = (32); { control char escape mode }
  3248. SGM_LONGINT = (64); { an intuition longint gadget }
  3249. { String Gadget Action Flags (put in SGWork.Actions by EditHook) }
  3250. SGA_USE = ($1); { use contents of SGWork }
  3251. SGA_END = ($2); { terminate gadget, code in Code field }
  3252. SGA_BEEP = ($4); { flash the screen for the user }
  3253. SGA_REUSE = ($8); { reuse input event }
  3254. SGA_REDISPLAY = ($10); { gadget visuals changed }
  3255. { New for V37: }
  3256. SGA_NEXTACTIVE = ($20); { Make next possible gadget active. }
  3257. SGA_PREVACTIVE = ($40); { Make previous possible gadget active.}
  3258. { function id for only existing custom string gadget edit hook }
  3259. SGH_KEY = (1); { process editing keystroke }
  3260. SGH_CLICK = (2); { process mouse click cursor position }
  3261. { Here's a brief summary of how the custom string gadget edit hook works:
  3262. * You provide a hook in StringInfo.Extension.EditHook.
  3263. * The hook is called in the standard way with the 'object'
  3264. * a pointer to SGWork, and the 'message' a pointer to a command
  3265. * block, starting either with (longword) SGH_KEY, SGH_CLICK,
  3266. * or something new.
  3267. *
  3268. * You return 0 if you don't understand the command (SGH_KEY is
  3269. * required and assumed). Return non-zero if you implement the
  3270. * command.
  3271. *
  3272. * SGH_KEY:
  3273. * There are no parameters following the command longword.
  3274. *
  3275. * Intuition will put its idea of proper values in the SGWork
  3276. * before calling you, and if you leave SGA_USE set in the
  3277. * SGWork.Actions field, Intuition will use the values
  3278. * found in SGWork fields WorkBuffer, NumChars, BufferPos,
  3279. * and LongInt, copying the WorkBuffer back to the StringInfo
  3280. * Buffer.
  3281. *
  3282. * NOTE WELL: You may NOT change other SGWork fields.
  3283. *
  3284. * If you clear SGA_USE, the string gadget will be unchanged.
  3285. *
  3286. * If you set SGA_END, Intuition will terminate the activation
  3287. * of the string gadget. If you also set SGA_REUSE, Intuition
  3288. * will reuse the input event after it deactivates your gadget.
  3289. *
  3290. * In this case, Intuition will put the value found in SGWork.Code
  3291. * into the IntuiMessage.Code field of the IDCMP_GADGETUP message it
  3292. * sends to the application.
  3293. *
  3294. * If you set SGA_BEEP, Intuition will call DisplayBeep(); use
  3295. * this if the user has typed in error, or buffer is full.
  3296. *
  3297. * Set SGA_REDISPLAY if the changes to the gadget warrant a
  3298. * gadget redisplay. Note: cursor movement requires a redisplay.
  3299. *
  3300. * Starting in V37, you may set SGA_PREVACTIVE or SGA_NEXTACTIVE
  3301. * when you set SGA_END. This tells Intuition that you want
  3302. * the next or previous gadget with GFLG_TABCYCLE to be activated.
  3303. *
  3304. * SGH_CLICK:
  3305. * This hook command is called when Intuition wants to position
  3306. * the cursor in response to a mouse click in the string gadget.
  3307. *
  3308. * Again, here are no parameters following the command longword.
  3309. *
  3310. * This time, Intuition has already calculated the mouse position
  3311. * character cell and put it in SGWork.BufferPos. The previous
  3312. * BufferPos value remains in the SGWork.StringInfo.BufferPos.
  3313. *
  3314. * Intuition will again use the SGWork fields listed above for
  3315. * SGH_KEY. One restriction is that you are NOT allowed to set
  3316. * SGA_END or SGA_REUSE for this command. Intuition will not
  3317. * stand for a gadget which goes inactive when you click in it.
  3318. *
  3319. * You should always leave the SGA_REDISPLAY flag set, since Intuition
  3320. * uses this processing when activating a string gadget.
  3321. }
  3322. const
  3323. INTUITIONNAME : PChar = 'intuition.library';
  3324. var
  3325. intuitionbase : PIntuitionBase;
  3326. procedure OpenIntuition;
  3327. SysCall IntuitionBase 030;
  3328. procedure Intuition(iEvent : pInputEvent location 'a0');
  3329. SysCall IntuitionBase 036;
  3330. function AddGadget(window : pWindow location 'a0'; gadget : pGadget location 'a1'; position : CARDINAL location 'd0') : Word;
  3331. SysCall IntuitionBase 042;
  3332. function ClearDMRequest(window : pWindow location 'a0') : BOOLEAN;
  3333. SysCall IntuitionBase 048;
  3334. procedure ClearMenuStrip(window : pWindow location 'a0');
  3335. SysCall IntuitionBase 054;
  3336. procedure ClearPointer(window : pWindow location 'a0');
  3337. SysCall IntuitionBase 060;
  3338. function CloseScreen(screen : pScreen location 'a0') : BOOLEAN;
  3339. SysCall IntuitionBase 066;
  3340. procedure CloseWindow(window : pWindow location 'a0');
  3341. SysCall IntuitionBase 072;
  3342. function CloseWorkBench : LongInt;
  3343. SysCall IntuitionBase 078;
  3344. procedure CurrentTime(VAR seconds : CARDINAL location 'a0'; VAR micros : CARDINAL location 'a1');
  3345. SysCall IntuitionBase 084;
  3346. function DisplayAlert(alertNumber : CARDINAL location 'd0'; string1 : PChar location 'a0'; height : CARDINAL location 'd1') : BOOLEAN;
  3347. SysCall IntuitionBase 090;
  3348. procedure DisplayBeep(screen : pScreen location 'a0');
  3349. SysCall IntuitionBase 096;
  3350. function DoubleClick(sSeconds : CARDINAL location 'd0'; sMicros : CARDINAL location 'd1'; cSeconds : CARDINAL location 'd2'; cMicros : CARDINAL location 'd3') : BOOLEAN;
  3351. SysCall IntuitionBase 102;
  3352. procedure DrawBorder(rp : pRastPort location 'a0'; border : pBorder location 'a1'; leftOffset : LongInt location 'd0'; topOffset : LongInt location 'd1');
  3353. SysCall IntuitionBase 108;
  3354. procedure DrawImage(rp : pRastPort location 'a0'; image : pImage location 'a1'; leftOffset : LongInt location 'd0'; topOffset : LongInt location 'd1');
  3355. SysCall IntuitionBase 114;
  3356. procedure EndRequest(requester : pRequester location 'a0'; window : pWindow location 'a1');
  3357. SysCall IntuitionBase 120;
  3358. function GetDefPrefs(preferences : pPreferences location 'a0'; size : LongInt location 'd0') : pPreferences;
  3359. SysCall IntuitionBase 126;
  3360. function GetPrefs(preferences : pPreferences location 'a0'; size : LongInt location 'd0') : pPreferences;
  3361. SysCall IntuitionBase 132;
  3362. procedure InitRequester(requester : pRequester location 'a0');
  3363. SysCall IntuitionBase 138;
  3364. function ItemAddress(menuStrip : pMenu location 'a0'; menuNumber : CARDINAL location 'd0') : pMenuItem;
  3365. SysCall IntuitionBase 144;
  3366. function ModifyIDCMP(window : pWindow location 'a0'; flags : CARDINAL location 'd0') : BOOLEAN;
  3367. SysCall IntuitionBase 150;
  3368. procedure ModifyProp(gadget : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2'; flags : CARDINAL location 'd0'; horizPot : CARDINAL location 'd1'; vertPot : CARDINAL location 'd2'; horizBody : CARDINAL location 'd3'; vertBody : CARDINAL location 'd4');
  3369. SysCall IntuitionBase 156;
  3370. procedure MoveScreen(screen : pScreen location 'a0'; dx : LongInt location 'd0'; dy : LongInt location 'd1');
  3371. SysCall IntuitionBase 162;
  3372. procedure MoveWindow(window : pWindow location 'a0'; dx : LongInt location 'd0'; dy : LongInt location 'd1');
  3373. SysCall IntuitionBase 168;
  3374. procedure OffGadget(gadget : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2');
  3375. SysCall IntuitionBase 174;
  3376. procedure OffMenu(window : pWindow location 'a0'; menuNumber : CARDINAL location 'd0');
  3377. SysCall IntuitionBase 180;
  3378. procedure OnGadget(gadget : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2');
  3379. SysCall IntuitionBase 186;
  3380. procedure OnMenu(window : pWindow location 'a0'; menuNumber : CARDINAL location 'd0');
  3381. SysCall IntuitionBase 192;
  3382. function OpenScreen(newScreen : pNewScreen location 'a0') : pScreen;
  3383. SysCall IntuitionBase 198;
  3384. function OpenWindow(newWindow : pNewWindow location 'a0') : pWindow;
  3385. SysCall IntuitionBase 204;
  3386. function OpenWorkBench : CARDINAL;
  3387. SysCall IntuitionBase 210;
  3388. procedure PrintIText(rp : pRastPort location 'a0'; iText : pIntuiText location 'a1'; left : LongInt location 'd0'; top : LongInt location 'd1');
  3389. SysCall IntuitionBase 216;
  3390. procedure RefreshGadgets(gadgets : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2');
  3391. SysCall IntuitionBase 222;
  3392. function RemoveGadget(window : pWindow location 'a0'; gadget : pGadget location 'a1') : Word;
  3393. SysCall IntuitionBase 228;
  3394. procedure ReportMouse(flag : LongInt location 'd0'; window : pWindow location 'a0');
  3395. SysCall IntuitionBase 234;
  3396. function Request(requester : pRequester location 'a0'; window : pWindow location 'a1') : BOOLEAN;
  3397. SysCall IntuitionBase 240;
  3398. procedure ScreenToBack(screen : pScreen location 'a0');
  3399. SysCall IntuitionBase 246;
  3400. procedure ScreenToFront(screen : pScreen location 'a0');
  3401. SysCall IntuitionBase 252;
  3402. function SetDMRequest(window : pWindow location 'a0'; requester : pRequester location 'a1') : BOOLEAN;
  3403. SysCall IntuitionBase 258;
  3404. function SetMenuStrip(window : pWindow location 'a0'; menu : pMenu location 'a1') : BOOLEAN;
  3405. SysCall IntuitionBase 264;
  3406. procedure SetPointer(window : pWindow location 'a0'; VAR pointer : Word location 'a1'; height : LongInt location 'd0'; width : LongInt location 'd1'; xOffset : LongInt location 'd2'; yOffset : LongInt location 'd3');
  3407. SysCall IntuitionBase 270;
  3408. procedure SetWindowTitles(window : pWindow location 'a0'; windowTitle : PChar location 'a1'; screenTitle : PChar location 'a2');
  3409. SysCall IntuitionBase 276;
  3410. procedure ShowTitle(screen : pScreen location 'a0'; showIt : LongInt location 'd0');
  3411. SysCall IntuitionBase 282;
  3412. procedure SizeWindow(window : pWindow location 'a0'; dx : LongInt location 'd0'; dy : LongInt location 'd1');
  3413. SysCall IntuitionBase 288;
  3414. function ViewAddress : pView;
  3415. SysCall IntuitionBase 294;
  3416. function ViewPortAddress(window : pWindow location 'a0') : pViewPort;
  3417. SysCall IntuitionBase 300;
  3418. procedure WindowToBack(window : pWindow location 'a0');
  3419. SysCall IntuitionBase 306;
  3420. procedure WindowToFront(window : pWindow location 'a0');
  3421. SysCall IntuitionBase 312;
  3422. function WindowLimits(window : pWindow location 'a0'; widthMin : LongInt location 'd0'; heightMin : LongInt location 'd1'; widthMax : CARDINAL location 'd2'; heightMax : CARDINAL location 'd3') : BOOLEAN;
  3423. SysCall IntuitionBase 318;
  3424. function SetPrefs(preferences : pPreferences location 'a0'; size : LongInt location 'd0'; inform : LongInt location 'd1') : pPreferences;
  3425. SysCall IntuitionBase 324;
  3426. function IntuiTextLength(iText : pIntuiText location 'a0') : LongInt;
  3427. SysCall IntuitionBase 330;
  3428. function WBenchToBack : BOOLEAN;
  3429. SysCall IntuitionBase 336;
  3430. function WBenchToFront : BOOLEAN;
  3431. SysCall IntuitionBase 342;
  3432. function AutoRequest(window : pWindow location 'a0'; body : pIntuiText location 'a1'; posText : pIntuiText location 'a2'; negText : pIntuiText location 'a3'; pFlag : CARDINAL location 'd0'; nFlag : CARDINAL location 'd1'; width : CARDINAL location 'd2'; height : CARDINAL location 'd3') : BOOLEAN;
  3433. SysCall IntuitionBase 348;
  3434. procedure BeginRefresh(window : pWindow location 'a0');
  3435. SysCall IntuitionBase 354;
  3436. function BuildSysRequest(window : pWindow location 'a0'; body : pIntuiText location 'a1'; posText : pIntuiText location 'a2'; negText : pIntuiText location 'a3'; flags : CARDINAL location 'd0'; width : CARDINAL location 'd1'; height : CARDINAL location 'd2') : pWindow;
  3437. SysCall IntuitionBase 360;
  3438. procedure EndRefresh(window : pWindow location 'a0'; complete : LongInt location 'd0');
  3439. SysCall IntuitionBase 366;
  3440. procedure FreeSysRequest(window : pWindow location 'a0');
  3441. SysCall IntuitionBase 372;
  3442. function MakeScreen(screen : pScreen location 'a0') : LongInt;
  3443. SysCall IntuitionBase 378;
  3444. function RemakeDisplay : LongInt;
  3445. SysCall IntuitionBase 384;
  3446. function RethinkDisplay : LongInt;
  3447. SysCall IntuitionBase 390;
  3448. function AllocRemember(var rememberKey : pRemember location 'a0'; size : CARDINAL location 'd0'; flags : CARDINAL location 'd1') : POINTER;
  3449. SysCall IntuitionBase 396;
  3450. procedure FreeRemember(var rememberKey : pRemember location 'a0'; reallyForget : LongInt location 'd0');
  3451. SysCall IntuitionBase 408;
  3452. function LockIBase(dontknow : CARDINAL location 'd0') : CARDINAL;
  3453. SysCall IntuitionBase 414;
  3454. procedure UnlockIBase(ibLock : CARDINAL location 'a0');
  3455. SysCall IntuitionBase 420;
  3456. function GetScreenData(buffer : POINTER location 'a0'; size : CARDINAL location 'd0'; type1 : CARDINAL location 'd1'; screen : pScreen location 'a1') : LongInt;
  3457. SysCall IntuitionBase 426;
  3458. procedure RefreshGList(gadgets : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2'; numGad : LongInt location 'd0');
  3459. SysCall IntuitionBase 432;
  3460. function AddGList(window : pWindow location 'a0'; gadget : pGadget location 'a1'; position : CARDINAL location 'd0'; numGad : LongInt location 'd1'; requester : pRequester location 'a2') : Word;
  3461. SysCall IntuitionBase 438;
  3462. function RemoveGList(remPtr : pWindow location 'a0'; gadget : pGadget location 'a1'; numGad : LongInt location 'd0') : Word;
  3463. SysCall IntuitionBase 444;
  3464. procedure ActivateWindow(window : pWindow location 'a0');
  3465. SysCall IntuitionBase 450;
  3466. procedure RefreshWindowFrame(window : pWindow location 'a0');
  3467. SysCall IntuitionBase 456;
  3468. function ActivateGadget(gadgets : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2') : BOOLEAN;
  3469. SysCall IntuitionBase 462;
  3470. procedure NewModifyProp(gadget : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2'; flags : CARDINAL location 'd0'; horizPot : CARDINAL location 'd1'; vertPot : CARDINAL location 'd2'; horizBody : CARDINAL location 'd3'; vertBody : CARDINAL location 'd4'; numGad : LongInt location 'd5');
  3471. SysCall IntuitionBase 468;
  3472. function QueryOverscan(displayID : CARDINAL location 'a0'; rect : pRectangle location 'a1'; oScanType : LongInt location 'd0') : LongInt;
  3473. SysCall IntuitionBase 474;
  3474. procedure MoveWindowInFrontOf(window : pWindow location 'a0'; behindWindow : pWindow location 'a1');
  3475. SysCall IntuitionBase 480;
  3476. procedure ChangeWindowBox(window : pWindow location 'a0'; left : LongInt location 'd0'; top : LongInt location 'd1'; width : LongInt location 'd2'; height : LongInt location 'd3');
  3477. SysCall IntuitionBase 486;
  3478. function SetEditHook(hook : pHook location 'a0') : pHook;
  3479. SysCall IntuitionBase 492;
  3480. function SetMouseQueue(window : pWindow location 'a0'; queueLength : CARDINAL location 'd0') : LongInt;
  3481. SysCall IntuitionBase 498;
  3482. procedure ZipWindow(window : pWindow location 'a0');
  3483. SysCall IntuitionBase 504;
  3484. function LockPubScreen(name : PChar location 'a0') : pScreen;
  3485. SysCall IntuitionBase 510;
  3486. procedure UnlockPubScreen(name : PChar location 'a0'; screen : pScreen location 'a1');
  3487. SysCall IntuitionBase 516;
  3488. function LockPubScreenList : pList;
  3489. SysCall IntuitionBase 522;
  3490. procedure UnlockPubScreenList;
  3491. SysCall IntuitionBase 528;
  3492. function NextPubScreen(screen : pScreen location 'a0'; namebuf : PChar location 'a1') : PChar;
  3493. SysCall IntuitionBase 534;
  3494. procedure SetDefaultPubScreen(name : PChar location 'a0');
  3495. SysCall IntuitionBase 540;
  3496. function SetPubScreenModes(modes : CARDINAL location 'd0') : Word;
  3497. SysCall IntuitionBase 546;
  3498. function PubScreenStatus(screen : pScreen location 'a0'; statusFlags : CARDINAL location 'd0') : Word;
  3499. SysCall IntuitionBase 552;
  3500. function ObtainGIRPort(gInfo : pGadgetInfo location 'a0') : pRastPort;
  3501. SysCall IntuitionBase 558;
  3502. procedure ReleaseGIRPort(rp : pRastPort location 'a0');
  3503. SysCall IntuitionBase 564;
  3504. procedure GadgetMouse(gadget : pGadget location 'a0'; gInfo : pGadgetInfo location 'a1'; VAR mousePoint : INTEGER location 'a2');
  3505. SysCall IntuitionBase 570;
  3506. procedure GetDefaultPubScreen(nameBuffer : PChar location 'a0');
  3507. SysCall IntuitionBase 582;
  3508. function EasyRequestArgs(window : pWindow location 'a0'; easyStruct : pEasyStruct location 'a1'; idcmpPtr : Pointer location 'a2'; args : POINTER location 'a3') : LongInt;
  3509. SysCall IntuitionBase 588;
  3510. function BuildEasyRequestArgs(window : pWindow location 'a0'; easyStruct : pEasyStruct location 'a1'; idcmp : CARDINAL location 'd0'; args : POINTER location 'a3') : pWindow;
  3511. SysCall IntuitionBase 594;
  3512. function SysReqHandler(window : pWindow location 'a0'; VAR idcmpPtr : CARDINAL location 'a1'; waitInput : LongInt location 'd0') : LongInt;
  3513. SysCall IntuitionBase 600;
  3514. function OpenWindowTagList(newWindow : pNewWindow location 'a0'; tagList : pTagItem location 'a1') : pWindow;
  3515. SysCall IntuitionBase 606;
  3516. function OpenWindowTags(newWindow : pNewWindow; tagList : array of DWord) : pWindow; Inline;
  3517. function OpenScreenTagList(newScreen : pNewScreen location 'a0'; tagList : pTagItem location 'a1') : pScreen;
  3518. SysCall IntuitionBase 612;
  3519. function OpenScreenTags(newScreen : pNewScreen; tagList : array of DWord) : pScreen; Inline;
  3520. procedure DrawImageState(rp : pRastPort location 'a0'; image : pImage location 'a1'; leftOffset : LongInt location 'd0'; topOffset : LongInt location 'd1'; state : CARDINAL location 'd2'; drawInfo : pDrawInfo location 'a2');
  3521. SysCall IntuitionBase 618;
  3522. function PointInImage(point : CARDINAL location 'd0'; image : pImage location 'a0') : BOOLEAN;
  3523. SysCall IntuitionBase 624;
  3524. procedure EraseImage(rp : pRastPort location 'a0'; image : pImage location 'a1'; leftOffset : LongInt location 'd0'; topOffset : LongInt location 'd1');
  3525. SysCall IntuitionBase 630;
  3526. function NewObjectA(classPtr : pIClass location 'a0'; classID : PChar location 'a1'; tagList : pTagItem location 'a2') : POINTER;
  3527. SysCall IntuitionBase 636;
  3528. function NewObject(classPtr : pIClass; classID : PChar; tags: array of LongWord) : POINTER;
  3529. procedure DisposeObject(object1 : POINTER location 'a0');
  3530. SysCall IntuitionBase 642;
  3531. function SetAttrsA(object1 : POINTER location 'a0'; tagList : pTagItem location 'a1') : CARDINAL;
  3532. SysCall IntuitionBase 648;
  3533. function GetAttr(attrID : CARDINAL location 'd0'; object1 : POINTER location 'a0'; VAR storagePtr : CARDINAL location 'a1') : CARDINAL;
  3534. SysCall IntuitionBase 654;
  3535. function SetGadgetAttrsA(gadget : pGadget location 'a0'; window : pWindow location 'a1'; requester : pRequester location 'a2'; tagList : pTagItem location 'a3') : CARDINAL;
  3536. SysCall IntuitionBase 660;
  3537. function NextObject(objectPtrPtr : POINTER location 'a0') : POINTER;
  3538. SysCall IntuitionBase 666;
  3539. function MakeClass(classID : PChar location 'a0'; superClassID : PChar location 'a1'; superClassPtr : pIClass location 'a2'; instanceSize : CARDINAL location 'd0'; flags : CARDINAL location 'd1') : pIClass;
  3540. SysCall IntuitionBase 678;
  3541. procedure AddClass(classPtr : pIClass location 'a0');
  3542. SysCall IntuitionBase 684;
  3543. function GetScreenDrawInfo(screen : pScreen location 'a0') : pDrawInfo;
  3544. SysCall IntuitionBase 690;
  3545. procedure FreeScreenDrawInfo(screen : pScreen location 'a0'; drawInfo : pDrawInfo location 'a1');
  3546. SysCall IntuitionBase 696;
  3547. function ResetMenuStrip(window : pWindow location 'a0'; menu : pMenu location 'a1') : BOOLEAN;
  3548. SysCall IntuitionBase 702;
  3549. procedure RemoveClass(classPtr : pIClass location 'a0');
  3550. SysCall IntuitionBase 708;
  3551. function FreeClass(classPtr : pIClass location 'a0') : BOOLEAN;
  3552. SysCall IntuitionBase 714;
  3553. function AllocScreenBuffer(sc : pScreen location 'a0'; bm : pBitMap location 'a1'; flags : CARDINAL location 'd0') : pScreenBuffer;
  3554. SysCall IntuitionBase 768;
  3555. procedure FreeScreenBuffer(sc : pScreen location 'a0'; sb : pScreenBuffer location 'a1');
  3556. SysCall IntuitionBase 774;
  3557. function ChangeScreenBuffer(sc : pScreen location 'a0'; sb : pScreenBuffer location 'a1') : CARDINAL;
  3558. SysCall IntuitionBase 780;
  3559. procedure ScreenDepth(screen : pScreen location 'a0'; flags : CARDINAL location 'd0'; reserved : POINTER location 'a1');
  3560. SysCall IntuitionBase 786;
  3561. procedure ScreenPosition(screen : pScreen location 'a0'; flags : CARDINAL location 'd0'; x1 : LongInt location 'd1'; y1 : LongInt location 'd2'; x2 : LongInt location 'd3'; y2 : LongInt location 'd4');
  3562. SysCall IntuitionBase 792;
  3563. procedure ScrollWindowRaster(win : pWindow location 'a1'; dx : LongInt location 'd0'; dy : LongInt location 'd1'; xMin : LongInt location 'd2'; yMin : LongInt location 'd3'; xMax : LongInt location 'd4'; yMax : LongInt location 'd5');
  3564. SysCall IntuitionBase 798;
  3565. procedure LendMenus(fromwindow : pWindow location 'a0'; towindow : pWindow location 'a1');
  3566. SysCall IntuitionBase 804;
  3567. function DoGadgetMethodA(gad : pGadget location 'a0'; win : pWindow location 'a1'; req : pRequester location 'a2'; message : pLongInt location 'a3') : CARDINAL;
  3568. SysCall IntuitionBase 810;
  3569. procedure SetWindowPointerA(win : pWindow location 'a0'; taglist : pTagItem location 'a1');
  3570. SysCall IntuitionBase 816;
  3571. function TimedDisplayAlert(alertNumber : CARDINAL location 'd0'; string1 : PChar location 'a0'; height : CARDINAL location 'd1'; time : CARDINAL location 'a1') : BOOLEAN;
  3572. SysCall IntuitionBase 822;
  3573. procedure HelpControl(win : pWindow location 'a0'; flags : CARDINAL location 'd0');
  3574. SysCall IntuitionBase 828;
  3575. procedure ShowWindow(win : pWindow location 'a0');
  3576. SysCall IntuitionBase 840;
  3577. procedure HideWindow(win : pWindow location 'a0');
  3578. SysCall IntuitionBase 846;
  3579. function GetSkinInfoAttrA(drawinfo : pDrawInfo location 'a0'; attr : CARDINAL location 'd0'; taglist : pTagItem location 'a1') : CARDINAL;
  3580. SysCall IntuitionBase 918;
  3581. function GetDrawInfoAttr(drawinfo : pDrawInfo location 'a0'; attr : CARDINAL location 'd0'; VAR errorPtr : CARDINAL location 'a1') : CARDINAL;
  3582. SysCall IntuitionBase 936;
  3583. procedure WindowAction(window : pWindow location 'a0'; action : CARDINAL location 'd0'; tags : pTagItem location 'a1');
  3584. SysCall IntuitionBase 942;
  3585. function TransparencyControl(window : pWindow location 'a0'; method : CARDINAL location 'd0'; tags : pTagItem location 'a1') : BOOLEAN;
  3586. SysCall IntuitionBase 948;
  3587. procedure ScrollWindowRasterNoFill(win : pWindow location 'a1'; dx : LongInt location 'd0'; dy : LongInt location 'd1'; xMin : LongInt location 'd2'; yMin : LongInt location 'd3'; xMax : LongInt location 'd4'; yMax : LongInt location 'd5');
  3588. SysCall IntuitionBase 954;
  3589. { Intuition macros }
  3590. function INST_DATA (cl: pIClass; o: p_Object): Pointer;
  3591. function SIZEOF_INSTANCE (cl: pIClass): Longint;
  3592. function BASEOBJECT (o: p_Object): Pointer;
  3593. function _OBJ(o: p_Object): p_Object;
  3594. function __OBJECT (o: Pointer): p_Object;
  3595. function OCLASS (o: Pointer): pIClass;
  3596. function SHIFTITEM (n: smallint): word;
  3597. function SHIFTMENU (n: smallint): word;
  3598. function SHIFTSUB (n: smallint): word;
  3599. function FULLMENUNUM (menu, item, sub: smallint): word;
  3600. function IM_BGPEN (im: pImage): byte;
  3601. function IM_BOX (im: pImage): pIBox;
  3602. function IM_FGPEN (im: pImage): byte;
  3603. function GADGET_BOX (g: pGadget): pIBox;
  3604. function CUSTOM_HOOK (gadget: pGadget): pHook;
  3605. function ITEMNUM( n : Word): Word;
  3606. function MENUNUM( n : Word): Word;
  3607. function SUBNUM( n : Word): Word;
  3608. {
  3609. FUNCTION DisplayAlert(alertNumber : Cardinal;string_ : string; height : Cardinal) : BOOLEAN;
  3610. FUNCTION LockPubScreen(name : string) : pScreen;
  3611. FUNCTION MakeClass(classID : string;superClassID : pCHAR;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass;
  3612. FUNCTION MakeClass(classID : pCHAR;superClassID : string;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass;
  3613. FUNCTION MakeClass(classID : string;superClassID : string;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass;
  3614. FUNCTION NewObjectA(classPtr : pIClass;classID : string;tagList : pTagItem) : POINTER;
  3615. PROCEDURE SetDefaultPubScreen(name : string);
  3616. PROCEDURE SetWindowTitles(window : pWindow;windowTitle : string;screenTitle : pCHAR);
  3617. PROCEDURE SetWindowTitles(window : pWindow;windowTitle : pCHAR;screenTitle : string);
  3618. PROCEDURE SetWindowTitles(window : pWindow;windowTitle : string;screenTitle : string);
  3619. FUNCTION TimedDisplayAlert(alertNumber : Cardinal;string_ : string; height : Cardinal; time : Cardinal) : BOOLEAN;
  3620. PROCEDURE UnlockPubScreen(name : string; screen : pScreen);
  3621. }
  3622. { Helper calls }
  3623. function InitIntuitionLibrary : boolean;
  3624. implementation
  3625. {$WARNING Ugly workaround, this still needs support in the compiler}
  3626. function OpenScreenTags(newScreen : pNewScreen; tagList : array of DWord) : pScreen; Inline;
  3627. begin
  3628. OpenScreenTags:=OpenScreenTagList(newScreen,@tagList);
  3629. end;
  3630. function OpenWindowTags(newWindow : pNewWindow; tagList : array of DWord) : pWindow; Inline;
  3631. begin
  3632. OpenWindowTags:=OpenWindowTagList(newWindow,@tagList);
  3633. end;
  3634. function NewObject(classPtr : pIClass; classID : PChar; tags: array of LongWord) : POINTER; inline;
  3635. begin
  3636. NewObject:=NewObjectA(classPtr, classID, @tags);
  3637. end;
  3638. function INST_DATA (cl: pIClass; o: p_Object): Pointer;
  3639. begin
  3640. INST_DATA := Pointer(Longint(o) + cl^.cl_InstOffset);
  3641. end;
  3642. function SIZEOF_INSTANCE (cl: pIClass): Longint;
  3643. begin
  3644. SIZEOF_INSTANCE := cl^.cl_InstOffset + cl^.cl_InstSize + sizeof(t_Object);
  3645. end;
  3646. function BASEOBJECT (o: p_Object): Pointer;
  3647. begin
  3648. BASEOBJECT := Pointer(Longint(o) + sizeof(t_Object));
  3649. end;
  3650. function _OBJ(o: p_Object): p_Object;
  3651. begin
  3652. _OBJ := p_Object(o);
  3653. END;
  3654. function __OBJECT (o: Pointer): p_Object;
  3655. begin
  3656. __OBJECT := p_Object(Longint(o) - sizeof(t_Object))
  3657. end;
  3658. function OCLASS (o: Pointer): pIClass;
  3659. var
  3660. obj: p_Object;
  3661. begin
  3662. obj := p_Object(Longint(o) - sizeof(t_Object));
  3663. OCLASS := obj^.o_Class;
  3664. end;
  3665. function SHIFTITEM (n: smallint): word;
  3666. begin
  3667. SHIFTITEM := (n and $3f) shl 5
  3668. end;
  3669. function SHIFTMENU (n: smallint): word;
  3670. begin
  3671. SHIFTMENU := n and $1f
  3672. end;
  3673. function SHIFTSUB (n: smallint): word;
  3674. begin
  3675. SHIFTSUB := (n and $1f) shl 11
  3676. end;
  3677. function FULLMENUNUM (menu, item, sub: smallint): word;
  3678. begin
  3679. FULLMENUNUM := ((sub and $1f) shl 11) or
  3680. ((item and $3f) shl 5) or
  3681. (menu and $1f)
  3682. end;
  3683. { The next functons _BGPEN AND _FGPEN aren't a full replacement of the
  3684. C macros because the C preprocessor makes it possible to set the
  3685. A/BPen values of the image class objects as well. This can't work
  3686. in pascal, of course! }
  3687. function IM_BGPEN (im: pImage): byte;
  3688. begin
  3689. IM_BGPEN := im^.PlaneOnOff;
  3690. end;
  3691. function IM_BOX (im: pImage): pIBox;
  3692. begin
  3693. IM_BOX := pIBox(@im^.LeftEdge);
  3694. END;
  3695. function IM_FGPEN (im: pImage): byte;
  3696. begin
  3697. IM_FGPEN := im^.PlanePick;
  3698. end;
  3699. function GADGET_BOX (g: pGadget): pIBox;
  3700. begin
  3701. GADGET_BOX := pIBox(@g^.LeftEdge);
  3702. end;
  3703. function CUSTOM_HOOK (gadget: pGadget): pHook;
  3704. begin
  3705. CUSTOM_HOOK := pHook(gadget^.MutualExclude);
  3706. end;
  3707. function ITEMNUM( n : Word): Word;
  3708. begin
  3709. ITEMNUM := (n shr 5) and $3F
  3710. end;
  3711. function MENUNUM( n : Word): Word;
  3712. begin
  3713. MENUNUM := n and $1f
  3714. end;
  3715. function SUBNUM( n : Word): Word;
  3716. begin
  3717. SUBNUM := (n shr 11) and $1f
  3718. end;
  3719. {
  3720. FUNCTION DisplayAlert(alertNumber : Cardinal;string_ : string; height : Cardinal) : BOOLEAN;
  3721. begin
  3722. DisplayAlert := DisplayAlert(alertNumber,pas2c(string_),height);
  3723. end;
  3724. FUNCTION LockPubScreen(name : string) : pScreen;
  3725. begin
  3726. LockPubScreen := LockPubScreen(pas2c(name));
  3727. end;
  3728. FUNCTION MakeClass(classID : string;superClassID : pCHAR;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass;
  3729. begin
  3730. MakeClass := MakeClass(pas2c(classID),superClassID,superClassPtr,instanceSize,flags);
  3731. end;
  3732. FUNCTION MakeClass(classID : pCHAR;superClassID : string;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass;
  3733. begin
  3734. MakeClass := MakeClass(classID,pas2c(superClassID),superClassPtr,instanceSize,flags);
  3735. end;
  3736. FUNCTION MakeClass(classID : string;superClassID : string;superClassPtr : pIClass; instanceSize : Cardinal; flags : Cardinal) : pIClass;
  3737. begin
  3738. MakeClass := MakeClass(pas2c(classID),pas2c(superClassID),superClassPtr,instanceSize,flags);
  3739. end;
  3740. FUNCTION NewObjectA(classPtr : pIClass;classID : string;tagList : pTagItem) : POINTER;
  3741. begin
  3742. NewObjectA := NewObjectA(classPtr,pas2c(classID),taglist);
  3743. end;
  3744. PROCEDURE SetDefaultPubScreen(name : string);
  3745. begin
  3746. SetDefaultPubScreen(pas2c(name));
  3747. end;
  3748. PROCEDURE SetWindowTitles(window : pWindow;windowTitle : string;screenTitle : pCHAR);
  3749. begin
  3750. SetWindowTitles(window,pas2c(windowTitle),screenTitle);
  3751. end;
  3752. PROCEDURE SetWindowTitles(window : pWindow;windowTitle : pCHAR;screenTitle : string);
  3753. begin
  3754. SetWindowTitles(window,windowTitle,pas2c(screenTitle));
  3755. end;
  3756. PROCEDURE SetWindowTitles(window : pWindow;windowTitle : string;screenTitle : string);
  3757. begin
  3758. SetWindowTitles(window,pas2c(windowTitle),pas2c(screenTitle));
  3759. end;
  3760. FUNCTION TimedDisplayAlert(alertNumber : Cardinal;string_ : string; height : Cardinal; time : Cardinal) : BOOLEAN;
  3761. begin
  3762. TimedDisplayAlert := TimedDisplayAlert(alertNumber,pas2c(string_),height,time);
  3763. end;
  3764. PROCEDURE UnlockPubScreen(name : string; screen : pScreen);
  3765. begin
  3766. UnlockPubScreen(pas2c(name),screen);
  3767. end;
  3768. }
  3769. const
  3770. { Change VERSION and LIBVERSION to proper values }
  3771. VERSION : string[2] = '50';
  3772. LIBVERSION : longword = 50;
  3773. var
  3774. intuition_exit : Pointer;
  3775. procedure CloseIntuitionLibrary;
  3776. begin
  3777. ExitProc := intuition_exit;
  3778. if IntuitionBase <> nil then begin
  3779. CloseLibrary(PLibrary(IntuitionBase));
  3780. IntuitionBase := nil;
  3781. end;
  3782. end;
  3783. function InitIntuitionLibrary : boolean;
  3784. begin
  3785. IntuitionBase := nil;
  3786. IntuitionBase := OpenLibrary(INTUITIONNAME,LIBVERSION);
  3787. if IntuitionBase <> nil then begin
  3788. intuition_exit := ExitProc;
  3789. ExitProc := @CloseIntuitionLibrary;
  3790. InitIntuitionLibrary:=True;
  3791. end else begin
  3792. InitIntuitionLibrary:=False;
  3793. end;
  3794. end;
  3795. end. (* UNIT INTUITION *)