intuition.pas 174 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2014 by Free Pascal development team
  4. intuition.library functions
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. unit Intuition;
  12. {$define INTUI_V36_NAMES_ONLY}
  13. interface
  14. uses
  15. Exec, Utility, AGraphics, InputEvent, Timer, Layers, Keymap;
  16. type
  17. { IntuiText is a series of strings that start with a screen location
  18. (always relative to the upper-left corner of something) and then the
  19. text of the string. The text is null-terminated.}
  20. PIntuiText = ^TIntuiText;
  21. TIntuiText = record
  22. FrontPen,
  23. BackPen: Byte; // the pen numbers for the rendering
  24. DrawMode: Byte; // the mode for rendering the text
  25. LeftEdge: SmallInt; // relative start location for the text
  26. TopEdge: SmallInt; // relative start location for the text
  27. ITextFont: PTextAttr; // if nil, you accept the default
  28. IText: PChar; // pointer to null-terminated text
  29. NextText: PIntuiText; // continuation to TxWrite another text
  30. end;
  31. PStringExtend = ^TStringExtend;
  32. TStringExtend = record
  33. // display specifications
  34. Font: PTextFont; // must be an open Font (not TextAttr)
  35. Pens: array[0..1] of Byte; // color of text/background
  36. ActivePens: array[0..1] of Byte; // colors when gadget is active
  37. // edit specifications
  38. InitialModes: LongWord; // initial mode flags, below
  39. EditHook: PHook; // IF non-nil, must supply WorkBuffer
  40. WorkBuffer: STRPTR; // must be as large as StringInfo.Buffer
  41. Reserved: array[0..3] of LongWord; // set to 0
  42. end;
  43. { Data type Border, used for drawing a series of lines which is intended for use as a border drawing, but which may, in fact, be used to render any
  44. arbitrary vector shape. The routine DrawBorder sets up the RastPort with the appropriate variables, then does a Move to the first coordinate, then does Draws
  45. to the subsequent coordinates. After all the Draws are done, if NextBorder is non-zero we call DrawBorder recursively}
  46. type
  47. PBorder = ^TBorder;
  48. TBorder = record
  49. LeftEdge,
  50. TopEdge: SmallInt; // initial offsets from the origin
  51. FrontPen,
  52. BackPen: Byte; // pens numbers for rendering
  53. DrawMode: Byte; // mode for rendering
  54. Count: ShortInt; // number of XY pairs
  55. XY: PSmallInt; // vector coordinate pairs rel to LeftTop
  56. NextBorder: PBorder; // pointer to any other Border too
  57. end;
  58. type
  59. PMenuItem = ^TMenuItem;
  60. TMenuItem = record
  61. NextItem: PMenuItem; // pointer to next in chained list
  62. LeftEdge,
  63. TopEdge: SmallInt; // position of the select box
  64. Width,
  65. Height: SmallInt; // dimensions of the select box
  66. Flags: Word; // see the defines below
  67. MutualExclude: LongInt; // set bits mean this item excludes that
  68. ItemFill: APTR; // points to Image, IntuiText, or nil
  69. SelectFill: APTR; // points to Image, IntuiText, or nil when this item is pointed to by the cursor and the items highlight mode HIGHIMAGE is selected, this alternate image will be displayed
  70. Command: Char; // only if appliprog sets the COMMSEQ flag
  71. SubItem: PMenuItem; // if non-nil, DrawMenu shows "->"
  72. NextSelect: Word; // The NextSelect field represents the menu number of next selected item (when user has drag-selected several items)
  73. end;
  74. const
  75. // Flags set by the Application
  76. CHECKIT = 1 shl 0; // whether to check this item if selected
  77. ITEMTEXT = 1 shl 1; // set if textual, clear if graphical item
  78. COMMSEQ = 1 shl 2; // set if there's an command sequence
  79. MENUTOGGLE = 1 shl 3; // set to toggle the check of a menu item
  80. ITEMENABLED = 1 shl 4; // set if this item is enabled
  81. // these are the SPECIAL HIGHLIGHT FLAG state meanings
  82. HIGHIMAGE = $0000; // use the user's "select image"
  83. HIGHCOMP = 1 shl 6; // highlight by complementing the selectbox
  84. HIGHBOX = 1 shl 7; // highlight by "boxing" the selectbox
  85. HIGHFLAGS = $00C0; // see definitions below for these bits
  86. HIGHNONE = $00C0; // don't highlight
  87. // Flags set by both Application and intuition
  88. Checked = 1 shl 8; // if CHECKIT, then set this when selected
  89. // Flags set by Intuition (Read Only)
  90. ISDRAWN = 1 shl 12; // this item's subs are currently drawn
  91. HIGHITEM = 1 shl 13; // this item is currently highlighted
  92. MENUTOGGLED = 1 shl 14; // this item was already toggled
  93. NOMENU = $001F;
  94. NOITEM = $003F;
  95. NOSUB = $001F;
  96. MENUNULL = $FFFF;
  97. { these defines are for the COMMSEQ and CHECKIT menu stuff. If CHECKIT,
  98. I'll use a generic Width (for all resolutions) for the CheckMark.
  99. If COMMSEQ, likewise I'll use this generic stuff}
  100. CHECKWIDTH = 19;
  101. LOWCHECKWIDTH = 13;
  102. COMMWIDTH = 27;
  103. LOWCOMMWIDTH = 16;
  104. type
  105. PMenu = ^TMenu;
  106. TMenu = record
  107. NextMenu: PMenu; // same level
  108. LeftEdge,
  109. TopEdge: SmallInt; // position of the select box
  110. Width,
  111. Height: SmallInt; // dimensions of the select box
  112. Flags: Word; // see flag definitions below (MENUENABLED, MIDRAWN)
  113. MenuName: PChar; // text for this Menu Header
  114. FirstItem: PMenuItem; // pointer to first in chain
  115. JazzX, // these mysteriously-named variables are for internal use only
  116. JazzY,
  117. BeatX,
  118. BeatY: SmallInt;
  119. end;
  120. const
  121. // FLAGS SET BY BOTH THE APPLIPROG AND INTUITION
  122. MENUENABLED = 1 shl 0; // whether or not this menu is enabled
  123. // FLAGS SET BY INTUITION }
  124. MIDRAWN = 1 shl 8; // this menu's items are currently drawn
  125. type
  126. PGadget = ^TGadget;
  127. TGadget = record
  128. NextGadget: PGadget; // next gadget in the list
  129. LeftEdge,
  130. TopEdge: SmallInt; // "hit box" of gadget
  131. Width,
  132. Height: SmallInt; // "hit box" of gadget
  133. Flags: Word; // see below for list of defines GFLG_*
  134. Activation: Word; // see below for list of defines GACT_*
  135. GadgetType: Word; // see below for defines GTYP_*
  136. GadgetRender: APTR; // appliprog can specify that the Gadget be rendered as either as Border
  137. // or an Image. This variable points to which (or equals nil if there's nothing to be rendered about this Gadget)
  138. SelectRender: APTR; // appliprog can specify "highlighted" imagery rather than algorithmic this can point to either Border or Image data
  139. GadgetText: PIntuiText; // text for this gadget
  140. MutualExclude: IPTR; // obsolete
  141. SpecialInfo: APTR; // pointer to a structure of special data required by Proportional, String and LongInt Gadgets
  142. GadgetID: Word; // user-definable ID field
  143. UserData: APTR; // ptr to general purpose User data (ignored by In)
  144. end;
  145. PExtGadget = ^TExtGadget;
  146. TExtGadget = record
  147. // The first fields match struct Gadget exactly
  148. NextGadget: PExtGadget; // Matches struct Gadget
  149. LeftEdge, TopEdge, // Matches struct Gadget
  150. Width, Height: SmallInt; // Matches struct Gadget
  151. Flags, // Matches struct Gadget
  152. Activation, // Matches struct Gadget
  153. GadgetType: Word; // Matches struct Gadget
  154. GadgetRender, // Matches struct Gadget
  155. SelectRender: APTR; // Matches struct Gadget
  156. GadgetText: PIntuiText; // Matches struct Gadget
  157. MutualExclude: IPTR; // Matches struct Gadget
  158. SpecialInfo: APTR; // Matches struct Gadget
  159. GadgetID: Word; // Matches struct Gadget
  160. UserData: APTR; // Matches struct Gadget
  161. // These fields only exist if GFLG_EXTENDED is set
  162. MoreFlags: LongWord; // see GMORE_* flags below
  163. BoundsLeftEdge, // Bounding extent for gadget, valid
  164. BoundsTopEdge, // only if GMORE_BOUNDS is set. The
  165. BoundsWidth, // GFLG_RELxxx flags affect these
  166. BoundsHeight: SmallInt; // coordinates as well.
  167. end;
  168. const
  169. // Gadget.Flags values
  170. // combinations in these bits describe the highlight technique to be used
  171. GFLG_GADGHCOMP = $0000; // Complement the select box
  172. GFLG_GADGHBOX = 1 shl 0; // Draw a box around the image
  173. GFLG_GADGHIMAGE = 1 shl 1; // Blast in this alternate image
  174. GFLG_GADGHNONE = $0003; // don't highlight
  175. GFLG_GADGHIGHBITS = $0003;
  176. GFLG_GADGIMAGE = 1 shl 2; // set IF GadgetRender AND SelectRender point to an Image structure, clear if they point to Border structures
  177. { combinations in these next two bits specify to which corner the gadget's Left & Top coordinates are relative. If relative to Top/Left,
  178. these are "normal" coordinates (everything is relative to something in this universe).
  179. Gadget positions and dimensions are relative to the window or requester which contains the gadget}
  180. GFLG_RELBOTTOM = 1 shl 3; // vert. pos. is relative to bottom edge
  181. GFLG_RELRIGHT = 1 shl 4; // horiz. pos. is relative to right edge
  182. GFLG_RELWIDTH = 1 shl 5; // width is relative to req/window
  183. GFLG_RELHEIGHT = 1 shl 6; // height is relative to req/window
  184. GFLG_SELECTED = 1 shl 7; // you may initialize AND look at this
  185. GFLG_DISABLED = 1 shl 8; // the GFLG_DISABLED flag is initialized by you and later set by Intuition according to your calls to On/OffGadget(). It specifies whether or not this Gadget is currently disabled from being selected
  186. GFLG_TABCYCLE = 1 shl 9; // (string OR custom) gadget participates in cycling activation with Tab or Shift-Tab
  187. GFLG_STRINGEXTEND = 1 shl 10; // this String Gadget has StringExtend
  188. GFLG_IMAGEDISABLE = 1 shl 11; // Gadget's image knows how to do disabled rendering
  189. GFLG_LABELITEXT = $0000; // GadgetText points to IntuiText
  190. GFLG_LABELSTRING = 1 shl 12; // GadgetText points to (PChar)
  191. GFLG_LABELIMAGE = 1 shl 13; // GadgetText points to Image (object)
  192. GFLG_LABELMASK = $3000;
  193. GFLG_RELSPECIAL = 1 shl 14; // custom gadget has special relativity. Gadget box values are absolutes, but can be changed via the GM_LAYOUT method.
  194. GFLG_EXTENDED = 1 shl 15; // Gadget is extended
  195. {GFLG_RELSPECIAL allows custom gadget implementors to
  196. make gadgets whose position and size depend in an arbitrary way
  197. on their window's dimensions. The GM_LAYOUT method will be invoked
  198. for such a gadget (or any other GREL_xxx gadget) at suitable times,
  199. such as when the window opens or the window's size changes.
  200. GFLG_STRINGEXTEND. We discovered that V34 doesn't properly
  201. ignore the value we had chosen for the Gadget->Activation flag
  202. GACT_STRINGEXTEND. NEVER SET THAT FLAG WHEN RUNNING UNDER V34.
  203. The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
  204. safe under V34, and equivalent to GACT_STRINGEXTEND under V37.
  205. (Note that the two flags are not numerically equal)
  206. GFLG_IMAGEDISABLE. This flag is automatically set if
  207. the custom image of this gadget knows how to do disabled rendering
  208. (more specifically, if its IA_SupportsDisable attribute is TRUE).
  209. Intuition uses this to defer the ghosting to the image-class,
  210. instead of doing it itself (the old compatible way).
  211. Do not set this flag yourself - Intuition will do it for you.
  212. GFLG_EXTENDED. If set, this bit means that the Gadget is actually
  213. a struct ExtGadget, with new fields and flags. All V39 boopsi
  214. gadgets are ExtGadgets. Never ever attempt to read the extended
  215. fields of a gadget if this flag is not set.
  216. GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive
  217. reports on mouse movements while this gadget is active.
  218. You probably want to set the GACT_IMMEDIATE flag when using
  219. GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
  220. learning why Intuition is suddenly sending you a stream of mouse
  221. movement events. If you don't set GACT_RELVERIFY, you'll get at
  222. least one Mouse Position event.
  223. }
  224. // Gadget.Activation flag values
  225. GACT_RELVERIFY = 1 shl 0; // Set if you want to verify that the pointer was still over the gadget when the select button was released. Will cause an IDCMP_GADGETUP message to be sent if so.
  226. GACT_IMMEDIATE = 1 shl 1; // when set, informs the caller that the gadget was activated when it was activated. This flag works in conjunction with the GACT_RELVERIFY flag
  227. GACT_ENDGADGET = 1 shl 2; // when set, tells the system that this gadget, when selected, causes the Requester to be ended. Requesters that are ended are erased and unlinked from the system.
  228. GACT_FOLLOWMOUSE = 1 shl 3;
  229. // if any of the BORDER flags are set in a Gadget that's included in the Gadget list when a Window is opened, the corresponding Border will be adjusted to make room for the Gadget
  230. GACT_RIGHTBORDER = 1 shl 4;
  231. GACT_LEFTBORDER = 1 shl 5;
  232. GACT_TOPBORDER = 1 shl 6;
  233. GACT_BOTTOMBORDER = 1 shl 7;
  234. GACT_TOGGLESELECT = 1 shl 8; // this bit for toggle-select mode
  235. // should properly be in StringInfo, but aren't
  236. GACT_STRINGLEFT = $0000; // NOTE WELL: that this has value zero
  237. GACT_STRINGCENTER = 1 shl 9;
  238. GACT_STRINGRIGHT = 1 shl 10;
  239. GACT_LONGINT = 1 shl 11; // this String Gadget is for Long Ints
  240. GACT_ALTKEYMAP = 1 shl 12; // this String has an alternate keymap
  241. GACT_STRINGEXTEND = 1 shl 13; // this String Gadget has StringExtend NOTE: NEVER SET GACT_STRINGEXTEND IF YOU ARE RUNNING ON LESS THAN V36! SEE GFLG_STRINGEXTEND (ABOVE) INSTEAD
  242. GACT_BOOLEXTEND = 1 shl 13; // this Boolean Gadget has a BoolInfo
  243. GACT_ACTIVEGADGET = 1 shl 14; // this gadget is "active". This flag is maintained by Intuition, and you cannot count on its value persisting
  244. // while you do something on your program's task. It can only be trusted by people implementing custom gadgets
  245. GACT_BORDERSNIFF = 1 shl 15; // neither set nor rely on this bit
  246. // GADGET TYPES
  247. {These are the Gadget type definitions for the variable GadgetType
  248. gadget number type MUST start from one. NO TYPES OF ZERO ALLOWED.
  249. first comes the mask for Gadget flags reserved for Gadget typing}
  250. GTYP_GADGETTYPE = $FC00; // all Gadget Global type flags (padded)
  251. GTYP_SYSTYPEMASK = $00F0;
  252. // system gadgets
  253. GTYP_SIZING = $0010;
  254. GTYP_WDRAGGING = $0020;
  255. GTYP_SDRAGGING = $0030;
  256. GTYP_WDEPTH = $0040;
  257. GTYP_SDEPTH = $0050;
  258. GTYP_WZOOM = $0060;
  259. GTYP_SUNUSED = $0070;
  260. GTYP_CLOSE = $0080;
  261. // application gadgets
  262. GTYP_REQGADGET = 1 shl 12; // 1 = this is a Requester Gadget
  263. GTYP_GZZGADGET = 1 shl 13; // 1 = for WFLG_GIMMEZEROZERO borders
  264. GTYP_SCRGADGET = 1 shl 14; // 1 = ScreenGadget, 0 = WindowGadget
  265. GTYP_SYSGADGET = 1 shl 15; // 1 = Allocated by the system, 0 = by app.
  266. GTYP_BOOLGADGET = $0001;
  267. GTYP_GADGET0002 = $0002;
  268. GTYP_PROPGADGET = $0003;
  269. GTYP_STRGADGET = $0004;
  270. GTYP_CUSTOMGADGET = $0005;
  271. GTYP_GTYPEMASK = $0007; //mask you can apply to tell what class of gadget this is. The possible classes follow.
  272. { Gadgets which have the GFLG_EXTENDED flag set are
  273. * actually ExtGadgets, which have more flags. The GMORE_xxx
  274. * identifiers describe those flags. For GMORE_SCROLLRASTER, see
  275. * important information in the ScrollWindowRaster() autodoc.
  276. * NB: GMORE_SCROLLRASTER must be set before the gadget is
  277. * added to a window.
  278. }
  279. GMORE_BOUNDS = 1 shl 0; // ExtGadget has valid Bounds
  280. GMORE_GADGETHELP = 1 shl 1; // This gadget responds to gadget help
  281. GMORE_SCROLLRASTER = 1 shl 2; // This (custom) gadget uses ScrollRaster
  282. GMORE_BOOPSIGADGET = 1 shl 3; // some internal boopsi classes changes the gadget type during execution (ie propgclass), so GTYP_CUSTOMGADGET doesn´t work (dariusb)
  283. type
  284. // Bool Gadget This is the special data needed by an Extended Boolean Gadget Typically this structure will be pointed to by the Gadget field SpecialInfo
  285. PBoolInfo = ^TBoolInfo;
  286. TBoolInfo = record
  287. Flags: Word; // defined below (BOOLMASK)
  288. Mask: PWord; // bit mask for highlighting and selecting mask must follow the same rules as an Image
  289. // plane. It's width and height are determined by the width and height of the gadget's select box. (i.e. Gadget.Width and .Height).
  290. Reserved: LongWord; // set to 0
  291. end;
  292. const
  293. // set BoolInfo.Flags to this flag bit. in the future, additional bits might mean more stuff hanging off of BoolInfo.Reserved.
  294. BOOLMASK = 1 shl 0; // extension is for masked gadget
  295. type
  296. // Proportional Gadget this is the special data required by the proportional Gadget typically, this data will be pointed to by the Gadget variable SpecialInfo
  297. PPropInfo = ^TPropInfo;
  298. TPropInfo = record
  299. Flags: Word; // general purpose flag bits (see defines below)
  300. { You initialize the Pot variables before the Gadget is added to
  301. the system. Then you can look here for the current settings
  302. any time, even while User is playing with this Gadget. To
  303. adjust these after the Gadget is added to the System, use
  304. ModifyProp(); The Pots are the actual proportional settings,
  305. where a value of zero means zero and a value of MAXPOT means
  306. that the Gadget is set to its maximum setting.}
  307. HorizPot: Word; // 16-bit FixedPoint horizontal quantity percentage
  308. VertPot: Word; // 16-bit FixedPoint vertical quantity percentage
  309. { the 16-bit FixedPoint Body variables describe what percentage of
  310. the entire body of stuff referred to by this Gadget is actually
  311. shown at one time. This is used with the AUTOKNOB routines,
  312. to adjust the size of the AUTOKNOB according to how much of
  313. the data can be seen. This is also used to decide how far
  314. to advance the Pots when User hits the Container of the Gadget.
  315. For instance, if you were controlling the display of a 5-line
  316. Window of text with this Gadget, and there was a total of 15
  317. lines that could be displayed, you would set the VertBody value to
  318. (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  319. Therefore, the AUTOKNOB would fill 1/3 of the container, and
  320. if User hits the Cotainer outside of the knob, the pot would
  321. advance 1/3 (plus or minus) If there's no body to show, or
  322. the total amount of displayable info is less than the display area,
  323. set the Body variables to the MAX. To adjust these after the
  324. Gadget is added to the System, use ModifyProp();}
  325. HorizBody: Word; // horizontal Body
  326. VertBody: Word; // vertical Body
  327. // these are the variables that Intuition sets and maintains
  328. CWidth: Word; // Container width (with any relativity absoluted)
  329. CHeight: Word; // Container height (with any relativity absoluted)
  330. HPotRes,
  331. VPotRes: Word; // pot increments
  332. LeftBorder: Word; // Container borders
  333. TopBorder: Word; // Container borders
  334. end;
  335. const
  336. // Flags BITS
  337. AUTOKNOB = 1 shl 0; // this flag sez: gimme that old auto-knob NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  338. // you are currently limited to using a single Image of your own design: Intuition won't handle a linked list
  339. // of images as a proportional gadget knob.
  340. FREEHORIZ = 1 shl 1; // IF set, the knob can move horizontally
  341. FREEVERT = 1 shl 2; // IF set, the knob can move vertically
  342. PROPBORDERLESS = 1 shl 3; // IF set, no border will be rendered
  343. KNOBHIT = 1 shl 8; // set when this Knob is hit
  344. PROPNEWLOOK = 1 shl 4; // set this IF you want to get the new look
  345. KNOBHMIN = 6; // minimum horizontal size of the Knob
  346. KNOBVMIN = 4; // minimum vertical size of the Knob
  347. MAXBODY = $FFFF; // maximum body value
  348. MAXPOT = $FFFF; // maximum pot value
  349. type
  350. // StringInfo this is the special data required by the string Gadget typically, this data will be pointed to by the Gadget variable SpecialInfo
  351. PStringInfo = ^TStringInfo;
  352. TStringInfo = record
  353. // you initialize these variables, and then Intuition maintains them
  354. Buffer: PChar; // the buffer containing the start and final string
  355. UndoBuffer: PChar; // optional buffer for undoing current entry
  356. BufferPos: SmallInt; // character position in Buffer
  357. MaxChars: SmallInt; // max number of chars in Buffer (including #0)
  358. DispPos: SmallInt; // Buffer position of first displayed character
  359. // Intuition initializes and maintains these variables for you
  360. UndoPos: SmallInt; // character position in the undo buffer
  361. NumChars: SmallInt; // number of characters currently in Buffer
  362. DispCount: SmallInt; // number of whole characters visible in Container
  363. CLeft,
  364. CTop: SmallInt; // topleft offset of the container
  365. { you can initialize this variable before the gadget is submitted to
  366. Intuition, and then examine it later to discover what LongInt
  367. the user has entered (if the user never plays with the gadget,
  368. the value will be unchanged from your initial setting)}
  369. Extension: PStringExtend;
  370. _LongInt: LongInt;
  371. { If you want this Gadget to use your own Console keymapping, you
  372. set the ALTKEYMAP bit in the Activation flags of the Gadget, and then
  373. set this variable to point to your keymap. If you don't set the
  374. ALTKEYMAP, you'll get the standard ASCII keymapping.}
  375. AltKeyMap: PKeymap;
  376. end;
  377. type
  378. PImage = ^TImage;
  379. PWindow = ^TWindow;
  380. PScreen = ^TScreen;
  381. // Requesters The following struct is used for standard intuition requesters (not to be mixed up with asl or easy requesters). See intuition.library/Request() for more information.
  382. PRequester = ^TRequester;
  383. TRequester = record
  384. // the ClipRect and BitMap and used for rendering the requester
  385. OlderRequest: PRequester;
  386. LeftEdge,
  387. TopEdge: SmallInt; // dimensions of the entire box
  388. Width,
  389. Height: SmallInt; // dimensions of the entire box
  390. RelLeft,
  391. RelTop: SmallInt; // for Pointer relativity offsets
  392. ReqGadget: PGadget; // First gadget of the requester
  393. ReqBorder: PBorder; // First border of the requester
  394. ReqText: PIntuiText; // First intuitext of the requester
  395. Flags: Word; // see definitions below
  396. BackFill: Byte; // pen number for back-plane fill before draws
  397. ReqLayer: PLayer; // Layer in place of clip rect
  398. ReqPad1: array [0..31] of Byte; // Private
  399. { If the BitMap plane pointers are non-zero, this tells the system
  400. that the image comes pre-drawn (if the appliprog wants to define
  401. it's own box, in any shape or size it wants!); this is OK by
  402. Intuition as long as there's a good correspondence between
  403. the image and the specified Gadgets}
  404. ImageBMap: PBitMap; // you may use this to fill the requester with your own image
  405. RWindow: PWindow; // window, which the requester belongs to
  406. ReqImage: PImage; // corresponds to USEREQIMAGE (see below)
  407. ReqPad2: array[0..31] of ShortInt; // PRIVATE
  408. end;
  409. { The Timage.PlanePick and PlaneOnOff variables work much the same way as the equivalent GELS Bob variables. It's a space-saving
  410. mechanism for image data. Rather than defining the image data for every plane of the RastPort, you need define data only
  411. for the planes that are not entirely zero or one. As you define your Imagery, you will often find that most of the planes
  412. ARE just as color selectors. For instance, if you're designing a two-color Gadget to use colors two and three, and the Gadget
  413. will reside in a five-plane display, bit plane zero of your imagery would be all ones, bit plane one would have data that
  414. describes the imagery, and bit planes two through four would be all zeroes. Using these flags allows you to avoid wasting all
  415. that memory in this way: first, you specify which planes you want your data to appear in using the PlanePick variable. For
  416. each bit set in the variable, the next "plane" of your image data is blitted to the display. For each bit clear in this
  417. variable, the corresponding bit in PlaneOnOff is examined. If that bit is clear, a "plane" of zeroes will be used.
  418. If the bit is set, ones will go out instead. So, for our example:
  419. Gadget.PlanePick = $02;
  420. Gadget.PlaneOnOff = $01;
  421. Note that this also allows for generic Gadgets, like the System Gadgets, which will work in any number of bit planes.
  422. Note also that if you want an Image that is only a filled rectangle, you can get this by setting PlanePick to zero
  423. (pick no planes of data) and set PlaneOnOff to describe the pen color of the rectangle.}
  424. // This is a brief image structure for very simple transfers of image data to a RastPort
  425. TImage = record
  426. LeftEdge: SmallInt; // starting offset relative to some origin
  427. TopEdge: SmallInt; // starting offsets relative to some origin
  428. Width: SmallInt; // pixel size (though data is Word-aligned)
  429. Height: SmallInt;
  430. Depth: SmallInt; // pixel sizes
  431. ImageData: PWord; // pointer to the actual Word-aligned bits
  432. PlanePick,
  433. PlaneOnOff: Byte;
  434. NextImage: PImage; // if not nil, Intuition presumes that it points to another Image structure with another Image to be rendered
  435. end;
  436. { If your window sets WA_TabletMessages to TRUE, then it will receive extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData
  437. field points at a TabletData structure. This structure contains additional information about the input event.}
  438. PTabletData = ^TTabletData;
  439. TTabletData = record
  440. td_XFraction, // Sub-pixel position of tablet, in screen coordinates, scaled to fill a Word fraction:
  441. td_YFraction: Word;
  442. td_TabletX,
  443. td_TabletY: LongWord; // Current tablet coordinates along each axis
  444. td_RangeX,
  445. td_RangeY: LongWord; // Tablet range along each axis. For example, if td_TabletX can take values 0-999, td_RangeX should be 1000.
  446. td_TagList: PTagItem; // Pointer to tag-list of additional tablet attributes. TABLETA_*
  447. end;
  448. { If a tablet driver supplies a hook for ient_CallBack, it will be invoked in the standard hook manner. A0 will point to the Hook
  449. itself, A2 will point to the InputEvent that was sent, and A1 will point to a TabletHookData structure. The InputEvent's
  450. ie_EventAddress field points at the IENewTablet structure that the driver supplied.
  451. Based on the thd_Screen, thd_Width, and thd_Height fields, the driver should scale the ient_TabletX and ient_TabletY fields and store the
  452. result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and ient_ScaledYFraction.
  453. The tablet hook must currently return NULL. This is the only acceptable return-value.}
  454. PTabletHookData = ^TTabletHookData;
  455. TTabletHookData = record
  456. thd_Screen: PScreen; // Pointer to the active screen: Note: if there are no open screens, thd_Screen will be nil.
  457. thd_Width, // thd_Width and thd_Height will then describe an NTSC 64$400 screen. Please scale accordingly.
  458. thd_Height: LongWord; // The width and height (measured in pixels of the active screen)that your are to scale to:
  459. thd_ScreenChanged: LongInt; // Non-zero if the screen or something about the screen changed since the last time you were invoked:
  460. end;
  461. PIntuiMessage = ^TIntuiMessage;
  462. TIntuiMessage = record
  463. ExecMessage: TMessage;
  464. IClass: LongWord; // the Class bits correspond directly with the IDCMP Flags, except for the special bit LONELYMESSAGE (defined below)
  465. Code: Word; // the Code field is for special values like MENU number
  466. Qualifier: Word; // the Qualifier field is a copy of the current InputEvent's Qualifier
  467. IAddress: APTR; // IAddress contains particular addresses for Intuition functions, like the pointer to the Gadget or the Screen
  468. MouseX, // when getting mouse movement reports, any event you get will have the the mouse coordinates in these variables.
  469. MouseY: SmallInt; // the coordinates are relative to the upper-left corner of your Window (GIMMEZEROZERO notwithstanding)
  470. Seconds, // the time values are copies of the current system clock time.
  471. Micros: LongWord; // Micros are in units of microseconds, Seconds in seconds.
  472. IDCMPWindow: PWindow; // the IDCMPWindow variable will always have the Pointer of the Window of this IDCMP
  473. SpecialLink: PIntuiMessage; // system-use variable
  474. end;
  475. { All IntuiMessages are now slightly extended. The ExtIntuiMessage
  476. structure has an additional field for tablet data, which is usually
  477. nil. If a tablet driver which is sending IESUBCLASS_NEWTABLET
  478. events is installed in the system, windows with the WA_TabletMessages
  479. property set will find that eim_TabletData points to the TabletData
  480. structure. Applications must first check that this field is non-NULL;
  481. it will be nil for certain kinds of message, including mouse activity
  482. generated from other than the tablet (i.e. the keyboard equivalents
  483. or the mouse itself).
  484. NOTE: This structure is subject to grow in the future. Making
  485. assumptions about its size is A BAD IDEA.}
  486. PExtIntuiMessage = ^TExtIntuiMessage;
  487. TExtIntuiMessage = record
  488. eim_IntuiMessage: TIntuiMessage;
  489. eim_TabletData: PTabletData;
  490. end;
  491. // A data structure common in Intuition processing
  492. PIBox = ^TIBox;
  493. TIBox = record
  494. Left,
  495. Top,
  496. Width,
  497. Height: SmallInt;
  498. end;
  499. // Window
  500. TWindow = record
  501. NextWindow: PWindow; // for the linked list in a screen
  502. LeftEdge,
  503. TopEdge: SmallInt; // screen dimensions of window
  504. Width,
  505. Height: SmallInt; // screen dimensions of window
  506. {$ifdef AROS_BINCOMPAT}
  507. MouseY,
  508. MouseX: SmallInt; // relative to upper-left of window
  509. {$else}
  510. MouseX,
  511. MouseY: SmallInt; // relative to upper-left of window
  512. {$endif}
  513. MinWidth,
  514. MinHeight: SmallInt; // minimum sizes
  515. MaxWidth,
  516. MaxHeight: Word; // maximum sizes
  517. Flags: LongWord; // see below for defines
  518. MenuStrip: PMenu; // the strip of Menu headers
  519. Title: PChar; // the title text for this window
  520. FirstRequest: PRequester; // all active Requesters
  521. DMRequest: PRequester; // double-click Requester
  522. ReqCount: SmallInt; // count of reqs blocking Window
  523. WScreen: PScreen; // this Window's Screen
  524. RPort: PRastPort; { this Window's very own RastPort }
  525. { the border variables describe the window border. If you specify
  526. GIMMEZEROZERO when you open the window, then the upper-left of the
  527. ClipRect for this window will be upper-left of the BitMap (with correct
  528. offsets when in SuperBitMap mode; you MUST select GIMMEZEROZERO when
  529. using SuperBitMap). If you don't specify ZeroZero, then you save
  530. memory (no allocation of RastPort, Layer, ClipRect and associated
  531. Bitmaps), but you also must offset all your writes by BorderTop,
  532. BorderLeft and do your own mini-clipping to prevent writing over the
  533. system gadgets}
  534. BorderLeft,
  535. BorderTop,
  536. BorderRight,
  537. BorderBottom: ShortInt;
  538. BorderRPort: PRastPort;
  539. { You supply a linked-list of Gadgets for your Window.
  540. This list DOES NOT include system gadgets. You get the standard
  541. window system gadgets by setting flag-bits in the variable Flags (see
  542. the bit definitions below)}
  543. FirstGadget: PGadget;
  544. Parent,
  545. Descendant: PWindow; // these are for opening/closing the windows
  546. // sprite data iformation for your own Pointer set these AFTER you Open the Window by calling SetPointer()
  547. _Pointer: PWord; // sprite data
  548. PtrHeight: ShortInt; // sprite height (not including sprite padding)
  549. PtrWidth: ShortInt; // sprite width (must be less than or equal to 16)
  550. XOffset,
  551. YOffset: ShortInt; // sprite offsets
  552. // the IDCMP Flags and User's and Intuition's Message Ports
  553. IDCMPFlags: LongWord; // User-selected flags
  554. UserPort,
  555. WindowPort: PMsgPort;
  556. MessageKey: PIntuiMessage;
  557. DetailPen,
  558. BlockPen: Byte; // for bar/border/gadget rendering
  559. CheckMark: PImage; // the CheckMark is a pointer to the imagery that will be used when rendering MenuItems of this Window that want to be checkmarked if this is equal to NULL, you'll get the default imagery
  560. ScreenTitle: PChar; // if non-nil, Screen title when Window is active
  561. { These variables have the mouse coordinates relative to the
  562. inner-Window of GIMMEZEROZERO Windows. This is compared with the
  563. MouseX and MouseY variables, which contain the mouse coordinates
  564. relative to the upper-left corner of the Window, GIMMEZEROZERO
  565. notwithstanding}
  566. GZZMouseX: SmallInt;
  567. GZZMouseY: SmallInt;
  568. GZZWidth: SmallInt; // these variables contain the width and height of the inner-Window of GIMMEZEROZERO Windows
  569. GZZHeight: SmallInt;
  570. ExtData: PByte;
  571. UserData: PSmallInt; // general-purpose pointer to User data extension
  572. WLayer: PLayer;
  573. IFont: PTextFont;
  574. MoreFlags: LongWord;
  575. RelLeftEdge: SmallInt; // relative coordinates of the window to its parent window. If it is
  576. RelTopEdge: SmallInt; // a window on the screen then these are the same as LeftEdge and TopEdge.
  577. FirstChild: PWindow; // pointer to first child
  578. PrevChild: PWindow; // if window is a child of a window
  579. NextChild: PWindow; // then they are concatenated here.
  580. Parent2: PWindow; // parent of this window
  581. // Data beyond this point are Intuition Private. DO NOT USE
  582. end;
  583. TScreen = record
  584. NextScreen: PScreen; // linked list of screens
  585. FirstWindow: PWindow; // linked list Screen's Windows
  586. LeftEdge,
  587. TopEdge: SmallInt; // parameters of the screen
  588. Width,
  589. Height: SmallInt; // parameters of the screen
  590. {$ifdef AROS_BINCOMPAT}
  591. MouseY,
  592. MouseX: SmallInt; // position relative to upper-left
  593. {$else}
  594. MouseX,
  595. MouseY: SmallInt; // position relative to upper-left
  596. {$endif}
  597. Flags: Word; // see definitions below
  598. Title: PChar; // null-terminated Title text
  599. DefaultTitle: PChar; // for Windows without ScreenTitle
  600. // Bar sizes for this Screen and all Window's in this Screen
  601. BarHeight,
  602. BarVBorder,
  603. BarHBorder,
  604. MenuVBorder,
  605. MenuHBorder: ShortInt;
  606. WBorTop,
  607. WBorLeft,
  608. WBorRight,
  609. WBorBottom: ShortInt;
  610. Font: PTextAttr; // this screen's default font
  611. // the display data structures for this Screen (note the prefix S)
  612. ViewPort: TViewPort; // describing the Screen's display
  613. RastPort: TRastPort; // describing Screen rendering
  614. BitMap: TBitMap; // extra copy of RastPort BitMap obsolete
  615. LayerInfo: TLayer_Info; // each screen gets a LayerInfo
  616. // You supply a linked-list of Gadgets for your Screen. This list DOES NOT include system Gadgets. You get the standard system Screen Gadgets by default
  617. FirstGadget: PGadget;
  618. DetailPen,
  619. BlockPen: Byte; // for bar/border/gadget rendering
  620. // the following variable(s) are maintained by Intuition to support the DisplayBeep() color flashing technique
  621. SaveColor0: Word;
  622. BarLayer: PLayer; // This layer is for the Screen and Menu bars
  623. ExtData: Pointer;
  624. UserData: Pointer;
  625. { general-purpose pointer to User data extension
  626. **** Data below this point are SYSTEM PRIVATE ****}
  627. end;
  628. const
  629. // IDCMP Classes
  630. // Please refer to the Autodoc for OpenWindow() and to the Rom Kernel Manual for full details on the IDCMP classes.
  631. IDCMP_SIZEVERIFY = 1 shl 0;
  632. IDCMP_NEWSIZE = 1 shl 1;
  633. IDCMP_REFRESHWINDOW = 1 shl 2;
  634. IDCMP_MOUSEBUTTONS = 1 shl 3;
  635. IDCMP_MOUSEMOVE = 1 shl 4;
  636. IDCMP_GADGETDOWN = 1 shl 5;
  637. IDCMP_GADGETUP = 1 shl 6;
  638. IDCMP_REQSET = 1 shl 7;
  639. IDCMP_MENUPICK = 1 shl 8;
  640. IDCMP_CLOSEWINDOW = 1 shl 9;
  641. IDCMP_RAWKEY = 1 shl 10;
  642. IDCMP_REQVERIFY = 1 shl 11;
  643. IDCMP_REQCLEAR = 1 shl 12;
  644. IDCMP_MENUVERIFY = 1 shl 13;
  645. IDCMP_NEWPREFS = 1 shl 14;
  646. IDCMP_DISKINSERTED = 1 shl 15;
  647. IDCMP_DISKREMOVED = 1 shl 16;
  648. IDCMP_WBENCHMESSAGE = 1 shl 17; // System use only
  649. IDCMP_ACTIVEWINDOW = 1 shl 18;
  650. IDCMP_INACTIVEWINDOW = 1 shl 19;
  651. IDCMP_DELTAMOVE = 1 shl 20;
  652. IDCMP_VANILLAKEY = 1 shl 21;
  653. IDCMP_INTUITICKS = 1 shl 22;
  654. IDCMP_IDCMPUPDATE = 1 shl 23; // for notifications from "boopsi" gadgets
  655. IDCMP_MENUHELP = 1 shl 24; // for getting help key report during menu session
  656. IDCMP_CHANGEWINDOW = 1 shl 25; // for notification of any move/size/zoom/change window
  657. IDCMP_GADGETHELP = 1 shl 26;
  658. IDCMP_LONELYMESSAGE = 1 shl 31; { the IDCMP Flags do not use this special bit, which is cleared when
  659. Intuition sends its special message to the Task, and set when Intuition
  660. gets its Message back from the Task. Therefore, I can check here to
  661. find out fast whether or not this Message is available for me to send }
  662. // IDCMP Codes
  663. // This group of codes is for the IDCMP_CHANGEWINDOW message
  664. CWCODE_MOVESIZE = 0; // Window was moved and/or sized
  665. CWCODE_DEPTH = 1; // Window was depth-arranged
  666. // This group of codes is for the IDCMP_MENUVERIFY function
  667. MENUHOT = 1; // IntuiWants verification OR MENUCANCEL
  668. MENUCANCEL = 2; // HOT Reply of this cancels Menu operation
  669. MENUWAITING = 3; // Intuition simply wants a ReplyMsg() ASAP
  670. // These are internal tokens to represent state of verification attempts shown here as a clue.
  671. OKOK = 1; // guy didn't care
  672. OKABORT = 4; // window rendered question moot
  673. OKCANCEL = 2; // window sent cancel reply
  674. // This group of codes is for the IDCMP_WBENCHMESSAGE messages
  675. WBENCHOPEN = 1;
  676. WBENCHCLOSE = 2;
  677. type
  678. PNewWindow = ^TNewWindow;
  679. TNewWindow = record
  680. LeftEdge,
  681. TopEdge: SmallInt; // screen dimensions of window
  682. Width,
  683. Height: SmallInt; // screen dimensions of window
  684. DetailPen,
  685. BlockPen: Byte; // for bar/border/gadget rendering
  686. IDCMPFlags: LongWord; // User-selected IDCMP flags
  687. Flags: LongWord; // see Window struct for defines
  688. FirstGadget: PGadget; { You supply a linked-list of Gadgets for your Window.
  689. This list DOES NOT include system Gadgets. You get the standard
  690. system Window Gadgets by setting flag-bits in the variable Flags (see
  691. the bit definitions under the Window structure definition)}
  692. CheckMark: PImage; { the CheckMark is a pointer to the imagery that will be used when
  693. rendering MenuItems of this Window that want to be checkmarked
  694. if this is equal to NULL, you'll get the default imagery}
  695. Title: PChar; // the title text for this window
  696. Screen: PScreen; { the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  697. want this Window to open in it. If so, you pass the Pointer of the
  698. Custom Screen structure in this variable. Otherwise, this variable
  699. is ignored and doesn't have to be initialized.}
  700. BitMap: PBitMap; { SUPER_BITMAP Window? If so, put the Pointer of your BitMap structure
  701. in this variable. If not, this variable is ignored and doesn't have
  702. to be initialized}
  703. { the values describe the minimum and maximum sizes of your Windows.
  704. these matter only if you've chosen the WINDOWSIZING Gadget option,
  705. which means that you want to let the User to change the size of
  706. this Window. You describe the minimum and maximum sizes that the
  707. Window can grow by setting these variables. You can initialize
  708. any one these to zero, which will mean that you want to duplicate
  709. the setting for that dimension (if MinWidth == 0, MinWidth will be
  710. set to the opening Width of the Window).
  711. You can change these settings later using SetWindowLimits().
  712. If you haven't asked for a SIZING Gadget, you don't have to
  713. initialize any of these variables.}
  714. MinWidth,
  715. MinHeight: SmallInt; // minimums
  716. MaxWidth,
  717. MaxHeight: Word; // maximums
  718. WType: Word; { the type variable describes the Screen in which you want this Window to
  719. open. The type value can either be CUSTOMSCREEN or one of the
  720. system standard Screen Types such as WBENCHSCREEN. See the
  721. type definitions under the Screen structure}
  722. end;
  723. { The following structure is the future NewWindow. Compatibility
  724. issues require that the size of NewWindow not change.
  725. Data in the common part (NewWindow) indicates the the extension
  726. fields are being used.
  727. NOTE WELL: This structure may be subject to future extension.
  728. Writing code depending on its size is not allowed.
  729. }
  730. PExtNewWindow = ^TExtNewWindow;
  731. TExtNewWindow = record
  732. LeftEdge,
  733. TopEdge: SmallInt;
  734. Width,
  735. Height: SmallInt;
  736. DetailPen,
  737. BlockPen: Byte;
  738. IDCMPFlags: LongWord;
  739. Flags: LongWord;
  740. FirstGadget: PGadget;
  741. CheckMark: PImage;
  742. Title: PChar;
  743. WScreen: PScreen;
  744. WBitMap: PBitMap;
  745. MinWidth,
  746. MinHeight: SmallInt;
  747. MaxWidth,
  748. MaxHeight: Word;
  749. { the type variable describes the Screen in which you want this Window to
  750. open. The type value can either be CUSTOMSCREEN or one of the
  751. system standard Screen Types such as WBENCHSCREEN. See the
  752. type definitions under the Screen structure.
  753. A new possible value for this field is PUBLICSCREEN, which
  754. defines the window as a 'visitor' window. See below for
  755. additional information provided.}
  756. WType: Word;
  757. { if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  758. this field is assumed to point to an array ( or chain of arrays)
  759. of TagItem structures. See also ExtNewScreen for another
  760. use of TagItems to pass optional data.
  761. see below for tag values and the corresponding data.}
  762. Extension: PTagItem;
  763. end;
  764. const
  765. TAG_DONE = 0; { terminates array of TagItems. ti_Data unused }
  766. TAG_END = TAG_DONE;
  767. { The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  768. They are values in a TagItem array passed as extension/replacement
  769. values for the data in NewWindow. OpenWindowTagList() can actually
  770. work well with a nil NewWindow pointer. }
  771. WA_Dummy = TAG_USER + 99; { $80000063 }
  772. // these tags simply override NewWindow parameters
  773. WA_Left = WA_Dummy + 1;
  774. WA_Top = WA_Dummy + 2;
  775. WA_Width = WA_Dummy + 3;
  776. WA_Height = WA_Dummy + 4;
  777. WA_DetailPen = WA_Dummy + 5;
  778. WA_BlockPen = WA_Dummy + 6;
  779. WA_IDCMP = WA_Dummy + 7;
  780. WA_Flags = WA_Dummy + 8; // "bulk" initialization of NewWindow.Flags
  781. WA_Gadgets = WA_Dummy + 9;
  782. WA_Checkmark = WA_Dummy + 10;
  783. WA_Title = WA_Dummy + 11; // means you don't have to call SetWindowTitles after you open your window
  784. WA_ScreenTitle = WA_Dummy + 12;
  785. WA_CustomScreen = WA_Dummy + 13;
  786. WA_SuperBitMap = WA_Dummy + 14;
  787. // also implies WFLG_SUPER_BITMAP property
  788. WA_MinWidth = WA_Dummy + 15;
  789. WA_MinHeight = WA_Dummy + 16;
  790. WA_MaxWidth = WA_Dummy + 17;
  791. WA_MaxHeight = WA_Dummy + 18;
  792. WA_InnerWidth = WA_Dummy + 19;
  793. WA_InnerHeight = WA_Dummy + 20; { You can specify the dimensions of the interior region of your window, independent of what the border widths will be. You probably want
  794. to also specify WA_AutoAdjust to allow Intuition to move your window or even shrink it so that it is completely on screen.}
  795. WA_PubScreenName = WA_Dummy + 21; // declares that you want the window to open as a visitor on the public screen whose name is pointed to by (PChar) ti_Data}
  796. WA_PubScreen = WA_Dummy + 22; { open as a visitor window on the public screen whose Pointer is in (PScreen) ti_Data. To ensure that this screen remains open, you
  797. should either be the screen's owner, have a window open on the screen, or use LockPubScreen().}
  798. WA_PubScreenFallBack = WA_Dummy + 23; { A Boolean, specifies whether a visitor window should "fall back" to the default public screen
  799. (or Workbench) if the named public screen isn't available}
  800. WA_WindowName = WA_Dummy + 24;
  801. WA_Colors = WA_Dummy + 25 unimplemented;
  802. { a ColorSpec array for colors to be set when this window is active. This is not implemented, and may not be, since the default
  803. values to restore would be hard to track. We'd like to at least support per-window colors for the mouse pointer sprite.}
  804. WA_Zoom = WA_Dummy + 26; { ti_Data points to an array of four Word's, the initial Left/Top/Width/Height values of the "alternate" zoom position/dimensions.
  805. It also specifies that you want a Zoom gadget for your window, whether or not you have a sizing gadget.}
  806. WA_MouseQueue = WA_Dummy + 27; // ti_Data contains initial value for the mouse message backlog limit for this window
  807. WA_BackFill = WA_Dummy + 28; // provides a "backfill hook" for your window's layer.
  808. WA_RptQueue = WA_Dummy + 29; // initial value of repeat key backlog limit
  809. WA_SizeGadget = WA_Dummy + 30; // These Boolean tag items are alternatives to the NewWindow.Flags boolean flags with similar names.
  810. WA_DragBar = WA_Dummy + 31;
  811. WA_DepthGadget = WA_Dummy + 32;
  812. WA_CloseGadget = WA_Dummy + 33;
  813. WA_Backdrop = WA_Dummy + 34;
  814. WA_ReportMouse = WA_Dummy + 35;
  815. WA_NoCareRefresh = WA_Dummy + 36;
  816. WA_Borderless = WA_Dummy + 37;
  817. WA_Activate = WA_Dummy + 38;
  818. WA_RMBTrap = WA_Dummy + 39;
  819. WA_WBenchWindow = WA_Dummy + 40; // PRIVATE!!
  820. WA_SimpleRefresh = WA_Dummy + 41; // only specify if True
  821. WA_SmartRefresh = WA_Dummy + 42; // only specify if True
  822. WA_SizeBRight = WA_Dummy + 43;
  823. WA_SizeBBottom = WA_Dummy + 44;
  824. WA_AutoAdjust = WA_Dummy + 45; // shift or squeeze the window's position and dimensions to fit it on screen.
  825. WA_GimmeZeroZero = WA_Dummy + 46; // equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO
  826. WA_MenuHelp = WA_Dummy + 47; // Enables IDCMP_MENUHELP: Pressing HELP during menus will return IDCMP_MENUHELP message.
  827. WA_NewLookMenus = WA_Dummy + 48; // Set to True if you want NewLook menus
  828. WA_AmigaKey = WA_Dummy + 49; // Pointer to image for Amiga-key equiv in menus
  829. WA_NotifyDepth = WA_Dummy + 50; // Requests IDCMP_CHANGEWINDOW message when window is depth arranged (imsg^.Code = CWCODE_DEPTH)
  830. // WA_Dummy + 51 is obsolete
  831. WA_Pointer = WA_Dummy + 52; { Allows you to specify a custom pointer for your window. ti_Data points to a pointer object you obtained via
  832. "pointerclass". NULL signifies the default pointer. This tag may be passed to OpenWindowTags() or SetWindowPointer().}
  833. WA_BusyPointer = WA_Dummy + 53; { ti_Data is boolean. Set to True to request the standard busy pointer. This tag may be passed to OpenWindowTags() or SetWindowPointer().}
  834. WA_PointerDelay = WA_Dummy + 54; { ti_Data is boolean. Set to True to request that the changing of the pointer be slightly delayed. The change
  835. will be called off if you call NewSetPointer() before the delay expires. This allows you to post a busy-pointer even if you think
  836. the busy-time may be very Word, without fear of a flashing pointer. This tag may be passed to OpenWindowTags() or SetWindowPointer().}
  837. WA_TabletMessages = WA_Dummy + 55; { ti_Data is a boolean. Set to True to request that tablet information be included in IntuiMessages sent to your window.
  838. Requires that something (i.e. a tablet driver) feed IESUBCLASS_NEWTABLET InputEvents into the system. For a pointer to the TabletData,
  839. examine the ExtIntuiMessage^.eim_TabletData field. It is UNSAFE to check this field when running on pre-V39 systems. It's always
  840. safe to check this field under V39 and up, though it may be nil.}
  841. WA_HelpGroup = WA_Dummy + 56; { When the active window has gadget help enabled, other windows of the same HelpGroup number will also get GadgetHelp. This allows GadgetHelp
  842. to work for multi-windowed applications. Use GetGroupID() to get an ID number. Pass this number as ti_Data to all your windows. See also the HelpControl() function.}
  843. WA_HelpGroupWindow = WA_Dummy + 57; { When the active window has gadget help enabled, other windows of the same HelpGroup will also get GadgetHelp. This allows GadgetHelp to work
  844. for multi-windowed applications. As an alternative to WA_HelpGroup, you can pass a pointer to any other window of the same group to join its help
  845. group. Defaults to NULL, which has no effect. See also the HelpControl() function.}
  846. WA_ToolBox = WA_Dummy + 58; // (LongBool) Make this window a Toolbox window
  847. // AROS specific tags
  848. WA_Priority = WA_Dummy + 100;
  849. WA_Parent = WA_Dummy + 101; // (PWindow) Make the window a child of the parent Window
  850. WA_InFrontOf = WA_Dummy + 102;
  851. WA_Behind = WA_Dummy + 103;
  852. WA_Visible = WA_Dummy + 104; // (LongBool) Make window visible. default True
  853. WA_Shape = WA_Dummy + 105; // (PRegion)
  854. WA_ShapeHook = WA_Dummy + 106; // (PHook)
  855. // --- Flags requested at OpenWindow() time by the application
  856. WFLG_SIZEGADGET = 1 shl 0; // include sizing system-gadget
  857. WFLG_DRAGBAR = 1 shl 1; // include dragging system-gadget
  858. WFLG_DEPTHGADGET = 1 shl 2; // include depth arrangement gadget
  859. WFLG_CLOSEGADGET = 1 shl 3; // include close-box system-gadget
  860. WFLG_SIZEBRIGHT = 1 shl 4; // size gadget uses right border
  861. WFLG_SIZEBBOTTOM = 1 shl 5; // size gadget uses bottom border
  862. // refresh modes combinations of the WFLG_REFRESHBITS select the refresh type
  863. WFLG_SMART_REFRESH = 0;
  864. WFLG_SIMPLE_REFRESH = 1 shl 6;
  865. WFLG_SUPER_BITMAP = 1 shl 7;
  866. WFLG_OTHER_REFRESH = (1 shl 6) or (1 shl 7);
  867. WFLG_REFRESHBITS = WFLG_OTHER_REFRESH;
  868. WFLG_BACKDROP = 1 shl 8; // this is a backdrop window
  869. WFLG_REPORTMOUSE = 1 shl 9; // to hear about every mouse move
  870. WFLG_GIMMEZEROZERO = 1 shl 10; // a GimmeZeroZero window
  871. WFLG_BORDERLESS = 1 shl 11; // to get a Window sans border
  872. WFLG_ACTIVATE = 1 shl 12; // when Window opens, it's Active
  873. // Private
  874. WFLG_WINDOWACTIVE = 1 shl 13; // this window is the active one
  875. WFLG_INREQUEST = 1 shl 14; // this window is in request mode
  876. WFLG_MENUSTATE = 1 shl 15; // Window is active with Menus on
  877. // Other User Flags
  878. WFLG_RMBTRAP = 1 shl 16; // Catch RMB events for your own
  879. WFLG_NOCAREREFRESH = 1 shl 17; // not to be bothered with REFRESH
  880. WFLG_NW_EXTENDED = 1 shl 18; // extension data provided see struct ExtNewWindow
  881. WFLG_NEWLOOKMENUS = 1 shl 21; // window has NewLook menus
  882. // These flags are set only by Intuition. YOU MAY NOT SET THEM YOURSELF!
  883. WFLG_WINDOWREFRESH = 1 shl 24; // Window is currently refreshing
  884. WFLG_WBENCHWINDOW = 1 shl 25; // WorkBench tool ONLY Window
  885. WFLG_WINDOWTICKED = 1 shl 26; // only one timer tick at a time
  886. WFLG_VISITOR = 1 shl 27; // visitor window
  887. WFLG_ZOOMED = 1 shl 28; // identifies "zoom state"
  888. WFLG_HASZOOM = 1 shl 29; // windowhas a zoom gadget
  889. WFLG_TOOLBOX = 1 shl 30;
  890. // Other Window Values
  891. DEFAULTMOUSEQUEUE = 5; // no more mouse messages
  892. // see struct IntuiMessage for the IDCMP Flag definitions
  893. // HelpControl() flags: HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more windows.
  894. HC_GADGETHELP = 1;
  895. const
  896. // Flags for TRequester.Flags
  897. // set by Application
  898. POINTREL = 1 shl 0; // if POINTREL set, TopLeft is relative to pointer to the coordinates of either the pointer or the window
  899. PREDRAWN = 1 shl 1; // If set, ImageBMap points to a custom bitmap
  900. NOISYREQ = 1 shl 2; // Requester doesn't filter input
  901. SIMPLEREQ = 1 shl 4; // If set, a SIMPLEREFRESH layer is used
  902. USEREQIMAGE = 1 shl 5; // render linked list ReqImage after BackFill but before gadgets and text
  903. NOREQBACKFILL = 1 shl 6; // don't bother filling requester with Requester.BackFill pen
  904. // Read only Flags set by Intuition
  905. REQOFFWINDOW = 1 shl 12; // part of one of the Gadgets was offwindow
  906. REQACTIVE = 1 shl 13; // this requester is active
  907. SYSREQUEST = 1 shl 14; // this requester caused by system
  908. DEFERREFRESH = 1 shl 15; // this Requester stops a Refresh broadcast
  909. { Intuition supports the IESUBCLASS_NEWTABLET subclass of the IECLASS_NEWPOINTERPOS event. The ie_EventAddress of such an event points to a TabletData structure (see below).
  910. The TabletData structure contains certain elements including a taglist.The taglist can be used for special tablet parameters. A tablet driver
  911. should include only those tag-items the tablet supports. An application can listen for any tag-items that interest it. Note: an application
  912. must set the WA_TabletMessages attribute to TRUE to receive this extended information in its IntuiMessages.
  913. The definitions given here MUST be followed. Pay careful attention
  914. to normalization and the interpretation of signs.
  915. Note: a stylus that supports tilt should use the TABLETA_AngleX
  916. and TABLETA_AngleY attributes. Tilting the stylus so the tip
  917. points towards increasing or decreasing X is actually a rotation
  918. around the Y-axis. Thus, if the stylus tip points towards
  919. positive X, then that tilt is represented as a negative
  920. TABLETA_AngleY. Likewise, if the stylus tip points towards
  921. positive Y, that tilt is represented by positive TABLETA_AngleX.}
  922. const
  923. TABLETA_Dummy = TAG_USER + $3A000;
  924. TABLETA_TabletZ = TABLETA_Dummy + $01; // the current value of the tablet in the Z direction. This unsigned value should typically be in the natural units of the
  925. // tablet. You should also provide TABLETA_RangeZ.
  926. TABLETA_RangeZ = TABLETA_Dummy + $02; // the maximum value of the tablet in the Z direction. Normally specified along with TABLETA_TabletZ, this allows the
  927. // application to scale the actual Z value across its range.
  928. TABLETA_AngleX = TABLETA_Dummy + $03; // the angle of rotation or tilt about the X-axis. This number should be normalized to fill a signed long LongInt. Positive
  929. // values imply a clockwise rotation about the X-axis when viewing from +X towards the origin.
  930. TABLETA_AngleY = TABLETA_Dummy + $04; // the angle of rotation or tilt about the Y-axis. This number should be normalized to fill a signed long LongInt. Positive
  931. // values imply a clockwise rotation about the Y-axis when viewing from +Y towards the origin.
  932. TABLETA_AngleZ = TABLETA_Dummy + $05; // the angle of rotation or tilt about the Z axis. This number should be normalized to fill a signed long LongInt. Positive
  933. // values imply a clockwise rotation about the Z-axis when viewing from +Z towards the origin.
  934. TABLETA_Pressure = TABLETA_Dummy + $06; { the pressure reading of the stylus. The pressure should be normalized to fill a signed long LongInt. Typical devices
  935. won't generate negative pressure, but the possibility is not precluded. The pressure threshold which is considered to cause a button-click is
  936. expected to be set in a Preferences program supplied by the tablet vendor. The tablet driver would send IECODE_LBUTTON-type events as
  937. the pressure crossed that threshold.}
  938. TABLETA_ButtonBits = TABLETA_Dummy + $07; // ti_Data is a long LongInt whose bits are to be interpreted at the state of the first 32 buttons of the tablet.
  939. TABLETA_InProximity = TABLETA_Dummy + $08; { ti_Data is a boolean. For tablets that support proximity, they should send the (TABLETA_InProximity,FALSE) tag item
  940. when the stylus is out of proximity. One possible use we can forsee is a mouse-blanking commodity which keys off this to blank the
  941. mouse. When this tag is absent, the stylus is assumed to be in proximity.}
  942. TABLETA_ResolutionX = TABLETA_Dummy + $09; // ti_Data is an unsigned long LongInt which is the x-axis resolution in dots per inch.
  943. TABLETA_ResolutionY = TABLETA_Dummy + $0A; // ti_Data is an unsigned long LongInt which is the y-axis resolution in dots per inch.
  944. type
  945. // this structure is used for remembering what memory has been allocated to date by a given routine,
  946. // so that a premature abort or systematic exit can deallocate memory cleanly, easily, and completely
  947. PRemember = ^TRemember;
  948. TRemember = record
  949. NextRemember: PRemember;
  950. RememberSize: LongWord;
  951. Memory: PByte;
  952. end;
  953. // How to tell Intuition about RGB values for a color table entry. }
  954. PColorSpec = ^TColorSpec;
  955. TColorSpec = record
  956. ColorIndex: SmallInt; // -1 terminates an array of ColorSpec
  957. Red: Word; // only the _bottom_ 4 bits recognized
  958. Green: Word; // only the _bottom_ 4 bits recognized
  959. Blue: Word; // only the _bottom_ 4 bits recognized
  960. end;
  961. // Easy Requester Specification see also autodocs for EasyRequest and BuildEasyRequest NOTE: This structure may grow in size in the future
  962. PEasyStruct = ^TEasyStruct;
  963. TEasyStruct = record
  964. es_StructSize: LongWord; // should be sizeof (TEasyStruct) Note that this size may change, if you update the includes! Do not use absolute values as the size of pointers may vary on different platforms!
  965. es_Flags: LongWord; // should be 0 for now
  966. es_Title: PChar; // title of requester window
  967. es_TextFormat: PChar; // 'printf' style formatting string
  968. es_GadgetFormat: PChar; // Text of the gadgets, separated by |'s
  969. end;
  970. const
  971. // These are the AlertNumber defines. if you are calling DisplayAlert() the AlertNumber you supply must have the ALERT_TYPE bits set to one of these patterns
  972. ALERT_TYPE = $80000000;
  973. RECOVERY_ALERT = $00000000; // the system can recover from this
  974. DEADEND_ALERT = $80000000; // no recovery possible, this is it
  975. { When you're defining IntuiText for the Positive and Negative Gadgets created by a call to AutoRequest(), these defines will get you
  976. reasonable-looking text. The only field without a define is the IText field; you decide what text goes with the Gadget}
  977. AUTOFRONTPEN = 0;
  978. AUTOBACKPEN = 1;
  979. AUTODRAWMODE = JAM2;
  980. AUTOLEFTEDGE = 6;
  981. AUTOTOPEDGE = 3;
  982. AUTOITEXTFONT = nil;
  983. AUTONEXTTEXT = nil;
  984. // RAWMOUSE Codes and Qualifiers (Console OR <IDCMP)
  985. SELECTDOWN = IECODE_LBUTTON;
  986. SELECTUP = IECODE_LBUTTON or IECODE_UP_PREFIX;
  987. MENUDOWN = IECODE_RBUTTON;
  988. MENUUP = IECODE_RBUTTON or IECODE_UP_PREFIX;
  989. MIDDLEDOWN = IECODE_MBUTTON;
  990. MIDDLEUP = IECODE_MBUTTON or IECODE_UP_PREFIX;
  991. ALTLEFT = IEQUALIFIER_LALT;
  992. ALTRIGHT = IEQUALIFIER_RALT;
  993. AMIGALEFT = IEQUALIFIER_LCOMMAND;
  994. AMIGARIGHT = IEQUALIFIER_RCOMMAND;
  995. AMIGAKEYS = AMIGALEFT or AMIGARIGHT;
  996. CURSORUP = $4C;
  997. CURSORDOWN = $4D;
  998. CURSORRIGHT = $4E;
  999. CURSORLEFT = $4F;
  1000. KEYCODE_Q = $10;
  1001. KEYCODE_Z = $31;
  1002. KEYCODE_X = $32;
  1003. KEYCODE_V = $34;
  1004. KEYCODE_B = $35;
  1005. KEYCODE_N = $36;
  1006. KEYCODE_M = $37;
  1007. KEYCODE_LESS = $38;
  1008. KEYCODE_GREATER = $39;
  1009. const
  1010. // these are the display modes for which we have corresponding parameter settings in the config arrays
  1011. HIRESPICK = $0000;
  1012. LOWRESPICK = $0001;
  1013. DMODECOUNT = $0002; // how many modes there are
  1014. // these are the system Gadget defines
  1015. HIRESGADGET = 0;
  1016. LOWRESGADGET = 1;
  1017. RESCOUNT = 2;
  1018. UPFRONTGADGET = 0;
  1019. DOWNBACKGADGET = 1;
  1020. SIZEGADGET = 2;
  1021. CLOSEGADGET = 3;
  1022. DRAGGADGET = 4;
  1023. SUPFRONTGADGET = 5;
  1024. SDOWNBACKGADGET = 6;
  1025. SDRAGGADGET = 7;
  1026. GADGETCOUNT = 8;
  1027. EVENTMAX = 10; // size of event array
  1028. type
  1029. // This is a packet of information for graphics rendering. It originates with a Screen, and is gotten using GetScreenDrawInfo( screen );
  1030. PDrawInfo = ^TDrawInfo;
  1031. TDrawInfo = record
  1032. dri_Version: Word; // will be DRI_VERSION
  1033. dri_NumPens: Word; // guaranteed to be >= numDrIPens
  1034. dri_Pens: PWord; // pointer to pen array
  1035. dri_Font: PTextFont; // screen default font
  1036. dri_Depth: Word; // (initial) depth of screen bitmap
  1037. dri_Resolution: record
  1038. x: Word; // from DisplayInfo database for initial display mode
  1039. y: Word;
  1040. end;
  1041. dri_Flags: LongWord; // defined below (DIRF_*)
  1042. dri_CheckMark: PImage; // pointer to scaled checkmark image Will be nil if DRI_VERSION < 2
  1043. dri_AmigaKey: PImage; // pointer to scaled Amiga-key image Will be NULL if DRI_VERSION < 2
  1044. dri_Reserved: array[0..4] of LongWord; // avoid recompilation ;^)
  1045. end;
  1046. const
  1047. // If you find dri_Version >= DRI_VERSION, you know this structure has at least the fields defined in this version of the include file
  1048. DRI_VERSION = 2;
  1049. // dri_Flags
  1050. DRIF_NEWLOOK = 1 shl 0; // specified SA_Pens, full treatment
  1051. DRIF_DIRECTCOLOR = 1 shl 1;
  1052. // rendering pen number indexes into DrawInfo.dri_Pens[]
  1053. DETAILPEN = 0; // compatible Intuition rendering pens
  1054. BLOCKPEN = 1; // compatible Intuition rendering pens
  1055. TEXTPEN = 2; // text on background
  1056. SHINEPEN = 3; // bright edge on 3D objects
  1057. SHADOWPEN = 4; // dark edge on 3D objects
  1058. FILLPEN = 5; // active-window/selected-gadget fill
  1059. FILLTEXTPEN = 6; // text over FILLPEN
  1060. BACKGROUNDPEN = 7; // always color 0
  1061. HIGHLIGHTTEXTPEN = 8; // special color text, on background
  1062. // Only present if DRI_VERSION >= 2
  1063. BARDETAILPEN = 9; // text/detail in screen-bar/menus
  1064. BARBLOCKPEN = 10; // screen-bar/menus fill
  1065. BARTRIMPEN = 11; // trim under screen-bar
  1066. NUMDRIPENS = 12;
  1067. //It is sometimes useful to specify that a pen value is to be the complement of color zero to three. The "magic" numbers serve that purpose:
  1068. PEN_C3 = $FEFC; // Complement of color 3
  1069. PEN_C2 = $FEFD; // Complement of color 2
  1070. PEN_C1 = $FEFE; // Complement of color 1
  1071. PEN_C0 = $FEFF; // Complement of color 0
  1072. // values for ChangeDecoration ID param
  1073. DECORATION_SET = $8001;
  1074. DECORATION_DEFAULT = $8000;
  1075. // OpenScreen error codes, which are returned in the (optional) LongIng pointed to by ti_Data for the SA_ErrorCode tag item
  1076. OSERR_NOMONITOR = 1; // named monitor spec not available
  1077. OSERR_NOCHIPS = 2; // you need newer custom chips
  1078. OSERR_NOMEM = 3; // couldn't get normal memory
  1079. OSERR_NOCHIPMEM = 4; // couldn't get chipmem
  1080. OSERR_PUBNOTUNIQUE = 5; // public screen name already used
  1081. OSERR_UNKNOWNMODE = 6; // don't recognize mode asked for
  1082. OSERR_TOODEEP = 7;
  1083. OSERR_ATTACHFAIL = 8;
  1084. OSERR_NOTAVAILABLE = 9;
  1085. // The SCREENTYPE bits are reserved for describing various Screen types available under Intuition.
  1086. // The screen flags have the suffix "_f" added to avoid conflicts with routine names.
  1087. // Screen^.Flags and (Ext)NewScreen^.Type
  1088. WBENCHSCREEN_f = 1 shl 0; // Ta Da! The Workbench
  1089. PUBLICSCREEN_f = 1 shl 1;
  1090. CUSTOMSCREEN_f = $000F; // for that special look
  1091. SCREENTYPE_f = $000F; // all the screens types available
  1092. // Screen^.Flags
  1093. SHOWTITLE_f = 1 shl 4; // this gets set by a call to ShowTitle()
  1094. BEEPING_f = 1 shl 5; // set when Screen is beeping
  1095. CUSTOMBITMAP_f = 1 shl 6; // if you are supplying your own BitMap
  1096. SCREENBEHIND_f = 1 shl 7; // if you want your screen to open behind already open screens
  1097. SCREENQUIET_f = 1 shl 8; // if you do not want Intuition to render into your screen (gadgets, title)
  1098. SCREENHIRES = 1 shl 9; // do no use lowres gadgets (private)
  1099. PENSHARED = 1 shl 10; // Screen opener set (SA_SharePens,True)
  1100. NS_EXTENDED = 1 shl 12; // ExtNewScreen.Extension is valid
  1101. AUTOSCROLL = 1 shl 14; // screen is to autoscoll
  1102. STDSCREENHEIGHT = -1; // supply in NewScreen.Height
  1103. STDSCREENWIDTH = -1; // supply in NewScreen.Width
  1104. const
  1105. // Screen attribute tag ID's. These are used in the ti_Tag field of TagItem arrays passed to OpenScreenTagList() (or in the ExtNewScreen.Extension field).
  1106. SA_Dummy = TAG_USER + 32;
  1107. // these items specify items equivalent to fields in NewScreen
  1108. SA_Left = SA_Dummy + 1;
  1109. SA_Top = SA_Dummy + 2;
  1110. SA_Width = SA_Dummy + 3;
  1111. SA_Height = SA_Dummy + 4; // traditional screen positions and dimensions
  1112. SA_Depth = SA_Dummy + 5; // screen bitmap depth
  1113. SA_DetailPen = SA_Dummy + 6; //serves as default for windows, too
  1114. SA_BlockPen = SA_Dummy + 7;
  1115. SA_Title = SA_Dummy + 8; // default screen title
  1116. SA_Colors = SA_Dummy + 9; // ti_Data is an array of struct ColorSpec, terminated by ColorIndex = -1. Specifies initial screen palette colors.
  1117. SA_ErrorCode = SA_Dummy + 10; // ti_Data points to LONG error code (values below)
  1118. SA_Font = SA_Dummy + 11; // equiv. to NewScreen.Font
  1119. SA_SysFont = SA_Dummy + 12; // Selects one of the preferences system fonts: 0 - old DefaultFont, fixed-width 1 - WB Screen preferred font
  1120. SA_Type = SA_Dummy + 13; // equiv. to NewScreen.type
  1121. SA_BitMap = SA_Dummy + 14; // ti_Data is pointer to custom BitMap. This implies type of CUSTOMBITMAP
  1122. SA_PubName = SA_Dummy + 15; // presence of this tag means that the screen is to be a public screen. Please specify BEFORE the two tags below
  1123. SA_PubSig = SA_Dummy + 16;
  1124. SA_PubTask = SA_Dummy + 17; // Task ID and signal for being notified that the last window has closed on a public screen.
  1125. SA_DisplayID = SA_Dummy + 18; // ti_Data is new extended display ID
  1126. SA_DClip = SA_Dummy + 19; // ti_Data points to a rectangle which defines screen display clip region
  1127. SA_Overscan = SA_Dummy + 20; { was S_STDDCLIP. Set to one of the OSCAN_* specifiers below to get a system standard
  1128. overscan region for your display clip, screen dimensions (unless otherwise specified),
  1129. and automatically centered position (partial support only so far).
  1130. If you use this, you shouldn't specify SA_DClip. SA_Overscan is for "standard"
  1131. overscan dimensions, SA_DClip is for your custom numeric specifications.}
  1132. SA_ShowTitle = SA_Dummy + 22; // boolean equivalent to flag SHOWTITLE
  1133. SA_Behind = SA_Dummy + 23; // boolean equivalent to flag SCREENBEHIND
  1134. SA_Quiet = SA_Dummy + 24; // boolean equivalent to flag SCREENQUIET
  1135. SA_AutoScroll = SA_Dummy + 25; // boolean equivalent to flag AUTOSCROLL
  1136. SA_Pens = SA_Dummy + 26; // pointer to ~0 terminated UWORD array, as found in struct DrawInfo
  1137. SA_FullPalette = SA_Dummy + 27; // boolean: initialize color table to entire preferences palette, rather than compatible pens 0-3, 17-19, with remaining palette as returned by GetColorMap()
  1138. SA_ColorMapEntries = SA_Dummy + 28; {Allows you to override the number of entries in the ColorMap for your screen. Intuition
  1139. normally allocates (1 shl depth) or 32, whichever is more, but you may require even more if you
  1140. use certain graphics.library features (eg. palette-banking).}
  1141. SA_Parent = SA_Dummy + 29; // Pointer to a "parent" screen to attach this one to. Attached screens slide and depth-arrange together.
  1142. SA_Draggable = SA_Dummy + 30; // Boolean tag allowing non-draggable screens. Do not use without good reason! (Defaults to True).
  1143. SA_Exclusive = SA_Dummy + 31; { Boolean tag allowing screens that won't share the display. Use sparingly! Starting with 3.01,
  1144. attached screens may be SA_Exclusive. Setting SA_Exclusive for each screen will produce an
  1145. exclusive family. (Defaults to FALSE).}
  1146. SA_SharePens = SA_Dummy + 32; { For those pens in the screen's DrawInfo^.dri_Pens, Intuition obtains them in shared mode (see
  1147. graphics.library/ObtainPen()). For compatibility, Intuition obtains the other pens of a public
  1148. screen as PEN_EXCLUSIVE. Screens that wish to manage the pens themselves should generally set
  1149. this tag to True. This instructs Intuition to leave the other pens unallocated.}
  1150. SA_BackFill = SA_Dummy + 33; // provides a "backfill hook" for your screen's Layer_Info. See layers.library/InstallLayerInfoHook()
  1151. SA_Interleaved = SA_Dummy + 34; // Boolean tag requesting that the bitmap allocated for you be interleaved. (Defaults to False).
  1152. SA_Colors32 = SA_Dummy + 35; { Tag to set the screen's initial palette colors at 32 bits-per-gun. ti_Data is a pointer
  1153. to a table to be passed to the graphics.library/LoadRGB32() function. This format supports both runs of color
  1154. registers and sparse registers. See the autodoc for that function for full details. Any color set here has
  1155. precedence over the same register set by SA_Colors.}
  1156. SA_VideoControl = SA_Dummy + 36; // Pointer to a taglist that Intuition will pass to graphics.library/VideoControl(), upon opening the screen.
  1157. SA_FrontChild = SA_Dummy + 37; // Pointer to an already open screen that is to be the child of the screen being opened. The child screen will be moved to the front of its family.
  1158. SA_BackChild = SA_Dummy + 38; // Pointer to an already open screen that is to be the child of the screen being opened. The child screen will be moved to the back of its family.
  1159. SA_LikeWorkbench = SA_Dummy + 39; // 1 = request a screen which is just like the Workbench. This gives you the same screen mode, depth, size, colors, etc., as the Workbench screen.
  1160. SA_Reserved = SA_Dummy + 40; // Reserved for private Intuition use
  1161. SA_MinimizeISG = SA_Dummy + 41; { For compatibility, Intuition always ensures that the inter-screen gap is at least three non-interlaced lines. If your application
  1162. would look best with the smallest possible inter-screen gap, set ti_Data to True. If you use the new graphics VideoControl()
  1163. VC_NoColorPaletteLoad tag for your screen's ViewPort, you should also set this tag.}
  1164. SA_ID = SA_Dummy + 42;
  1165. // this is an obsolete tag included only for compatibility with V35 interim release for the A2024 and Viking monitors
  1166. NSTAG_EXT_VPMODE = TAG_USER + 1;
  1167. // SA_Overscan
  1168. OSCAN_TEXT = 1; // entirely visible
  1169. OSCAN_STANDARD = 2; // just past edges
  1170. OSCAN_MAX = 3; // as much as possible
  1171. OSCAN_VIDEO = 4; // even more than is possible
  1172. type
  1173. PNewScreen = ^TNewScreen;
  1174. TNewScreen = record
  1175. LeftEdge,
  1176. TopEdge,
  1177. Width,
  1178. Height,
  1179. Depth: SmallInt; // screen dimensions
  1180. DetailPen,
  1181. BlockPen: Byte; // for bar/border/gadget rendering
  1182. ViewModes: Word; // the Modes for the ViewPort (and View)
  1183. SType: Word; // the Screen type (see defines above) (Type in C-Include)
  1184. Font: PTextAttr; // this Screen's default text attributes
  1185. DefaultTitle: PChar; // the default title for this Screen
  1186. Gadgets: PGadget; // your own Gadgets for this Screen
  1187. { if you are opening a CUSTOMSCREEN and already have a BitMap
  1188. that you want used for your Screen, you set the flags CUSTOMBITMAP in
  1189. the type field and you set this variable to point to your BitMap
  1190. structure. The structure will be copied into your Screen structure,
  1191. after which you may discard your own BitMap if you want}
  1192. CustomBitMap: PBitMap;
  1193. end;
  1194. PExtNewScreen = ^TExtNewScreen;
  1195. TExtNewScreen = record
  1196. LeftEdge,
  1197. TopEdge,
  1198. Width,
  1199. Height,
  1200. Depth: SmallInt;
  1201. DetailPen,
  1202. BlockPen: Byte;
  1203. ViewModes: Word;
  1204. ens_Type: Word; { type in C-Includes }
  1205. Font: PTextAttr;
  1206. DefaultTitle: PChar;
  1207. Gadgets: PGadget;
  1208. CustomBitMap: PBitMap;
  1209. Extension: PTagItem; // ExtNewScreen specific extension SA_*
  1210. end;
  1211. // Public Shared Screen Node
  1212. { This is the representative of a public shared screen.
  1213. This is an internal data structure, but some functions may
  1214. present a copy of it to the calling application. In that case,
  1215. be aware that the screen pointer of the structure can NOT be
  1216. used safely, since there is no guarantee that the referenced
  1217. screen will remain open and a valid data structure.
  1218. Never change one of these.}
  1219. PPubScreenNode = ^TPubScreenNode;
  1220. TPubScreenNode = record
  1221. psn_Node: TNode; // ln_Name is screen name
  1222. psn_Screen: PScreen;
  1223. psn_Flags: Word; // below (PSNF_*)
  1224. psn_Size: SmallInt; // includes name buffer
  1225. psn_VisitorCount: SmallInt; // how many visitor windows
  1226. psn_SigTask: PTask; // who to signal when visitors gone
  1227. psn_SigBit: Byte; // which signal
  1228. end;
  1229. const
  1230. // psn_Flags
  1231. PSNF_PRIVATE = 1 shl 0;
  1232. // Maximum length of public screen names. The buffers containing these strings must have a length of MAXPUBSCREENNAME+1.
  1233. MAXPUBSCREENNAME = 139; // names no longer, please
  1234. // pub screen modes
  1235. SHANGHAI = 1 shl 0; // put workbench windows on pub screen
  1236. POPPUBSCREEN = 1 shl 1; // pop pub screen to front when visitor opens
  1237. {Intuition has new screen depth-arrangement and movement
  1238. functions called ScreenDepth() and ScreenPosition() respectively.
  1239. These functions permit the old behavior of ScreenToFront(),
  1240. ScreenToBack(), and MoveScreen(). ScreenDepth() also allows
  1241. independent depth control of attached screens. ScreenPosition()
  1242. optionally allows positioning screens even though they were opened
  1243. (SA_Draggable, False).
  1244. For ScreenDepth(), specify one of SDEPTH_TOFRONT or SDEPTH_TOBACK,
  1245. and optionally also SDEPTH_INFAMILY.
  1246. NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  1247. SDEPTH_INFAMILY. Commodities, "input helper" programs,
  1248. or any other program that did not open a screen should never
  1249. use that flag. (Note that this is a style-behavior
  1250. requirement; there is no technical requirement that the
  1251. task calling this function need be the task which opened
  1252. the screen).}
  1253. SDEPTH_TOFRONT = 0; // Bring screen to front
  1254. SDEPTH_TOBACK = 1; // Send screen to back
  1255. SDEPTH_INFAMILY = 2; // Move an attached screen with respect to other screens of its family
  1256. { For ScreenPosition(), specify one of SPOS_RELATIVE, SPOS_ABSOLUTE, or SPOS_MAKEVISIBLE to describe the kind of screen positioning you
  1257. wish to perform. You may additionally set SPOS_FORCEDRAG along with any of the above. Set this if you wish to reposition an (SA_Draggable,False)
  1258. screen that you opened.
  1259. NOTE: ONLY THE OWNER OF THE SCREEN should ever specify SPOS_FORCEDRAG. Commodities, "input helper" programs, or any other program that did not
  1260. open a screen should never use that flag.
  1261. }
  1262. SPOS_RELATIVE = 0; // The x1 and y1 parameters to ScreenPosition() describe the offset in coordinates you wish to move the screen by. Coordinates are relative
  1263. SPOS_ABSOLUTE = 1 shl 0; // The x1 and y1 parameters to ScreenPosition() describe the absolute coordinates you wish to move the screen to. Coordinates are expressed as absolutes, not relatives.
  1264. SPOS_MAKEVISIBLE = 1 shl 1; // Coordinates describe a box on the screen you wish to be made visible by autoscrolling
  1265. // (x1,y1)-(x2,y2) describes a rectangle on the screen which you would like autoscrolled into view.
  1266. SPOS_FORCEDRAG = 1 shl 2; // Move non-draggable screen, You may additionally set SPOS_FORCEDRAG along with any of the above.
  1267. // Set this if you wish to reposition an (SA_Draggable, False) screen that you opened.
  1268. { Intuition supports double-buffering in screens, with friendly interaction with menus and certain gadgets.
  1269. For each buffer, you need to get one of these structures from the AllocScreenBuffer() call. Never allocate your own ScreenBuffer structures!
  1270. The sb_DBufInfo field is for your use. See the graphics.library AllocDBufInfo() autodoc for details.}
  1271. type
  1272. PScreenBuffer = ^TScreenBuffer;
  1273. TScreenBuffer = record
  1274. sb_BitMap: PBitMap; // BitMap of this buffer
  1275. sb_DBufInfo: PDBufInfo; // DBufInfo for this buffer
  1276. end;
  1277. const
  1278. // These are the flags that may be passed to AllocScreenBuffer().
  1279. SB_SCREEN_BITMAP = 1;
  1280. SB_COPY_BITMAP = 2;
  1281. const
  1282. // these are the definitions for the printer configurations
  1283. FILENAME_SIZE = 30; // Filename size
  1284. DEVNAME_SIZE = 16;
  1285. POINTERSIZE = (1 + 16 + 1) * 2; // Size of Pointer data buffer
  1286. { These defines are for the default font size. These actually describe the
  1287. height of the defaults fonts. The default font type is the topaz
  1288. font, which is a fixed width font that can be used in either
  1289. eighty-column or sixty-column mode. The Preferences structure reflects
  1290. which is currently selected by the value found in the variable FontSize,
  1291. which may have either of the values defined below. These values actually
  1292. are used to select the height of the default font. By changing the
  1293. height, the resolution of the font changes as well.}
  1294. TOPAZ_EIGHTY = 8;
  1295. TOPAZ_SIXTY = 9;
  1296. type
  1297. PPreferences = ^TPreferences;
  1298. TPreferences = record
  1299. FontHeight: ShortInt; // height for system default font
  1300. PrinterPort: Byte; // printer port connection constant describing what's hooked up to the port
  1301. BaudRate: Word; // baud rate for the serial port
  1302. // various timing rates
  1303. KeyRptSpeed: Ttimeval; // repeat speed for keyboard
  1304. KeyRptDelay: Ttimeval; // Delay before keys repeat
  1305. DoubleClick: Ttimeval; // Interval allowed between clicks
  1306. // Intuition Mouse-Pointer data
  1307. PointerMatrix: array[0..POINTERSIZE - 1] of Word; // Definition of pointer sprite
  1308. XOffset: ShortInt; // X-Offset for active 'bit'
  1309. YOffset: ShortInt; // Y-Offset for active 'bit'
  1310. color17: Word; //
  1311. color18: Word; // Colours for sprite pointer
  1312. color19: Word; //
  1313. PointerTicks: Word; // Sensitivity of the pointer
  1314. // Workbench Screen colors
  1315. color0: Word; //
  1316. color1: Word; // Standard default colours
  1317. color2: Word; // Used in the Workbench
  1318. color3: Word; //
  1319. // positioning data for the Intuition View
  1320. ViewXOffset: ShortInt; // Offset for top lefthand corner
  1321. ViewYOffset: ShortInt; // X and Y dimensions
  1322. ViewInitX,
  1323. ViewInitY: SmallInt; // View initial offset values
  1324. EnableCLI: LongBool; // CLI availability switch
  1325. // printer configurations
  1326. PrinterType: Word; // printer type
  1327. PrinterFilename: array[0..FILENAME_SIZE - 1] of char; // file for printer
  1328. // print format and quality configurations
  1329. PrintPitch: Word; // print pitch
  1330. PrintQuality: Word; // print quality
  1331. PrintSpacing: Word; // number of lines per inch
  1332. PrintLeftMargin: Word; // left margin in characters
  1333. PrintRightMargin: Word; // right margin in characters
  1334. PrintImage: Word; // positive or negative
  1335. PrintAspect: Word; // horizontal or vertical
  1336. PrintShade: Word; // b&w, half-tone, or color
  1337. PrintThreshold: SmallInt; // darkness ctrl for b/w dumps
  1338. // print paper descriptors
  1339. PaperSize: Word; // paper size
  1340. PaperLength: Word; // paper length in number of lines
  1341. PaperType: Word; // continuous or single sheet
  1342. // Serial device settings: These are six nibble-fields in three bytes (these look a little strange so the defaults will map out to zero)
  1343. SerRWBits: Byte; // upper nibble = (8-number of read bits), lower nibble = (8-number of write bits)
  1344. SerStopBuf: Byte; // upper nibble = (number of stop bits - 1), lower nibble = (table value for BufSize)
  1345. SerParShk: Byte; // upper nibble = (value for Parity setting), lower nibble = (value for Handshake mode)
  1346. LaceWB: Byte; // if workbench is to be interlaced
  1347. // temp file for printer
  1348. Pad: array[0..11] of Byte;
  1349. PrtDevName: array [0..DEVNAME_SIZE - 1] of char; // Device used by printer.device (leave out the ".device")
  1350. DefaultPrtUnit: Byte; // Default unit opened by printer.device
  1351. DefaultSerUnit: Byte; // Default serial unit
  1352. RowSizeChange: ShortInt; // Affect NormalDisplayRows/Columns
  1353. ColumnSizeChange: ShortInt;
  1354. PrintFlags: Word; // user preference flags
  1355. PrintMaxWidth: Word; // max width of printed picture in 10ths/inch
  1356. PrintMaxHeight: Word; // max height of printed picture in 10ths/inch
  1357. PrintDensity: Byte; // print density
  1358. PrintXOffset: Byte; // offset of printed picture in 10ths/inch
  1359. wb_Width: Word; // override default workbench width
  1360. wb_Height: Word; // override default workbench height
  1361. wb_Depth: Byte; // override default workbench depth
  1362. ext_size: Byte; // extension information -- do not touch!
  1363. // extension size in blocks of 64 bytes DO NOT TOUCH
  1364. end;
  1365. const
  1366. // Workbench Interlace (use one bit)
  1367. LACEWB = 1 shl 0;
  1368. LW_RESERVED = 1; // internal use only
  1369. SCREEN_DRAG = 1 shl 14;
  1370. MOUSE_ACCEL = 1 shl 15;
  1371. // PrinterPort
  1372. PARALLEL_PRINTER = $00;
  1373. SERIAL_PRINTER = $01;
  1374. // BaudRate
  1375. BAUD_110 = $00;
  1376. BAUD_300 = $01;
  1377. BAUD_1200 = $02;
  1378. BAUD_2400 = $03;
  1379. BAUD_4800 = $04;
  1380. BAUD_9600 = $05;
  1381. BAUD_19200 = $06;
  1382. BAUD_MIDI = $07;
  1383. // PaperType
  1384. FANFOLD_PT = $00;
  1385. Single_PT = $80;
  1386. // PrintPitch
  1387. PICA = $000;
  1388. ELITE = $400;
  1389. FINE = $800;
  1390. // PrintQuality
  1391. DRAFT = $000;
  1392. LETTER = $100;
  1393. // PrintSpacing
  1394. SIX_LPI = $000;
  1395. EIGHT_LPI = $200;
  1396. // Print Image
  1397. IMAGE_POSITIVE = $00;
  1398. IMAGE_NEGATIVE = $01;
  1399. // PrintAspect
  1400. ASPECT_HORIZ = $00;
  1401. ASPECT_VERT = $01;
  1402. // PrintShade
  1403. SHADE_BW = $00;
  1404. SHADE_GREYSCALE = $01;
  1405. SHADE_COLOR = $02;
  1406. // PaperSize
  1407. US_LETTER = $00;
  1408. US_LEGAL = $10;
  1409. N_TRACTOR = $20;
  1410. W_TRACTOR = $30;
  1411. CUSTOM_PAPER = $40;
  1412. // European sizes
  1413. EURO_A0 = $50; // European size A0: 841 x 1189
  1414. EURO_A1 = $60; // European size A1: 594 x 841
  1415. EURO_A2 = $70; // European size A2: 420 x 594
  1416. EURO_A3 = $80; // European size A3: 297 x 420
  1417. EURO_A4 = $90; // European size A4: 210 x 297
  1418. EURO_A5 = $A0; // European size A5: 148 x 210
  1419. EURO_A6 = $B0; // European size A6: 105 x 148
  1420. EURO_A7 = $C0; // European size A7: 74 x 105
  1421. EURO_A8 = $D0; // European size A8: 52 x 74
  1422. // PrinterType
  1423. CUSTOM_NAME = $00;
  1424. ALPHA_P_101 = $01;
  1425. BROTHER_15XL = $02;
  1426. CBM_MPS1000 = $03;
  1427. DIAB_630 = $04;
  1428. DIAB_ADV_D25 = $05;
  1429. DIAB_C_150 = $06;
  1430. EPSON = $07;
  1431. EPSON_JX_80 = $08;
  1432. OKIMATE_20 = $09;
  1433. QUME_LP_20 = $0A;
  1434. HP_LASERJET = $0B;
  1435. HP_LASERJET_PLUS = $0C;
  1436. // Serial Input Buffer Sizes
  1437. SBUF_512 = $00;
  1438. SBUF_1024 = $01;
  1439. SBUF_2048 = $02;
  1440. SBUF_4096 = $03;
  1441. SBUF_8000 = $04;
  1442. SBUF_16000 = $05;
  1443. // Serial Bit Masks
  1444. SREAD_BITS = $F0; // for SerRWBits
  1445. SWRITE_BITS = $0F;
  1446. SSTOP_BITS = $F0; // for SerStopBuf
  1447. SBUFSIZE_BITS = $0F;
  1448. SPARITY_BITS = $F0; // for SerParShk
  1449. SHSHAKE_BITS = $0F;
  1450. // Serial Parity (upper nibble, after being shifted by macro SPARNUM())
  1451. SPARITY_NONE = 0;
  1452. SPARITY_EVEN = 1;
  1453. SPARITY_ODD = 2;
  1454. SPARITY_MARK = 3;
  1455. SPARITY_SPACE = 4;
  1456. // Serial Handshake Mode (lower nibble, after masking using macro SHANKNUM())
  1457. SHSHAKE_XON = 0;
  1458. SHSHAKE_RTS = 1;
  1459. SHSHAKE_NONE = 2;
  1460. // new defines for PrintFlags
  1461. CORRECT_RED = $0001; // color correct red shades
  1462. CORRECT_GREEN = $0002; // color correct green shades
  1463. CORRECT_BLUE = $0004; // color correct blue shades
  1464. CENTER_IMAGE = $0008; // center image on paper
  1465. IGNORE_DIMENSIONS = $0000; // ignore max width/height settings
  1466. BOUNDED_DIMENSIONS = $0010; // use max width/height as boundaries
  1467. ABSOLUTE_DIMENSIONS = $0020; // use max width/height as absolutes
  1468. PIXEL_DIMENSIONS = $0040; // use max width/height as prt pixels
  1469. MULTIPLY_DIMENSIONS = $0080; // use max width/height as multipliers
  1470. INTEGER_SCALING = $0100; // force integer scaling
  1471. ORDERED_DITHERING = $0000; // ordered dithering
  1472. HALFTONE_DITHERING = $0200; // halftone dithering
  1473. FLOYD_DITHERING = $0400; // Floyd-Steinberg dithering
  1474. ANTI_ALIAS = $0800; // anti-alias image
  1475. GREY_SCALE2 = $1000; // for use with hi-res monitor
  1476. // masks used for checking bits
  1477. CORRECT_RGB_MASK = CORRECT_RED or CORRECT_GREEN or CORRECT_BLUE;
  1478. DIMENSIONS_MASK = BOUNDED_DIMENSIONS or ABSOLUTE_DIMENSIONS or PIXEL_DIMENSIONS or MULTIPLY_DIMENSIONS;
  1479. DITHERING_MASK = HALFTONE_DITHERING or FLOYD_DITHERING;
  1480. { Be sure to protect yourself against someone modifying these data as you look at them. This is done by calling:
  1481. lock = LockIBase(0), which returns an Integer. When done call UnlockIBase(lock) where lock is what LockIBase() returned.}
  1482. type
  1483. // IntuitionBase should never be directly modified by programs
  1484. PIntuitionBase = ^TIntuitionBase;
  1485. TIntuitionBase = record
  1486. LibNode: TLibrary;
  1487. ViewLord: TView;
  1488. ActiveWindow: PWindow;
  1489. ActiveScreen: PScreen;
  1490. FirstScreen: PScreen; { for linked list of all screens, the FirstScreen variable points to the frontmost Screen.
  1491. Screens are then maintained in a front to back order using Screen.NextScreen }
  1492. Flags: LongWord; // see definitions below
  1493. {$ifdef AROS_BINCOMPAT}
  1494. MouseX,
  1495. MouseY: SmallInt; // mouse position relative to View
  1496. {$else}
  1497. MouseY,
  1498. MouseX: SmallInt; // mouse position relative to View
  1499. {$endif}
  1500. Seconds: LongWord; // timestamp of most current input event
  1501. Micros: LongWord; // timestamp of most current input event
  1502. // I told you this was private. The data beyond this point has changed, is changing, and will continue to change.
  1503. end;
  1504. { Package of information passed to custom and 'boopsi'
  1505. gadget 'hook' functions. This structure is READ ONLY.}
  1506. type
  1507. PGadgetInfo = ^TGadgetInfo;
  1508. TGadgetInfo = record
  1509. gi_Screen: PScreen; // ScreenPtr
  1510. gi_Window: PWindow; // nil for screen gadgets
  1511. gi_Requester: PRequester; // nil IF not GTYP_REQGADGET
  1512. gi_RastPort: PRastPort; // rendering information: don't use these without cloning/locking. Official way is to call ObtainRPort()
  1513. gi_Layer: PLayer; // LayerPtr
  1514. { copy of dimensions of screen/window/g00/req(/group)
  1515. that gadget resides in. Left/Top of this box is
  1516. offset from window mouse coordinates to gadget coordinates
  1517. screen gadgets: 0,0 (from screen coords)
  1518. window gadgets (no g00): 0,0
  1519. GTYP_GZZGADGETs (borderlayer): 0,0
  1520. GZZ innerlayer gadget: borderleft, bordertop
  1521. Requester gadgets: reqleft, reqtop}
  1522. gi_Domain: TIBox;
  1523. gi_Pens: record
  1524. DetailPen: Byte;
  1525. BlockPen: Byte;
  1526. end;
  1527. gi_DrInfo: PDrawInfo; // the Detail and Block pens in gi_DrInfo^.dri_Pens[] are for the screen. Use the above for window-sensitive colors.
  1528. gi_Reserved: array[0..5] of LongWord; // reserved space: this structure is extensible anyway, but using these saves some recompilation
  1529. end;
  1530. { system private data structure for now
  1531. prop gadget extra info}
  1532. PPGX = ^TPGX;
  1533. TPGX = record
  1534. pgx_Container: TIBox;
  1535. pgx_NewKnob: TIBox;
  1536. end;
  1537. {** User visible handles on objects, classes, messages **}
  1538. type
  1539. Object_ = LongWord;
  1540. PObject_ = ^Object_;
  1541. PPObject_ = ^PObject_;
  1542. ClassID = STRPTR;
  1543. { you can use this type to point to a 'generic' message,
  1544. in the object-oriented programming parlance. Based on
  1545. the value of 'MethodID', you dispatch to processing
  1546. for the various message types. The meaningful parameter
  1547. packet structure definitions are defined below.}
  1548. PMsg = ^TMsg;
  1549. TMsg = record
  1550. MethodID: LongWord;
  1551. end;
  1552. { Class id strings for Intuition classes.
  1553. There's no real reason to use the uppercase constants
  1554. over the lowercase strings, but this makes a good place
  1555. to list the names of the built-in classes.}
  1556. const
  1557. ROOTCLASS: ClassID = 'rootclass'; // classusr.h
  1558. IMAGECLASS: ClassID = 'imageclass'; // imageclass.h
  1559. FRAMEICLASS: ClassID = 'frameiclass';
  1560. SYSICLASS: ClassID = 'sysiclass';
  1561. FILLRECTCLASS: ClassID = 'fillrectclass';
  1562. GADGETCLASS: ClassID = 'gadgetclass'; // gadgetclass.h
  1563. PROPGCLASS: ClassID = 'propgclass';
  1564. STRGCLASS: ClassID = 'strgclass';
  1565. BUTTONGCLASS: ClassID = 'buttongclass';
  1566. FRBUTTONCLASS: ClassID = 'frbuttonclass';
  1567. GROUPGCLASS: ClassID = 'groupgclass';
  1568. ICCLASS: ClassID = 'icclass'; // icclass.h
  1569. MODELCLASS: ClassID = 'modelclass';
  1570. ITEXTICLASS: ClassID = 'itexticlass';
  1571. POINTERCLASS: ClassID = 'pointerclass'; // pointerclass.h
  1572. // public classes existing only in AROS but not AmigaOS
  1573. MENUBARLABELCLASS: PChar = 'menubarlabelclass';
  1574. WINDECORCLASS: PChar = 'windecorclass';
  1575. SCRDECORCLASS: PChar = 'scrdecorclass';
  1576. MENUDECORCLASS: PChar = 'menudecorclass';
  1577. { Dispatched method ID's
  1578. NOTE: Applications should use Intuition entry points, not direct
  1579. DoMethod() calls, for NewObject, DisposeObject, SetAttrs,
  1580. SetGadgetAttrs, and GetAttr}
  1581. OM_Dummy = $100;
  1582. OM_NEW = OM_Dummy + 1; // 'object' parameter is 'true class'
  1583. OM_DISPOSE = OM_Dummy + 2; // delete self (no parameters)
  1584. OM_SET = OM_Dummy + 3; // set attributes (in tag list)
  1585. OM_GET = OM_Dummy + 4; // return single attribute value
  1586. OM_ADDTAIL = OM_Dummy + 5; // add self to a List (let root do it)
  1587. OM_REMOVE = OM_Dummy + 6; // remove self from list
  1588. OM_NOTIFY = OM_Dummy + 7; // send to self: notify dependents
  1589. OM_UPDATE = OM_Dummy + 8; // notification message from somebody
  1590. OM_ADDMEMBER = OM_Dummy + 9; // used by various classes with lists
  1591. OM_REMMEMBER = OM_Dummy + 10; // used by various classes with lists
  1592. // Parameter 'Messages' passed to methods
  1593. type
  1594. // OM_NEW and OM_SET
  1595. PopSet = ^TopSet;
  1596. TopSet = record
  1597. MethodID: LongWord;
  1598. ops_AttrList: PTagItem; // new attributes
  1599. ops_GInfo: PGadgetInfo; // always there for gadgets, when SetGadgetAttrs() is used, but will be nil for OM_NEW
  1600. end;
  1601. // OM_GET
  1602. PopGet = ^TopGet;
  1603. TopGet = record
  1604. MethodID,
  1605. opg_AttrID: LongWord;
  1606. opg_Storage: Pointer; // may be other types, but 'int' types are all LongWord
  1607. end;
  1608. // OM_ADDTAIL
  1609. PopAddTail = ^TopAddTail;
  1610. TopAddTail = record
  1611. MethodID: LongWord;
  1612. opat_List: PList;
  1613. end;
  1614. // OM_ADDMEMBER, OM_REMMEMBER
  1615. PopMember = ^TopMember;
  1616. TopMember = record
  1617. MethodID: LongWord;
  1618. opam_Object: PObject_;
  1619. end;
  1620. TopAddMember = TopMember;
  1621. PopAddMember = ^TopAddMember;
  1622. // OM_NOTIFY, and OM_UPDATE
  1623. PopUpdate = ^TopUpdate;
  1624. TopUpdate = record
  1625. MethodID: LongWord;
  1626. opu_AttrList: PTagItem; // new attributes
  1627. opu_GInfo: PGadgetInfo; // non-nil when SetGadgetAttrs OR notification resulting from gadget input occurs.
  1628. opu_Flags: LongWord; // defined below (OPUF_*)
  1629. end;
  1630. { this flag means that the update message is being issued from
  1631. something like an active gadget, a la GACT_FOLLOWMOUSE. When
  1632. the gadget goes inactive, it will issue a final update
  1633. message with this bit cleared. Examples of use are for
  1634. GACT_FOLLOWMOUSE equivalents for propgadclass, and repeat strobes
  1635. for buttons.}
  1636. const
  1637. OPUF_INTERIM = 1; // opu_Flags
  1638. { This structure is READ-ONLY, and allocated only by Intuition }
  1639. type
  1640. PIClass = ^TIClass;
  1641. TIClass = record // also used as Class
  1642. cl_Dispatcher: THook;
  1643. cl_Reserved: LongWord; // must be 0
  1644. cl_Super: PIClass; // Super - Class
  1645. cl_ID: ClassID;
  1646. cl_InstOffset: Word; // where within an object is the instance data for this class?
  1647. cl_InstSize: Word;
  1648. cl_UserData: IPTR; // per-class data of your choice, application specific
  1649. cl_SubclassCount: LongWord; // # of direct suclasses
  1650. cl_ObjectCount: LongWord; // # of objects, made from this class must be 0, if the class is to be deleted
  1651. cl_Flags: LongWord; // Flags (CLF_INLIST)
  1652. cl_ObjectSize: LongWord; // cl_InstOffset + cl_InstSize + SizeOf(_Object)
  1653. cl_MemoryPool: APTR;
  1654. end;
  1655. const
  1656. CLF_INLIST = 1 shl 0; // class is in public class list (cl_Flags)
  1657. { We have this, the instance data of the root class, PRECEDING
  1658. the 'object'. This is so that Gadget objects are Gadget pointers,
  1659. and so on. If this structure grows, it will always have o_Class
  1660. at the end, so the macro OCLASS(o) will always have the same
  1661. offset back from the pointer returned from NewObject().}
  1662. type
  1663. P_Object = ^T_Object;
  1664. T_Object = record
  1665. o_Node: TMinNode;
  1666. o_Class: PIClass;
  1667. end;
  1668. { BOOPSI class libraries should use this structure as the base for their
  1669. library data. This allows developers to obtain the class pointer for
  1670. performing object-less inquiries. }
  1671. PClassLibrary = ^TClassLibrary;
  1672. TClassLibrary = record
  1673. cl_Lib: TLibrary; // Embedded library
  1674. cl_Pad: Word; // Align the structure
  1675. cl_Class: PIClass; // Class pointer
  1676. end;
  1677. { GadgetClass Attributes
  1678. Most subclasses of GadgetClass implement a subset of these attributes. Note
  1679. also that even if an attribute is signed as settable, some subclasses may
  1680. ignore this or even behave strange, if such an attribute is set, after they
  1681. were added to a window. Read the class documentation of the subclasses to
  1682. learn about such caveats.
  1683. Many of these attributes correspond directly to a field of the Gadget
  1684. structure or to one flag for this structure. }
  1685. const
  1686. GA_Dummy = (TAG_USER + $30000);
  1687. // Gadget placing (in pixels). Of course, all GA_Rel attributes are mutually
  1688. // exclusive with their non relative equivalents.
  1689. GA_Left = (GA_Dummy + $0001); // [ISG] (LONG) Left edge of gadget.
  1690. GA_RelRight = (GA_Dummy + $0002); // [ISG] (LONG) Left edge of gadget, depending on right window border: Left=Win^.Width-this-1
  1691. GA_Top = (GA_Dummy + $0003); // [ISG] (LONG) Top edge of gadget.
  1692. GA_RelBottom = (GA_Dummy + $0004); // [ISG] (LONG) Top edge of gadget, depending on bottom window border: Top=Win^.Height-this-1
  1693. GA_Width = (GA_Dummy + $0005); // [ISG] (LONG) Width of gadget.
  1694. GA_RelWidth = (GA_Dummy + $0006); // [ISG] (LONG) Width of gadget, depending on window width: Width=Win^.Width-this
  1695. GA_Height = (GA_Dummy + $0007); // [ISG] (LONG) Height of gadget.
  1696. GA_RelHeight = (GA_Dummy + $0008); // [ISG] (LONG) Height of gadget, depending on window height: Height=Win^.Height-this
  1697. // Gadget rendering
  1698. GA_Text = (GA_Dummy + $0009); // [IS.] (PChar) Label text. This is mutually exclusive with GA_IntuiText and GA_LabelImage.
  1699. // The next two attributes are mutually exclusive.
  1700. GA_Image = (GA_Dummy + $000A); // (PImage) Gadget imagry is an image
  1701. GA_Border = (GA_Dummy + $000B); // (PBorder) Gadget imagry is a border
  1702. GA_SelectRender = (GA_Dummy + $000C); { [IS.] (PImage) Gadgets' image in selected state. Note that if
  1703. this is nil and GA_Image is in fact an image object, GA_Image may be
  1704. tried to be drawn with IDS_SELECTED. So you do not need to fill this in,
  1705. if you wish to have a special selected image and GA_Image is an image
  1706. object that supports the selected state.}
  1707. GA_Highlight = (GA_Dummy + $000D); // [IS.] (LongWord) Takes GFLG_GADGH* flags as argument. Used to specify the highlighting technique.
  1708. GA_Disabled = (GA_Dummy + $000E); // [ISG] (LongBool) If this is set to true, the gadget is not selectable. Often this is visually represented by using a special disabled pattern.
  1709. // Additional information.
  1710. GA_GZZGadget = (GA_Dummy + $000F); // [IS.] (LongBool) The Gadget is a GimmeZeroZero gadget. Default = False
  1711. GA_ID = (GA_Dummy + $0010); // (LongInt) Gadget ID assigned by the application (prevent double numbers)
  1712. GA_UserData = (GA_Dummy + $0011); // [ISG] (IPTR) Fill with whatever you want to. This field is ignored by the system.
  1713. GA_SpecialInfo = (GA_Dummy + $0012); { [IS.] (APTR) Pointer to additional information, needed by some gadgets
  1714. (like string or integer gadgets). This field should generally only be set
  1715. by subclasses of GadgetClass. Applications should keep their hands off it.}
  1716. // Gadget activation.
  1717. GA_Selected = (GA_Dummy + $0013); // [ISG] (LongBool) Indicate whether the gadget is selected or not. Default = False
  1718. GA_EndGadget = (GA_Dummy + $0014); // [IS.] (LongBool) Only used for requester gadgets. This tells intuition that the requester is to be closed, when the gadget is released. Default = False
  1719. GA_Immediate = (GA_Dummy + $0015); // [IS.] (LongBool) If set the gadget responds immediatly, when the gadget is selected. Default = False
  1720. GA_RelVerify = (GA_Dummy + $0016); // [IS.] (LongBool) If set the gadget responds, when it is released from selected state. Default = False
  1721. GA_FollowMouse = (GA_Dummy + $0017); // [IS.] (LongBool) If this is set, the gadget receives information about the movement of the mouse as long as it is activated. Default = False
  1722. GA_RightBorder = (GA_Dummy + $0018); // [IS.] (LongBool) Indicate whether the gadget is in the right border or not. Default = False.
  1723. GA_LeftBorder = (GA_Dummy + $0019); // [IS.] (LongBool) Indicate whether the gadget is in the left border or not. Default = False.
  1724. GA_TopBorder = (GA_Dummy + $001A); // [IS.] (LongBool) Indicate whether the gadget is in the top border or not. Default = False.
  1725. GA_BottomBorder = (GA_Dummy + $001B); // [IS.] (LongBool) Indicate whether the gadget is in the bottom border or not. Default = False.
  1726. GA_ToggleSelect = (GA_Dummy + $001C); // [IS.] (LongBool) Indicate whether the gadget is toggle-selected or not. Default = False.
  1727. // The following two attributes are PRIVATE!
  1728. GA_SysGadget = (GA_Dummy + $001D); // [IS.] (LongBool) Set, if gadget is a system-gadget e.g. a standard window border gadget. Default = False.
  1729. GA_SysGType = (GA_Dummy + $001E); // [IS.] (LongWord) Reserved for system use to indicate the gadget type.
  1730. // Gadget linking.
  1731. GA_Previous = (GA_Dummy + $001F); { [I..] (PGadget) Pointer to previous gadget. This is used to link
  1732. the current gadget into a gadget list, before this list is used. It can
  1733. not be used to add a gadget to a list of an open window or requester!}
  1734. GA_Next = (GA_Dummy + $0020); // [I..] (PGadget) Next gadget in the linked list. Currently not implemented.
  1735. GA_DrawInfo = (GA_Dummy + $0021); { [I..] (PDrawInfo) Some gadgets need a DrawInfo structure
  1736. to be able to perform correct rendering. Read the documentation of the
  1737. subclasses to learn, which need this attribute. To be on the safe side,
  1738. you can always supply it.}
  1739. // You should use at most ONE of GA_Text, GA_IntuiText, and GA_LabelImage
  1740. GA_IntuiText = (GA_Dummy + $0022); // [IS.] (PIntuiText) Label is an IntuiText.
  1741. GA_LabelImage = (GA_Dummy + $0023); // [IS.] (PObject_) Label is an image object.
  1742. GA_TabCycle = (GA_Dummy + $0024); // [IS.] (LongBool) If set to true that gadget participates in TAB handling, i.e. if tab is pressed, the next gadget is activated.
  1743. GA_GadgetHelp = (GA_Dummy + $0025); // [..G] (LongBool) If this is set by the gadget, the sends GADGETHELP messages.
  1744. GA_Bounds = (GA_Dummy + $0026); // [IS.] (PIBox) Bounds to be copied into the ExtGadget structure.
  1745. GA_RelSpecial = (GA_Dummy + $0027); { [IS.] (Long) This attribute should only be set by subclasses of
  1746. GadgetClass. Applications should keep their hands away!
  1747. If set this means, that GM_LAYOUT is called, when the window it is in is
  1748. opened or its size changes. This allows gadgets to make their own size
  1749. dependent on the size of the window. }
  1750. GA_TextAttr = GA_Dummy + 40; // [IS.] (PTextAttr) Indicate the font to use for the gadget.
  1751. GA_ReadOnly = GA_Dummy + 41; // (LongBool) Indicate that the gadget is read-only (non-selectable). Default = False
  1752. GA_Underscore = GA_Dummy + 42; // (Char) Underscore/escape character for keyboard shortcuts. Defaults = '_'
  1753. GA_ActivateKey = GA_Dummy + 43; // (PChar) Set/Get the gadgets shortcut/activation key(s) Default = nil
  1754. GA_BackFill = GA_Dummy + 44; // (PHook) Backfill pattern hook. Defaults to nil.
  1755. GA_GadgetHelpText = GA_Dummy + 45; // (PChar) RESERVERD/PRIVATE DO NOT USE. Default = nil
  1756. GA_UserInput = GA_Dummy + 46; // (LongBool) Notification tag indicates this notification is from the activite gadget receiving user input - an attempt to make IDCMPUPDATE more efficient.
  1757. // Aros Specifics
  1758. GA_LabelPlace = GA_Dummy + 100; { [I..] (LongInt) Choose the placing of the label. GadgetClass does not support
  1759. this directly. Its subclasses have to take care of that. For possible values see GV_* .}
  1760. // Placetext values for GA_LabelPlace.
  1761. GV_LabelPlace_In = 1;
  1762. GV_LabelPlace_Left = 2;
  1763. GV_LabelPlace_Right = 3;
  1764. GV_LabelPlace_Above = 4;
  1765. GV_LabelPlace_Below = 5;
  1766. //*** PropGClass
  1767. // This class defines a standard proportional gadget.
  1768. PGA_Dummy = TAG_USER + $31000;
  1769. PGA_Freedom = PGA_Dummy + 1; // [IS.] (LongWord) Define in which the direction gadget should stretch. Possible values are FREEVERT and FREEHORIZ
  1770. PGA_Borderless = PGA_Dummy + 2; // [IS.] (LongBool) If set, no border will be rendered.
  1771. // The following four attributes should not be used with PGA_Total, PGA_Visible and PGA_Top.
  1772. PGA_HorizPot = PGA_Dummy + 3; // [ISG] (Word)
  1773. PGA_HorizBody = PGA_Dummy + 4; // [ISG] (Word)
  1774. PGA_VertPot = PGA_Dummy + 5; // [ISG] (Word)
  1775. PGA_VertBody = PGA_Dummy + 6; // [ISG] (Word)
  1776. // The following three attributes should not be used with the PGA_*Pot and PGA_*Body attributes.
  1777. PGA_Total = PGA_Dummy + 7; // [IS.] (Word) The total number of positions in the gadget.
  1778. PGA_Visible = PGA_Dummy + 8; // [IS.] (Word) The number of visible positions in the gadget.
  1779. PGA_Top = PGA_Dummy + 9; // [ISG] (Word) The first visible position.
  1780. PGA_NewLook = PGA_Dummy + 10; // [IS.] (LongBool) If set, this indicated that the new look should be used for rendering.
  1781. PGA_DisplayHook = PGA_Dummy + 11; // [I.G] (PHook) Use this Hook to render the Gadget visuals
  1782. PGA_NotifyBehaviour = PGA_Dummy + 30; { [I..] (Word) If set to PG_BEHAVIOUR_NICE OM_NOTIFY messages are sent
  1783. also during OM_SET/OM_UPDATE, not just when user drags the knob, which is the default behaviour (PG_BEHAVIOUR_COMPATIBLE)}
  1784. PGA_RenderBehaviour = PGA_Dummy + 31; { [I..] (Word) If set to PG_BEHAVIOUR_NICE the gadget is re-rendered
  1785. during OM_SET/OM_UPDATE even when being a subclass of propgclass.
  1786. The default behaviour (PG_BEHAVIOUR_COMPATIBLE) is that subclasses
  1787. of propgclass don't render in OM_SET/OM_UPDATE }
  1788. // Flags for PGA_*Behaviour
  1789. PG_BEHAVIOUR_COMPATIBLE = 0;
  1790. PG_BEHAVIOUR_NICE = 1;
  1791. // StrGClass StringGClass is just a normal "string" gadget.
  1792. STRINGA_Dummy = TAG_USER + $32000;
  1793. STRINGA_MaxChars = STRINGA_Dummy + 1; // [I..] (SmallInt) Maximum number of characters the string gadget accepts. Default SG_DEFAULTMAXCHARS.
  1794. STRINGA_Buffer = STRINGA_Dummy + 2; // [I..] (STRPTR) Buffer for storing the current string of the gadget.
  1795. STRINGA_UndoBuffer = STRINGA_Dummy + 3; // [I..] (STRPTR) Buffer for storing the old (undo) string of the gadget.
  1796. STRINGA_WorkBuffer = STRINGA_Dummy + 4; // [I..] (STRPTR) Buffer for the class to work with.
  1797. STRINGA_BufferPos = STRINGA_Dummy + 5; // [IS.] (SmallInt) Current position of cursor (relative to the beginning of the buffer).
  1798. STRINGA_DispPos = STRINGA_Dummy + 6; // [IS.] (SmallInt) FIXME
  1799. STRINGA_AltKeyMap = STRINGA_Dummy + 7; // [IS.] (PKeyMap) KeyMap to use
  1800. STRINGA_Font = STRINGA_Dummy + 8; // [IS.] (PTextFont) Font to use for displaying the string
  1801. STRINGA_Pens = STRINGA_Dummy + 9; // [IS.] (LongInt) The lower 16 bits specify the background-pen, the upper 16 bits the foreground-pen. The gadget is rendered, using these pens, if the gadget is inactive
  1802. STRINGA_ActivePens = STRINGA_Dummy + 10; // [IS.] (LongInt) Like STRINGA_Pens. These pens are used, if the gadget is active.
  1803. STRINGA_EditHook = STRINGA_Dummy + 11; // [I..] (PHook) FIXME
  1804. STRINGA_EditModes = STRINGA_Dummy + 12; // [IS.] (LongWord) FIXME
  1805. STRINGA_ReplaceMode = STRINGA_Dummy + 13; // [IS.] (BOOL) If this is TRUE, the current character is overwritten, if the use presses a key. Otherwise, the new character is inserted.
  1806. STRINGA_FixedFieldMode = STRINGA_Dummy + 14; // [IS.] (LongBool) FIXME
  1807. STRINGA_NoFilterMode = STRINGA_Dummy + 15; // [IS.] (LongBool) FIXME
  1808. STRINGA_Justification = STRINGA_Dummy + 16; // [IS.] (UWORD) Where should the text be justified? Use one of GACT_STRINGCENTER, GACT_STRINGLEFT and GACT_STRINGRIGHT
  1809. STRINGA_LongVal = STRINGA_Dummy + 17; // [ISG] (LONG) If this is set, the string gadget will only accept numeric values. Argument is the number, the string gadget is to be set to. When getting this attribute, this number is returned.
  1810. STRINGA_TextVal = STRINGA_Dummy + 18; // [ISG] (STRPTR) If this is set, the string gadget will accept strings. Argument is a string that is to be copied into the string gadget and its buffer.
  1811. STRINGA_ExitHelp = STRINGA_Dummy + 19; // [IS.] (BOOL) If this is set, pressing the "Help" key, while the gadget is active, will unselect the gadget.
  1812. SG_DEFAULTMAXCHARS = 128; // Default, if STRINGA_MaxChars is not set.
  1813. // Gadget Layout related attributes
  1814. LAYOUTA_Dummy = TAG_USER + $38000;
  1815. LAYOUTA_LayoutObj = LAYOUTA_Dummy + 1;
  1816. LAYOUTA_Spacing = LAYOUTA_Dummy + 2;
  1817. LAYOUTA_Orientation = LAYOUTA_Dummy + 3; // Orientation LORIENT_*
  1818. LAYOUTA_ChildMaxWidth = LAYOUTA_Dummy + 4; // (BOOL) Child objects are of equal width. Should default to True for gadgets with a horizontal orientation.
  1819. LAYOUTA_ChildMaxHeight = LAYOUTA_Dummy + 5; // (BOOL) Child objects are of equal height. Should default to True for gadgets with a vertical orientation.
  1820. // orientation values for LAYOUTA_Orientation
  1821. LORIENT_NONE = 0;
  1822. LORIENT_HORIZ = 1;
  1823. LORIENT_VERT = 2;
  1824. // Gadget Method ID's
  1825. GM_Dummy = -1; // not used for anything
  1826. GM_HITTEST = 0; // return GMR_GADGETHIT IF you are clicked on (whether or not you are disabled).
  1827. GM_RENDER = 1; // draw yourself, in the appropriate state
  1828. GM_GOACTIVE = 2; // you are now going to be fed input
  1829. GM_HANDLEINPUT = 3; // handle that input
  1830. GM_GOINACTIVE = 4; // whether or not by choice, you are done
  1831. GM_HELPTEST = 5; // Will you send gadget help if the mouse is at the specified coordinates? See below for possible GMR_ values. }
  1832. GM_LAYOUT = 6; // re-evaluate your size based on the GadgetInfo Domain. Do NOT re-render yourself yet, you will be called when it is time...
  1833. GM_DOMAIN = 7; // This method is invoked to learn about the sizing requirements of your class, before an object is created.
  1834. // Parameter "Messages" passed to gadget class methods
  1835. type
  1836. // GM_HITTEST
  1837. { This method is used to test, if a mouse-click hit the gadget. You return
  1838. GMR_GADGETHIT (see below), if you were hit and 0 otherwise. Note that you
  1839. have to test, if you were hit, no matter if you are disabled or not.}
  1840. PgpHitTest = ^TgpHitTest;
  1841. TgpHitTest = record
  1842. MethodID: LongWord; // GM_HITEST or GM_HELPTEST
  1843. gpht_GInfo: PGadgetInfo;
  1844. gpht_Mouse: record // These values are relative to the gadget select box for GM_HITTEST. For
  1845. x: SmallInt; // GM_HELPTEST they are relative to the bounding box (which is often
  1846. y: SmallInt; // equal to the select box).
  1847. end;
  1848. end;
  1849. const
  1850. GMR_GADGETHIT = $00000004; // GM_HITTEST hit
  1851. GMR_NOHELPHIT = $00000000; // GM_HELPTEST didn't hit
  1852. GMR_HELPHIT = $FFFFFFFF; // GM_HELPTEST hit, The gadget was hit. The lower word of the Code field of the IntuiMessage will be set to -1.
  1853. GMR_HELPCODE = $00010000; // GM_HELPTEST hit, return low Word as code. The gadget was hit. Pass the lower word, returned by this method to the application by using the Code field of the IntuiMessage.
  1854. type
  1855. // GM_RENDER This method is invoked to draw the gadget into a rastport.
  1856. PgpRender = ^TgpRender;
  1857. TgpRender = record
  1858. MethodID: LongWord; // GM_RENDER
  1859. gpr_GInfo: PGadgetInfo; // gadget context
  1860. gpr_RPort: PRastPort; // all ready for use
  1861. gpr_Redraw: LongInt; // might be a "highlight pass" (GREDRAW_*)
  1862. end;
  1863. const
  1864. // gpr_Redraw. Not all of these values make sense for all gadgets.
  1865. GREDRAW_UPDATE = 2; // incremental update. Some data (e.g. the level of a slider) was updated. Just redraw the necessary parts.
  1866. GREDRAW_REDRAW = 1; // redraw the whole gadget
  1867. GREDRAW_TOGGLE = 0; // toggle highlight, IF applicable
  1868. type
  1869. // GM_GOACTIVE, GM_HANDLEINPUT
  1870. {GM_GOACTIVE tells the gadget that it has become active and will receive
  1871. input from now on from the method GM_HANDLEINPUT. This is stopped by using
  1872. GM_GOINACTIVE (see below).
  1873. GM_GOACTIVE and GM_HANDLEINPUT both use the same structure and return the
  1874. same values, as defined below.}
  1875. PgpInput = ^TgpInput;
  1876. TgpInput = record
  1877. MethodID: LongWord; // GM_GOACTIVE or GM_HANDLEINPUT
  1878. gpi_GInfo: PGadgetInfo; // gadget context
  1879. gpi_IEvent: PInputEvent; // Pointer to the InputEvent that caused the method to be invoked.
  1880. gpi_Termination: Pointer; { Pointer to a variable that is to be set by the gadget class, if
  1881. GMR_VERIFY is returned. The lower 16 bits of this value are returned
  1882. in the Code field of the IntuiMessage passed back to the application}
  1883. gpi_Mouse: record // This struct defines the current mouse position, relative to the gadgets' bounding box.
  1884. x: SmallInt;
  1885. y: SmallInt;
  1886. end;
  1887. gpi_TabletData: PTabletData; { Pointer to TabletData structure or nil,
  1888. if this input event did not originate from a tablet that is capable of
  1889. sending IESUBCLASS_NEWTABLET events.}
  1890. end;
  1891. const
  1892. // GM_HANDLEINPUT and GM_GOACTIVE return code flags. These are actually flags and may be or'ed.
  1893. GMR_MEACTIVE = 0; // Gadget is still alive.
  1894. GMR_NOREUSE = 1 shl 1; // Gadget has become inactive, but the input event may not be used again.
  1895. GMR_REUSE = 1 shl 2; // Gadget has become inactive, and the input event may be reused by intuition.
  1896. GMR_VERIFY = 1 shl 3; // Gadget was selected. Generate IDCMP_GADGETUP message. gpi_Termination must be set.
  1897. { If one of the following two flags is returned, the gadget has become
  1898. inactive, but the next or previous gadget, which has the GFLG_TABCYCLE flag
  1899. set is to be activated.}
  1900. GMR_NEXTACTIVE = 1 shl 4; // Activate next gadget.
  1901. GMR_PREVACTIVE = 1 shl 5; // Activate previous gadget.
  1902. type
  1903. // GM_GOINACTIVE see GM_GOACTIVE for explanation
  1904. PgpGoInactive = ^TgpGoInactive;
  1905. TgpGoInactive = record
  1906. MethodID: LongWord; // GM_GOINACTIVE
  1907. gpgi_GInfo: PGadgetInfo;
  1908. gpgi_Abort: LongWord; { Boolean field to indicate, who wanted the gadget to go inactive. If
  1909. this is 1 this method was sent, because intution wants the gadget to
  1910. go inactive, if it is 0, it was the gadget itself that wanted it.}
  1911. end;
  1912. type
  1913. // GM_LAYOUT
  1914. { This method is called by intuition, if on of the GFLG_REL flags or one of
  1915. the GA_Rel attributes is set and the window size changes or you are added to
  1916. a window. In this method you should re-evaluate the size of yourself. You
  1917. are not allowed to do any rendering operation during this method!}
  1918. PgpLayout = ^TgpLayout;
  1919. TgpLayout = record
  1920. MethodID: LongWord; // GM_LAYOUT
  1921. gpl_GInfo: PGadgetInfo;
  1922. gpl_Initial: LongWord; {Boolean that indicated, if this method was invoked, when you are added
  1923. to a window (True) or if it is called, because the window was resized
  1924. (False).}
  1925. end;
  1926. // GM_DOMAIN
  1927. { This method is invoked to learn about the sizing requirements of your class,
  1928. before an object is created. This is AROS specific.}
  1929. PgpDomain = ^TgpDomain;
  1930. TgpDomain = record
  1931. MethodID: LongWord; // GM_DOMAIN
  1932. gpd_GInfo: PGadgetInfo;
  1933. gpd_RPort: PRastPort; // RastPort to calculate dimensions for.
  1934. gpd_Which: LONG; // what to calculate (GDOMAIN_*)
  1935. gpd_Domain: TIBox; // Resulting domain
  1936. gpd_Attrs: PTagItem; // Additional attributes. None defines yet
  1937. end;
  1938. const
  1939. // gpd_Which
  1940. GDOMAIN_MINIMUM = 0; // Calculate minimum size.
  1941. GDOMAIN_NOMINAL = 1; // Calculate nominal size.
  1942. GDOMAIN_MAXIMUM = 2; // Calculate maximum size.
  1943. const
  1944. ICM_Dummy = $0401; // used for nothing
  1945. // no parameters for ICM_SETLOOP, ICM_CLEARLOOP, ICM_CHECKLOOP
  1946. ICM_SETLOOP = ICM_Dummy + 1; // set/increment loop counter
  1947. ICM_CLEARLOOP = ICM_Dummy + 2; // clear/decrement loop counter
  1948. ICM_CHECKLOOP = ICM_Dummy + 3; // set/increment loop
  1949. // interconnection attributes used by icclass, modelclass, and gadgetclass
  1950. ICA_Dummy = TAG_USER + $40000;
  1951. ICA_TARGET = ICA_Dummy + 1; // interconnection target
  1952. ICA_MAP = ICA_Dummy + 2; // interconnection map tagitem list
  1953. ICSPECIAL_CODE = ICA_Dummy + 3; // a "pseudo-attribute", see below.
  1954. { Normally, the value for ICA_TARGET is some object pointer,
  1955. but if you specify the special value ICTARGET_IDCMP, notification
  1956. will be send as an IDCMP_IDCMPUPDATE message to the appropriate window's
  1957. IDCMP port. See the definition of IDCMP_IDCMPUPDATE.
  1958. When you specify ICTARGET_IDCMP for ICA_TARGET, the map you
  1959. specify will be applied to derive the attribute list that is
  1960. sent with the IDCMP_IDCMPUPDATE message. If you specify a map list
  1961. which results in the attribute tag id ICSPECIAL_CODE, the
  1962. lower sixteen bits of the corresponding ti_Data value will
  1963. be copied into the Code field of the IDCMP_IDCMPUPDATE IntuiMessage.}
  1964. ICTARGET_IDCMP = not 0;
  1965. const
  1966. // if image.Depth is this, it's a new Image class object
  1967. CUSTOMIMAGEDEPTH = -1;
  1968. // Attributes for IMAGECLASS
  1969. IA_Dummy = TAG_USER + $20000;
  1970. IA_Left = IA_Dummy + $01;
  1971. IA_Top = IA_Dummy + $02;
  1972. IA_Width = IA_Dummy + $03;
  1973. IA_Height = IA_Dummy + $04;
  1974. IA_FGPen = IA_Dummy + $05; // IA_FGPen also means "PlanePick"
  1975. IA_BGPen = IA_Dummy + $06; // IA_BGPen also means "PlaneOnOff"
  1976. IA_Data = IA_Dummy + $07; // bitplanes, for classic image, other image classes may use it for other things
  1977. IA_LineWidth = IA_Dummy + $08;
  1978. IA_Pens = IA_Dummy + $0E; // pointer to UWord pens[], ala DrawInfo.Pens, MUST be terminated by (not 0). Some classes can choose to have this, or SYSIA_DrawInfo, or both.
  1979. IA_Resolution = IA_Dummy + $0F; // packed uwords for x/y resolution into a LongWord ala DrawInfo.Resolution
  1980. // see class documentation to learn which classes recognize these
  1981. IA_APattern = IA_Dummy + $10;
  1982. IA_APatSize = IA_Dummy + $11;
  1983. IA_Mode = IA_Dummy + $12;
  1984. IA_Font = IA_Dummy + $13;
  1985. IA_Outline = IA_Dummy + $14;
  1986. IA_Recessed = IA_Dummy + $15;
  1987. IA_DoubleEmboss = IA_Dummy + $16;
  1988. IA_EdgesOnly = IA_Dummy + $17; // to specify that the interior of a frame should not be cleared
  1989. // SYSICLASS attributes
  1990. SYSIA_Size = IA_Dummy + $0B; // see below SYSISIZE_*
  1991. SYSIA_Depth = IA_Dummy + $0C;
  1992. SYSIA_Which = IA_Dummy + $0D; // see below
  1993. SYSIA_UserBuffer = IA_Dummy + $20; // Only for system Images
  1994. SYSIA_DrawInfo = IA_Dummy + $18; // Must be specified
  1995. SYSIA_ReferenceFont = IA_Dummy + $19; // Font to use as reference for scaling certain sysiclass images
  1996. IA_SupportsDisable = IA_Dummy + $1a; // Tell intuition to use IDS_*DISABLED instead of own code
  1997. IA_FrameType = IA_Dummy + $1b; // Starting with V39, FrameIClass recognizes several standard types of frame. Use one of the FRAME_* specifiers below. Default = FRAME_DEFAULT.
  1998. // Private AROS sysiclass tags and defines
  1999. SYSIA_WithBorder = IA_FGPen; // default: True
  2000. SYSIA_Style = IA_BGPen; // default: SYSISTYLE_NORMAL
  2001. SYSISTYLE_NORMAL = 0;
  2002. SYSISTYLE_GADTOOLS = 1; // to get arrow images in gadtools look
  2003. // data values for SYSIA_Size
  2004. SYSISIZE_MEDRES = 0;
  2005. SYSISIZE_LOWRES = 1;
  2006. SYSISIZE_HIRES = 2;
  2007. // SYSIA_Which tag data values: Specifies which system gadget you want an image for. Some numbers correspond to internal Intuition
  2008. DEPTHIMAGE = $00; // Window depth gadget image
  2009. ZOOMIMAGE = $01; // Window zoom gadget image
  2010. SIZEIMAGE = $02; // Window sizing gadget image
  2011. CLOSEIMAGE = $03; // Window close gadget image
  2012. SDEPTHIMAGE = $05; // Screen depth gadget image
  2013. LEFTIMAGE = $0A; // Left-arrow gadget image
  2014. UPIMAGE = $0B; // Up-arrow gadget image
  2015. RIGHTIMAGE = $0C; // Right-arrow gadget image
  2016. DOWNIMAGE = $0D; // Down-arrow gadget image
  2017. CHECKIMAGE = $0E; // GadTools checkbox image
  2018. MXIMAGE = $0F; // GadTools mutual exclude "button" image
  2019. MENUCHECK = $10; // Menu checkmark image
  2020. AMIGAKEY = $11; // Menu Amiga-key image
  2021. // Data values for IA_FrameType (recognized by FrameIClass)
  2022. FRAME_DEFAULT = 0; // The standard V37-type frame, which has thin edges.
  2023. FRAME_BUTTON = 1; // Standard button gadget frames, having thicker sides and nicely edged corners.
  2024. FRAME_RIDGE = 2; // A ridge such as used by standard string gadgets. You can recess the ridge to get a groove image.
  2025. FRAME_ICONDROPBOX = 3; // A broad ridge which is the standard imagery for areas in AppWindows where icons may be dropped.
  2026. // image message id's
  2027. IM_DRAW = $202; // draw yourself, with "state"
  2028. IM_HITTEST = $203; // return True if click hits image
  2029. IM_ERASE = $204; // erase yourself
  2030. IM_MOVE = $205; // draw new and erase old, smoothly
  2031. IM_DRAWFRAME = $206; // draw with specified dimensions
  2032. IM_FRAMEBOX = $207; // get recommended frame around some box
  2033. IM_HITFRAME = $208; // hittest with dimensions
  2034. IM_ERASEFRAME = $209; // hittest with dimensions
  2035. // image draw states or styles, for IM_DRAW
  2036. IDS_NORMAL = 0;
  2037. IDS_SELECTED = 1; // for selected gadgets
  2038. IDS_DISABLED = 2; // for disabled gadgets
  2039. IDS_BUSY = 3; // for future functionality
  2040. IDS_INDETERMINATE = 4; // for future functionality
  2041. IDS_INACTIVENORMAL = 5; // normal, in inactive window border
  2042. IDS_INACTIVESELECTED = 6; // selected, in inactive border
  2043. IDS_INACTIVEDISABLED = 7; // disabled, in inactive border
  2044. IDS_SELECTEDDISABLED = 8; // disabled and selected
  2045. type
  2046. // IM_FRAMEBOX
  2047. PimpFrameBox = ^TimpFrameBox;
  2048. TimpFrameBox = record
  2049. MethodID: LongWord;
  2050. imp_ContentsBox: PIBox; // input: relative box of contents
  2051. imp_FrameBox: PIBox; // output: rel. box of encl frame
  2052. imp_DrInfo: PDrawInfo; // may be nil
  2053. imp_FrameFlags: LongWord;
  2054. end;
  2055. const
  2056. FRAMEF_SPECIFY = 1 shl 0; // Make do with the dimensions of FrameBox provided.
  2057. type
  2058. PimpPos = ^TimpPos;
  2059. TimpPos = record
  2060. X: SmallInt;
  2061. Y: SmallInt;
  2062. end;
  2063. PimpSize = ^TimpSize;
  2064. TimpSize = record
  2065. Width: SmallInt;
  2066. Height: SmallInt;
  2067. end;
  2068. // IM_DRAW, IM_DRAWFRAME
  2069. PimpDraw = ^TimpDraw;
  2070. TimpDraw = record
  2071. MethodID: LongWord;
  2072. imp_RPort: PRastPort;
  2073. imp_Offset: TimpPos;
  2074. imp_State: LongWord;
  2075. imp_DrInfo: PDrawInfo; // May be nil
  2076. imp_Dimensions: TimpSize; // Only valid for IM_DRAWFRAME
  2077. end;
  2078. // IM_ERASE, IM_ERASEFRAME NOTE: This is a subset of TimpDraw
  2079. PimpErase = ^TimpErase;
  2080. TimpErase = record
  2081. MethodID: LongWord;
  2082. imp_RPort: PRastPort;
  2083. imp_Offset: TimpPos;
  2084. imp_Dimensions: TimpSize; // // Only valid for IM_DRAWFRAME
  2085. end;
  2086. // IM_HITTEST, IM_HITFRAME
  2087. PimpHitTest = ^TimpHitTest;
  2088. TimpHitTest = record
  2089. MethodID: LongWord;
  2090. imp_Point: TimpPos;
  2091. imp_Dimensions: TimpSize; // only valid for IM_HITFRAME
  2092. end;
  2093. // 'boopsi' pointer class interface
  2094. const
  2095. // The following tags are recognized at NewObject() time by pointerclass
  2096. POINTERA_Dummy = TAG_USER + $39000;
  2097. POINTERA_BitMap = POINTERA_Dummy + $01; // (PBitmap) Pointer to bitmap to get pointer imagery from. Bitplane data need not be in chip RAM.
  2098. POINTERA_XOffset = POINTERA_Dummy + $02; // (LongInt) - X-offset of the pointer hotspot.
  2099. POINTERA_YOffset = POINTERA_Dummy + $03; // (LongInt) - Y-offset of the pointer hotspot.
  2100. POINTERA_WordWidth = POINTERA_Dummy + $04; // (LongWord) - designed width of the pointer in words
  2101. POINTERA_XResolution = POINTERA_Dummy + $05; // (LongWord) - one of the POINTERXRESN_ flags below
  2102. POINTERA_YResolution = POINTERA_Dummy + $06; // (LongWord) - one of the POINTERYRESN_ flags below
  2103. // These are the choices for the POINTERA_XResolution attribute which
  2104. // will determine what resolution pixels are used for this pointer.
  2105. POINTERXRESN_DEFAULT = 0; // (ECS-compatible pointer width) = 70 ns if SUPERHIRES-type mode, 140 ns if not
  2106. POINTERXRESN_140NS = 1; // (pointer always in 140 ns pixels) = 140 ns always
  2107. POINTERXRESN_70NS = 2; // (pointer always in 70 ns pixels) = 70 ns always
  2108. POINTERXRESN_35NS = 3; // (pointer always in 35 ns pixels) = 35 ns always
  2109. POINTERXRESN_SCREENRES = 4; // Same as pixel speed of screen
  2110. POINTERXRESN_LORES = 5; // (pointer always in lores-like pixels) = 140 ns in 15kHz modes, 70 ns in 31kHz modes
  2111. POINTERXRESN_HIRES = 6; // (pointer always in hires-like pixels) = 70 ns in 15kHz modes, 35 ns in 31kHz modes
  2112. { These are the choices for the POINTERA_YResolution attribute which
  2113. will determine what vertical resolution is used for this pointer.
  2114. POINTERYRESN_DEFAULT
  2115. = In 15 kHz modes, the pointer resolution will be the same
  2116. as a non-interlaced screen. In 31 kHz modes, the pointer
  2117. will be doubled vertically. This means there will be about
  2118. 200-256 pointer lines per screen.
  2119. POINTERYRESN_HIGH
  2120. POINTERYRESN_HIGHASPECT
  2121. = Where the hardware/software supports it, the pointer resolution
  2122. will be high. This means there will be about 400-480 pointer
  2123. lines per screen. POINTERYRESN_HIGHASPECT also means that
  2124. when the pointer comes out double-height due to hardware/software
  2125. restrictions, its width would be doubled as well, if possible
  2126. (to preserve aspect).
  2127. POINTERYRESN_SCREENRES
  2128. POINTERYRESN_SCREENRESASPECT
  2129. = Will attempt to match the vertical resolution of the pointer
  2130. to the screen's vertical resolution. POINTERYRESN_SCREENASPECT also
  2131. means that when the pointer comes out double-height due to
  2132. hardware/software restrictions, its width would be doubled as well,
  2133. if possible (to preserve aspect).}
  2134. POINTERYRESN_DEFAULT = 0;
  2135. POINTERYRESN_HIGH = 2;
  2136. POINTERYRESN_HIGHASPECT = 3;
  2137. POINTERYRESN_SCREENRES = 4;
  2138. POINTERYRESN_SCREENRESASPECT = 5;
  2139. type
  2140. PSGWork = ^TSGWork;
  2141. TSGWork = record
  2142. // set up when gadget is first activated }
  2143. Gadget: PGadget; // the contestant itself
  2144. StringInfo: PStringInfo; // easy access to sinfo
  2145. WorkBuffer: STRPTR; // intuition's planned result
  2146. PrevBuffer: STRPTR; // what was there before
  2147. Modes: LongWord; // current mode
  2148. // modified for each input event
  2149. IEvent: PInputEvent; // actual event: do not change
  2150. Code: Word; // character code, IF one Byte
  2151. BufferPos: SmallInt; // cursor position
  2152. NumChars: SmallInt;
  2153. Actions: LongWord; // what Intuition will do
  2154. LongInt_: LongInt; // temp storage for LongInt
  2155. GadgetInfo: PGadgetInfo;
  2156. EditOp: Word; // from constants below
  2157. end;
  2158. { TSGWork.EditOp - These values indicate what basic type of operation the global editing hook has performed on the string before your gadget's custom
  2159. editing hook gets called. You do not have to be concerned with the value your custom hook leaves in the EditOp field, only if you write a global editing hook.
  2160. For most of these general edit operations, you'll want to compare the BufferPos and NumChars of the StringInfo (before global editing) and SGWork (after global editing).}
  2161. const
  2162. EO_NOOP = $0001; // did nothing
  2163. EO_DELBACKWARD = $0002; // deleted some chars (maybe 0).
  2164. EO_DELFORWARD = $0003; // deleted some characters under and in front of the cursor
  2165. EO_MOVECURSOR = $0004; // moved the cursor
  2166. EO_ENTER = $0005; // "enter" or "return" key, terminate
  2167. EO_RESET = $0006; // current Intuition-style undo
  2168. EO_REPLACECHAR = $0007; // replaced one character and (maybe) advanced cursor
  2169. EO_INSERTCHAR = $0008; // inserted one char into string or added one at end
  2170. EO_BADFORMAT = $0009; // didn't like the text data, e.g., Bad LONGINT
  2171. EO_BIGCHANGE = $000A; // unused by Intuition complete or major change to the text, e.g. new string
  2172. EO_UNDO = $000B; // unused by Intuition some other style of undo
  2173. EO_CLEAR = $000C; // clear the string
  2174. EO_SPECIAL = $000D; // unused by Intuition some operation that doesn't fit into the categories here
  2175. // Mode Flags definitions (ONLY first group allowed as InitialModes)
  2176. SGM_REPLACE = 1 shl 0; // replace mode please initialize StringInfo with in-range value of BufferPos if you are using SGM_REPLACE mode.
  2177. SGM_FIXEDFIELD = 1 shl 1; // fixed length buffer always set SGM_REPLACE, too
  2178. SGM_NOFILTER = 1 shl 2; // don't filter control chars
  2179. SGM_EXITHELP = 1 shl 7; // exit with code = $5F IF HELP hit
  2180. // These Mode Flags are for internal use only
  2181. SGM_NOCHANGE = 1 shl 3; // no edit changes yet
  2182. SGM_NOWORKB = 1 shl 4; // Buffer = PrevBuffer
  2183. SGM_CONTROL = 1 shl 5; // control char escape mode
  2184. SGM_LONGINT = 1 shl 6; // an intuition LongInt gadget
  2185. // String Gadget Action Flags (put in SGWork.Actions by EditHook)
  2186. SGA_USE = $1; // use contents of SGWork
  2187. SGA_END = $2; // terminate gadget, code in Code field
  2188. SGA_BEEP = $4; // flash the screen for the user
  2189. SGA_REUSE = $8; // reuse input event
  2190. SGA_REDISPLAY = $10; // gadget visuals changed
  2191. SGA_NEXTACTIVE = $20; // Make next possible gadget active.
  2192. SGA_PREVACTIVE = $40; // Make previous possible gadget active.
  2193. // function id for only existing custom string gadget edit hook
  2194. SGH_KEY = 1; // process editing keystroke
  2195. SGH_CLICK = 2; // process mouse click cursor position
  2196. { Here's a brief summary of how the custom string gadget edit hook works:
  2197. You provide a hook in StringInfo.Extension.EditHook. The hook is called in the standard way with the 'object' a pointer to SGWork,
  2198. and the 'message' a pointer to a command block, starting either with (LongWord) SGH_KEY, SGH_CLICK, or something new.
  2199. You return 0 if you don't understand the command (SGH_KEY is required and assumed). Return non-zero if you implement the command.
  2200. SGH_KEY:
  2201. There are no parameters following the command LongWord. Intuition will put its idea of proper values in the SGWork
  2202. before calling you, and if you leave SGA_USE set in the SGWork.Actions field, Intuition will use the values
  2203. found in SGWork fields WorkBuffer, NumChars, BufferPos, and LongInt, copying the WorkBuffer back to the StringInfo
  2204. Buffer.
  2205. NOTE WELL: You may NOT change other SGWork fields.
  2206. If you clear SGA_USE, the string gadget will be unchanged.
  2207. If you set SGA_END, Intuition will terminate the activation of the string gadget. If you also set SGA_REUSE, Intuition
  2208. will reuse the input event after it deactivates your gadget. In this case, Intuition will put the value found in SGWork.Code
  2209. into the IntuiMessage.Code field of the IDCMP_GADGETUP message it sends to the application.
  2210. If you set SGA_BEEP, Intuition will call DisplayBeep(); use this if the user has typed in error, or buffer is full.
  2211. Set SGA_REDISPLAY if the changes to the gadget warrant a gadget redisplay. Note: cursor movement requires a redisplay.
  2212. Starting in V37, you may set SGA_PREVACTIVE or SGA_NEXTACTIVE when you set SGA_END. This tells Intuition that you want
  2213. the next or previous gadget with GFLG_TABCYCLE to be activated.
  2214. SGH_CLICK:
  2215. This hook command is called when Intuition wants to position the cursor in response to a mouse click in the string gadget.
  2216. Again, here are no parameters following the command LongWord. This time, Intuition has already calculated the mouse position
  2217. character cell and put it in SGWork.BufferPos. The previous BufferPos value remains in the SGWork.StringInfo.BufferPos.
  2218. Intuition will again use the SGWork fields listed above for SGH_KEY. One restriction is that you are NOT allowed to set
  2219. SGA_END or SGA_REUSE for this command. Intuition will not stand for a gadget which goes inactive when you click in it.
  2220. You should always leave the SGA_REDISPLAY flag set, since Intuition uses this processing when activating a string gadget.}
  2221. type
  2222. { NewDecorator structure used by ChangeDecoration the three Objects (nd_Window, nd_Screen and nd_Menu must be installed and point to decorator objects
  2223. the port is used for different issues and will be filled up with DecoratorMessages}
  2224. PNewDecorator = ^TNewDecorator;
  2225. TNewDecorator = record
  2226. nd_Node: TNode;
  2227. nd_Port: PMsgPort;
  2228. nd_cnt: Word;
  2229. nd_Pattern: STRPTR;
  2230. nd_IntPattern: STRPTR; // Private, transformated Pattern be dos/ParsePattern()
  2231. nd_Window: PObject_;
  2232. nd_Screen: PObject_;
  2233. nd_Menu: PObject_;
  2234. end;
  2235. PDecoratorMessage = ^TDecoratorMessage;
  2236. TDecoratorMessage = record
  2237. dm_Message: TMagicMessage;
  2238. dm_Class: LongWord;
  2239. dm_Code: LongWord;
  2240. dm_Flags: LongWord;
  2241. dm_Object: IPTR;
  2242. end;
  2243. PScreenNotifyMessage = ^TScreenNotifyMessage;
  2244. TScreenNotifyMessage = record
  2245. snm_Message: PMagicMessage;
  2246. snm_Class: LongWord; // Notification Class ID same as SNA_Notify
  2247. snm_Code: LongWord; // Code only supported for ScreenDepth() and will put the Flags in
  2248. snm_Object: IPTR; // Pointer to the Object that caused this message
  2249. snm_UserData: IPTR; // will be filled with SNA_UserData
  2250. end;
  2251. const
  2252. DECORATOR_VERSION = 0;
  2253. SCREENNOTIFY_VERSION = 0;
  2254. { there is only one Message in the initial decoration system it will be sent to the decorator port to signal that it´ll not be used any longer
  2255. and may be destroyed, in that case the dm_Object contains the NewDecorator struct Intuition does not touch anything, the decorator have to
  2256. destroy all objects as well as the NewDecorator struct.}
  2257. DM_CLASS_DESTROYDECORATOR = $8001;
  2258. // Tags for Screen notify message
  2259. SNA_PubName = TAG_USER + $01; // public screen name of nil for all screens
  2260. SNA_Notify = TAG_USER + $02; // Flags to look for see below
  2261. SNA_UserData = TAG_USER + $03; // this tag will be passed to the screennotify message
  2262. SNA_SigTask = TAG_USER + $04; // if port = nil, a sigbit will be set for this task
  2263. SNA_SigBit = TAG_USER + $05; // signal bit to set if port = nil
  2264. SNA_MsgPort = TAG_USER + $06; // if <> nil post mesage to this port
  2265. SNA_Priority = TAG_USER + $07;
  2266. SNA_Hook = TAG_USER + $08;
  2267. // SNA_Notify (all unassigned bits are reserved for system use)
  2268. SNOTIFY_AFTER_OPENSCREEN = 1 shl 0; // screen has been opened
  2269. SNOTIFY_BEFORE_CLOSESCREEN = 1 shl 1; // going to close screen
  2270. SNOTIFY_AFTER_OPENWB = 1 shl 2; // Workbench is open
  2271. SNOTIFY_BEFORE_CLOSEWB = 1 shl 3; // Workbench is going to be closed
  2272. SNOTIFY_AFTER_OPENWINDOW = 1 shl 4; // new window
  2273. SNOTIFY_BEFORE_CLOSEWINDOW = 1 shl 5; // window is going to be closed
  2274. SNOTIFY_PUBSCREENSTATE = 1 shl 6; // PubScreenState()
  2275. SNOTIFY_LOCKPUBSCREEN = 1 shl 7; // LockPubScreen()
  2276. SNOTIFY_SCREENDEPTH = 1 shl 8; // ScreenDepth()
  2277. SNOTIFY_AFTER_CLOSESCREEN = 1 shl 9; // notify after CloseScreen()
  2278. SNOTIFY_AFTER_CLOSEWINDOW = 1 shl 10; // dto. CloseWindow()
  2279. SNOTIFY_BEFORE_OPENSCREEN = 1 shl 11; // notify before OpenScreen()
  2280. SNOTIFY_BEFORE_OPENWINDOW = 1 shl 12; // dto. OpenWindow()
  2281. SNOTIFY_BEFORE_OPENWB = 1 shl 13; // like OPENSCREEN
  2282. SNOTIFY_AFTER_CLOSEWB = 1 shl 14; // like CLOSESCREEN
  2283. SNOTIFY_WAIT_REPLY = 1 shl 15; // wait for reply before taking action
  2284. SNOTIFY_UNLOCKPUBSCREEN = 1 shl 16; // UnlockPubScreen()
  2285. SNOTIFY_BEFORE_UPDATEINTUITION = 1 shl 17; // Intuition is going to be updated
  2286. SNOTIFY_AFTER_UPDATEINTUITION = 1 shl 18; // Intuition is updated
  2287. // Attributes for MENUDECORCLASS
  2288. MDA_Dummy = TAG_USER + $22000;
  2289. MDA_DrawInfo = MDA_Dummy + 1; // [I.G]
  2290. MDA_Screen = MDA_Dummy + 2; // [I.G]
  2291. MDA_TrueColorOnly = MDA_Dummy + 3; // [..G]
  2292. MDA_UserBuffer = MDA_Dummy + 4; // [I.G]
  2293. // Methods for MENUDECORCLASS
  2294. MDM_Dummy = MDA_Dummy + 500;
  2295. MDM_GETDEFSIZE_SYSIMAGE = MDM_Dummy + 1;
  2296. MDM_DRAW_SYSIMAGE = MDM_Dummy + 2;
  2297. MDM_GETMENUSPACES = MDM_Dummy + 3;
  2298. MDM_DRAWBACKGROUND = MDM_Dummy + 4;
  2299. MDM_INITMENU = MDM_Dummy + 5;
  2300. MDM_EXITMENU = MDM_Dummy + 6;
  2301. type
  2302. PmdpGetDefSizeSysImage = ^TmdpGetDefSizeSysImage;
  2303. TmdpGetDefSizeSysImage = record
  2304. MethodID: LongWord;
  2305. mdp_TrueColor: ShortInt;
  2306. mdp_Dri: PDrawInfo;
  2307. mdp_ReferenceFont: PTextFont; // In:
  2308. mdp_Which: LongWord; // In: One of CLOSEIMAGE, SIZEIMAGE, ...
  2309. mdp_SysiSize: LongWord; // In: lowres/medres/highres
  2310. mdp_Width: PLongWord; // Out
  2311. mdp_Height: PLongWord; // Out
  2312. mdp_Flags: LongWord;
  2313. end;
  2314. PmdpDrawSysImage = ^TmdpDrawSysImage;
  2315. TmdpDrawSysImage = record
  2316. MethodID: LongWord;
  2317. mdp_TrueColor: ShortInt;
  2318. mdp_Dri: PDrawInfo;
  2319. mdp_RPort: PRastPort;
  2320. mdp_X: LongInt;
  2321. mdp_Y: LongInt;
  2322. mdp_Width: LongInt;
  2323. mdp_Height: LongInt;
  2324. mdp_Which: LongWord;
  2325. mdp_State: LongWord;
  2326. mdp_Flags: LongWord;
  2327. mdp_UserBuffer: IPTR;
  2328. end;
  2329. PmdpGetMenuSpaces = ^TmdpGetMenuSpaces;
  2330. TmdpGetMenuSpaces = record
  2331. MethodID: LongInt;
  2332. mdp_TrueColor: ShortInt;
  2333. mdp_InnerLeft: LongInt; // Out
  2334. mdp_InnerTop: LongInt; // Out
  2335. mdp_InnerRight: LongInt;
  2336. mdp_InnerBottom: LongInt;
  2337. mdp_ItemInnerLeft: LongInt;
  2338. mdp_ItemInnerTop: LongInt;
  2339. mdp_ItemInnerRight: LongInt;
  2340. mdp_ItemInnerBottom: LongInt;
  2341. mdp_MinWidth: LongInt;
  2342. mdp_MinHeight: LongInt;
  2343. end;
  2344. PmdpDrawBackground = ^TmdpDrawBackground;
  2345. TmdpDrawBackground = record
  2346. MethodID: Longword;
  2347. mdp_TrueColor: ShortInt;
  2348. mdp_RPort: PRastPort;
  2349. mdp_X: LongInt;
  2350. mdp_Y: LongInt;
  2351. mdp_Width: LongInt;
  2352. mdp_Height: LongInt;
  2353. mdp_ItemLeft: LongInt;
  2354. mdp_ItemTop: LongInt;
  2355. mdp_ItemWidth: LongInt;
  2356. mdp_ItemHeight: LongInt;
  2357. mdp_Flags: Word;
  2358. mdp_UserBuffer: IPTR;
  2359. mdp_MenuDecorFlags: LongWord;
  2360. end;
  2361. PmdpInitMenu = ^TmdpInitMenu;
  2362. TmdpInitMenu = record
  2363. MethodID: LongInt;
  2364. mdp_TrueColor: SmallInt;
  2365. mdp_RPort: PRastPort;
  2366. mdp_Screen: PScreen;
  2367. mdp_Left: LongWord;
  2368. mdp_Top: LongWord;
  2369. mdp_Width: LongWord;
  2370. mdp_Height: LongInt;
  2371. mdp_UserBuffer: IPTR;
  2372. mdp_ScreenUserBuffer: IPTR;
  2373. mdp_MenuDecorFlags: LongWord;
  2374. end;
  2375. PmdpExitMenu = ^TmdpExitMenu;
  2376. TmdpExitMenu = record
  2377. MethodID: LongInt;
  2378. mdp_TrueColor: ShortInt;
  2379. mdp_UserBuffer: IPTR;
  2380. end;
  2381. const
  2382. MDP_STATE_NORMAL = 0;
  2383. MDP_STATE_SELECTED = 1;
  2384. MDP_STATE_DISABLED = 2;
  2385. MDP_MDF_MENU = 1 shl 0;
  2386. MDP_MDF_ITEM = 1 shl 1;
  2387. MDP_MDF_SUBITEM = 1 shl 2;
  2388. MDP_MDF_MENUS_UNDERMOUSE = 1 shl 7;
  2389. // Length of array returned by MA_PixelFormats
  2390. MONITOR_MAXPIXELFORMATS = 14;
  2391. // Attributes
  2392. MA_Dummy = TAG_USER;
  2393. MA_MonitorName = MA_Dummy + 1; // [..G] STRPTR Monitor name
  2394. MA_Manufacturer = MA_Dummy + 2; // [..G] STRPTR Hardware manufacturer string
  2395. MA_ManufacturerID = MA_Dummy + 3; // [..G] LongWord
  2396. MA_ProductID = MA_Dummy + 4; // [..G] LongWord
  2397. MA_MemorySize = MA_Dummy + 5; // [..G] LongWord Video card memory size
  2398. MA_PixelFormats = MA_Dummy + 6; // [..G] PLongWord Pixelformat support flags
  2399. MA_TopLeftMonitor = MA_Dummy + 7; // [.SG] PObject_ Monitor placed in a position relative to the current one
  2400. MA_TopMiddleMonitor = MA_Dummy + 8; // [.SG] PObject_
  2401. MA_TopRightMonitor = MA_Dummy + 9; // [.SG] PObject_
  2402. MA_MiddleLeftMonitor = MA_Dummy + 10; // [.SG] PObject_
  2403. MA_MiddleRightMonitor = MA_Dummy + 11; // [.SG] PObject_
  2404. MA_BottomLeftMonitor = MA_Dummy + 12; // [.SG] PObject_
  2405. MA_BottomMiddleMonitor = MA_Dummy + 13; // [.SG] PObject_
  2406. MA_BottomRightMonitor = MA_Dummy + 14; // [.SG] PObject_
  2407. MA_GammaControl = MA_Dummy + 15; // [..G] LongBool Whether gamma control is supported
  2408. MA_PointerType = MA_Dummy + 16; // [..G] LongWord Supported pointer types
  2409. MA_DriverName = MA_Dummy + 17; // [..G] STRPTR Driver name
  2410. MA_MemoryClock = MA_Dummy + 18; // [..G] LongWord Video memory clock in Hz, 0 if unknown
  2411. //* Pointer type flags */
  2412. PointerType_3Plus1 = $0001; // color 0 transparent, 1-3 visible
  2413. PointerType_2Plus1 = $0002; // color 0 transparent, 2-3 visible, 1 undefined/clear/inverse
  2414. PointerType_ARGB = $0004; // Direct color alpha-blended bitmap pointer
  2415. // Methods
  2416. MM_GetRootBitMap = $401; // Reserved
  2417. MM_Query3DSupport = $402; // Ask for 3D acceleration support for given pixelformat
  2418. MM_GetDefaultGammaTables = $403; // Get default gamma correction table
  2419. MM_GetDefaultPixelFormat = $404; // Ask for preferred pixelformat for given depth (-1 = unsupported depth)
  2420. MM_GetPointerBounds = $405; // Ask for maximum supported mouse pointer size
  2421. MM_RunBlanker = $406; // Start screensaver for this monitor
  2422. MM_EnterPowerSaveMode = $407; // Start power saving mode
  2423. MM_ExitBlanker = $408; // Stop screensaver or power saving mode
  2424. // AROS-specific attributes
  2425. MA_AROS = TAG_USER + $00010000;
  2426. MA_Windowed = MA_AROS + 1; // [G..] BOOL A display is a window on hosted OS
  2427. // AROS-specific methods
  2428. MM_SetDefaultGammaTables = $1401; // Set default gamma correction table
  2429. type
  2430. PmsGetRootBitMap = ^TmsGetRootBitMap;
  2431. TmsGetRootBitMap = record
  2432. MethodID: LongWord;
  2433. PixelFormat: LongWord;
  2434. Store: ^PBitMap;
  2435. end;
  2436. PmsQuery3DSupport = ^TmsQuery3DSupport;
  2437. TmsQuery3DSupport = record
  2438. MethodID: LongWord;
  2439. PixelFormat: LongWord;
  2440. Store: PLongWord;
  2441. end;
  2442. const
  2443. MSQUERY3D_UNKNOWN = 0; // Unsupported pixelformat or other error
  2444. MSQUERY3D_NODRIVER = 1; // No 3D support available
  2445. MSQUERY3D_SWDRIVER = 2; // Software 3D support available
  2446. MSQUERY3D_HWDRIVER = 3; // Hardware accelerated 3D available
  2447. type
  2448. PmsGetDefaultGammaTables = ^TmsGetDefaultGammaTables;
  2449. TmsGetDefaultGammaTables = record
  2450. MethodID: LongWord;
  2451. Red: PByte; // Optional pointers to 256-byte arrays to fill in
  2452. Green: PByte;
  2453. Blue: PByte;
  2454. end;
  2455. PmsGetDefaultPixelFormat = ^TmsGetDefaultPixelFormat;
  2456. TmsGetDefaultPixelFormat = record
  2457. MethodID: LongWord;
  2458. Depth: LongWord;
  2459. Store: PLongWord;
  2460. end;
  2461. PmsGetPointerBounds = ^TmsGetPointerBounds;
  2462. TmsGetPointerBounds = record
  2463. MethodID: LongWord;
  2464. PointerType: LongWord;
  2465. Width: PLongWord;
  2466. Height: PLongWord;
  2467. end;
  2468. PmsSetDefaultGammaTables = PmsGetDefaultGammaTables;
  2469. TmsSetDefaultGammaTables = TmsGetDefaultGammaTables;
  2470. const
  2471. // Attributes for SCRDECORCLASS
  2472. SDA_Dummy = TAG_USER + $22100;
  2473. SDA_DrawInfo = SDA_Dummy + 1; // [I.G]
  2474. SDA_Screen = SDA_Dummy + 2; // [I.G]
  2475. SDA_TrueColorOnly = SDA_Dummy + 3; // [..G]
  2476. SDA_UserBuffer = SDA_Dummy + 4; // [I.G]
  2477. // Methods for SCRDECORCLASS */
  2478. SDM_Dummy = SDA_Dummy + 500;
  2479. SDM_SETUP = SDM_Dummy + 1;
  2480. SDM_CLEANUP = SDM_Dummy + 2;
  2481. SDM_GETDEFSIZE_SYSIMAGE = SDM_Dummy + 3;
  2482. SDM_DRAW_SYSIMAGE = SDM_Dummy + 4;
  2483. SDM_DRAW_SCREENBAR = SDM_Dummy + 5;
  2484. SDM_LAYOUT_SCREENGADGETS = SDM_Dummy + 6;
  2485. SDM_INITSCREEN = SDM_Dummy + 7;
  2486. SDM_EXITSCREEN = SDM_Dummy + 8;
  2487. type
  2488. PsdpGetDefSizeSysImage = ^TsdpGetDefSizeSysImage;
  2489. TsdpGetDefSizeSysImage = record
  2490. MethodID: LongWord;
  2491. sdp_TrueColor: ShortInt;
  2492. sdp_Dri: PDrawInfo;
  2493. sdp_ReferenceFont: PTextFont; // In:
  2494. sdp_Which: LongWord; // In: SDEPTHIMAGE
  2495. sdp_SysiSize: LongWord; // In: lowres/medres/highres
  2496. sdp_Width: PLongWord; // Out
  2497. sdp_Height: PLongWord; // Out
  2498. sdp_Flags: LongWord;
  2499. sdp_UserBuffer: LongWord;
  2500. end;
  2501. PsdpDrawSysImage = ^TsdpDrawSysImage;
  2502. TsdpDrawSysImage = record
  2503. MethodID: LongInt;
  2504. sdp_TrueColor: ShortInt;
  2505. sdp_Dri: PDrawInfo;
  2506. sdp_RPort: PRastPort;
  2507. sdp_X: LongInt;
  2508. sdp_Y: LongInt;
  2509. sdp_Width: LongInt;
  2510. sdp_Height: LongInt;
  2511. sdp_Which: LongWord;
  2512. sdp_State: LongWord;
  2513. sdp_Flags: LongWord;
  2514. sdp_UserBuffer: IPTR;
  2515. end;
  2516. PsdpDrawScreenBar = ^TsdpDrawScreenBar;
  2517. TsdpDrawScreenBar = record
  2518. MethodID: LongWord;
  2519. sdp_TrueColor: ShortInt;
  2520. sdp_Dri: PDrawInfo;
  2521. sdp_Layer: PLayer;
  2522. sdp_RPort: PRastPort;
  2523. sdp_Screen: PScreen;
  2524. sdp_Flags: LongWord;
  2525. sdp_UserBuffer: IPTR;
  2526. end;
  2527. PsdpLayoutScreenGadgets = ^TsdpLayoutScreenGadgets;
  2528. TsdpLayoutScreenGadgets = record
  2529. MethodID: LongWord;
  2530. sdp_TrueColor: ShortInt;
  2531. sdp_Dri: PDrawInfo;
  2532. sdp_Layer: PLayer;
  2533. sdp_Gadgets: PGadget;
  2534. sdp_Flags: LongWord;
  2535. sdp_UserBuffer: IPTR;
  2536. end;
  2537. PsdpInitScreen = ^TsdpInitScreen;
  2538. TsdpInitScreen = record
  2539. MethodID: LongWord;
  2540. sdp_TrueColor: ShortInt;
  2541. sdp_Dri: PDrawInfo;
  2542. sdp_Screen: PScreen;
  2543. sdp_FontHeight: LongWord;
  2544. sdp_TitleHack: LongInt;
  2545. sdp_BarHeight: LongWord;
  2546. sdp_BarVBorder: LongWord;
  2547. sdp_BarHBorder: LongWord;
  2548. sdp_MenuVBorder: LongWord;
  2549. spd_MenuHBorder: LongWord;
  2550. sdp_WBorTop: ShortInt;
  2551. sdp_WBorLeft: ShortInt;
  2552. sdp_WBorRight: ShortInt;
  2553. sdp_WBorBottom: ShortInt;
  2554. sdp_UserBuffer: IPTR;
  2555. end;
  2556. PsdpExitScreen = ^TsdpExitScreen;
  2557. TsdpExitScreen = record
  2558. MethodID: LongWord;
  2559. sdp_TrueColor: ShortInt;
  2560. sdp_UserBuffer: IPTR;
  2561. end;
  2562. const
  2563. // ScrDecor LayoutScreenGadgets Flags
  2564. SDF_LSG_INITIAL = 1; // First time = During OpenScreen
  2565. SDF_LSG_SYSTEMGADGET = 2; // Is a system gadget (sdepth)
  2566. SDF_LSG_INGADLIST = 4; // Gadget is already in screen gadget list
  2567. SDF_LSG_MULTIPLE = 8; // There may be multiple gadgets (linked together through NextGadget. Follow it)
  2568. // Attributes for WINDECORCLASS
  2569. WDA_Dummy = TAG_USER + $22000;
  2570. WDA_DrawInfo = WDA_Dummy + 1; // [I.G]
  2571. WDA_Screen = WDA_Dummy + 2; // [I.G]
  2572. WDA_TrueColorOnly = WDA_Dummy + 3; // [..G]
  2573. WDA_UserBuffer = WDA_Dummy + 4; // [I.G]
  2574. // Methods for WINDECORCLASS
  2575. WDM_Dummy = WDA_Dummy + 500;
  2576. WDM_SETUP = WDM_Dummy + 1;
  2577. WDM_CLEANUP = WDM_Dummy + 2;
  2578. WDM_GETDEFSIZE_SYSIMAGE = WDM_Dummy + 3;
  2579. WDM_DRAW_SYSIMAGE = WDM_Dummy + 4;
  2580. WDM_DRAW_WINBORDER = WDM_Dummy + 5;
  2581. WDM_LAYOUT_BORDERGADGETS = WDM_Dummy + 6;
  2582. WDM_DRAW_BORDERPROPBACK = WDM_Dummy + 7;
  2583. WDM_DRAW_BORDERPROPKNOB = WDM_Dummy + 8;
  2584. WDM_INITWINDOW = WDM_Dummy + 9;
  2585. WDM_EXITWINDOW = WDM_Dummy + 10;
  2586. WDM_WINDOWSHAPE = WDM_Dummy + 11;
  2587. type
  2588. PwdpGetDefSizeSysImage = ^TwdpGetDefSizeSysImage;
  2589. TwdpGetDefSizeSysImage = record
  2590. MethodID: LongWord;
  2591. wdp_TrueColor: ShortInt;
  2592. wdp_Dri: PDrawInfo;
  2593. wdp_ReferenceFont: PTextFont; // In:
  2594. wdp_Which: LongWord; // In: One of CLOSEIMAGE, SIZEIMAGE, ...
  2595. wdp_SysiSize: LongWord; // In: lowres/medres/highres
  2596. wdp_Width: PLongWord; // Out
  2597. wdp_Height: PLongWord; // Out
  2598. wdp_Flags: LongWord;
  2599. wdp_UserBuffer: IPTR;
  2600. end;
  2601. PwdpDrawSysImage = ^TwdpDrawSysImage;
  2602. TwdpDrawSysImage = record
  2603. MethodID: LongWord;
  2604. wdp_TrueColor: ShortInt;
  2605. wdp_Dri: PDrawInfo;
  2606. wdp_RPort: PRastPort;
  2607. wdp_X: LongInt;
  2608. wdp_Y: LongInt;
  2609. wdp_Width: LongInt;
  2610. wdp_Height: LongInt;
  2611. wdp_Which: LongWord;
  2612. wdp_State: LongWord;
  2613. wdp_Flags: LongWord;
  2614. wdp_UserBuffer: IPTR;
  2615. end;
  2616. PwdpDrawWinBorder = ^TwdpDrawWinBorder;
  2617. TwdpDrawWinBorder = record
  2618. MethodID: LongWord;
  2619. wdp_TrueColor: ShortInt;
  2620. wdp_Dri: PDrawInfo;
  2621. wdp_Window: PWindow;
  2622. wdp_RPort: PRastPort;
  2623. wdp_Flags: LongWord;
  2624. wdp_UserBuffer: IPTR;
  2625. end;
  2626. PwdpLayoutBorderGadgets = ^TwdpLayoutBorderGadgets;
  2627. TwdpLayoutBorderGadgets = record
  2628. MethodID: LongWord;
  2629. wdp_TrueColor: ShortInt;
  2630. wdp_Dri: PDrawInfo;
  2631. wdp_Window: PWindow;
  2632. wdp_Gadgets: PGadget;
  2633. wdp_Flags: LongWord;
  2634. wdp_ExtraButtons: LongWord;
  2635. wdp_UserBuffer: IPTR;
  2636. end;
  2637. PwdpDrawBorderPropBack = ^TwdpDrawBorderPropBack;
  2638. TwdpDrawBorderPropBack = record
  2639. MethodID: LongWord;
  2640. wdp_TrueColor: ShortInt;
  2641. wdp_Dri: PDrawInfo;
  2642. wdp_Window: PWindow;
  2643. wdp_RPort: PRastPort;
  2644. wdp_Gadget: PGadget;
  2645. wdp_RenderRect: PRectangle;
  2646. wdp_PropRect: PRectangle;
  2647. wdp_KnobRect: Prectangle;
  2648. wdp_Flags: LongWord;
  2649. wdp_UserBuffer: IPTR;
  2650. end;
  2651. PwdpDrawBorderPropKnob = ^TwdpDrawBorderPropKnob;
  2652. TwdpDrawBorderPropKnob = record
  2653. MethodID: LongWord;
  2654. wdp_TrueColor: ShortInt;
  2655. wdp_Dri: PDrawInfo;
  2656. wdp_Window: PWindow;
  2657. wdp_RPort: PRastPort;
  2658. wdp_Gadget: PGadget;
  2659. wdp_RenderRect: PRectangle;
  2660. wdp_PropRect: PRectangle;
  2661. wdp_Flags: LongWord;
  2662. wdp_UserBuffer: IPTR;
  2663. end;
  2664. PwdpInitWindow = ^TwdpInitWindow;
  2665. TwdpInitWindow = record
  2666. MethodID: LongWord;
  2667. wdp_TrueColor: ShortInt;
  2668. wdp_UserBuffer: IPTR;
  2669. wdp_Screen: PScreen;
  2670. wdp_ScreenUserBuffer: IPTR;
  2671. end;
  2672. PwdpExitWindow = ^TwdpExitWindow;
  2673. TwdpExitWindow = record
  2674. MethodID: LongWord;
  2675. wdp_TrueColor: ShortInt;
  2676. wdp_UserBuffer: IPTR;
  2677. end;
  2678. PwdpWindowShape = ^TwdpWindowShape;
  2679. TwdpWindowShape = record
  2680. MethodID: LongWord;
  2681. wdp_TrueColor: ShortInt;
  2682. wdp_Window: PWindow;
  2683. wdp_Width: LongInt;
  2684. wdp_Height: LongInt;
  2685. wdp_UserBuffer: IPTR;
  2686. end;
  2687. const
  2688. // WinDecor DrawWindowBorder Flags
  2689. WDF_DWB_TOP_ONLY = 1; // Draw top border only
  2690. // WinDecor DrawWinTitle Title Align
  2691. WD_DWTA_LEFT = 0;
  2692. WD_DWTA_RIGHT = 1;
  2693. WD_DWTA_CENTER = 2;
  2694. // WinDecor LayourBorderGadgets Flags
  2695. WDF_LBG_INITIAL = 1; // First time == During OpenWindow
  2696. WDF_LBG_SYSTEMGADGET = 2; // Is a system gadget (close/depth/zoom)
  2697. WDF_LBG_INGADLIST = 4; // Gadget is already in window gadget list
  2698. WDF_LBG_MULTIPLE = 8; // There may be multiple gadgets (linked together through NextGadget. Follow it)
  2699. // WinDecor DrawBorderPropKnob Flags
  2700. WDF_DBPK_HIT = 1; // Knob is hit / in use by user
  2701. // extensions:
  2702. const
  2703. // Sysiclass SYSIA_Which
  2704. ICONIFYIMAGE = $12;
  2705. LOCKIMAGE = $13;
  2706. MUIIMAGE = $14;
  2707. POPUPIMAGE = $15;
  2708. SNAPSHOTIMAGE = $16;
  2709. JUMPIMAGE = $17;
  2710. MENUTOGGLEIMAGE = $19;
  2711. SUBMENUIMAGE = $1A;
  2712. // Window attributes
  2713. WA_ExtraTitlebarGadgets = WA_Dummy + 151;
  2714. WA_ExtraGadgetsStartID = WA_Dummy + 152;
  2715. WA_ExtraGadget_Iconify = WA_Dummy + 153;
  2716. WA_ExtraGadget_Lock = WA_Dummy + 154;
  2717. WA_ExtraGadget_MUI = WA_Dummy + 155;
  2718. WA_ExtraGadget_PopUp = WA_Dummy + 156;
  2719. WA_ExtraGadget_Snapshot = WA_Dummy + 157;
  2720. WA_ExtraGadget_Jump = WA_Dummy + 158;
  2721. // WA_ExtraTitlebarGadgets
  2722. // Flags
  2723. ETG_ICONIFY = $01;
  2724. ETG_LOCK = $02;
  2725. ETG_MUI = $04;
  2726. ETG_POPUP = $08;
  2727. ETG_SNAPSHOT = $10;
  2728. ETG_JUMP = $20;
  2729. // Gadget ID offsets
  2730. ETD_Iconify = 0;
  2731. ETD_Lock = 1;
  2732. ETD_MUI = 2;
  2733. ETD_PopUp = 3;
  2734. ETD_Snapshot = 4;
  2735. ETD_Jump = 5;
  2736. // Gadget IDs
  2737. ETI_Dummy = $FFD0;
  2738. ETI_Iconify = ETI_Dummy + ETD_Iconify;
  2739. ETI_Lock = ETI_Dummy + ETD_Lock;
  2740. ETI_MUI = ETI_Dummy + ETD_MUI;
  2741. ETI_PopUp = ETI_Dummy + ETD_PopUp;
  2742. ETI_Snapshot = ETI_Dummy + ETD_Snapshot;
  2743. ETI_Jump = ETI_Dummy + ETD_Jump;
  2744. // Defines for WindowAction()
  2745. // Commands
  2746. WAC_BASE = $0001;
  2747. WAC_HIDEWINDOW = WAC_BASE + 0 unimplemented;
  2748. WAC_SHOWWINDOW = WAC_BASE + 1 unimplemented;
  2749. WAC_SENDIDCMPCLOSE = WAC_BASE + 2;
  2750. WAC_MOVEWINDOW = WAC_BASE + 3 unimplemented;
  2751. WAC_SIZEWINDOW = WAC_BASE + 4 unimplemented;
  2752. WAC_CHANGEWINDOWBOX = WAC_BASE + 5 unimplemented;
  2753. WAC_WINDOWTOFRONT = WAC_BASE + 6 unimplemented;
  2754. WAC_WINDOWTOBACK = WAC_BASE + 7 unimplemented;
  2755. WAC_ZIPWINDOW = WAC_BASE + 8 unimplemented;
  2756. WAC_MOVEWINDOWINFRONTOF = WAC_BASE + 9 unimplemented;
  2757. WAC_ACTIVATEWINDOW = WAC_BASE + 10 unimplemented;
  2758. // Tags
  2759. WAT_BASE = TAG_USER;
  2760. // WAC_MOVEWINDOW
  2761. WAT_MOVEWINDOWX = WAT_BASE + 1;
  2762. WAT_MOVEWINDOWY = WAT_BASE + 2;
  2763. // WAC_SIZEWINDOW
  2764. WAT_SIZEWINDOWX = WAT_BASE + 3;
  2765. WAT_SIZEWINDOWY = WAT_BASE + 4;
  2766. // WAC_CHANGEWINDOWBOX
  2767. WAT_WINDOWBOXLEFT = WAT_BASE + 5;
  2768. WAT_WINDOWBOXTOP = WAT_BASE + 6;
  2769. WAT_WINDOWBOXWIDTH = WAT_BASE + 7;
  2770. WAT_WINDOWBOXHEIGHT = WAT_BASE + 8;
  2771. // WAC_MOVEWINDOWINFRONTOF
  2772. WAT_MOVEWBEHINDWINDOW = WAT_BASE + 9;
  2773. {$ifndef INTUI_V36_NAMES_ONLY}
  2774. //* Gadget Type names: */
  2775. GTYPEMASK = GTYP_GTYPEMASK;
  2776. CUSTOMGADGET = GTYP_CUSTOMGADGET;
  2777. STRGADGET = GTYP_STRGADGET;
  2778. PROPGADGET = GTYP_PROPGADGET;
  2779. GADGET0002 = GTYP_GADGET0002;
  2780. BOOLGADGET = GTYP_BOOLGADGET;
  2781. IntuiCLOSE = GTYP_CLOSE;
  2782. //SDOWNBACK = GTYP_SDOWNBACK; // not in the official AROS includes
  2783. //WDOWNBACK = GTYP_WDOWNBACK;
  2784. //SUPFRONT = GTYP_SUPFRONT;
  2785. //WUPFRONT = GTYP_WUPFRONT;
  2786. SDRAGGING = GTYP_SDRAGGING;
  2787. WDRAGGING = GTYP_WDRAGGING;
  2788. SIZING = GTYP_SIZING;
  2789. REQGADGET = GTYP_REQGADGET;
  2790. GZZGADGET = GTYP_GZZGADGET;
  2791. SCRGADGET = GTYP_SCRGADGET;
  2792. SYSGADGET = GTYP_SYSGADGET;
  2793. GADGETTYPE = GTYP_GADGETTYPE;
  2794. // Gadget Flags names:
  2795. LABELIMAGE = GFLG_LABELIMAGE;
  2796. LABELSTRING = GFLG_LABELSTRING;
  2797. LABELITEXT = GFLG_LABELITEXT;
  2798. LABELMASK = GFLG_LABELMASK;
  2799. GADGDISABLED = GFLG_DISABLED;
  2800. SELECTED = GFLG_SELECTED;
  2801. GRELHEIGHT = GFLG_RELHEIGHT;
  2802. GRELWIDTH = GFLG_RELWIDTH;
  2803. GRELRIGHT = GFLG_RELRIGHT;
  2804. GRELBOTTOM = GFLG_RELBOTTOM;
  2805. GADGIMAGE = GFLG_GADGIMAGE;
  2806. GADGHNONE = GFLG_GADGHNONE;
  2807. GADGHIMAGE = GFLG_GADGHIMAGE;
  2808. GADGHBOX = GFLG_GADGHBOX;
  2809. GADGHCOMP = GFLG_GADGHCOMP;
  2810. GADGHIGHBITS = GFLG_GADGHIGHBITS;
  2811. // Gadget Activation flag names:
  2812. ACTIVEGADGET = GACT_ACTIVEGADGET;
  2813. STRINGEXTEND = GACT_STRINGEXTEND;
  2814. ALTKEYMAP = GACT_ALTKEYMAP;
  2815. IntuiLONGINT = GACT_LONGINT;
  2816. STRINGRIGHT = GACT_STRINGRIGHT;
  2817. STRINGCENTER = GACT_STRINGCENTER;
  2818. STRINGLEFT = GACT_STRINGLEFT;
  2819. BOOLEXTEND = GACT_BOOLEXTEND;
  2820. TOGGLESELECT = GACT_TOGGLESELECT;
  2821. BORDERSNIFF = GACT_BORDERSNIFF;
  2822. BOTTOMBORDER = GACT_BOTTOMBORDER;
  2823. TOPBORDER = GACT_TOPBORDER;
  2824. LEFTBORDER = GACT_LEFTBORDER;
  2825. RIGHTBORDER = GACT_RIGHTBORDER;
  2826. FOLLOWMOUSE = GACT_FOLLOWMOUSE;
  2827. ENDGADGET = GACT_ENDGADGET;
  2828. GADGIMMEDIATE = GACT_IMMEDIATE;
  2829. RELVERIFY = GACT_RELVERIFY;
  2830. // Window Flags names:
  2831. HASZOOM = WFLG_HASZOOM;
  2832. ZOOMED = WFLG_ZOOMED;
  2833. VISITOR = WFLG_VISITOR;
  2834. NW_EXTENDED = WFLG_NW_EXTENDED;
  2835. WINDOWTICKED = WFLG_WINDOWTICKED;
  2836. WBENCHWINDOW = WFLG_WBENCHWINDOW;
  2837. WINDOWREFRESH = WFLG_WINDOWREFRESH;
  2838. NOCAREREFRESH = WFLG_NOCAREREFRESH;
  2839. RMBTRAP = WFLG_RMBTRAP;
  2840. MENUSTATE = WFLG_MENUSTATE;
  2841. INREQUEST = WFLG_INREQUEST;
  2842. WINDOWACTIVE = WFLG_WINDOWACTIVE;
  2843. ACTIVATE = WFLG_ACTIVATE;
  2844. BORDERLESS = WFLG_BORDERLESS;
  2845. GIMMEZEROZERO = WFLG_GIMMEZEROZERO;
  2846. IntuiREPORTMOUSE = WFLG_REPORTMOUSE;
  2847. BACKDROP = WFLG_BACKDROP;
  2848. OTHER_REFRESH = WFLG_OTHER_REFRESH;
  2849. SUPER_BITMAP = WFLG_SUPER_BITMAP;
  2850. SIMPLE_REFRESH= WFLG_SIMPLE_REFRESH;
  2851. SMART_REFRESH = WFLG_SMART_REFRESH;
  2852. REFRESHBITS = WFLG_REFRESHBITS;
  2853. SIZEBBOTTOM = WFLG_SIZEBBOTTOM;
  2854. SIZEBRIGHT = WFLG_SIZEBRIGHT;
  2855. WINDOWCLOSE = WFLG_CLOSEGADGET;
  2856. WINDOWDEPTH = WFLG_DEPTHGADGET;
  2857. WINDOWDRAG = WFLG_DRAGBAR;
  2858. WINDOWSIZING = WFLG_SIZEGADGET;
  2859. // IDCMP class names:
  2860. LONELYMESSAGE = IDCMP_LONELYMESSAGE;
  2861. CHANGEWINDOW = IDCMP_CHANGEWINDOW;
  2862. MENUHELP = IDCMP_MENUHELP;
  2863. IDCMPUPDATE = IDCMP_IDCMPUPDATE;
  2864. INTUITICKS = IDCMP_INTUITICKS;
  2865. VANILLAKEY = IDCMP_VANILLAKEY;
  2866. DELTAMOVE = IDCMP_DELTAMOVE;
  2867. INACTIVEWINDOW = IDCMP_INACTIVEWINDOW;
  2868. ACTIVEWINDOW = IDCMP_ACTIVEWINDOW;
  2869. WBENCHMESSAGE = IDCMP_WBENCHMESSAGE;
  2870. DISKREMOVED = IDCMP_DISKREMOVED;
  2871. DISKINSERTED = IDCMP_DISKINSERTED;
  2872. NEWPREFS = IDCMP_NEWPREFS;
  2873. MENUVERIFY = IDCMP_MENUVERIFY;
  2874. REQCLEAR = IDCMP_REQCLEAR;
  2875. REQVERIFY = IDCMP_REQVERIFY;
  2876. RAWKEY = IDCMP_RAWKEY;
  2877. IntuiCLOSEWINDOW = IDCMP_CLOSEWINDOW;
  2878. MENUPICK = IDCMP_MENUPICK;
  2879. REQSET = IDCMP_REQSET;
  2880. GADGETUP = IDCMP_GADGETUP;
  2881. GADGETDOWN = IDCMP_GADGETDOWN;
  2882. MOUSEMOVE = IDCMP_MOUSEMOVE;
  2883. MOUSEBUTTONS = IDCMP_MOUSEBUTTONS;
  2884. REFRESHWINDOW = IDCMP_REFRESHWINDOW;
  2885. NEWSIZE = IDCMP_NEWSIZE;
  2886. SIZEVERIFY = IDCMP_SIZEVERIFY;
  2887. {$endif} // not INTUI_V36_NAMES_ONLY
  2888. // Tags for GetMonitorList
  2889. const
  2890. GMLA_Dummy = TAG_USER + $4000;
  2891. GMLA_DisplayID = GMLA_Dummy + 1;
  2892. var
  2893. IntuitionBase: PIntuitionBase;
  2894. function ActivateGadget(Gadget: PGadget; Window: PWindow; Requester: PRequester): LongBool; syscall IntuitionBase 77;
  2895. procedure ActivateWindow(Window: PWindow); syscall IntuitionBase 75;
  2896. procedure AddClass(ClassPtr: PIClass); syscall IntuitionBase 114;
  2897. function AddGadget(Window: PWindow; Gadget: PGadget; Position: LongWord): Word; syscall IntuitionBase 7;
  2898. function AddGList(Window: PWindow; Gadget: PGadget; Position: LongWord; NumGad: LongInt; Requester: PRequester): Word; syscall IntuitionBase 73;
  2899. function AllocIntuiMessage(Window: PWindow): PIntuiMessage; syscall IntuitionBase 148;
  2900. function AllocRemember(var RememberKey: PRemember; Size: LongWord; Flags: LongWord): APTR; syscall IntuitionBase 66;
  2901. function AllocScreenBuffer(Screen: PScreen; Bitmap: PBitMap; Flags: LongWord): PScreenBuffer; syscall IntuitionBase 128;
  2902. procedure AlohaWorkbench(MsgPort: PMsgPort); syscall IntuitionBase 67;
  2903. function AutoRequest(Window: PWindow; Body: PIntuiText; PosText: PIntuiText; NegText: PIntuiText; PFlag: LongWord; NFlag: LongWord; Width: LongWord; Height: LongWord): LongBool; syscall IntuitionBase 58;
  2904. procedure BeginRefresh(Window: PWindow); syscall IntuitionBase 59;
  2905. function BuildEasyRequestArgs(Window: PWindow; EasyStruct: PEasyStruct; IDCMP: LongWord; Args: APTR): PWindow; syscall IntuitionBase 99;
  2906. function BuildSysRequest(Window: PWindow; Body: PIntuiText; PosText: PIntuiText; NegText: PIntuiText; Flags: LongWord; Width: LongWord; Height: LongWord): PWindow; syscall IntuitionBase 60;
  2907. function ChangeScreenBuffer(Screen: PScreen; ScreenBuffer: PScreenBuffer): LongWord; syscall IntuitionBase 130;
  2908. procedure ChangeWindowBox(Window: PWindow; Left: LongInt; Top: LongInt; Width: LongInt; Height: LongInt); syscall IntuitionBase 81;
  2909. function ClearDMRequest(Window: PWindow): LongBool; syscall IntuitionBase 8;
  2910. procedure ClearMenuStrip(Window: PWindow); syscall IntuitionBase 9;
  2911. procedure ClearPointer(Window: PWindow); syscall IntuitionBase 10;
  2912. function CloseScreen(Screen: PScreen): LongBool; syscall IntuitionBase 11;
  2913. procedure CloseWindow(Window: PWindow); syscall IntuitionBase 12;
  2914. function CloseWorkBench: LongInt; syscall IntuitionBase 13;
  2915. procedure ChangeDecoration(ID: LongWord; Decor: PNewDecorator); syscall IntuitionBase 153;
  2916. function ChangeWindowShape(Window: PWindow; NewShape: PRegion; CallBack: PHook): PRegion; syscall IntuitionBase 143; unimplemented;
  2917. procedure CurrentTime(var Seconds: LongWord; var Micros: LongWord); syscall IntuitionBase 14;
  2918. function DisplayAlert(AlertNumber: LongWord; String_: PChar; Height: Word): LongBool; syscall IntuitionBase 15; deprecated;
  2919. procedure DisplayBeep(Screen: PScreen); syscall IntuitionBase 16;
  2920. procedure DisposeObject(Object_: APTR); syscall IntuitionBase 107;
  2921. function DoGadgetMethodA(Gad: PGadget; Win: PWindow; Req: PRequester; Msg: TMsg): IPTR; syscall IntuitionBase 135;
  2922. function DoNotify(Cl: PIClass; O: PObject_; Ic: Pointer; Msg: TopUpdate): Pointer; syscall IntuitionBase 145;
  2923. function DoubleClick(SSeconds: LongWord; SMicros: LongWord; CSeconds: LongWord; CMicros: LongWord): LongBool; syscall IntuitionBase 17;
  2924. procedure DrawBorder(Rp: PRastPort; Border: PBorder; LeftOffset: LongInt; TopOffset: LongInt); syscall IntuitionBase 18;
  2925. procedure DrawImage(Rp: PRastPort; Image: PImage; LeftOffset: LongInt; TopOffset: LongInt); syscall IntuitionBase 19;
  2926. procedure DrawImageState(Rp: PRastPort; Image: PImage; LeftOffset: LongInt; TopOffset: LongInt; state: LongWord; DrawInfo: PDrawInfo); syscall IntuitionBase 103;
  2927. function EasyRequestArgs(Window: PWindow; EasyStruct: PEasyStruct; IDCMP_Ptr: PLongWord; Args: APTR): LongInt; syscall IntuitionBase 98;
  2928. procedure EndRefresh(Window: PWindow; Complete: LongBool); syscall IntuitionBase 61;
  2929. procedure EndRequest(Requester: PRequester; Window: PWindow); syscall IntuitionBase 20;
  2930. function EndScreenNotify(Notify: IPTR): LongBool; syscall IntuitionBase 162;
  2931. procedure EraseImage(Rp: PRastPort; Image: PImage; LeftOffset: LongInt; TopOffset: LongInt); syscall IntuitionBase 105;
  2932. function FindClass(ClassID: ClassID): PIClass; syscall IntuitionBase 112;
  2933. function FreeClass(IClass: PIClass): LongBool; syscall IntuitionBase 119;
  2934. procedure FreeICData(ICData: Pointer); syscall IntuitionBase 146;
  2935. procedure FreeIntuiMessage(IMsg: PIntuiMessage); syscall IntuitionBase 149;
  2936. procedure FreeMonitorList(Obj: PPObject_); syscall IntuitionBase 164;
  2937. procedure FreeRemember(var RememberKey: PRemember; ReallyForget: LongInt); syscall IntuitionBase 68;
  2938. procedure FreeScreenBuffer(Screen: PScreen; ScreenBuffer: PScreenBuffer); syscall IntuitionBase 129;
  2939. procedure FreeScreenDrawInfo(Screen: PScreen; DrawInfo: PDrawInfo); syscall IntuitionBase 116;
  2940. procedure FreeSysRequest(Window: PWindow); syscall IntuitionBase 62;
  2941. procedure GadgetMouse(Gadget: PGadget; GInfo: PGadgetInfo; var MousePoint: SmallInt); syscall IntuitionBase 95;
  2942. function GetAttr(AttrID: LongWord; Object_: PObject_; StoragePtr: PIPTR): LongWord; overload syscall IntuitionBase 109;
  2943. function GetAttr(AttrID: LongWord; Object_: PObject_; var Storage: IPTR): LongWord; overload syscall IntuitionBase 109;
  2944. function GetDefaultPubScreen(NameBuffer: PChar): PScreen; syscall IntuitionBase 97;
  2945. function GetDefPrefs(Preferences: PPreferences; Size: SmallInt): PPreferences; syscall IntuitionBase 21;
  2946. function GetMonitorList(Tags: PTagItem): PPObject_; syscall IntuitionBase 163;
  2947. function GetPrefs(Preferences: PPreferences; Size: SmallInt): PPreferences; syscall IntuitionBase 22;
  2948. function GetScreenData(Buffer: APTR; Size: LongWord; Type_: LongWord; Screen: PScreen): LongInt; syscall IntuitionBase 71;
  2949. function GetScreenDrawInfo(Screen: PScreen): PDrawInfo; syscall IntuitionBase 115;
  2950. procedure HelpControl(Window: PWindow; Flags: LongWord); syscall IntuitionBase 138;
  2951. procedure HideWindow(Window: PWindow); syscall IntuitionBase 141;
  2952. procedure InitRequester(Requester: PRequester); syscall IntuitionBase 23; deprecated;
  2953. function IntuiTextLength(iText: PIntuiText): LongInt; syscall IntuitionBase 55;
  2954. function ItemAddress(MenuStrip: PMenu; MenuNumber: Word): PMenuItem; syscall IntuitionBase 24;
  2955. function IsWindowVisible(Window: PWindow): LongWord; syscall IntuitionBase 139;
  2956. procedure LendMenus(FromWindow: PWindow; ToWindow: PWindow); syscall IntuitionBase 134;
  2957. function LockIBase(LockNumber: LongWord): LongWord; syscall IntuitionBase 69;
  2958. function LockPubScreen(const Name: STRPTR): PScreen; syscall IntuitionBase 85;
  2959. function LockPubScreenList: PList; syscall IntuitionBase 87;
  2960. function MakeClass(ClassID: ClassID; SuperClassID: ClassID; SuperClassPtr: PIClass; InstanceSize: LongWord; Flags: LongWord): PIClass; syscall IntuitionBase 113;
  2961. function MakeScreen(Screen: PScreen): LongInt; syscall IntuitionBase 63;
  2962. function ModifyIDCMP(Window: PWindow; Flags: LongWord): LongBool; syscall IntuitionBase 25;
  2963. procedure ModifyProp(Gadget: PGadget; Window: PWindow; Requester: PRequester; Flags: LongWord; HorizPot: LongWord; VertPot: LongWord; HorizBody: LongWord; VertBody: LongWord); syscall IntuitionBase 26;
  2964. procedure MoveScreen(Screen: PScreen; Dx: LongInt; Dy: LongInt); syscall IntuitionBase 27;
  2965. procedure MoveWindow(Window: PWindow; Dx: LongInt; Dy: LongInt); syscall IntuitionBase 28;
  2966. procedure MoveWindowInFrontOf(Window: PWindow; BehindWindow: PWindow); syscall IntuitionBase 80;
  2967. procedure NewModifyProp(Gadget: PGadget; Window: PWindow; Requester: PRequester; Flags: LongWord; HorizPot: LongWord; VertPot: LongWord; HorizBody: LongWord; VertBody: LongWord; NumGad: LongInt); syscall IntuitionBase 78;
  2968. function NewObjectA(ClassPtr: PIClass; ClassID: PChar; TagList: PTagItem): APTR; syscall IntuitionBase 106;
  2969. function NextObject(ObjectPtrPtr: APTR): APTR; syscall IntuitionBase 111;
  2970. function NextPubScreen(Screen: PScreen; Namebuf: PChar): PChar; syscall IntuitionBase 89;
  2971. function ObtainGIRPort(GInfo: PGadgetInfo): PRastPort; syscall IntuitionBase 93;
  2972. procedure OffGadget(Gadget: PGadget; Window: PWindow; Requester: PRequester); syscall IntuitionBase 29;
  2973. procedure OffMenu(Window: PWindow; MenuNumber: Word); syscall IntuitionBase 30;
  2974. procedure OnGadget(Gadget: PGadget; Window: PWindow; Requester: PRequester); syscall IntuitionBase 31;
  2975. procedure OnMenu(Window: PWindow; MenuNumber: Word); syscall IntuitionBase 32;
  2976. function OpenScreen(NewScreen: PNewScreen): PScreen; syscall IntuitionBase 33;
  2977. function OpenScreenTagList(NewScreen: PNewScreen; TagList: PTagItem): PScreen; syscall IntuitionBase 102;
  2978. function OpenWindow(NewWindow: PNewWindow): PWindow; syscall IntuitionBase 34;
  2979. function OpenWindowTagList(NewWindow: PNewWindow; TagList: PTagItem): PWindow; syscall IntuitionBase 101;
  2980. function OpenWorkBench: IPTR; syscall IntuitionBase 35;
  2981. function PointInImage(Point: LongWord; Image: PImage): LongBool; syscall IntuitionBase 104;
  2982. procedure PrintIText(Rp: PRastPort; IText: PIntuiText; Left: LongInt; Top: LongInt); syscall IntuitionBase 36;
  2983. function PubScreenStatus(Screen: PScreen; StatusFlags: Word): Word; syscall IntuitionBase 92;
  2984. function QueryOverscan(DisplayID: LongWord; Rect: PRectangle; OScanType: SmallInt): LongInt; syscall IntuitionBase 79;
  2985. procedure RefreshGadgets(Gadgets: PGadget; Window: PWindow; Requester: PRequester); syscall IntuitionBase 37;
  2986. procedure RefreshGList(Gadgets: PGadget; Window: PWindow; Requester: PRequester; NumGad: LongInt); syscall IntuitionBase 72;
  2987. procedure RefreshWindowFrame(Window: PWindow); syscall IntuitionBase 76;
  2988. procedure ReleaseGIRPort(Rp: PRastPort); syscall IntuitionBase 94;
  2989. function RemakeDisplay: LongInt; syscall IntuitionBase 64;
  2990. procedure RemoveClass(ClassPtr: PIClass); syscall IntuitionBase 118;
  2991. function RemoveGadget(Window: PWindow; Gadget: PGadget): Word; syscall IntuitionBase 38;
  2992. function RemoveGList(RemPtr: PWindow; Gadget: PGadget; NumGad: LongInt): Word; syscall IntuitionBase 74;
  2993. procedure ReportMouse(Flag: LongInt; Window: PWindow); syscall IntuitionBase 39;
  2994. function Request(Requester: PRequester; Window: PWindow): LongBool; syscall IntuitionBase 40;
  2995. function ResetMenuStrip(Window: PWindow; Menu: PMenu): LongBool; syscall IntuitionBase 117;
  2996. function RethinkDisplay: LongInt; syscall IntuitionBase 65;
  2997. procedure ScreenDepth(Screen: PScreen; Flags: LongWord; Reserved: APTR); syscall IntuitionBase 131;
  2998. procedure ScreenPosition(Screen: PScreen; Flags: LongWord; X1: LongInt; Y1: LongInt; X2: LongInt; Y2: LongInt); syscall IntuitionBase 132;
  2999. procedure ScreenToBack(Screen: PScreen); syscall IntuitionBase 41;
  3000. procedure ScreenToFront(Screen: PScreen); syscall IntuitionBase 42;
  3001. procedure ScrollWindowRaster(Win: PWindow; Dx: SmallInt; Dy: SmallInt; XMin: SmallInt; YMin: SmallInt; XMax: SmallInt; YMax: SmallInt); syscall IntuitionBase 133;
  3002. procedure ScrollWindowRasterNoFill(Window: PWindow; Dx, Dy, XMin, YMin, XMax, YMax: Word); syscall IntuitionBase 159;
  3003. procedure SendIntuiMessage(Window: PWindow; IMsg: PIntuiMessage); syscall IntuitionBase 151;
  3004. function SetAttrsA(Object_: APTR; TagList: PTagItem): IPTR; syscall IntuitionBase 108;
  3005. procedure SetDefaultPubScreen(Name: PChar); syscall IntuitionBase 90;
  3006. procedure SetDefaultScreenFont(TextFont: PTextFont); syscall IntuitionBase 144;
  3007. function SetDMRequest(Window: PWindow; Requester: PRequester): LongBool; syscall IntuitionBase 43;
  3008. function SetEditHook(Hook: PHook): PHook; syscall IntuitionBase 82;
  3009. function SetGadgetAttrsA(Gadget: PGadget; Window: PWindow; Requester: PRequester; TagList: PTagItem): IPTR; syscall IntuitionBase 110;
  3010. function SetIPrefs(Data: Pointer; Length: LongWord; Typ: LongWord): LongWord; syscall IntuitionBase 96;
  3011. function SetMenuStrip(Window: PWindow; Menu: PMenu): LongBool; syscall IntuitionBase 44;
  3012. function SetMouseQueue(Window: PWindow; QueueLength: LongWord): LongInt; syscall IntuitionBase 83;
  3013. procedure SetPointer(Window: PWindow; Pointer_: PWord; Height: LongInt; Width: LongInt; XOffset: LongInt; YOffset: LongInt); syscall IntuitionBase 45;
  3014. function SetPointerBounds(Screen: PScreen; Rect: TRectangle; Reserved: LongWord; Tags: PTagItem): LongWord; syscall IntuitionBase 160;
  3015. function SetPrefs(PrefBuffer: PPreferences; Size: LongInt; Inform: LongBool): PPreferences; syscall IntuitionBase 54;
  3016. function SetPubScreenModes(Modes: Word): Word; syscall IntuitionBase 91;
  3017. procedure SetWindowPointerA(Win: PWindow; Taglist: PTagItem); syscall IntuitionBase 136;
  3018. procedure SetWindowTitles(Window: PWindow; const WindowTitle: PChar; const ScreenTitle: PChar); syscall IntuitionBase 46;
  3019. procedure ShowTitle(Screen: PScreen; ShowIt: LongBool); syscall IntuitionBase 47;
  3020. procedure ShowWindow(Window: PWindow); syscall IntuitionBase 140;
  3021. procedure SizeWindow(Window: PWindow; Dx: LongInt; Dy: LongInt); syscall IntuitionBase 48;
  3022. function StartScreenNotifyTagList(Tags: PTagItem): IPTR; syscall IntuitionBase 161;
  3023. function SysReqHandler(Window: PWindow; IDCMPFlagsPtr: PLongWord; WaitInput: LongBool): LongInt; syscall IntuitionBase 100;
  3024. function TimedDisplayAlert(AlertNumber: LongWord; String_: PChar; Height: Word; Time: LongWord): LongBool; syscall IntuitionBase 137;
  3025. procedure UnlockIBase(LockNumber: LongWord); syscall IntuitionBase 70;
  3026. procedure UnlockPubScreen(Name: PChar; Screen: PScreen); syscall IntuitionBase 86;
  3027. procedure UnlockPubScreenList; syscall IntuitionBase 88;
  3028. function ViewAddress: PView; syscall IntuitionBase 49;
  3029. function ViewPortAddress(Window: PWindow): PViewPort; syscall IntuitionBase 50;
  3030. function WBenchToBack: LongBool; syscall IntuitionBase 56;
  3031. function WBenchToFront: LongBool; syscall IntuitionBase 57;
  3032. procedure WindowAction(Window: PWindow; Action: LongWord; Tags: PTagItem); syscall IntuitionBase 157;
  3033. function WindowLimits(Window: PWindow; WidthMin: SmallInt; HeightMin: SmallInt; WidthMax: Word; HeightMax: Word): LongBool; syscall IntuitionBase 53;
  3034. procedure WindowToBack(Window: PWindow); syscall IntuitionBase 51;
  3035. procedure WindowToFront(Window: PWindow); syscall IntuitionBase 52;
  3036. procedure ZipWindow(Window: PWindow); syscall IntuitionBase 84;
  3037. // VarArgs Versions
  3038. function SetAttrs(Obj: APTR; const Tags: array of PtrUInt): LongWord;
  3039. function NewObject(ClassPtr: PIClass; ClassID: PChar; const Tags: array of PtrUInt): APTR;
  3040. function BuildEasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP: LongWord; const Args: array of PtrUInt): PWindow;
  3041. function DoGadgetMethod(Gad: PGadget; Win: PWindow; Req: PRequester; const Args: array of PtrUInt): IPTR;
  3042. function EasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP_Ptr: PLongWord; const Args: array of PtrUInt): LongInt;
  3043. function OpenScreenTags(NewScreen: PNewScreen; const Tags: array of PtrUInt): PScreen;
  3044. function OpenWindowTags(NewWindow: PNewWindow; const Tags: array of PtrUInt): PWindow;
  3045. function SetGadgetAttrs(Gadget: PGadget; Window: PWindow; Requester: PRequester; const Tags: array of PtrUInt): IPTR;
  3046. procedure SetWindowPointer(Win: PWindow; const Tags: array of PtrUInt);
  3047. // Function wrapper
  3048. function SetSuperAttrsA(cl: PIClass; Obj: PObject_; TagList: PTagItem): IPTR;
  3049. function SetSuperAttrs(cl: PIClass; Obj: PObject_; const Tags: array of PtrUInt): IPTR;
  3050. function DoMethodA(Obj: PObject_; Message: APTR): IPTR;
  3051. function DoMethod(Obj: PObject_; const Args: array of PtrUInt): IPTR;
  3052. function CoerceMethodA(cl: PIClass; Obj: PObject_; Message: APTR): IPTR;
  3053. function CoerceMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): IPTR;
  3054. function DoSuperMethodA(cl: PIClass; Obj: PObject_; Message: APTR): IPTR;
  3055. function DoSuperMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): IPTR;
  3056. function Has_Children(Win: PWindow): Boolean;
  3057. function Is_Children(Win: PWindow): Boolean;
  3058. { Intuition macros }
  3059. function INST_DATA(Cl: PIClass; O: P_Object): Pointer;
  3060. function SIZEOF_INSTANCE(Cl: PIClass): LongInt;
  3061. function BASEOBJECT(O: P_Object): Pointer;
  3062. function _OBJ(O: Pointer): P_Object; inline;
  3063. function __OBJECT(O: Pointer): P_Object; inline;
  3064. function OCLASS(O: Pointer): PIClass; inline;
  3065. function SHIFTITEM(N: SmallInt): Word;
  3066. function SHIFTMENU(N: SmallInt): Word;
  3067. function SHIFTSUB(N: SmallInt): Word;
  3068. function FULLMENUNUM(Menu, Item, Sub: SmallInt): Word;
  3069. function IM_BGPEN(Im: PImage): Byte;
  3070. function IM_BOX(Im: PImage): PIBox;
  3071. function IM_FGPEN(Im: PImage): Byte;
  3072. function GADGET_BOX(G: PGadget): PIBox;
  3073. function CUSTOM_HOOK(Gadget: PGadget): PHook;
  3074. function ITEMNUM(N: Word): Word;
  3075. function MENUNUM(N: Word): Word;
  3076. function SUBNUM(N: Word): Word;
  3077. function IAM_Resolution(x, y: Word): LongWord; // Pack two Words into one LongWord
  3078. function SRBNUM(x: Word): Word;
  3079. function SWBNUM(x: Word): Word;
  3080. function SSBNUM(x: Word): Word;
  3081. function SPARNUM(x: Word): Word;
  3082. function SHAKNUM(x: Word): Word;
  3083. implementation
  3084. function SetAttrs(Obj: APTR; const Tags: array of PtrUInt): LongWord; inline;
  3085. begin
  3086. SetAttrs := SetAttrsA(Obj, @Tags);
  3087. end;
  3088. function NewObject(ClassPtr: PIClass; ClassID: PChar; const Tags: array of PtrUInt): APTR; inline;
  3089. begin
  3090. NewObject := NewObjectA(ClassPtr, ClassID, @Tags);
  3091. end;
  3092. function BuildEasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP: LongWord; const Args: array of PtrUInt): PWindow; inline;
  3093. begin
  3094. BuildEasyRequest := BuildEasyRequestArgs(Window, EasyStruct, IDCMP, @Args);
  3095. end;
  3096. function DoGadgetMethod(Gad: PGadget; Win: PWindow; Req: PRequester; const Args: array of PtrUInt): IPTR; inline;
  3097. begin
  3098. {$ifdef i386}
  3099. DoGadgetMethod := DoGadgetMethodA(Gad, Win, Req, TMsg(@Args));
  3100. {$else}
  3101. {$warning fix me!}
  3102. {$endif}
  3103. end;
  3104. function EasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP_Ptr: PLongWord; const Args: array of PtrUInt): LongInt; inline;
  3105. begin
  3106. EasyRequest := EasyRequestArgs(Window, EasyStruct, IDCMP_Ptr, @Args);
  3107. end;
  3108. function OpenScreenTags(NewScreen: PNewScreen; const Tags: array of PtrUInt): PScreen; inline;
  3109. begin
  3110. OpenScreenTags := OpenScreenTagList(NewScreen, @Tags);
  3111. end;
  3112. function OpenWindowTags(NewWindow: PNewWindow; const Tags: array of PtrUInt): PWindow; inline;
  3113. begin
  3114. OpenWindowTags := OpenWindowTagList(NewWindow, @Tags);
  3115. end;
  3116. function SetGadgetAttrs(Gadget: PGadget; Window: PWindow; Requester: PRequester; const Tags: array of PtrUInt): IPTR; inline;
  3117. begin
  3118. SetGadgetAttrs := SetGadgetAttrsA(Gadget, Window, Requester, @Tags);
  3119. end;
  3120. procedure SetWindowPointer(Win: PWindow; const Tags: array of PtrUInt); inline;
  3121. begin
  3122. SetWindowPointerA(Win, @Tags);
  3123. end;
  3124. // Functions wrapper
  3125. function DoMethodA(Obj: PObject_; Message: APTR): IPTR; inline;
  3126. begin
  3127. DoMethodA := 0;
  3128. if Obj = nil then
  3129. Exit;
  3130. DoMethodA := CALLHOOKPKT_(PHook(OCLASS(Obj)), Obj, Message);
  3131. end;
  3132. function DoMethod(Obj: PObject_; const Args: array of PtrUInt): IPTR; inline;
  3133. begin
  3134. DoMethod := 0;
  3135. if obj = nil then
  3136. Exit;
  3137. DoMethod := CALLHOOKPKT_(PHook(OCLASS(Obj)), Obj, @Args);
  3138. end;
  3139. function DoSuperMethodA(cl: PIClass; Obj: PObject_; Message: APTR): IPTR; inline;
  3140. begin
  3141. DoSuperMethodA := 0;
  3142. if (cl = nil) or (obj = nil) then
  3143. Exit;
  3144. DoSuperMethodA := CALLHOOKPKT_(PHook(cl^.cl_Super), Obj, Message);
  3145. end;
  3146. function DoSuperMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): IPTR; inline;
  3147. begin
  3148. DoSuperMethod := 0;
  3149. if (cl = nil) or (obj = nil) then
  3150. Exit;
  3151. DoSuperMethod := CALLHOOKPKT_(PHook(cl^.cl_Super), Obj, @Args);
  3152. end;
  3153. function CoerceMethodA(cl: PIClass; Obj: PObject_; Message: APTR): IPTR; inline;
  3154. begin
  3155. CoerceMethodA := 0;
  3156. if (cl = nil) or (obj = nil) then
  3157. Exit;
  3158. CoerceMethodA := CALLHOOKPKT_(PHook(cl), Obj, Message);
  3159. end;
  3160. function CoerceMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): IPTR; inline;
  3161. begin
  3162. CoerceMethod := CoerceMethodA(cl, Obj, @Args);
  3163. end;
  3164. function SetSuperAttrs(cl: PIClass; Obj: PObject_; const Tags: array of PtrUInt): IPTR;
  3165. var
  3166. ops: TopSet;
  3167. begin
  3168. ops.MethodID := OM_SET;
  3169. ops.ops_AttrList := @Tags;
  3170. ops.ops_GInfo := nil;
  3171. SetSuperAttrs := DoSuperMethodA(cl, obj, @ops);
  3172. end;
  3173. function SetSuperAttrsA(cl: PIClass; Obj: PObject_; TagList: PTagItem): IPTR;
  3174. var
  3175. ops: TopSet;
  3176. begin
  3177. ops.MethodID := OM_SET;
  3178. ops.ops_AttrList := TagList;
  3179. ops.ops_GInfo := nil;
  3180. SetSuperAttrsA := DoSuperMethodA(cl, obj, @ops);
  3181. end;
  3182. function INST_DATA(Cl: PIClass; O: P_Object): Pointer; inline;
  3183. begin
  3184. INST_DATA := Pointer(PtrUInt(O) + Cl^.cl_InstOffset);
  3185. end;
  3186. function SIZEOF_INSTANCE(Cl: PIClass): LongInt; inline;
  3187. begin
  3188. SIZEOF_INSTANCE := Cl^.cl_InstOffset + Cl^.cl_InstSize + SizeOf(T_Object);
  3189. end;
  3190. function BASEOBJECT(O: P_Object): Pointer; inline;
  3191. begin
  3192. BASEOBJECT := Pointer(PtrUInt(O) + SizeOf(T_Object));
  3193. end;
  3194. function _OBJ(O: Pointer): P_Object; inline;
  3195. begin
  3196. _OBJ := P_Object(O);
  3197. end;
  3198. function __OBJECT(O: Pointer): P_Object; inline;
  3199. begin
  3200. __OBJECT := P_Object(PtrUInt(O) - SizeOf(T_Object))
  3201. end;
  3202. function OCLASS(O: Pointer): PIClass; inline;
  3203. begin
  3204. OCLASS := P_Object(PtrUInt(O) - SizeOf(T_Object))^.o_Class;
  3205. end;
  3206. function SHIFTITEM(N: SmallInt): Word;
  3207. begin
  3208. SHIFTITEM := (N and $3f) shl 5
  3209. end;
  3210. function SHIFTMENU(N: SmallInt): Word; inline;
  3211. begin
  3212. SHIFTMENU := N and $1f
  3213. end;
  3214. function SHIFTSUB(N: SmallInt): Word; inline;
  3215. begin
  3216. SHIFTSUB := (N and $1f) shl 11
  3217. end;
  3218. function FULLMENUNUM(Menu, Item, Sub: SmallInt): Word; inline;
  3219. begin
  3220. FULLMENUNUM := ((Sub and $1f) shl 11) or ((Item and $3f) shl 5) or (Menu and $1f);
  3221. end;
  3222. { The next functons _BGPEN AND _FGPEN aren't a full replacement of the
  3223. C macros because the C preprocessor makes it possible to set the
  3224. A/BPen values of the Image class objects as well. This can't work
  3225. in pascal, of course!
  3226. }
  3227. function IM_BGPEN(Im: PImage): Byte; inline;
  3228. begin
  3229. IM_BGPEN := Im^.PlaneOnOff;
  3230. end;
  3231. function IM_BOX(Im: PImage): PIBox; inline;
  3232. begin
  3233. IM_BOX := PIBox(@Im^.LeftEdge);
  3234. END;
  3235. function IM_FGPEN (Im: PImage): Byte; inline;
  3236. begin
  3237. IM_FGPEN := Im^.PlanePick;
  3238. end;
  3239. function GADGET_BOX(G: PGadget): PIBox; inline;
  3240. begin
  3241. GADGET_BOX := PIBox(@G^.LeftEdge);
  3242. end;
  3243. function CUSTOM_HOOK (Gadget: PGadget): PHook; inline;
  3244. begin
  3245. CUSTOM_HOOK := PHook(Gadget^.MutualExclude);
  3246. end;
  3247. function ITEMNUM(N: Word): Word; inline;
  3248. begin
  3249. ITEMNUM := (N shr 5) and $3F
  3250. end;
  3251. function MENUNUM(N: Word): Word; inline;
  3252. begin
  3253. MENUNUM := N and $1f
  3254. end;
  3255. function SUBNUM(N: Word): Word; inline;
  3256. begin
  3257. SUBNUM := (N shr 11) and $1f
  3258. end;
  3259. function IAM_Resolution(x, y: Word): LongWord; inline;
  3260. begin
  3261. IAM_Resolution := (x shl 16) or y;
  3262. end;
  3263. function SRBNUM(x: Word): Word; inline;
  3264. begin
  3265. SRBNUM := $08 - (x shr 4);
  3266. end;
  3267. function SWBNUM(x: Word): Word; inline;
  3268. begin
  3269. SWBNUM := $08 - (x and $0f);
  3270. end;
  3271. function SSBNUM(x: Word): Word; inline;
  3272. begin
  3273. SSBNUM := $01 + (x shr 4);
  3274. end;
  3275. function SPARNUM(x: Word): Word; inline;
  3276. begin
  3277. SPARNUM := x shr 4;
  3278. end;
  3279. function SHAKNUM(x: Word): Word; inline;
  3280. begin
  3281. SHAKNUM := x and $0f;
  3282. end;
  3283. function Has_Children(Win: PWindow): Boolean; inline;
  3284. begin
  3285. Has_Children := Assigned(Win^.FirstChild);
  3286. end;
  3287. function Is_Children(Win: PWindow): Boolean; inline;
  3288. begin
  3289. Is_Children := Assigned(Win^.Parent2);
  3290. end;
  3291. initialization
  3292. IntuitionBase := PIntuitionBase(OpenLibrary('intuition.library', 36));
  3293. finalization
  3294. CloseLibrary(PLibrary(IntuitionBase));
  3295. end.