intuition.pas 180 KB

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