HIView.pas 160 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125
  1. {
  2. File: HIToolbox/HIView.h
  3. Contains: HIView routines
  4. Version: HIToolbox-624~3
  5. Copyright: © 2001-2008 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { File: HIView.p(.pas) }
  11. { }
  12. { Contains: CodeWarrior Pascal( GPC) translation of Apple's Mac OS X 10.3 HIView.h }
  13. { Translation compatible with make-gpc-interfaces.pl generated MWPInterfaces }
  14. { (GPCPInterfaces). For the 10.2 available APIs, the CodeWarrior Pascal translation }
  15. { is linkable with Mac OS X 10.2.x or higher CFM CarbonLib and the GPC translation is }
  16. { linkable with Mac OS X 10.2.x or higher Mach-O Carbon.framework. For the 10.3 }
  17. { available APIs, the CodeWarrior Pascal translation is only selectively linkable with }
  18. { Mac OS X 10.3.x or higher CFM CarbonLib and the GPC translation is linkable with Mac }
  19. { OS X 10.3.x or higher Mach-O Carbon.framework. }
  20. { }
  21. { Version: 1.1 }
  22. { }
  23. { Pascal Translation: Gale Paeper, <[email protected]>, 2004 }
  24. { }
  25. { Copyright: Subject to the constraints of Apple's original rights, you're free to use this }
  26. { translation as you deem fit. }
  27. { }
  28. { Bugs?: This is an AS IS translation with no express guarentees of any kind. }
  29. { If you do find a bug, please help out the Macintosh Pascal programming community by }
  30. { reporting your bug finding and possible fix to either personal e-mail to Gale Paeper }
  31. { or a posting to the MacPascal mailing list. }
  32. {
  33. Change History (most recent first ):
  34. <4> 4/8/04 GRP Completed new additions from HIView.h, version HIToolbox-145.33~1.
  35. <3> ?/?/04 PNL Added most new additions from HIView.h, version HIToolbox-145.33~1.
  36. <2> 10/02/04 GRP Added support for GPC as well as CodeWarrior Pascal.
  37. <1> 9/8/03 GRP First Pascal translation of HIView.h, version HIToolbox-123.6~10.
  38. }
  39. { Translation assisted by: }
  40. {This file was processed by Dan's Source Converter}
  41. {version 1.3 (this version modified by Ingemar Ragnemalm)}
  42. { Pascal Translation Updated: Peter N Lewis, <[email protected]>, August 2005 }
  43. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  44. { Pascal Translation Updated: Gorazd Krosl, <[email protected]>, October 2009 }
  45. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  46. {
  47. Modified for use with Free Pascal
  48. Version 308
  49. Please report any bugs to <[email protected]>
  50. }
  51. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  52. {$mode macpas}
  53. {$packenum 1}
  54. {$macro on}
  55. {$inline on}
  56. {$calling mwpascal}
  57. unit HIView;
  58. interface
  59. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  60. {$setc GAP_INTERFACES_VERSION := $0308}
  61. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  62. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  63. {$endc}
  64. {$ifc defined CPUPOWERPC and defined CPUI386}
  65. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  66. {$endc}
  67. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  68. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  69. {$endc}
  70. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  71. {$setc __ppc__ := 1}
  72. {$elsec}
  73. {$setc __ppc__ := 0}
  74. {$endc}
  75. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  76. {$setc __ppc64__ := 1}
  77. {$elsec}
  78. {$setc __ppc64__ := 0}
  79. {$endc}
  80. {$ifc not defined __i386__ and defined CPUI386}
  81. {$setc __i386__ := 1}
  82. {$elsec}
  83. {$setc __i386__ := 0}
  84. {$endc}
  85. {$ifc not defined __x86_64__ and defined CPUX86_64}
  86. {$setc __x86_64__ := 1}
  87. {$elsec}
  88. {$setc __x86_64__ := 0}
  89. {$endc}
  90. {$ifc not defined __arm__ and defined CPUARM}
  91. {$setc __arm__ := 1}
  92. {$elsec}
  93. {$setc __arm__ := 0}
  94. {$endc}
  95. {$ifc not defined __arm64__ and defined CPUAARCH64}
  96. {$setc __arm64__ := 1}
  97. {$elsec}
  98. {$setc __arm64__ := 0}
  99. {$endc}
  100. {$ifc defined cpu64}
  101. {$setc __LP64__ := 1}
  102. {$elsec}
  103. {$setc __LP64__ := 0}
  104. {$endc}
  105. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  106. {$error Conflicting definitions for __ppc__ and __i386__}
  107. {$endc}
  108. {$ifc defined __ppc__ and __ppc__}
  109. {$setc TARGET_CPU_PPC := TRUE}
  110. {$setc TARGET_CPU_PPC64 := FALSE}
  111. {$setc TARGET_CPU_X86 := FALSE}
  112. {$setc TARGET_CPU_X86_64 := FALSE}
  113. {$setc TARGET_CPU_ARM := FALSE}
  114. {$setc TARGET_CPU_ARM64 := FALSE}
  115. {$setc TARGET_OS_MAC := TRUE}
  116. {$setc TARGET_OS_IPHONE := FALSE}
  117. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  118. {$setc TARGET_OS_EMBEDDED := FALSE}
  119. {$elifc defined __ppc64__ and __ppc64__}
  120. {$setc TARGET_CPU_PPC := FALSE}
  121. {$setc TARGET_CPU_PPC64 := TRUE}
  122. {$setc TARGET_CPU_X86 := FALSE}
  123. {$setc TARGET_CPU_X86_64 := FALSE}
  124. {$setc TARGET_CPU_ARM := FALSE}
  125. {$setc TARGET_CPU_ARM64 := FALSE}
  126. {$setc TARGET_OS_MAC := TRUE}
  127. {$setc TARGET_OS_IPHONE := FALSE}
  128. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  129. {$setc TARGET_OS_EMBEDDED := FALSE}
  130. {$elifc defined __i386__ and __i386__}
  131. {$setc TARGET_CPU_PPC := FALSE}
  132. {$setc TARGET_CPU_PPC64 := FALSE}
  133. {$setc TARGET_CPU_X86 := TRUE}
  134. {$setc TARGET_CPU_X86_64 := FALSE}
  135. {$setc TARGET_CPU_ARM := FALSE}
  136. {$setc TARGET_CPU_ARM64 := FALSE}
  137. {$ifc defined(iphonesim)}
  138. {$setc TARGET_OS_MAC := FALSE}
  139. {$setc TARGET_OS_IPHONE := TRUE}
  140. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  141. {$elsec}
  142. {$setc TARGET_OS_MAC := TRUE}
  143. {$setc TARGET_OS_IPHONE := FALSE}
  144. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  145. {$endc}
  146. {$setc TARGET_OS_EMBEDDED := FALSE}
  147. {$elifc defined __x86_64__ and __x86_64__}
  148. {$setc TARGET_CPU_PPC := FALSE}
  149. {$setc TARGET_CPU_PPC64 := FALSE}
  150. {$setc TARGET_CPU_X86 := FALSE}
  151. {$setc TARGET_CPU_X86_64 := TRUE}
  152. {$setc TARGET_CPU_ARM := FALSE}
  153. {$setc TARGET_CPU_ARM64 := FALSE}
  154. {$ifc defined(iphonesim)}
  155. {$setc TARGET_OS_MAC := FALSE}
  156. {$setc TARGET_OS_IPHONE := TRUE}
  157. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  158. {$elsec}
  159. {$setc TARGET_OS_MAC := TRUE}
  160. {$setc TARGET_OS_IPHONE := FALSE}
  161. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  162. {$endc}
  163. {$setc TARGET_OS_EMBEDDED := FALSE}
  164. {$elifc defined __arm__ and __arm__}
  165. {$setc TARGET_CPU_PPC := FALSE}
  166. {$setc TARGET_CPU_PPC64 := FALSE}
  167. {$setc TARGET_CPU_X86 := FALSE}
  168. {$setc TARGET_CPU_X86_64 := FALSE}
  169. {$setc TARGET_CPU_ARM := TRUE}
  170. {$setc TARGET_CPU_ARM64 := FALSE}
  171. { will require compiler define when/if other Apple devices with ARM cpus ship }
  172. {$setc TARGET_OS_MAC := FALSE}
  173. {$setc TARGET_OS_IPHONE := TRUE}
  174. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  175. {$setc TARGET_OS_EMBEDDED := TRUE}
  176. {$elifc defined __arm64__ and __arm64__}
  177. {$setc TARGET_CPU_PPC := FALSE}
  178. {$setc TARGET_CPU_PPC64 := FALSE}
  179. {$setc TARGET_CPU_X86 := FALSE}
  180. {$setc TARGET_CPU_X86_64 := FALSE}
  181. {$setc TARGET_CPU_ARM := FALSE}
  182. {$setc TARGET_CPU_ARM64 := TRUE}
  183. { will require compiler define when/if other Apple devices with ARM cpus ship }
  184. {$setc TARGET_OS_MAC := FALSE}
  185. {$setc TARGET_OS_IPHONE := TRUE}
  186. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  187. {$setc TARGET_OS_EMBEDDED := TRUE}
  188. {$elsec}
  189. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  190. {$endc}
  191. {$ifc defined __LP64__ and __LP64__ }
  192. {$setc TARGET_CPU_64 := TRUE}
  193. {$elsec}
  194. {$setc TARGET_CPU_64 := FALSE}
  195. {$endc}
  196. {$ifc defined FPC_BIG_ENDIAN}
  197. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  198. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  199. {$elifc defined FPC_LITTLE_ENDIAN}
  200. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  201. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  202. {$elsec}
  203. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  204. {$endc}
  205. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  206. {$setc CALL_NOT_IN_CARBON := FALSE}
  207. {$setc OLDROUTINENAMES := FALSE}
  208. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  209. {$setc OPAQUE_UPP_TYPES := TRUE}
  210. {$setc OTCARBONAPPLICATION := TRUE}
  211. {$setc OTKERNEL := FALSE}
  212. {$setc PM_USE_SESSION_APIS := TRUE}
  213. {$setc TARGET_API_MAC_CARBON := TRUE}
  214. {$setc TARGET_API_MAC_OS8 := FALSE}
  215. {$setc TARGET_API_MAC_OSX := TRUE}
  216. {$setc TARGET_CARBON := TRUE}
  217. {$setc TARGET_CPU_68K := FALSE}
  218. {$setc TARGET_CPU_MIPS := FALSE}
  219. {$setc TARGET_CPU_SPARC := FALSE}
  220. {$setc TARGET_OS_UNIX := FALSE}
  221. {$setc TARGET_OS_WIN32 := FALSE}
  222. {$setc TARGET_RT_MAC_68881 := FALSE}
  223. {$setc TARGET_RT_MAC_CFM := FALSE}
  224. {$setc TARGET_RT_MAC_MACHO := TRUE}
  225. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  226. {$setc TYPE_BOOL := FALSE}
  227. {$setc TYPE_EXTENDED := FALSE}
  228. {$setc TYPE_LONGLONG := TRUE}
  229. uses MacTypes,CFArray,CFBase,CGBase,CGContext,CGImage,CarbonEventsCore,Drag,Events,QuickdrawTypes,Menus,Appearance,Controls,CarbonEvents,HIGeometry,HIObject,IconsCore,Icons,HIShape,HITheme,CTFont;
  230. {$endc} {not MACOSALLINCLUDE}
  231. {$ifc TARGET_OS_MAC}
  232. {$ALIGN MAC68K}
  233. type
  234. HIViewID = ControlID;
  235. {
  236. * Discussion:
  237. * HIViewZOrderOp
  238. }
  239. const
  240. {
  241. * Indicates we wish to order a view above another view.
  242. }
  243. kHIViewZOrderAbove = 1;
  244. {
  245. * Indicates we wish to order a view below another view.
  246. }
  247. kHIViewZOrderBelow = 2;
  248. type
  249. HIViewZOrderOp = UInt32;
  250. {
  251. * HIViewFrameMetrics
  252. *
  253. * Summary:
  254. * Describes the offsets from the structure to the content area of a
  255. * view; for example, the top metric is the difference between the
  256. * vertical coordinate of the top edge of the viewÕs structure
  257. * region and the vertical coordinate of the top edge of the viewÕs
  258. * content region. This structure is returned by a view in response
  259. * to a kEventControlGetFrameMetrics event.
  260. }
  261. type
  262. HIViewFrameMetrics = record
  263. {
  264. * Height of the top of the structure area.
  265. }
  266. top: CGFloat;
  267. {
  268. * Width of the left of the structure area.
  269. }
  270. left: CGFloat;
  271. {
  272. * Height of the bottom of the structure area.
  273. }
  274. bottom: CGFloat;
  275. {
  276. * Width of the right of the structure area.
  277. }
  278. right: CGFloat;
  279. end;
  280. {==============================================================================}
  281. { ATTRIBUTES }
  282. {==============================================================================}
  283. {
  284. * Summary:
  285. * View attributes are generally determined by clients of the view;
  286. * the view itself should observe the attributes and behave
  287. * accordingly.
  288. *
  289. * Discussion:
  290. * View Attributes
  291. }
  292. const
  293. {
  294. * When set, the view will send the command it generates to the user
  295. * focus and propagate as it would naturally from there. The default
  296. * is to send the command to itself and then to its parent and so
  297. * forth.
  298. }
  299. kHIViewAttributeSendCommandToUserFocus = 1 shl 0;
  300. {
  301. * Indicates that a text editing view should behave appropriately for
  302. * editing fields in a dialog; specifically, the view should ignore
  303. * the Return, Enter, Escape, and Tab keys, and allow them to be
  304. * processed by other participants in the event flow. Available on
  305. * Mac OS X 10.3 and later.
  306. }
  307. kHIViewAttributeIsFieldEditor = 1 shl 1;
  308. {
  309. * Legacy synonym for kHIViewAttributeSendCommandToUserFocus. Please
  310. * use it instead.
  311. }
  312. kHIViewSendCommandToUserFocus = kHIViewAttributeSendCommandToUserFocus;
  313. {
  314. * HIView features
  315. *
  316. * Summary:
  317. * View feature flags are generally determined by the view itself,
  318. * and are not typically changed by clients of the view.
  319. *
  320. * Historical note: This list is similar to the list of Control
  321. * Feature Bits in Controls.h. This list is shorter because some of
  322. * the Control Manager constants were introduced to enable the
  323. * Control Manager to tell whether a CDEF supported a new CDEF
  324. * message. This capability is not required by the HIView Manager,
  325. * because an HIView that doesn't support a particular Carbon event
  326. * will simply ignore it.
  327. }
  328. const
  329. {
  330. * This view supports using the ghosting protocol when live tracking
  331. * is not enabled.
  332. }
  333. kHIViewFeatureSupportsGhosting = 1 shl 0;
  334. {
  335. * This view allows subviews to be embedded within it.
  336. }
  337. kHIViewFeatureAllowsSubviews = 1 shl 1;
  338. {
  339. * If this view is clicked, the keyboard focus should be set to this
  340. * view automatically. This is primarily used for edit text views.
  341. }
  342. kHIViewFeatureGetsFocusOnClick = 1 shl 8;
  343. {
  344. * This view supports the live feedback protocol. Necessary to
  345. * implement live scroll bar tracking. Clients of a view should never
  346. * disable this.
  347. }
  348. kHIViewFeatureSupportsLiveFeedback = 1 shl 10;
  349. {
  350. * This view can be put into a radio group. Radio buttons and bevel
  351. * buttons report this behavior.
  352. }
  353. kHIViewFeatureSupportsRadioBehavior = 1 shl 11;
  354. {
  355. * This view supports the auto-toggle protocol and should at the very
  356. * least auto- toggle from off to on and back. The view can support a
  357. * carbon event for more advanced auto-toggling of its value. The tab
  358. * view supports this, for example, so that when a tab is clicked its
  359. * value changes automatically.
  360. }
  361. kHIViewFeatureAutoToggles = 1 shl 14;
  362. {
  363. * This is merely informational. Turning it off would not necessarily
  364. * disable any timer a view might be using, but it could obey this
  365. * bit if it so desired.
  366. }
  367. kHIViewFeatureIdlesWithTimer = 1 shl 23;
  368. {
  369. * This tells the Control Manager that the up button part increases
  370. * the value of the view instead of decreasing it. For example, the
  371. * Little Arrows (Spinner) view increase its value when the up button
  372. * is pressed. Scroll bars, on the other hand, decrease the value
  373. * when their up buttons are pressed.
  374. }
  375. kHIViewFeatureInvertsUpDownValueMeaning = 1 shl 24;
  376. {
  377. * This is an optimization for determining a view's opaque region.
  378. * When set, the view system just uses the view's structure region,
  379. * and can usually avoid having to call the view at all.
  380. }
  381. kHIViewFeatureIsOpaque = 1 shl 25;
  382. {
  383. * This is an optimization for determining what gets invalidated when
  384. * views are dirtied. For example, on a metal window, the content
  385. * view is actually fully transparent, so invalidating it doesn't
  386. * really help things. By telling the Control Manager that the view
  387. * is transparent and does not do any drawing, we can avoid trying to
  388. * invalidate it and instead invalidate views behind it.
  389. }
  390. kHIViewFeatureDoesNotDraw = 1 shl 27;
  391. {
  392. * Indicates to the Control Manager that this view doesn't use the
  393. * special part codes for indicator, inactive, and disabled.
  394. * Available in Mac OS X 10.3 and later.
  395. }
  396. kHIViewFeatureDoesNotUseSpecialParts = 1 shl 28;
  397. {
  398. * This is an optimization for determining the clickable region of a
  399. * window (used for metal windows, for example, when doing async
  400. * window dragging). The presence of this bit tells us not to bother
  401. * asking the view for the clickable region. A view like the visual
  402. * separator would set this bit. It's typically used in conjunction
  403. * with the kHIViewFeatureDoesNotDraw bit.
  404. }
  405. kHIViewFeatureIgnoresClicks = 1 shl 29;
  406. {
  407. * HIView valid feature sets
  408. *
  409. * Summary:
  410. * These are sets of features that are available on the version of
  411. * Mac OS X corresponding to that named in the constant.
  412. }
  413. const
  414. kHIViewValidFeaturesForPanther = $3B804D03;
  415. {
  416. * HIView feature synonyms
  417. *
  418. * Summary:
  419. * Legacy synonyms for HIView feature bit names. Please use the
  420. * newer names.
  421. }
  422. const
  423. kHIViewSupportsGhosting = kHIViewFeatureSupportsGhosting;
  424. kHIViewAllowsSubviews = kHIViewFeatureAllowsSubviews;
  425. kHIViewGetsFocusOnClick = kHIViewFeatureGetsFocusOnClick;
  426. kHIViewSupportsLiveFeedback = kHIViewFeatureSupportsLiveFeedback;
  427. kHIViewSupportsRadioBehavior = kHIViewFeatureSupportsRadioBehavior;
  428. kHIViewAutoToggles = kHIViewFeatureAutoToggles;
  429. kHIViewIdlesWithTimer = kHIViewFeatureIdlesWithTimer;
  430. kHIViewInvertsUpDownValueMeaning = kHIViewFeatureInvertsUpDownValueMeaning;
  431. kHIViewIsOpaque = kHIViewFeatureIsOpaque;
  432. kHIViewDoesNotDraw = kHIViewFeatureDoesNotDraw;
  433. kHIViewDoesNotUseSpecialParts = kHIViewFeatureDoesNotUseSpecialParts;
  434. kHIViewIgnoresClicks = kHIViewFeatureIgnoresClicks;
  435. type
  436. HIViewFeatures = UInt64;
  437. {==============================================================================}
  438. { VIEW PART CODES }
  439. {==============================================================================}
  440. type
  441. HIViewPartCode = ControlPartCode;
  442. HIViewPartCodePtr = ^HIViewPartCode;
  443. {
  444. * HIViewPartCodes
  445. *
  446. }
  447. const
  448. kHIViewNoPart = 0;
  449. kHIViewIndicatorPart = 129;
  450. kHIViewDisabledPart = 254;
  451. kHIViewInactivePart = 255;
  452. {
  453. * Use this constant when not referring to a specific part, but
  454. * rather the entire view.
  455. }
  456. kHIViewEntireView = kHIViewNoPart;
  457. {
  458. * HIView meta-parts
  459. *
  460. * Summary:
  461. * A meta-part is a part used in a call to the HIViewCopyShape API.
  462. * These parts might be defined by a view, but should not be
  463. * returned from calls such as HIViewGetPartHit. They define a
  464. * region of a view.
  465. *
  466. * Along with these parts, you can also pass in normal part codes to
  467. * get the regions of those parts. Not all views fully support this
  468. * feature.
  469. }
  470. const
  471. {
  472. * The entire area that the view will draw into. When a composited
  473. * view is drawn, the HIView Manager clips the view's drawing to the
  474. * structure area. This area may extend beyond the bounds of the view
  475. * (for example, if the view draws a focus ring outside of its
  476. * bounds). You may return a superset of the drawn area if this is
  477. * computationally easier to construct. This area is used to
  478. * determine the area of a window that should be invalidated and
  479. * redrawn when a view is invalidated. It is not necessary for a view
  480. * to return a shape that precisely describes the structure area; for
  481. * example, a view whose structure is an oval may simply return the
  482. * oval's bounding rectangle. The default handler for the
  483. * kEventControlGetPartRegion event will return the view's bounds
  484. * when this part is requested.
  485. }
  486. kHIViewStructureMetaPart = -1;
  487. {
  488. * The area of the view in which embedded views should be positioned.
  489. * This part is only defined for views that can contain other views
  490. * (for example, the group box). This area is largely informational
  491. * and is not used by the HIView Manager itself. The default handler
  492. * for the kEventControlGetPartRegion event will return
  493. * errInvalidPartCode when this part is requested.
  494. }
  495. kHIViewContentMetaPart = -2;
  496. {
  497. * The area of the view that, when drawn, is filled with opaque
  498. * pixels. You may also return a subset of the opaque area if this is
  499. * computationally easier to construct. If a view is contained in a
  500. * composited window, the HIView Manager will use this area to
  501. * optimize drawing of other views that intersect this area; views
  502. * that are entirely contained within the opaque area, and that are
  503. * z-ordered underneath this view, will not be drawn at all, since
  504. * any drawing would be completely overwritten by this view. The
  505. * default handler for the kEventControlGetPartRegion event will
  506. * return an empty area when this part is requested. This meta-part
  507. * is available in Mac OS X 10.2 or later.
  508. }
  509. kHIViewOpaqueMetaPart = -3;
  510. {
  511. * The area of the view that causes a mouse event to be captured by
  512. * that view. If a mouse event falls inside the view bounds but
  513. * outside of this area, then the Control Manager will allow the
  514. * event to pass through the view to the next view behind it in
  515. * z-order. This area is used to determine which parts of a window
  516. * should allow async window dragging when clicked (the draggable
  517. * area is computed by subtracting the clickable areas of views in
  518. * the window from the window's total area). You can also customize
  519. * the clickable area of a view if you want the view to have an
  520. * effectively transparent area (for example, a view that draws
  521. * multiple tabs might want clicks in the space between the tabs to
  522. * fall through to the next view rather than be captured by the
  523. * tab-drawing view). The default handler for the
  524. * kEventControlGetPartRegion event will return the view's bounds
  525. * when this part is requested. This meta-part is available in Mac OS
  526. * X 10.3 or later.
  527. }
  528. kHIViewClickableMetaPart = -4;
  529. {
  530. * HIView Focus Parts
  531. *
  532. }
  533. const
  534. {
  535. * Tells view to clear its focus
  536. }
  537. kHIViewFocusNoPart = kHIViewNoPart;
  538. {
  539. * Tells view to focus on the next part
  540. }
  541. kHIViewFocusNextPart = -1;
  542. {
  543. * Tells view to focus on the previous part
  544. }
  545. kHIViewFocusPrevPart = -2;
  546. {==============================================================================}
  547. { CONTENT }
  548. {==============================================================================}
  549. type
  550. HIViewImageContentType = ControlContentType;
  551. HIViewImageContentInfo = ControlImageContentInfo;
  552. HIViewContentType = SInt16;
  553. {
  554. * HIViewContentTypes
  555. *
  556. * Summary:
  557. * HIView image content types.
  558. }
  559. const
  560. {
  561. * The view has no content other than text.
  562. }
  563. kHIViewContentTextOnly = 0;
  564. {
  565. * The view has no content.
  566. }
  567. kHIViewContentNone = 0;
  568. {
  569. * The view's content is an IconSuiteRef. The icon suite handle
  570. * should be placed in HIViewContentInfo.u.iconSuite.
  571. }
  572. kHIViewContentIconSuiteRef = 129;
  573. {
  574. * The view's content is an IconRef. The IconRef should be placed in
  575. * HIViewContentInfo.u.iconRef.
  576. }
  577. kHIViewContentIconRef = 132;
  578. {
  579. * The view's content is a CGImageRef. The CGImageRef should be
  580. * placed in HIViewContentInfo.u.imageRef. Available in Mac OS X 10.4
  581. * and later.
  582. }
  583. kHIViewContentCGImageRef = 134;
  584. {
  585. * The view's content is an image file in the main bundle's Resources
  586. * directory. The CFStringRef of the full name of the image file
  587. * should be placed in HIViewContentInfo.u.imageResource. Available
  588. * in Mac OS X 10.5 and later.
  589. }
  590. kHIViewContentImageResource = 135;
  591. {
  592. * The view's content is an image file at an arbitrary location. The
  593. * CFURLRef identifying the image file should be placed in
  594. * HIViewContentInfo.u.imageFile. Available in Mac OS X 10.5 and
  595. * later.
  596. }
  597. kHIViewContentImageFile = 136;
  598. {
  599. * The view's content is an IconRef, specified by an icon type and
  600. * creator. The type and creator should be placed in
  601. * HIViewContentInfo.u.iconTypeAndCreator. Available in Mac OS X 10.5
  602. * and later.
  603. }
  604. kHIViewContentIconTypeAndCreator = 137;
  605. {
  606. * The view's content is a Note, Caution, or Stop icon, specified by
  607. * the corresponding icon type (kAlertNoteIcon, kAlertCautionIcon, or
  608. * kAlertStopIcon). When the icon is drawn, it may be modified to
  609. * correspond to the current Mac OS X user interface guidelines. The
  610. * type should be placed in
  611. * HIViewContentInfo.u.iconTypeAndCreator.type. The creator field of
  612. * the iconTypeAndCreator field is ignored in this case. Available in
  613. * Mac OS X 10.5 and later.
  614. }
  615. kHIViewContentAlertIconType = 138;
  616. {
  617. * The view's content is a reference to an NSImage. The NSImage*
  618. * should be placed in HIViewContentInfo.u.nsImage. Available in Mac
  619. * OS X 10.5 and later.
  620. }
  621. kHIViewContentNSImage = 139;
  622. {
  623. * HITypeAndCreator
  624. *
  625. * Summary:
  626. * A type/creator pair used to identify an IconRef.
  627. }
  628. type
  629. HITypeAndCreator = record
  630. {
  631. * The icon type.
  632. }
  633. typ: OSType;
  634. {
  635. * The icon creator.
  636. }
  637. creator: OSType;
  638. end;
  639. {
  640. * HIViewContentInfo
  641. *
  642. * Summary:
  643. * Defines the image content of a view.
  644. *
  645. * Discussion:
  646. * This structure is the HIView equivalent of the
  647. * ControlImageContentInfo structure. On Mac OS X 10.5 and later,
  648. * you should use this structure with the HIViewSetImageContent and
  649. * HIViewCopyImageContent APIs to set or retrieve the image content
  650. * of a view.
  651. *
  652. * Prior to Mac OS X 10.5, you may pass this structure to
  653. * GetControlData and SetControlData with the kControlContentTag
  654. * constant. Note, however, that the size of this structure as
  655. * declared in the Mac OS X 10.5 headers is different (and larger)
  656. * than the size of this structure as declared in the Mac OS X 10.4
  657. * headers, and the Mac OS X 10.5 version is larger than the size of
  658. * the ControlImageContentInfo structure. The view implementations
  659. * prior to Mac OS X 10.5 only support Get/SetControlData requests
  660. * if the specified data size matches the size of
  661. * ControlImageContentInfo. Therefore, if you need to use
  662. * Get/SetControlData with this structure prior to Mac OS X 10.5,
  663. * you should pass sizeof(ControlImageContentInfo) rather than
  664. * sizeof(HIViewContentInfo) as the size of the incoming/outgoing
  665. * data buffer.
  666. }
  667. type
  668. HIViewContentInfo = record
  669. {
  670. * The type of content referenced in the content union.
  671. }
  672. contentType: HIViewContentType;
  673. case SInt16 of
  674. {$ifc not TARGET_CPU_64}
  675. 0: (
  676. iconSuite: IconSuiteRef;
  677. );
  678. {$endc} {not TARGET_CPU_64}
  679. 1: (
  680. iconRef: IconRef_fix;
  681. );
  682. 2: (
  683. imagiconTypeAndCreatoreRef: HITypeAndCreator;
  684. );
  685. 3: (
  686. imageRef: CGImageRef;
  687. );
  688. 4: (
  689. imageResource: CFStringRef;
  690. );
  691. 5: (
  692. imageFile: CFURLRef;
  693. );
  694. end;
  695. type
  696. HIViewContentInfoPtr = ^HIViewContentInfo;
  697. {==============================================================================}
  698. { ERROR CODES }
  699. {==============================================================================}
  700. {
  701. * Discussion:
  702. * View/Control Error Codes
  703. }
  704. const
  705. {
  706. * This value will be returned from an HIView API or a Control
  707. * Manager API when an action that is only supported on a compositing
  708. * window is attempted on a non-compositing window. This doesn't
  709. * necessarily mean that the API is only callable for compositing
  710. * windows; sometimes the legality of the action is based on other
  711. * parameters of the API. See HIViewAddSubview for one particular use
  712. * of this error code.
  713. }
  714. errNeedsCompositedWindow = -30598;
  715. {==============================================================================}
  716. { HIOBJECT SUPPORT }
  717. { Setting Initial Bounds }
  718. { When creating a view using HIObjectCreate, you can set the initial bounds }
  719. { automatically by passing in an initialization event into HIObjectCreate }
  720. { with a kEventParamBounds parameter as typeHIRect or typeQDRectangle. }
  721. {==============================================================================}
  722. { The HIObject class ID for the HIView class. }
  723. {$ifc USE_CFSTR_CONSTANT_MACROS}
  724. {$definec kHIViewClassID CFSTRP('com.apple.hiview')}
  725. {$endc}
  726. {==============================================================================}
  727. { EMBEDDING }
  728. {==============================================================================}
  729. {$ifc not TARGET_CPU_64}
  730. {
  731. * HIViewGetRoot()
  732. *
  733. * Discussion:
  734. * Returns the root view for a window.
  735. *
  736. * Mac OS X threading:
  737. * Not thread safe
  738. *
  739. * Parameters:
  740. *
  741. * inWindow:
  742. * The window to get the root for.
  743. *
  744. * Result:
  745. * The root view for the window, or NULL if an invalid window is
  746. * passed.
  747. *
  748. * Availability:
  749. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  750. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  751. * Non-Carbon CFM: not available
  752. }
  753. function HIViewGetRoot( inWindow: WindowRef ): HIViewRef; external name '_HIViewGetRoot';
  754. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  755. {
  756. * HIViewAddSubview()
  757. *
  758. * Discussion:
  759. * Adds a subview to the given parent. The new subview is added to
  760. * the front of the list of subviews (i.e., it is made topmost).
  761. *
  762. * The subview being added is not retained by the new parent view.
  763. * Do not release the view after adding it, or it will cease to
  764. * exist. All views in a window will be released automatically when
  765. * the window is destroyed.
  766. *
  767. * Note that you should not use this API to transfer a window's
  768. * content view from one window to another. A window's content view
  769. * should always be left in its original window.
  770. *
  771. * Mac OS X threading:
  772. * Not thread safe
  773. *
  774. * Parameters:
  775. *
  776. * inParent:
  777. * The view which will receive the new subview.
  778. *
  779. * inNewChild:
  780. * The subview being added.
  781. *
  782. * Result:
  783. * An operating system result code.
  784. * errNeedsCompositedWindow will be returned when you try to embed
  785. * into the content view in a non-compositing window; you can only
  786. * embed into the content view in compositing windows.
  787. *
  788. * Availability:
  789. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  790. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  791. * Non-Carbon CFM: not available
  792. }
  793. function HIViewAddSubview( inParent: HIViewRef; inNewChild: HIViewRef ): OSStatus; external name '_HIViewAddSubview';
  794. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  795. {
  796. * HIViewRemoveFromSuperview()
  797. *
  798. * Discussion:
  799. * Removes a view from its parent.
  800. * The subview being removed from the parent is not released and
  801. * still exists.
  802. *
  803. * Mac OS X threading:
  804. * Not thread safe
  805. *
  806. * Parameters:
  807. *
  808. * inView:
  809. * The view to remove.
  810. *
  811. * Result:
  812. * An operating system result code.
  813. *
  814. * Availability:
  815. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  816. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  817. * Non-Carbon CFM: not available
  818. }
  819. function HIViewRemoveFromSuperview( inView: HIViewRef ): OSStatus; external name '_HIViewRemoveFromSuperview';
  820. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  821. {
  822. * HIViewGetSuperview()
  823. *
  824. * Discussion:
  825. * Returns a view's parent view.
  826. *
  827. * Mac OS X threading:
  828. * Not thread safe
  829. *
  830. * Parameters:
  831. *
  832. * inView:
  833. * The view whose parent you are interested in getting.
  834. *
  835. * Result:
  836. * An HIView reference, or NULL if this view has no parent or is
  837. * invalid.
  838. *
  839. * Availability:
  840. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  841. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  842. * Non-Carbon CFM: not available
  843. }
  844. function HIViewGetSuperview( inView: HIViewRef ): HIViewRef; external name '_HIViewGetSuperview';
  845. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  846. {
  847. * HIViewGetFirstSubview()
  848. *
  849. * Discussion:
  850. * Returns the first subview of a container. The first subview is
  851. * the topmost subview in z-order.
  852. *
  853. * Mac OS X threading:
  854. * Not thread safe
  855. *
  856. * Parameters:
  857. *
  858. * inView:
  859. * The view whose subview you are fetching.
  860. *
  861. * Result:
  862. * An HIView reference, or NULL if this view has no subviews or is
  863. * invalid.
  864. *
  865. * Availability:
  866. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  867. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  868. * Non-Carbon CFM: not available
  869. }
  870. function HIViewGetFirstSubview( inView: HIViewRef ): HIViewRef; external name '_HIViewGetFirstSubview';
  871. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  872. {
  873. * HIViewGetLastSubview()
  874. *
  875. * Discussion:
  876. * Returns the last subview of a container. The last subview is the
  877. * bottommost subview in z-order.
  878. *
  879. * Mac OS X threading:
  880. * Not thread safe
  881. *
  882. * Parameters:
  883. *
  884. * inView:
  885. * The view whose subview you are fetching.
  886. *
  887. * Result:
  888. * An HIView reference, or NULL if this view has no subviews or is
  889. * invalid.
  890. *
  891. * Availability:
  892. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  893. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  894. * Non-Carbon CFM: not available
  895. }
  896. function HIViewGetLastSubview( inView: HIViewRef ): HIViewRef; external name '_HIViewGetLastSubview';
  897. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  898. {
  899. * HIViewGetNextView()
  900. *
  901. * Discussion:
  902. * Returns the next view after the one given, in z-order.
  903. *
  904. * Mac OS X threading:
  905. * Not thread safe
  906. *
  907. * Parameters:
  908. *
  909. * inView:
  910. * The view to use as reference.
  911. *
  912. * Result:
  913. * An HIView reference, or NULL if this view has no view behind it
  914. * or is invalid.
  915. *
  916. * Availability:
  917. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  918. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  919. * Non-Carbon CFM: not available
  920. }
  921. function HIViewGetNextView( inView: HIViewRef ): HIViewRef; external name '_HIViewGetNextView';
  922. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  923. {
  924. * HIViewGetPreviousView()
  925. *
  926. * Discussion:
  927. * Returns the previous view before the one given, in z-order.
  928. *
  929. * Mac OS X threading:
  930. * Not thread safe
  931. *
  932. * Parameters:
  933. *
  934. * inView:
  935. * The view to use as reference.
  936. *
  937. * Result:
  938. * An HIView reference, or NULL if this view has no view in front of
  939. * it or is invalid.
  940. *
  941. * Availability:
  942. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  943. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  944. * Non-Carbon CFM: not available
  945. }
  946. function HIViewGetPreviousView( inView: HIViewRef ): HIViewRef; external name '_HIViewGetPreviousView';
  947. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  948. {
  949. * HIViewCountSubviews()
  950. *
  951. * Summary:
  952. * Counts the number of subviews embedded in a view.
  953. *
  954. * Mac OS X threading:
  955. * Not thread safe
  956. *
  957. * Parameters:
  958. *
  959. * inView:
  960. * The view for which to count subviews.
  961. *
  962. * outSubviewCount:
  963. *
  964. * Result:
  965. * The number of subviews of the specified view.
  966. *
  967. * Availability:
  968. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  969. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  970. * Non-Carbon CFM: not available
  971. }
  972. function HIViewCountSubviews( inView: HIViewRef ): CFIndex; external name '_HIViewCountSubviews';
  973. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  974. {
  975. * HIViewGetIndexedSubview()
  976. *
  977. * Summary:
  978. * Get the Nth subview of a view.
  979. *
  980. * Discussion:
  981. * Instead of calling HIViewGetIndexedSubview repeatedly, it may be
  982. * more efficient to iterate through the subviews of a view with
  983. * calls HIViewGetFirstSubview and HIViewGetNextView.
  984. *
  985. * Mac OS X threading:
  986. * Not thread safe
  987. *
  988. * Parameters:
  989. *
  990. * inView:
  991. * The view whose indexed sub-view is being requested.
  992. *
  993. * inSubviewIndex:
  994. * The index of the subview to get.
  995. *
  996. * outSubview:
  997. * An HIViewRef to be filled with the indexed subview.
  998. *
  999. * Result:
  1000. * A result code indicating success or failure.
  1001. *
  1002. * Availability:
  1003. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1004. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1005. * Non-Carbon CFM: not available
  1006. }
  1007. function HIViewGetIndexedSubview( inView: HIViewRef; inSubviewIndex: CFIndex; var outSubview: HIViewRef ): OSStatus; external name '_HIViewGetIndexedSubview';
  1008. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1009. {
  1010. * HIViewSetZOrder()
  1011. *
  1012. * Discussion:
  1013. * Allows you to change the front-to-back ordering of sibling views.
  1014. *
  1015. * Mac OS X threading:
  1016. * Not thread safe
  1017. *
  1018. * Parameters:
  1019. *
  1020. * inView:
  1021. * The view whose Z-order you wish to change.
  1022. *
  1023. * inOp:
  1024. * Indicates to order inView above or below inOther.
  1025. *
  1026. * inOther:
  1027. * Another optional view to use as a reference. You can pass NULL
  1028. * to mean an absolute position. For example, passing
  1029. * kHIViewZOrderAbove and NULL will move a view to the front of
  1030. * all of its siblings. Likewise, passing kHIViewZOrderBelow and
  1031. * NULL will move it to the back.
  1032. *
  1033. * Result:
  1034. * An operating system result code.
  1035. *
  1036. * Availability:
  1037. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  1038. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1039. * Non-Carbon CFM: not available
  1040. }
  1041. function HIViewSetZOrder( inView: HIViewRef; inOp: HIViewZOrderOp; inOther: HIViewRef { can be NULL } ): OSStatus; external name '_HIViewSetZOrder';
  1042. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1043. {==============================================================================}
  1044. { STATE and VALUES }
  1045. {==============================================================================}
  1046. {$endc} {not TARGET_CPU_64}
  1047. {
  1048. * HIViewKind
  1049. }
  1050. type
  1051. HIViewKind = record
  1052. {
  1053. * The signature of the view. Apple reserves all signatures made up
  1054. * of only lowercase characters.
  1055. }
  1056. signature: OSType;
  1057. {
  1058. * The kind of the view. Apple reserves all kinds made up of only
  1059. * lowercase characters.
  1060. }
  1061. kind: OSType;
  1062. end;
  1063. {
  1064. * View signature kind
  1065. *
  1066. }
  1067. const
  1068. {
  1069. * The signature of all HIToolbox views.
  1070. }
  1071. kHIViewKindSignatureApple = FourCharCode('appl');
  1072. {$ifc not TARGET_CPU_64}
  1073. {
  1074. * HIViewSetVisible()
  1075. *
  1076. * Discussion:
  1077. * Hides or shows a view. Marks the area the view will occupy or
  1078. * used to occupy as needing to be redrawn later.
  1079. *
  1080. * Mac OS X threading:
  1081. * Not thread safe
  1082. *
  1083. * Parameters:
  1084. *
  1085. * inView:
  1086. * The view to hide or show.
  1087. *
  1088. * inVisible:
  1089. * A boolean value which indicates whether you wish to hide the
  1090. * view (false) or show the view (true).
  1091. *
  1092. * Result:
  1093. * An operating system result code.
  1094. *
  1095. * Availability:
  1096. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  1097. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1098. * Non-Carbon CFM: not available
  1099. }
  1100. function HIViewSetVisible( inView: HIViewRef; inVisible: Boolean ): OSStatus; external name '_HIViewSetVisible';
  1101. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1102. {
  1103. * HIViewIsVisible()
  1104. *
  1105. * Summary:
  1106. * Returns whether a view is visible.
  1107. *
  1108. * Discussion:
  1109. * Note that HIViewIsVisible returns a view's effective visibility,
  1110. * which is determined both by the view's own visibility and the
  1111. * visibility of its parent views. If a parent view is invisible,
  1112. * then this view is considered to be invisible also.
  1113. *
  1114. * Latent visibility can be determined with HIViewIsLatentlyVisible.
  1115. *
  1116. * Mac OS X threading:
  1117. * Not thread safe
  1118. *
  1119. * Parameters:
  1120. *
  1121. * inView:
  1122. * The view whose visibility you wish to determine.
  1123. *
  1124. * Result:
  1125. * A boolean value indicating whether the view is visible (true) or
  1126. * hidden (false).
  1127. *
  1128. * Availability:
  1129. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  1130. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1131. * Non-Carbon CFM: not available
  1132. }
  1133. function HIViewIsVisible( inView: HIViewRef ): Boolean; external name '_HIViewIsVisible';
  1134. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1135. {
  1136. * HIViewIsLatentlyVisible()
  1137. *
  1138. * Summary:
  1139. * Returns whether or not a view is latently visible.
  1140. *
  1141. * Discussion:
  1142. * The view's visibility is also affected by the visibility of its
  1143. * parents; if any parent view is invisible, this view is considered
  1144. * invisible as well. HIViewIsLatentlyVisible returns whether a view
  1145. * is latently visible, even if its parents are invisible.
  1146. *
  1147. * Mac OS X threading:
  1148. * Not thread safe
  1149. *
  1150. * Parameters:
  1151. *
  1152. * inView:
  1153. * The view whose latent visibility is to be checked.
  1154. *
  1155. * Result:
  1156. * True if the view is latently visible, otherwise false.
  1157. *
  1158. * Availability:
  1159. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1160. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1161. * Non-Carbon CFM: not available
  1162. }
  1163. function HIViewIsLatentlyVisible( inView: HIViewRef ): Boolean; external name '_HIViewIsLatentlyVisible';
  1164. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1165. {
  1166. * HIViewSetHilite()
  1167. *
  1168. * Summary:
  1169. * Changes the highlighting of a view.
  1170. *
  1171. * Mac OS X threading:
  1172. * Not thread safe
  1173. *
  1174. * Parameters:
  1175. *
  1176. * inView:
  1177. * The view on which to set the highlight.
  1178. *
  1179. * inHilitePart:
  1180. * An HIViewPartCode indicating the part of the view to highlight.
  1181. *
  1182. * Result:
  1183. * A result code indicating success or failure.
  1184. *
  1185. * Availability:
  1186. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1187. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1188. * Non-Carbon CFM: not available
  1189. }
  1190. function HIViewSetHilite( inView: HIViewRef; inHilitePart: HIViewPartCode ): OSStatus; external name '_HIViewSetHilite';
  1191. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1192. {
  1193. * HIViewIsActive()
  1194. *
  1195. * Summary:
  1196. * Returns whether or not a view is active.
  1197. *
  1198. * Discussion:
  1199. * The view's active state is also affected by the active state of
  1200. * its parents; if any parent view is inactive, this view is
  1201. * considered inactive as well. HIViewIsActive can optionally check
  1202. * to see if a view is latently active, even if its parents are
  1203. * inactive.
  1204. *
  1205. * Mac OS X threading:
  1206. * Not thread safe
  1207. *
  1208. * Parameters:
  1209. *
  1210. * inView:
  1211. * The view whose active state is to be checked.
  1212. *
  1213. * outIsLatentActive:
  1214. * A pointer to a Boolean to be filled in with the latent active
  1215. * state of the view. The Boolean is set to true if the view is
  1216. * latently active, otherwise false. Can be NULL.
  1217. *
  1218. * Result:
  1219. * True if the view is active, otherwise false.
  1220. *
  1221. * Availability:
  1222. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1223. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1224. * Non-Carbon CFM: not available
  1225. }
  1226. function HIViewIsActive( inView: HIViewRef; outIsLatentActive: BooleanPtr { can be NULL } ): Boolean; external name '_HIViewIsActive';
  1227. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1228. {
  1229. * HIViewSetActivated()
  1230. *
  1231. * Summary:
  1232. * Sets whether or not a view is active or inactive. If any children
  1233. * of the view have a latent active state, they will be adjusted
  1234. * accordingly.
  1235. *
  1236. * Mac OS X threading:
  1237. * Not thread safe
  1238. *
  1239. * Parameters:
  1240. *
  1241. * inView:
  1242. * The view to activate or deactivate.
  1243. *
  1244. * inSetActivated:
  1245. * True if setting the view to active, false if setting the view
  1246. * to inactive.
  1247. *
  1248. * Result:
  1249. * A result code indicating success or failure.
  1250. *
  1251. * Availability:
  1252. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1253. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1254. * Non-Carbon CFM: not available
  1255. }
  1256. function HIViewSetActivated( inView: HIViewRef; inSetActivated: Boolean ): OSStatus; external name '_HIViewSetActivated';
  1257. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1258. {
  1259. * HIViewIsEnabled()
  1260. *
  1261. * Summary:
  1262. * Tests whether or not a view is enabled.
  1263. *
  1264. * Discussion:
  1265. * The view's enabled state is also affected by the enabled state of
  1266. * its parents; if any parent view is disabled, this view is
  1267. * considered disabled as well. HIViewIsEnabled can optionally check
  1268. * to see if a view is latently enabled, even if its parents are
  1269. * disabled.
  1270. *
  1271. * Mac OS X threading:
  1272. * Not thread safe
  1273. *
  1274. * Parameters:
  1275. *
  1276. * inView:
  1277. * The view to test.
  1278. *
  1279. * outIsLatentEnabled:
  1280. * A pointer to a Boolean to be filled in with the latent enabled
  1281. * state of the view. The Boolean is set to true if the view is
  1282. * latently enabled, otherwise false. Can be NULL.
  1283. *
  1284. * Result:
  1285. * True if the view is enabled, otherwise false.
  1286. *
  1287. * Availability:
  1288. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1289. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1290. * Non-Carbon CFM: not available
  1291. }
  1292. function HIViewIsEnabled( inView: HIViewRef; outIsLatentEnabled: BooleanPtr { can be NULL } ): Boolean; external name '_HIViewIsEnabled';
  1293. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1294. {
  1295. * HIViewSetEnabled()
  1296. *
  1297. * Summary:
  1298. * Sets whether or not a view (and any subviews) are enabled or
  1299. * disabled.
  1300. *
  1301. * Mac OS X threading:
  1302. * Not thread safe
  1303. *
  1304. * Parameters:
  1305. *
  1306. * inView:
  1307. * The view to enable or disable.
  1308. *
  1309. * inSetEnabled:
  1310. * True if setting the view to enabled, false if setting the view
  1311. * to disabled.
  1312. *
  1313. * Result:
  1314. * A result code indicating success or failure.
  1315. *
  1316. * Availability:
  1317. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1318. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1319. * Non-Carbon CFM: not available
  1320. }
  1321. function HIViewSetEnabled( inView: HIViewRef; inSetEnabled: Boolean ): OSStatus; external name '_HIViewSetEnabled';
  1322. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1323. {
  1324. * HIViewIsCompositingEnabled()
  1325. *
  1326. * Summary:
  1327. * Returns whether a view is being used in a compositing hierarchy.
  1328. *
  1329. * Discussion:
  1330. * A view that supports both compositing mode and non-compositing
  1331. * mode can use this routine to determine which mode it is currently
  1332. * running in. Looking for a window's kWindowCompositingAttribute is
  1333. * not sufficient, since some windows with that attribute have some
  1334. * of its views in non-compositing mode and vice-versa.
  1335. *
  1336. * Mac OS X threading:
  1337. * Not thread safe
  1338. *
  1339. * Parameters:
  1340. *
  1341. * inView:
  1342. * The view whose compositing state you wish to determine.
  1343. *
  1344. * Result:
  1345. * A boolean value indicating whether the view is in compositing
  1346. * mode (true) or non-compositing mode (false).
  1347. *
  1348. * Availability:
  1349. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1350. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1351. * Non-Carbon CFM: not available
  1352. }
  1353. function HIViewIsCompositingEnabled( inView: HIViewRef ): Boolean; external name '_HIViewIsCompositingEnabled';
  1354. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1355. {
  1356. * HIViewSetText()
  1357. *
  1358. * Summary:
  1359. * Sets the text of a view to the specified string.
  1360. *
  1361. * Discussion:
  1362. * The "text" of the view is the text that will be displayed when
  1363. * drawing the view. This API first attempts to set the view's text
  1364. * (generally successful on views that handle the
  1365. * kControlEditTextCFStringTag SetControlData tag). If the attempt
  1366. * is unsuccessful, the view's title is set instead.
  1367. *
  1368. * Mac OS X threading:
  1369. * Not thread safe
  1370. *
  1371. * Parameters:
  1372. *
  1373. * inView:
  1374. * The view whose text is being set.
  1375. *
  1376. * inText:
  1377. * The text to set for the view. The string is copied by the view,
  1378. * and may be released by the caller afterwards.
  1379. *
  1380. * Result:
  1381. * A result code indicating success or failure.
  1382. *
  1383. * Availability:
  1384. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1385. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1386. * Non-Carbon CFM: not available
  1387. }
  1388. function HIViewSetText( inView: HIViewRef; inText: CFStringRef ): OSStatus; external name '_HIViewSetText';
  1389. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1390. {
  1391. * HIViewCopyText()
  1392. *
  1393. * Summary:
  1394. * Makes a copy of the view's text as a CFString.
  1395. *
  1396. * Discussion:
  1397. * The "text" of the view is the text that will be displayed when
  1398. * drawing the view. This API first attempts to get the view's text
  1399. * (generally successful on views that handle the
  1400. * kControlEditTextCFStringTag GetControlData tag). If the attempt
  1401. * is unsuccessful, the view's title is copied instead.
  1402. *
  1403. * Mac OS X threading:
  1404. * Not thread safe
  1405. *
  1406. * Parameters:
  1407. *
  1408. * inView:
  1409. * The view for which to get the text.
  1410. *
  1411. * Result:
  1412. * A CFStringRef containing a copy of the view's text. The caller of
  1413. * HIViewCopyText is responsible for releasing the returned text.
  1414. *
  1415. * Availability:
  1416. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1417. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1418. * Non-Carbon CFM: not available
  1419. }
  1420. function HIViewCopyText( inView: HIViewRef ): CFStringRef; external name '_HIViewCopyText';
  1421. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1422. {
  1423. * HIViewGetValue()
  1424. *
  1425. * Summary:
  1426. * Gets a view's value.
  1427. *
  1428. * Mac OS X threading:
  1429. * Not thread safe
  1430. *
  1431. * Parameters:
  1432. *
  1433. * inView:
  1434. * The view for which to get the value.
  1435. *
  1436. * Result:
  1437. * The view's value.
  1438. *
  1439. * Availability:
  1440. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1441. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1442. * Non-Carbon CFM: not available
  1443. }
  1444. function HIViewGetValue( inView: HIViewRef ): SInt32; external name '_HIViewGetValue';
  1445. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1446. {
  1447. * HIViewSetValue()
  1448. *
  1449. * Summary:
  1450. * Sets a view's value.
  1451. *
  1452. * Mac OS X threading:
  1453. * Not thread safe
  1454. *
  1455. * Parameters:
  1456. *
  1457. * inView:
  1458. * The view whose value is to be set.
  1459. *
  1460. * inValue:
  1461. * The new value.
  1462. *
  1463. * Result:
  1464. * A result code indicating success or failure.
  1465. *
  1466. * Availability:
  1467. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1468. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1469. * Non-Carbon CFM: not available
  1470. }
  1471. function HIViewSetValue( inView: HIViewRef; inValue: SInt32 ): OSStatus; external name '_HIViewSetValue';
  1472. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1473. {
  1474. * HIViewGetMinimum()
  1475. *
  1476. * Summary:
  1477. * Gets a view's minimum value.
  1478. *
  1479. * Mac OS X threading:
  1480. * Not thread safe
  1481. *
  1482. * Parameters:
  1483. *
  1484. * inView:
  1485. * The view for which to get the minimum value.
  1486. *
  1487. * Result:
  1488. * The view's minimum value.
  1489. *
  1490. * Availability:
  1491. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1492. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1493. * Non-Carbon CFM: not available
  1494. }
  1495. function HIViewGetMinimum( inView: HIViewRef ): SInt32; external name '_HIViewGetMinimum';
  1496. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1497. {
  1498. * HIViewSetMinimum()
  1499. *
  1500. * Summary:
  1501. * Sets a view's minimum value.
  1502. *
  1503. * Mac OS X threading:
  1504. * Not thread safe
  1505. *
  1506. * Parameters:
  1507. *
  1508. * inView:
  1509. * The view whose minimum value is to be set.
  1510. *
  1511. * inMinimum:
  1512. * The new minimum value.
  1513. *
  1514. * Result:
  1515. * A result code indicating success or failure.
  1516. *
  1517. * Availability:
  1518. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1519. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1520. * Non-Carbon CFM: not available
  1521. }
  1522. function HIViewSetMinimum( inView: HIViewRef; inMinimum: SInt32 ): OSStatus; external name '_HIViewSetMinimum';
  1523. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1524. {
  1525. * HIViewGetMaximum()
  1526. *
  1527. * Summary:
  1528. * Gets a view's maximum value.
  1529. *
  1530. * Mac OS X threading:
  1531. * Not thread safe
  1532. *
  1533. * Parameters:
  1534. *
  1535. * inView:
  1536. * The view for which to get the maximum value.
  1537. *
  1538. * Result:
  1539. * The view's maximum value.
  1540. *
  1541. * Availability:
  1542. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1543. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1544. * Non-Carbon CFM: not available
  1545. }
  1546. function HIViewGetMaximum( inView: HIViewRef ): SInt32; external name '_HIViewGetMaximum';
  1547. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1548. {
  1549. * HIViewSetMaximum()
  1550. *
  1551. * Summary:
  1552. * Sets a view's maximum value.
  1553. *
  1554. * Mac OS X threading:
  1555. * Not thread safe
  1556. *
  1557. * Parameters:
  1558. *
  1559. * inView:
  1560. * The view whose maximum value is to be set.
  1561. *
  1562. * inMaximum:
  1563. * The new maximum value.
  1564. *
  1565. * Result:
  1566. * A result code indicating success or failure.
  1567. *
  1568. * Availability:
  1569. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1570. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1571. * Non-Carbon CFM: not available
  1572. }
  1573. function HIViewSetMaximum( inView: HIViewRef; inMaximum: SInt32 ): OSStatus; external name '_HIViewSetMaximum';
  1574. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1575. {
  1576. * HIViewGetViewSize()
  1577. *
  1578. * Summary:
  1579. * Gets a view's view size.
  1580. *
  1581. * Discussion:
  1582. * The view size is the size of the content to which a view's
  1583. * display is proportioned. Most commonly used to set the
  1584. * proportional size of a scroll bar's thumb indicator.
  1585. *
  1586. * Mac OS X threading:
  1587. * Not thread safe
  1588. *
  1589. * Parameters:
  1590. *
  1591. * inView:
  1592. * The view for which to get the view size.
  1593. *
  1594. * Result:
  1595. * The view size.
  1596. *
  1597. * Availability:
  1598. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1599. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1600. * Non-Carbon CFM: not available
  1601. }
  1602. function HIViewGetViewSize( inView: HIViewRef ): SInt32; external name '_HIViewGetViewSize';
  1603. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1604. {
  1605. * HIViewSetViewSize()
  1606. *
  1607. * Summary:
  1608. * Sets a view's view size.
  1609. *
  1610. * Discussion:
  1611. * The view size is the size of the content to which a view's
  1612. * display is proportioned. Most commonly used to set the
  1613. * proportional size of a scroll bar's thumb indicator.
  1614. *
  1615. * Mac OS X threading:
  1616. * Not thread safe
  1617. *
  1618. * Parameters:
  1619. *
  1620. * inView:
  1621. * The view whose view size is to be set.
  1622. *
  1623. * inViewSize:
  1624. * The new view size.
  1625. *
  1626. * Result:
  1627. * A result code indicating success or failure.
  1628. *
  1629. * Availability:
  1630. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1631. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1632. * Non-Carbon CFM: not available
  1633. }
  1634. function HIViewSetViewSize( inView: HIViewRef; inViewSize: SInt32 ): OSStatus; external name '_HIViewSetViewSize';
  1635. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1636. {
  1637. * HIViewIsValid()
  1638. *
  1639. * Summary:
  1640. * HIViewIsValid tests to see if the passed in view is a view that
  1641. * HIToolbox knows about. It does not sanity check the data in the
  1642. * view.
  1643. *
  1644. * Mac OS X threading:
  1645. * Not thread safe
  1646. *
  1647. * Parameters:
  1648. *
  1649. * inView:
  1650. * The view to test for validity.
  1651. *
  1652. * Result:
  1653. * True if the view is a valid view, otherwise, false.
  1654. *
  1655. * Availability:
  1656. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1657. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1658. * Non-Carbon CFM: not available
  1659. }
  1660. function HIViewIsValid( inView: HIViewRef ): Boolean; external name '_HIViewIsValid';
  1661. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1662. {
  1663. * HIViewSetID()
  1664. *
  1665. * Summary:
  1666. * Sets the HIViewID of a view.
  1667. *
  1668. * Mac OS X threading:
  1669. * Not thread safe
  1670. *
  1671. * Parameters:
  1672. *
  1673. * inView:
  1674. * The view for which to set the ID.
  1675. *
  1676. * inID:
  1677. * The ID to set on the view.
  1678. *
  1679. * Result:
  1680. * A result code indicating success or failure.
  1681. *
  1682. * Availability:
  1683. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1684. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1685. * Non-Carbon CFM: not available
  1686. }
  1687. function HIViewSetID( inView: HIViewRef; inID: HIViewID ): OSStatus; external name '_HIViewSetID';
  1688. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1689. {
  1690. * HIViewGetID()
  1691. *
  1692. * Summary:
  1693. * Gets the HIViewID of a view.
  1694. *
  1695. * Mac OS X threading:
  1696. * Not thread safe
  1697. *
  1698. * Parameters:
  1699. *
  1700. * inView:
  1701. * The view for which to get the ID.
  1702. *
  1703. * outID:
  1704. * A pointer to an HIViewID to be filled with the view's ID.
  1705. *
  1706. * Result:
  1707. * A result code indicating success or failure.
  1708. *
  1709. * Availability:
  1710. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1711. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1712. * Non-Carbon CFM: not available
  1713. }
  1714. function HIViewGetID( inView: HIViewRef; var outID: HIViewID ): OSStatus; external name '_HIViewGetID';
  1715. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1716. {
  1717. * HIViewSetCommandID()
  1718. *
  1719. * Summary:
  1720. * Sets the command ID of a view.
  1721. *
  1722. * Mac OS X threading:
  1723. * Not thread safe
  1724. *
  1725. * Parameters:
  1726. *
  1727. * inView:
  1728. * The view for which to set the command ID.
  1729. *
  1730. * inCommandID:
  1731. * The command ID to set on the view.
  1732. *
  1733. * Result:
  1734. * A result code indicating success or failure.
  1735. *
  1736. * Availability:
  1737. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1738. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1739. * Non-Carbon CFM: not available
  1740. }
  1741. function HIViewSetCommandID( inView: HIViewRef; inCommandID: UInt32 ): OSStatus; external name '_HIViewSetCommandID';
  1742. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1743. {
  1744. * HIViewGetCommandID()
  1745. *
  1746. * Summary:
  1747. * Gets the command ID of a view.
  1748. *
  1749. * Mac OS X threading:
  1750. * Not thread safe
  1751. *
  1752. * Parameters:
  1753. *
  1754. * inView:
  1755. * The view for which to get the command ID.
  1756. *
  1757. * outCommandID:
  1758. * A pointer to a UInt32 to fill with the view's command id.
  1759. *
  1760. * Result:
  1761. * A result code indicating success or failure.
  1762. *
  1763. * Availability:
  1764. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1765. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1766. * Non-Carbon CFM: not available
  1767. }
  1768. function HIViewGetCommandID( inView: HIViewRef; var outCommandID: UInt32 ): OSStatus; external name '_HIViewGetCommandID';
  1769. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1770. {
  1771. * HIViewGetKind()
  1772. *
  1773. * Summary:
  1774. * Returns the kind of the given view.
  1775. *
  1776. * Mac OS X threading:
  1777. * Not thread safe
  1778. *
  1779. * Parameters:
  1780. *
  1781. * inView:
  1782. * The view whose kind to get.
  1783. *
  1784. * outViewKind:
  1785. * On successful exit, this will contain the view signature and
  1786. * kind. See ControlDefinitions.h or HIView.h for the kinds of
  1787. * each system view.
  1788. *
  1789. * Availability:
  1790. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1791. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1792. * Non-Carbon CFM: not available
  1793. }
  1794. function HIViewGetKind( inView: HIViewRef; var outViewKind: HIViewKind ): OSStatus; external name '_HIViewGetKind';
  1795. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1796. {==============================================================================}
  1797. { POSITIONING }
  1798. {==============================================================================}
  1799. {
  1800. * HIViewGetBounds()
  1801. *
  1802. * Discussion:
  1803. * Returns the local bounds of a view. The local bounds are the
  1804. * coordinate system that is completely view-relative. A view's top
  1805. * left coordinate starts out at 0, 0. Most operations are done in
  1806. * these local coordinates. Moving a view is done via the frame
  1807. * instead.
  1808. *
  1809. * Mac OS X threading:
  1810. * Not thread safe
  1811. *
  1812. * Parameters:
  1813. *
  1814. * inView:
  1815. * The view whose bounds you wish to determine.
  1816. *
  1817. * outRect:
  1818. * The local bounds of the view.
  1819. *
  1820. * Result:
  1821. * An operating system result code.
  1822. *
  1823. * Availability:
  1824. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  1825. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1826. * Non-Carbon CFM: not available
  1827. }
  1828. function HIViewGetBounds( inView: HIViewRef; var outRect: HIRect ): OSStatus; external name '_HIViewGetBounds';
  1829. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1830. {
  1831. * HIViewGetFrame()
  1832. *
  1833. * Discussion:
  1834. * Returns the frame of a view. The frame is the bounds of a view
  1835. * relative to its parent's local coordinate system.
  1836. *
  1837. * Mac OS X threading:
  1838. * Not thread safe
  1839. *
  1840. * Parameters:
  1841. *
  1842. * inView:
  1843. * The view whose frame you wish to determine.
  1844. *
  1845. * outRect:
  1846. * The frame of the view.
  1847. *
  1848. * Result:
  1849. * An operating system result code.
  1850. *
  1851. * Availability:
  1852. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  1853. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1854. * Non-Carbon CFM: not available
  1855. }
  1856. function HIViewGetFrame( inView: HIViewRef; var outRect: HIRect ): OSStatus; external name '_HIViewGetFrame';
  1857. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1858. {
  1859. * HIViewSetFrame()
  1860. *
  1861. * Discussion:
  1862. * Sets the frame of a view. This effectively moves the view within
  1863. * its parent. It also marks the view (and anything that was exposed
  1864. * behind it) to be redrawn.
  1865. *
  1866. * Mac OS X threading:
  1867. * Not thread safe
  1868. *
  1869. * Parameters:
  1870. *
  1871. * inView:
  1872. * The view whose frame you wish to change.
  1873. *
  1874. * inRect:
  1875. * The new frame of the view.
  1876. *
  1877. * Result:
  1878. * An operating system result code.
  1879. *
  1880. * Availability:
  1881. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  1882. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1883. * Non-Carbon CFM: not available
  1884. }
  1885. function HIViewSetFrame( inView: HIViewRef; const (*var*) inRect: HIRect ): OSStatus; external name '_HIViewSetFrame';
  1886. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1887. {
  1888. * HIViewMoveBy()
  1889. *
  1890. * Discussion:
  1891. * Moves a view by a certain distance, relative to its current
  1892. * location. This affects a view's frame, but not its bounds.
  1893. *
  1894. * Mac OS X threading:
  1895. * Not thread safe
  1896. *
  1897. * Parameters:
  1898. *
  1899. * inView:
  1900. * The view you wish to move.
  1901. *
  1902. * inDX:
  1903. * The horizontal distance to move the view. Negative values move
  1904. * the view to the left, positive values to the right.
  1905. *
  1906. * inDY:
  1907. * The vertical distance to move the view. Negative values move
  1908. * the view upward, positive values downward.
  1909. *
  1910. * Result:
  1911. * An operating system result code.
  1912. *
  1913. * Availability:
  1914. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  1915. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1916. * Non-Carbon CFM: not available
  1917. }
  1918. function HIViewMoveBy( inView: HIViewRef; inDX: CGFloat; inDY: CGFloat ): OSStatus; external name '_HIViewMoveBy';
  1919. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1920. {
  1921. * HIViewPlaceInSuperviewAt()
  1922. *
  1923. * Discussion:
  1924. * Places a view at an absolute location within its parent. This
  1925. * affects the view's frame, but not its bounds.
  1926. *
  1927. * Mac OS X threading:
  1928. * Not thread safe
  1929. *
  1930. * Parameters:
  1931. *
  1932. * inView:
  1933. * The view you wish to position.
  1934. *
  1935. * inX:
  1936. * The absolute horizontal coordinate at which to position the
  1937. * view.
  1938. *
  1939. * inY:
  1940. * The absolute vertical coordinate at which to position the view.
  1941. *
  1942. * Result:
  1943. * An operating system result code.
  1944. *
  1945. * Availability:
  1946. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  1947. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1948. * Non-Carbon CFM: not available
  1949. }
  1950. function HIViewPlaceInSuperviewAt( inView: HIViewRef; inX: CGFloat; inY: CGFloat ): OSStatus; external name '_HIViewPlaceInSuperviewAt';
  1951. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1952. {
  1953. * HIViewReshapeStructure()
  1954. *
  1955. * Discussion:
  1956. * This is for use by custom views. If a view decides that its
  1957. * structure will change shape, it should call this. This tells the
  1958. * Toolbox to recalc things and invalidate as appropriate. You might
  1959. * use this when gaining/losing a focus ring, for example.
  1960. *
  1961. * Mac OS X threading:
  1962. * Not thread safe
  1963. *
  1964. * Parameters:
  1965. *
  1966. * inView:
  1967. * The view to reshape and invalidate.
  1968. *
  1969. * Result:
  1970. * An operating system result code.
  1971. *
  1972. * Availability:
  1973. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  1974. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1975. * Non-Carbon CFM: not available
  1976. }
  1977. function HIViewReshapeStructure( inView: HIViewRef ): OSStatus; external name '_HIViewReshapeStructure';
  1978. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1979. {
  1980. * HIViewRegionChanged()
  1981. *
  1982. * Discussion:
  1983. * Allows a view to tell the view system that a region of itself has
  1984. * changed. The view system might choose to react in some way. For
  1985. * example, if a view's clickable region has changed, this can be
  1986. * called to tell the Toolbox to resync the region it uses for async
  1987. * window dragging, if enabled. Likewise, if a view's opaque region
  1988. * changes, we can adjust the window's opaque shape as well. When
  1989. * views are moved, resizes, this stuff is taken care of for you. So
  1990. * this only need be called when there's a change in your view that
  1991. * occurs outside of those times.
  1992. *
  1993. * Mac OS X threading:
  1994. * Not thread safe
  1995. *
  1996. * Parameters:
  1997. *
  1998. * inView:
  1999. * The view to deal with.
  2000. *
  2001. * inRegionCode:
  2002. * The region that was changed. This can only be the structure
  2003. * opaque, and clickable regions at present.
  2004. *
  2005. * Result:
  2006. * An operating system status code.
  2007. *
  2008. * Availability:
  2009. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  2010. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2011. * Non-Carbon CFM: not available
  2012. }
  2013. function HIViewRegionChanged( inView: HIViewRef; inRegionCode: HIViewPartCode ): OSStatus; external name '_HIViewRegionChanged';
  2014. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2015. {
  2016. * HIViewCopyShape()
  2017. *
  2018. * Summary:
  2019. * Copies the shape of a part of a view. See the discussion on
  2020. * meta-parts in this header for more information
  2021. *
  2022. * Mac OS X threading:
  2023. * Not thread safe
  2024. *
  2025. * Parameters:
  2026. *
  2027. * inView:
  2028. * The view for which to copy the shape.
  2029. *
  2030. * inPart:
  2031. * The part of the view whose shape is to be copied.
  2032. *
  2033. * outShape:
  2034. * On exit, contains a newly created shape. The caller of
  2035. * HIViewCopyShape is responsible for releasing the copied shape.
  2036. *
  2037. * Result:
  2038. * A result code indicating success or failure.
  2039. *
  2040. * Availability:
  2041. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  2042. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2043. * Non-Carbon CFM: not available
  2044. }
  2045. function HIViewCopyShape( inView: HIViewRef; inPart: HIViewPartCode; var outShape: HIShapeRef ): OSStatus; external name '_HIViewCopyShape';
  2046. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2047. {
  2048. * HIViewGetOptimalBounds()
  2049. *
  2050. * Summary:
  2051. * Obtain a view's optimal size and/or text placement.
  2052. *
  2053. * Mac OS X threading:
  2054. * Not thread safe
  2055. *
  2056. * Parameters:
  2057. *
  2058. * inView:
  2059. * The view to examine.
  2060. *
  2061. * outBounds:
  2062. * A pointer to an HIRect to be filled with the view's optimal
  2063. * bounds. Can be NULL.
  2064. *
  2065. * outBaseLineOffset:
  2066. * A pointer to a float to be filled with the view's optimal text
  2067. * placement. Can be NULL.
  2068. *
  2069. * Result:
  2070. * A result code indicating success or failure.
  2071. *
  2072. * Availability:
  2073. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  2074. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2075. * Non-Carbon CFM: not available
  2076. }
  2077. function HIViewGetOptimalBounds( inView: HIViewRef; outBounds: HIRectPtr { can be NULL }; outBaseLineOffset: CGFloatPtr { can be NULL } ): OSStatus; external name '_HIViewGetOptimalBounds';
  2078. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2079. {==============================================================================}
  2080. { TEXT AND FONT SUPPORT }
  2081. {==============================================================================}
  2082. {
  2083. * HIViewSetTextFont()
  2084. *
  2085. * Summary:
  2086. * Set the font that the control will use. NULL will specify the
  2087. * default value.
  2088. *
  2089. * Mac OS X threading:
  2090. * Not thread safe
  2091. *
  2092. * Parameters:
  2093. *
  2094. * inView:
  2095. * The view whose font is to be modified.
  2096. *
  2097. * inPart:
  2098. * The part whose font is to be modified.
  2099. *
  2100. * inFont:
  2101. * The font that the view should use to draw its text. The font
  2102. * will be retained by the view. If NULL, the view will revert to
  2103. * the default font.
  2104. *
  2105. * Result:
  2106. * An operating system status code.
  2107. *
  2108. * Availability:
  2109. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  2110. * CarbonLib: not available
  2111. * Non-Carbon CFM: not available
  2112. }
  2113. function HIViewSetTextFont( inView: HIViewRef; inPart: HIViewPartCode; inFont: CTFontRef { can be NULL } ): OSStatus; external name '_HIViewSetTextFont';
  2114. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2115. {
  2116. * HIViewSetTextHorizontalFlush()
  2117. *
  2118. * Summary:
  2119. * Set the horizontal flushness of the view's text.
  2120. *
  2121. * Mac OS X threading:
  2122. * Not thread safe
  2123. *
  2124. * Parameters:
  2125. *
  2126. * inView:
  2127. * The view whose flushness is to be modified.
  2128. *
  2129. * inPart:
  2130. * The part whose flushness is to be modified.
  2131. *
  2132. * inHFlush:
  2133. * The horizontal flush that the view's text will be drawn with.
  2134. * kHIThemeTextHorizontalFlushDefault will revert to the default
  2135. * flush for the view.
  2136. *
  2137. * Result:
  2138. * An operating system status code.
  2139. *
  2140. * Availability:
  2141. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  2142. * CarbonLib: not available
  2143. * Non-Carbon CFM: not available
  2144. }
  2145. function HIViewSetTextHorizontalFlush( inView: HIViewRef; inPart: HIViewPartCode; inHFlush: HIThemeTextHorizontalFlush ): OSStatus; external name '_HIViewSetTextHorizontalFlush';
  2146. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2147. {
  2148. * HIViewSetTextVerticalFlush()
  2149. *
  2150. * Summary:
  2151. * Set the vertical flushness of the view's text.
  2152. *
  2153. * Mac OS X threading:
  2154. * Not thread safe
  2155. *
  2156. * Parameters:
  2157. *
  2158. * inView:
  2159. * The view whose flushness is to be modified.
  2160. *
  2161. * inPart:
  2162. * The part whose flushness is to be modified.
  2163. *
  2164. * inVFlush:
  2165. * The vertical flush that the view's text will be drawn with.
  2166. * kHIThemeTextVerticalFlushDefault will revert to the default
  2167. * flush for the view.
  2168. *
  2169. * Result:
  2170. * An operating system status code.
  2171. *
  2172. * Availability:
  2173. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  2174. * CarbonLib: not available
  2175. * Non-Carbon CFM: not available
  2176. }
  2177. function HIViewSetTextVerticalFlush( inView: HIViewRef; inPart: HIViewPartCode; inVFlush: HIThemeTextVerticalFlush ): OSStatus; external name '_HIViewSetTextVerticalFlush';
  2178. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2179. {
  2180. * HIViewSetTextTruncation()
  2181. *
  2182. * Summary:
  2183. * Sets how the view's text will truncate.
  2184. *
  2185. * Mac OS X threading:
  2186. * Not thread safe
  2187. *
  2188. * Parameters:
  2189. *
  2190. * inView:
  2191. * The view whose truncation is to be modified.
  2192. *
  2193. * inPart:
  2194. * The part whose truncation is to be modified.
  2195. *
  2196. * inTrunc:
  2197. * How the view's text will be truncated if it doesn't fit within
  2198. * the available label space. kHIThemeTextTruncationDefault will
  2199. * revert to the default truncation for the view.
  2200. *
  2201. * Result:
  2202. * An operating system status code.
  2203. *
  2204. * Availability:
  2205. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  2206. * CarbonLib: not available
  2207. * Non-Carbon CFM: not available
  2208. }
  2209. function HIViewSetTextTruncation( inView: HIViewRef; inPart: HIViewPartCode; inTrunc: HIThemeTextTruncation ): OSStatus; external name '_HIViewSetTextTruncation';
  2210. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2211. {
  2212. * HIViewGetThemeTextInfo()
  2213. *
  2214. * Summary:
  2215. * Gets the HIThemeTextInfo structure that is used to draw the
  2216. * view's text.
  2217. *
  2218. * Discussion:
  2219. * This function returns the HIThemeTextInfo structure that will be
  2220. * used for drawing the view's text. All of the fields will be
  2221. * concrete values, they will not contain constants of the form
  2222. * HIThemeTextFooDefault. You will be unable to determine if the
  2223. * view is using the default values using this API. This API is
  2224. * useful if you need to draw a text item using the same font and
  2225. * attributes that the view's text is drawing with.
  2226. *
  2227. * Mac OS X threading:
  2228. * Not thread safe
  2229. *
  2230. * Parameters:
  2231. *
  2232. * inView:
  2233. * The view whose text information is to be queried.
  2234. *
  2235. * inPart:
  2236. * The part whose text information is to be queried.
  2237. *
  2238. * inVersion:
  2239. * The version of the HIThemeTextInfo structure that is being
  2240. * passed in. This is important for future compatibility with
  2241. * different versions of the HIThemeTextInfo structure. Currently
  2242. * this must be version 1.
  2243. *
  2244. * outTextInfo:
  2245. * A pointer to an HIThemeTextInfo structure whose version is
  2246. * given in the inVersion parameter.
  2247. *
  2248. * Result:
  2249. * An operating system status code.
  2250. *
  2251. * Availability:
  2252. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  2253. * CarbonLib: not available
  2254. * Non-Carbon CFM: not available
  2255. }
  2256. function HIViewGetThemeTextInfo( inView: HIViewRef; inPart: HIViewPartCode; inVersion: UInt32; var outTextInfo: HIThemeTextInfo ): OSStatus; external name '_HIViewGetThemeTextInfo';
  2257. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2258. {==============================================================================}
  2259. { HIT TESTING/EVENT HANDLING }
  2260. {==============================================================================}
  2261. {
  2262. * HIViewGetViewForMouseEvent()
  2263. *
  2264. * Discussion:
  2265. * Returns the appropriate view to handle a mouse event. This is a
  2266. * little higher-level than HIViewGetSubviewHit. This routine will
  2267. * find the deepest view that should handle the mouse event, but
  2268. * along the way, it sends Carbon Events to each view asking it to
  2269. * return the appropriate subview. This allows parent views to catch
  2270. * clicks on their subviews. This is the recommended function to use
  2271. * before processing mouse events. Using one of the more primitive
  2272. * functions may result in an undefined behavior. In general we
  2273. * recommend the use of the Standard Window Handler instead of
  2274. * calling this function yourself.
  2275. *
  2276. * Mac OS X threading:
  2277. * Not thread safe
  2278. *
  2279. * Parameters:
  2280. *
  2281. * inView:
  2282. * The view to start from. You should pass the window's root view.
  2283. *
  2284. * inEvent:
  2285. * The mouse event in question.
  2286. *
  2287. * outView:
  2288. * The view that the mouse event should be sent to.
  2289. *
  2290. * Result:
  2291. * An operating system result code.
  2292. *
  2293. * Availability:
  2294. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  2295. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2296. * Non-Carbon CFM: not available
  2297. }
  2298. function HIViewGetViewForMouseEvent( inView: HIViewRef; inEvent: EventRef; var outView: HIViewRef ): OSStatus; external name '_HIViewGetViewForMouseEvent';
  2299. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2300. {
  2301. * HIViewClick()
  2302. *
  2303. * Discussion:
  2304. * After a successful call to HIViewGetViewForMouseEvent for a mouse
  2305. * down event, you should call this function to have the view handle
  2306. * the click. In general we recommend the use of the Standard Window
  2307. * Handler instead of calling this function yourself.
  2308. *
  2309. * Mac OS X threading:
  2310. * Not thread safe
  2311. *
  2312. * Parameters:
  2313. *
  2314. * inView:
  2315. * The view to handle the event.
  2316. *
  2317. * inEvent:
  2318. * The mouse event to handle.
  2319. *
  2320. * Result:
  2321. * An operating system result code.
  2322. *
  2323. * Availability:
  2324. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  2325. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2326. * Non-Carbon CFM: not available
  2327. }
  2328. function HIViewClick( inView: HIViewRef; inEvent: EventRef ): OSStatus; external name '_HIViewClick';
  2329. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2330. {
  2331. * HIViewSimulateClick()
  2332. *
  2333. * Discussion:
  2334. * This function is used to simulate a mouse click on a given view.
  2335. * It sends a kEventControlSimulateHit event to the specified view,
  2336. * and also sends kEventControlHit and (if the Hit event is not
  2337. * handled) kEventCommandProcess events.
  2338. *
  2339. * Note that not all windows will respond to the events that are
  2340. * sent by this API. A fully Carbon-event-based window most likely
  2341. * will respond exactly as if the user had really clicked in the
  2342. * view. A window that is handled using classic EventRecord-based
  2343. * APIs (WaitNextEvent or ModalDialog) will typically not respond at
  2344. * all; to simulate a click in such a window, you may need to post a
  2345. * mouse-down/mouse-up pair, or use a Dialog Manager event filter
  2346. * proc to simulate a hit in a dialog item.
  2347. *
  2348. * Mac OS X threading:
  2349. * Not thread safe
  2350. *
  2351. * Parameters:
  2352. *
  2353. * inView:
  2354. * The view to test the part hit.
  2355. *
  2356. * inPartToClick:
  2357. * The part the view should consider to be clicked.
  2358. *
  2359. * inModifiers:
  2360. * The modifiers the view can consider for its click action.
  2361. *
  2362. * outPartClicked:
  2363. * The part that was hit, can be kHIViewNoPart if no action
  2364. * occurred. May be NULL if you don't need the part code returned.
  2365. *
  2366. * Result:
  2367. * An operating system result code.
  2368. *
  2369. * Availability:
  2370. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  2371. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2372. * Non-Carbon CFM: not available
  2373. }
  2374. function HIViewSimulateClick( inView: HIViewRef; inPartToClick: HIViewPartCode; inModifiers: UInt32; outPartClicked: HIViewPartCodePtr { can be NULL } ): OSStatus; external name '_HIViewSimulateClick';
  2375. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2376. {
  2377. * HIViewGetPartHit()
  2378. *
  2379. * Discussion:
  2380. * Given a view, and a view-relative point, this function returns
  2381. * the part code hit as determined by the view.
  2382. *
  2383. * Mac OS X threading:
  2384. * Not thread safe
  2385. *
  2386. * Parameters:
  2387. *
  2388. * inView:
  2389. * The view to test the part hit.
  2390. *
  2391. * inPoint:
  2392. * The view-relative point to use.
  2393. *
  2394. * outPart:
  2395. * The part hit by inPoint.
  2396. *
  2397. * Result:
  2398. * An operating system result code.
  2399. *
  2400. * Availability:
  2401. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  2402. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2403. * Non-Carbon CFM: not available
  2404. }
  2405. function HIViewGetPartHit( inView: HIViewRef; const (*var*) inPoint: HIPoint; var outPart: HIViewPartCode ): OSStatus; external name '_HIViewGetPartHit';
  2406. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2407. {
  2408. * HIViewGetSubviewHit()
  2409. *
  2410. * Discussion:
  2411. * Returns the child of the given view hit by the point passed in.
  2412. * This is more primitive than using HIViewGetViewForMouseEvent, and
  2413. * should be used only in non-event-handling cases.
  2414. *
  2415. * Mac OS X threading:
  2416. * Not thread safe
  2417. *
  2418. * Parameters:
  2419. *
  2420. * inView:
  2421. * The view you wish to start from.
  2422. *
  2423. * inPoint:
  2424. * The mouse coordinate to use. This is passed in the local
  2425. * coordinate system of inView.
  2426. *
  2427. * inDeep:
  2428. * Pass true to find the deepest child hit, false to go only one
  2429. * level deep (just check direct children of inView).
  2430. *
  2431. * outView:
  2432. * The view hit by inPoint, or NULL if no subview was hit.
  2433. *
  2434. * Result:
  2435. * An operating system result code.
  2436. *
  2437. * Availability:
  2438. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  2439. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2440. * Non-Carbon CFM: not available
  2441. }
  2442. function HIViewGetSubviewHit( inView: HIViewRef; const (*var*) inPoint: HIPoint; inDeep: Boolean; var outView: HIViewRef ): OSStatus; external name '_HIViewGetSubviewHit';
  2443. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2444. {
  2445. * HIViewTrackMouseLocation()
  2446. *
  2447. * Summary:
  2448. * An HIView-based version of TrackMouseLocationWithOptions.
  2449. *
  2450. * Discussion:
  2451. * This routine is similar to TrackMouseLocationWithOptions
  2452. * described in CarbonEvents.i. Please read the notes on that
  2453. * function as well. HIViewTrackMouseLocation optionally returns the
  2454. * EventRef that ended the tracking loop, and the caller may extend
  2455. * the list of events that end the loop.
  2456. *
  2457. * Mac OS X threading:
  2458. * Not thread safe
  2459. *
  2460. * Parameters:
  2461. *
  2462. * inView:
  2463. * The HIViewRef in whose coordinate space to return the mouse
  2464. * position.
  2465. *
  2466. * inOptions:
  2467. * Pass kTrackMouseLocationOptionDontConsumeMouseUp to indicate
  2468. * that the toolbox should leave mouse-up events in the queue.
  2469. * Pass kTrackMouseLocationOptionIncludeScrollWheel to indicate
  2470. * that the tracking loop should terminate when a
  2471. * kEventMouseWheelMoved or kEventMouseScroll event is received.
  2472. *
  2473. * inTimeout:
  2474. * The amount of time to wait for an event. If no events arrive
  2475. * within this time, kMouseTrackingTimedOut is returned in
  2476. * outResult. Pass kEventDurationForever to wait indefinitely for
  2477. * the next event.
  2478. *
  2479. * inClientEventCount:
  2480. * Number of caller-supplied EventTypeSpecs in the
  2481. * inClientEventList parameter. Pass 0 if you do not want any
  2482. * custom event types to end the tracking loop.
  2483. *
  2484. * inClientEventList:
  2485. * Array of caller-supplied EventTypeSpecs that the caller wants
  2486. * to end the tracking loop. Pass NULL if you do not want any
  2487. * custom event types to end the tracking loop.
  2488. *
  2489. * outWhere:
  2490. * On exit, this parameter receives the mouse location from the
  2491. * last mouse event that caused this function to exit. If a
  2492. * timeout or key modifiers changed event caused this function to
  2493. * exit, the current mouse position at the time is returned. The
  2494. * mouse position will be returned in the coordinate space of the
  2495. * specifed HIView.
  2496. *
  2497. * outModifiers:
  2498. * On exit, this parameter receives the most recent state of the
  2499. * keyboard modifiers. If a timeout caused this function to exit,
  2500. * the current keyboard modifiers at the time are returned. You
  2501. * may pass NULL if you don't need this information.
  2502. *
  2503. * outEvent:
  2504. * On exit, this parameter receives the EventRef that caused the
  2505. * function to exit. You may pass NULL if you don't need this
  2506. * information. The event will be NULL for mouse-tracking results
  2507. * that don't involve events, such as the timeout expiring. If the
  2508. * event is not NULL, you must release the event when you're done
  2509. * with it.
  2510. *
  2511. * outResult:
  2512. * On exit, this parameter receives a value representing what kind
  2513. * of event was received that cause the function to exit, such as
  2514. * kMouseTrackingMouseUp. If a caller-supplied EventTypeSpec ended
  2515. * the loop, kMouseTrackingClientEvent is returned.
  2516. *
  2517. * Availability:
  2518. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  2519. * CarbonLib: not available
  2520. * Non-Carbon CFM: not available
  2521. }
  2522. function HIViewTrackMouseLocation( inView: HIViewRef; inOptions: OptionBits; inTimeout: EventTimeout; inClientEventCount: ItemCount; inClientEventList: EventTypeSpecPtr { can be NULL }; var outWhere: HIPoint; outModifiers: UInt32Ptr { can be NULL }; outEvent: EventRefPtr { can be NULL }; var outResult: MouseTrackingResult ): OSStatus; external name '_HIViewTrackMouseLocation';
  2523. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2524. {
  2525. * HIViewTrackMouseShape()
  2526. *
  2527. * Summary:
  2528. * An HIView-based version of TrackMouseRegion.
  2529. *
  2530. * Discussion:
  2531. * This routine is similar to TrackMouseRegion described in
  2532. * CarbonEvents.i. Please read the notes on that function as well.
  2533. * HIViewTrackMouseShape optionally returns the EventRef that ended
  2534. * the tracking loop, and the caller may extend the list of events
  2535. * that end the loop.
  2536. *
  2537. * Mac OS X threading:
  2538. * Not thread safe
  2539. *
  2540. * Parameters:
  2541. *
  2542. * inView:
  2543. * The HIViewRef in whose coordinate space to return the mouse
  2544. * position.
  2545. *
  2546. * inShape:
  2547. * The shape to observe. This shape should be in the coordinates
  2548. * of the view specified in the inView parameter.
  2549. *
  2550. * ioWasInShape:
  2551. * On entry, this parameter should be set to true if the mouse is
  2552. * currently inside the shape passed in inShape, or false if the
  2553. * mouse is currently outside the shape. On exit, this parameter
  2554. * is updated to reflect the current reality; e.g., if the
  2555. * outResult parameter returns kMouseTrackingMouseExited,
  2556. * ioWasInShape will be set to false when this function exits.
  2557. * Because it is updated from within, you should only need to set
  2558. * this yourself before the first call to this function in your
  2559. * tracking loop. Typically, you should set this value to false
  2560. * initially, and HIViewTrackMouseShape will return immediately
  2561. * with kMouseTrackingMouseEntered if your guess was wrong.
  2562. *
  2563. * inOptions:
  2564. * Pass kTrackMouseLocationOptionDontConsumeMouseUp to indicate
  2565. * that the toolbox should leave mouse-up events in the queue.
  2566. * Pass kTrackMouseLocationOptionIncludeScrollWheel to indicate
  2567. * that the tracking loop should terminate when a
  2568. * kEventMouseWheelMoved or kEventMouseScroll event is received.
  2569. *
  2570. * inTimeout:
  2571. * The amount of time to wait for an event. If no events arrive
  2572. * within this time, kMouseTrackingTimedOut is returned in
  2573. * outResult. Pass kEventDurationForever to wait indefinitely for
  2574. * the next event.
  2575. *
  2576. * inClientEventCount:
  2577. * Number of caller-supplied EventTypeSpecs in the
  2578. * inClientEventList parameter. Pass 0 if you do not want any
  2579. * custom event types to end the tracking loop.
  2580. *
  2581. * inClientEventList:
  2582. * Array of caller-supplied EventTypeSpecs that the caller wants
  2583. * to end the tracking loop. Pass NULL if you do not want any
  2584. * custom event types to end the tracking loop.
  2585. *
  2586. * outModifiers:
  2587. * On exit, this parameter receives the most recent state of the
  2588. * keyboard modifiers. If a timeout caused this function to exit,
  2589. * the current keyboard modifiers at the time are returned. You
  2590. * may pass NULL if you don't need this information.
  2591. *
  2592. * outEvent:
  2593. * On exit, this parameter receives the EventRef that caused the
  2594. * function to exit. You may pass NULL if you don't need this
  2595. * information. The event will be NULL for mouse-tracking results
  2596. * that don't involve events, such as the timeout expiring. If the
  2597. * event is not NULL, you must release the event when you're done
  2598. * with it.
  2599. *
  2600. * outResult:
  2601. * On exit, this parameter receives a value representing what kind
  2602. * of event was received that cause the function to exit, such as
  2603. * kMouseTrackingMouseUp. If a caller-supplied EventTypeSpec ended
  2604. * the loop, kMouseTrackingClientEvent is returned.
  2605. *
  2606. * Availability:
  2607. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  2608. * CarbonLib: not available
  2609. * Non-Carbon CFM: not available
  2610. }
  2611. function HIViewTrackMouseShape( inView: HIViewRef; inShape: HIShapeRef; var ioWasInShape: Boolean; inOptions: OptionBits; inTimeout: EventTimeout; inClientEventCount: ItemCount; inClientEventList: EventTypeSpecPtr { can be NULL }; outModifiers: UInt32Ptr { can be NULL }; outEvent: EventRefPtr { can be NULL }; var outResult: MouseTrackingResult ): OSStatus; external name '_HIViewTrackMouseShape';
  2612. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2613. {==============================================================================}
  2614. { HIView-based tracking areas }
  2615. {==============================================================================}
  2616. {$endc} {not TARGET_CPU_64}
  2617. type
  2618. HIViewTrackingAreaRef = ^OpaqueHIViewTrackingAreaRef; { an opaque type }
  2619. OpaqueHIViewTrackingAreaRef = record end;
  2620. HIViewTrackingAreaRefPtr = ^HIViewTrackingAreaRef;
  2621. const
  2622. kEventParamHIViewTrackingArea = FourCharCode('ctra'); { typeHIViewTrackingAreaRef}
  2623. typeHIViewTrackingAreaRef = FourCharCode('ctra');
  2624. {
  2625. * kEventClassControl / kEventControlTrackingAreaEntered
  2626. *
  2627. * Summary:
  2628. * The mouse has entered a tracking area owned by your control.
  2629. *
  2630. * Discussion:
  2631. * If you have installed a mouse tracking area in your view, you
  2632. * will receive this event when the mouse enters that area. The
  2633. * tracking area reference is sent with the event. This event is
  2634. * sent only to the view, and is not propagated past it.
  2635. *
  2636. * Mac OS X threading:
  2637. * Not thread safe
  2638. *
  2639. * Parameters:
  2640. *
  2641. * --> kEventParamDirectObject (in, typeControlRef)
  2642. * The control that owns the tracking area and is receiving
  2643. * the event. This parameter is available on Mac OS X 10.5 and
  2644. * later.
  2645. *
  2646. * --> kEventParamHIViewTrackingArea (in, typeHIViewTrackingAreaRef)
  2647. * The tracking area that was entered.
  2648. *
  2649. * --> kEventParamKeyModifiers (in, typeUInt32)
  2650. * The keyboard modifiers that were in effect when the mouse
  2651. * entered.
  2652. *
  2653. * --> kEventParamMouseLocation (in, typeHIPoint)
  2654. * The location of the mouse in view coordinates.
  2655. *
  2656. * Availability:
  2657. * Mac OS X: in version 10.4 and later in Carbon.framework
  2658. * CarbonLib: not available
  2659. }
  2660. const
  2661. kEventControlTrackingAreaEntered = 23;
  2662. {
  2663. * kEventClassControl / kEventControlTrackingAreaExited
  2664. *
  2665. * Summary:
  2666. * The mouse has exited a tracking area owned by your control.
  2667. *
  2668. * Discussion:
  2669. * If you have installed a mouse tracking area in your view, you
  2670. * will receive this event when the mouse leaves that area. The
  2671. * tracking area reference is sent with the event. This event is
  2672. * sent only to the view, and is not propagated past it.
  2673. *
  2674. * Mac OS X threading:
  2675. * Not thread safe
  2676. *
  2677. * Parameters:
  2678. *
  2679. * --> kEventParamDirectObject (in, typeControlRef)
  2680. * The control that owns the tracking area and is receiving
  2681. * the event. This parameter is available on Mac OS X 10.5 and
  2682. * later.
  2683. *
  2684. * --> kEventParamHIViewTrackingArea (in, typeHIViewTrackingAreaRef)
  2685. * The tracking area that was entered.
  2686. *
  2687. * --> kEventParamKeyModifiers (in, typeUInt32)
  2688. * The keyboard modifiers that were in effect when the mouse
  2689. * left.
  2690. *
  2691. * --> kEventParamMouseLocation (in, typeHIPoint)
  2692. * The location of the mouse in view coordinates. This point
  2693. * may or may not lie on the boundary of the mouse region. It
  2694. * is merely where the mouse was relative to the view when the
  2695. * exit event was generated.
  2696. *
  2697. * Availability:
  2698. * Mac OS X: in version 10.4 and later in Carbon.framework
  2699. * CarbonLib: not available
  2700. }
  2701. const
  2702. kEventControlTrackingAreaExited = 24;
  2703. type
  2704. HIViewTrackingAreaID = UInt64;
  2705. HIViewTrackingAreaIDPtr = ^HIViewTrackingAreaID;
  2706. {$ifc not TARGET_CPU_64}
  2707. {
  2708. * HIViewNewTrackingArea()
  2709. *
  2710. * Summary:
  2711. * Creates a new tracking area for a view.
  2712. *
  2713. * Mac OS X threading:
  2714. * Not thread safe
  2715. *
  2716. * Parameters:
  2717. *
  2718. * inView:
  2719. * The view to create a tracking area for.
  2720. *
  2721. * inShape:
  2722. * The shape to use. Pass NULL to indicate the entire structure
  2723. * region of the view is to be used.
  2724. *
  2725. * inID:
  2726. * An identifier for this tracking area. This value is completely
  2727. * up to the view to define. Pass zero if you don't care.
  2728. *
  2729. * outRef:
  2730. * A reference to the newly created tracking area. This reference
  2731. * is NOT refcounted. The tracking area will be automatically
  2732. * destroyed when the view is destroyed; you do not need to
  2733. * destroy the tracking area yourself unless you want to remove it
  2734. * from the view before the view is destroyed. This parameter can
  2735. * be NULL in Mac OS X 10.5 or later if you don't need this
  2736. * information.
  2737. *
  2738. * Result:
  2739. * An operating system status code.
  2740. *
  2741. * Availability:
  2742. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  2743. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2744. * Non-Carbon CFM: not available
  2745. }
  2746. function HIViewNewTrackingArea( inView: HIViewRef; inShape: HIShapeRef { can be NULL }; inID: HIViewTrackingAreaID; outRef: HIViewTrackingAreaRefPtr { can be NULL } ): OSStatus; external name '_HIViewNewTrackingArea';
  2747. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2748. {
  2749. * HIViewChangeTrackingArea()
  2750. *
  2751. * Summary:
  2752. * Alters the shape of an existing tracking area.
  2753. *
  2754. * Mac OS X threading:
  2755. * Not thread safe
  2756. *
  2757. * Parameters:
  2758. *
  2759. * inArea:
  2760. * The area to change.
  2761. *
  2762. * inShape:
  2763. * The shape to use. Pass NULL to indicate the entire structure
  2764. * region of the view is to be used.
  2765. *
  2766. * Result:
  2767. * An operating system status code.
  2768. *
  2769. * Availability:
  2770. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  2771. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2772. * Non-Carbon CFM: not available
  2773. }
  2774. function HIViewChangeTrackingArea( inArea: HIViewTrackingAreaRef; inShape: HIShapeRef ): OSStatus; external name '_HIViewChangeTrackingArea';
  2775. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2776. {
  2777. * HIViewGetTrackingAreaID()
  2778. *
  2779. * Summary:
  2780. * Retrieves the HIViewTrackingAreaID of an existing tracking area.
  2781. * This value was set upon creation of the HIViewTrackingArea.
  2782. *
  2783. * Mac OS X threading:
  2784. * Not thread safe
  2785. *
  2786. * Parameters:
  2787. *
  2788. * inArea:
  2789. * The area whose HIViewTrackingAreaID to retrieve.
  2790. *
  2791. * outID:
  2792. * The HIViewTrackingAreaID for this tracking area.
  2793. *
  2794. * Result:
  2795. * An operating system status code.
  2796. *
  2797. * Availability:
  2798. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  2799. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2800. * Non-Carbon CFM: not available
  2801. }
  2802. function HIViewGetTrackingAreaID( inArea: HIViewTrackingAreaRef; var outID: HIViewTrackingAreaID ): OSStatus; external name '_HIViewGetTrackingAreaID';
  2803. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2804. {
  2805. * HIViewDisposeTrackingArea()
  2806. *
  2807. * Summary:
  2808. * Disposes an existing tracking area. The reference is considered
  2809. * to be invalid after calling this function. Note that all tracking
  2810. * areas attached to a view are automatically destroyed when the
  2811. * view is destroyed.
  2812. *
  2813. * Mac OS X threading:
  2814. * Not thread safe
  2815. *
  2816. * Parameters:
  2817. *
  2818. * inArea:
  2819. * The area to dispose.
  2820. *
  2821. * Result:
  2822. * An operating system status code.
  2823. *
  2824. * Availability:
  2825. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  2826. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2827. * Non-Carbon CFM: not available
  2828. }
  2829. function HIViewDisposeTrackingArea( inArea: HIViewTrackingAreaRef ): OSStatus; external name '_HIViewDisposeTrackingArea';
  2830. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2831. {==============================================================================}
  2832. { DISPLAY }
  2833. {==============================================================================}
  2834. {
  2835. * HIViewGetNeedsDisplay()
  2836. *
  2837. * Discussion:
  2838. * Returns true if the view passed in or any subview of it requires
  2839. * redrawing (i.e. part of it has been invalidated).
  2840. *
  2841. * Mac OS X threading:
  2842. * Not thread safe
  2843. *
  2844. * Parameters:
  2845. *
  2846. * inView:
  2847. * The view to inspect.
  2848. *
  2849. * Result:
  2850. * A boolean result code.
  2851. *
  2852. * Availability:
  2853. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  2854. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2855. * Non-Carbon CFM: not available
  2856. }
  2857. function HIViewGetNeedsDisplay( inView: HIViewRef ): Boolean; external name '_HIViewGetNeedsDisplay';
  2858. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2859. {
  2860. * HIViewSetNeedsDisplay()
  2861. *
  2862. * Discussion:
  2863. * Marks a view as needing to be completely redrawn, or completely
  2864. * valid. If the view is not visible, or is obscured completely by
  2865. * other views, no action is taken.
  2866. *
  2867. * Note that this API does not affect the state of subviews of this
  2868. * view. If you need to modify subview state, you should use either
  2869. * HIViewSetSubviewsNeedDisplayInShape on Mac OS X 10.5 and later,
  2870. * or iterate over subviews with HIViewGetFirstSubview and
  2871. * HIViewGetNextView.
  2872. *
  2873. * Mac OS X threading:
  2874. * Not thread safe
  2875. *
  2876. * Parameters:
  2877. *
  2878. * inView:
  2879. * The view to mark dirty.
  2880. *
  2881. * inNeedsDisplay:
  2882. * A boolean which indicates whether inView needs to be redrawn or
  2883. * not.
  2884. *
  2885. * Result:
  2886. * An operating system result code.
  2887. *
  2888. * Availability:
  2889. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  2890. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2891. * Non-Carbon CFM: not available
  2892. }
  2893. function HIViewSetNeedsDisplay( inView: HIViewRef; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplay';
  2894. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2895. {
  2896. * HIViewSetNeedsDisplayInRect()
  2897. *
  2898. * Discussion:
  2899. * Marks a portion of a view as needing to be redrawn, or valid. If
  2900. * the view is not visible, or is obscured completely by other
  2901. * views, no action is taken. The rectangle passed is effectively
  2902. * intersected with the view's visible region. It should be in
  2903. * view-relative coordinates.
  2904. *
  2905. * Note that this API does not affect the state of subviews of this
  2906. * view. If you need to modify subview state, you should use either
  2907. * HIViewSetSubviewsNeedDisplayInShape on Mac OS X 10.5 and later,
  2908. * or iterate over subviews with HIViewGetFirstSubview and
  2909. * HIViewGetNextView.
  2910. *
  2911. * Mac OS X threading:
  2912. * Not thread safe
  2913. *
  2914. * Parameters:
  2915. *
  2916. * inView:
  2917. * The view to mark dirty.
  2918. *
  2919. * inRect:
  2920. * The rectangle encompassing the area to mark dirty or clean.
  2921. *
  2922. * inNeedsDisplay:
  2923. * A boolean which indicates whether or not inRect should be added
  2924. * to the invalid region or removed from it.
  2925. *
  2926. * Result:
  2927. * An operating system result code.
  2928. *
  2929. * Availability:
  2930. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  2931. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2932. * Non-Carbon CFM: not available
  2933. }
  2934. function HIViewSetNeedsDisplayInRect( inView: HIViewRef; const (*var*) inRect: HIRect; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplayInRect';
  2935. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2936. {
  2937. * HIViewSetNeedsDisplayInShape()
  2938. *
  2939. * Discussion:
  2940. * Marks a portion of a view as needing to be redrawn, or valid. If
  2941. * the view is not visible, or is obscured completely by other
  2942. * views, no action is taken. The shape passed is effectively
  2943. * intersected with the view's visible region. It should be in
  2944. * view-relative coordinates.
  2945. *
  2946. * Note that this API does not affect the state of subviews of this
  2947. * view. If you need to modify subview state, you should use either
  2948. * HIViewSetSubviewsNeedDisplayInShape on Mac OS X 10.5 and later,
  2949. * or iterate over subviews with HIViewGetFirstSubview and
  2950. * HIViewGetNextView.
  2951. *
  2952. * Mac OS X threading:
  2953. * Not thread safe
  2954. *
  2955. * Parameters:
  2956. *
  2957. * inView:
  2958. * The view to mark dirty.
  2959. *
  2960. * inArea:
  2961. * The area to mark dirty or clean, in the coordinate system of
  2962. * the view. This parameter may be NULL in Mac OS X 10.5 and later
  2963. * to indicate that the entire view should be affected.
  2964. *
  2965. * inNeedsDisplay:
  2966. * A boolean which indicates whether or not inArea should be added
  2967. * to the invalid region or removed from it.
  2968. *
  2969. * Result:
  2970. * An operating system result code.
  2971. *
  2972. * Availability:
  2973. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  2974. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2975. * Non-Carbon CFM: not available
  2976. }
  2977. function HIViewSetNeedsDisplayInShape( inView: HIViewRef; inArea: HIShapeRef; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplayInShape';
  2978. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2979. {
  2980. * HIViewSetNeedsDisplayInRegion()
  2981. *
  2982. * Discussion:
  2983. * Marks a portion of a view as needing to be redrawn, or valid. If
  2984. * the view is not visible, or is obscured completely by other
  2985. * views, no action is taken. The region passed is effectively
  2986. * intersected with the view's visible region. It should be in
  2987. * view-relative coordinates.
  2988. *
  2989. * Note that this API does not affect the state of subviews of this
  2990. * view. If you need to modify subview state, you should use either
  2991. * HIViewSetSubviewsNeedDisplayInShape on Mac OS X 10.5 and later,
  2992. * or iterate over subviews with HIViewGetFirstSubview and
  2993. * HIViewGetNextView.
  2994. *
  2995. * Mac OS X threading:
  2996. * Not thread safe
  2997. *
  2998. * Parameters:
  2999. *
  3000. * inView:
  3001. * The view to mark dirty.
  3002. *
  3003. * inRgn:
  3004. * The region to mark dirty or clean.
  3005. *
  3006. * inNeedsDisplay:
  3007. * A boolean which indicates whether or not inRgn should be added
  3008. * to the invalid region or removed from it.
  3009. *
  3010. * Result:
  3011. * An operating system result code.
  3012. *
  3013. * Availability:
  3014. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3015. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3016. * Non-Carbon CFM: not available
  3017. }
  3018. function HIViewSetNeedsDisplayInRegion( inView: HIViewRef; inRgn: RgnHandle; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplayInRegion';
  3019. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3020. {
  3021. * HIViewSetSubviewsNeedDisplayInShape()
  3022. *
  3023. * Summary:
  3024. * Validates or invalidates a portion of a view and all of its
  3025. * subviews.
  3026. *
  3027. * Discussion:
  3028. * Marks a portion of a view as needing to be redrawn, or valid, and
  3029. * then does the same for each subview of the view. If the view or a
  3030. * subview is not visible, or is obscured completely by other views,
  3031. * no action is taken for that view. The shape passed is effectively
  3032. * intersected with each view's visible region. The shape should be
  3033. * in view-relative coordinates.
  3034. *
  3035. * Note! It is very rare that an application truly needs to
  3036. * invalidate a view and all of its subviews. Normally, when a view
  3037. * is invalidated, its subviews will be automatically redrawn by the
  3038. * HIView Manager after the parent view is redrawn, so it is not
  3039. * necessary to explicitly invalidate the subviews. (The only
  3040. * exception occurs when the parent view uses
  3041. * kHIViewFeatureDoesNotDraw; in that case, invalidating the parent
  3042. * view does nothing, and subviews are not invalidated or redrawn.)
  3043. * In most cases, if you think you need to use this API, you should
  3044. * probably consider whether all of the subviews need to redraw, or
  3045. * just some of them, and explicitly invalidate only those subviews
  3046. * that need to redraw. That will give you better performance than
  3047. * invalidating and redrawing every subview.
  3048. *
  3049. * Mac OS X threading:
  3050. * Not thread safe
  3051. *
  3052. * Parameters:
  3053. *
  3054. * inView:
  3055. * The view to mark dirty.
  3056. *
  3057. * inArea:
  3058. * The area to mark dirty or clean, in the coordinate system of
  3059. * the view. This parameter may be NULL to indicate that the
  3060. * entire view should be affected.
  3061. *
  3062. * inNeedsDisplay:
  3063. * A boolean which indicates whether or not inArea should be added
  3064. * to the invalid region or removed from it.
  3065. *
  3066. * Result:
  3067. * An operating system result code.
  3068. *
  3069. * Availability:
  3070. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  3071. * CarbonLib: not available
  3072. * Non-Carbon CFM: not available
  3073. }
  3074. function HIViewSetSubviewsNeedDisplayInShape( inView: HIViewRef; inArea: HIShapeRef; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetSubviewsNeedDisplayInShape';
  3075. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  3076. {
  3077. * HIViewRender()
  3078. *
  3079. * Discussion:
  3080. * Renders the invalid portions of a view (as marked with
  3081. * HIViewSetNeedsDisplay[InRegion]) immediately. Normally, these
  3082. * areas are redrawn at event loop time, but there might be
  3083. * situations where you need an immediate draw. Use this sparingly,
  3084. * as it does cause a fully composited draw for the area of the
  3085. * view; that is, all other views that intersect the area of the
  3086. * specified view will also be drawn. Calling this for several views
  3087. * at a particular level of a hierarchy can be costly. We highly
  3088. * recommend that you only pass the root view of a window to this
  3089. * API. The behavior of this API when passed a non-root view was
  3090. * poorly defined in Mac OS X 10.3 and has changed in Mac OS X 10.4.
  3091. * In 10.3, calling this API on a non-root view would entirely
  3092. * validate all of the views in the window that intersect the
  3093. * specified view, including portions that did not intersect the
  3094. * specified view and so were not actually drawn. In 10.4, calling
  3095. * this API on a non-root view will only validate those portions of
  3096. * each view that intersect the specified view.
  3097. *
  3098. * Mac OS X threading:
  3099. * Not thread safe
  3100. *
  3101. * Parameters:
  3102. *
  3103. * inView:
  3104. * The view to draw.
  3105. *
  3106. * Result:
  3107. * An operating system result code.
  3108. *
  3109. * Availability:
  3110. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  3111. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3112. * Non-Carbon CFM: not available
  3113. }
  3114. function HIViewRender( inView: HIViewRef ): OSStatus; external name '_HIViewRender';
  3115. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3116. {
  3117. * HIViewGetSizeConstraints()
  3118. *
  3119. * Discussion:
  3120. * Return the minimum and maximum size for a view. A view must
  3121. * respond to this protocol to get meaningful results. These sizes
  3122. * can be used to help autoposition subviews, for example.
  3123. *
  3124. * Mac OS X threading:
  3125. * Not thread safe
  3126. *
  3127. * Parameters:
  3128. *
  3129. * inView:
  3130. * The view to inspect.
  3131. *
  3132. * outMinSize:
  3133. * The minimum size the view can be. May be NULL if you don't need
  3134. * this information.
  3135. *
  3136. * outMaxSize:
  3137. * The maximum size the view can be. May be NULL if you don't need
  3138. * this information.
  3139. *
  3140. * Result:
  3141. * An operating system result code.
  3142. *
  3143. * Availability:
  3144. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3145. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3146. * Non-Carbon CFM: not available
  3147. }
  3148. function HIViewGetSizeConstraints( inView: HIViewRef; outMinSize: HISizePtr { can be NULL }; outMaxSize: HISizePtr { can be NULL } ): OSStatus; external name '_HIViewGetSizeConstraints';
  3149. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3150. {==============================================================================}
  3151. { COORDINATE SYSTEM CONVERSION }
  3152. {==============================================================================}
  3153. {
  3154. * HIViewConvertPoint()
  3155. *
  3156. * Discussion:
  3157. * Converts a point from one view to another. Both views must have a
  3158. * common ancestor, i.e. they must both be in the same window.
  3159. *
  3160. * Mac OS X threading:
  3161. * Not thread safe
  3162. *
  3163. * Parameters:
  3164. *
  3165. * ioPoint:
  3166. * The point to convert.
  3167. *
  3168. * inSourceView:
  3169. * The view whose coordinate system ioPoint is starting out in.
  3170. * You can pass NULL to indicate that ioPoint is a window-relative
  3171. * point.
  3172. *
  3173. * inDestView:
  3174. * The view whose coordinate system ioPoint should end up in. You
  3175. * can pass NULL to indicate that ioPoint is a window-relative
  3176. * point.
  3177. *
  3178. * Result:
  3179. * An operating system result code.
  3180. *
  3181. * Availability:
  3182. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3183. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3184. * Non-Carbon CFM: not available
  3185. }
  3186. function HIViewConvertPoint( var ioPoint: HIPoint; inSourceView: HIViewRef; inDestView: HIViewRef ): OSStatus; external name '_HIViewConvertPoint';
  3187. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3188. {
  3189. * HIViewConvertRect()
  3190. *
  3191. * Discussion:
  3192. * Converts a rectangle from one view to another. Both views must
  3193. * have a common ancestor, i.e. they must both be in the same window.
  3194. *
  3195. * Mac OS X threading:
  3196. * Not thread safe
  3197. *
  3198. * Parameters:
  3199. *
  3200. * ioRect:
  3201. * The rectangle to convert.
  3202. *
  3203. * inSourceView:
  3204. * The view whose coordinate system ioRect is starting out in. You
  3205. * can pass NULL to indicate that ioRect is a window-relative
  3206. * rectangle.
  3207. *
  3208. * inDestView:
  3209. * The view whose coordinate system ioRect should end up in. You
  3210. * can pass NULL to indicate that ioRect is a window-relative
  3211. * rectangle.
  3212. *
  3213. * Result:
  3214. * An operating system result code.
  3215. *
  3216. * Availability:
  3217. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3218. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3219. * Non-Carbon CFM: not available
  3220. }
  3221. function HIViewConvertRect( var ioRect: HIRect; inSourceView: HIViewRef; inDestView: HIViewRef ): OSStatus; external name '_HIViewConvertRect';
  3222. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3223. {
  3224. * HIViewConvertRegion()
  3225. *
  3226. * Discussion:
  3227. * Converts a region from one view to another. Both views must have
  3228. * a common ancestor, i.e. they must both be in the same window.
  3229. *
  3230. * Mac OS X threading:
  3231. * Not thread safe
  3232. *
  3233. * Parameters:
  3234. *
  3235. * ioRgn:
  3236. * The region to convert.
  3237. *
  3238. * inSourceView:
  3239. * The view whose coordinate system ioRgn is starting out in. You
  3240. * can pass NULL to indicate that ioRgn is a window-relative
  3241. * region.
  3242. *
  3243. * inDestView:
  3244. * The view whose coordinate system ioRgn should end up in. You
  3245. * can pass NULL to indicate that ioRgn is a window-relative
  3246. * region.
  3247. *
  3248. * Result:
  3249. * An operating system result code.
  3250. *
  3251. * Availability:
  3252. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3253. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3254. * Non-Carbon CFM: not available
  3255. }
  3256. function HIViewConvertRegion( ioRgn: RgnHandle; inSourceView: HIViewRef; inDestView: HIViewRef ): OSStatus; external name '_HIViewConvertRegion';
  3257. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3258. {
  3259. * HIViewSetDrawingEnabled()
  3260. *
  3261. * Discussion:
  3262. * Turns view drawing on or off. You can use this to ensure that no
  3263. * drawing events are sent to the view. Even Draw1Control will not
  3264. * draw! HIViewSetNeedsDisplay is also rendered useless when drawing
  3265. * is off.
  3266. *
  3267. * Mac OS X threading:
  3268. * Not thread safe
  3269. *
  3270. * Parameters:
  3271. *
  3272. * inView:
  3273. * The view to enable or disable drawing for.
  3274. *
  3275. * inEnabled:
  3276. * A boolean value indicating whether drawing should be on (true)
  3277. * or off (false).
  3278. *
  3279. * Result:
  3280. * An operating system result code.
  3281. *
  3282. * Availability:
  3283. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3284. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3285. * Non-Carbon CFM: not available
  3286. }
  3287. function HIViewSetDrawingEnabled( inView: HIViewRef; inEnabled: Boolean ): OSStatus; external name '_HIViewSetDrawingEnabled';
  3288. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3289. {
  3290. * HIViewIsDrawingEnabled()
  3291. *
  3292. * Discussion:
  3293. * Determines if drawing is currently enabled for a view.
  3294. *
  3295. * Mac OS X threading:
  3296. * Not thread safe
  3297. *
  3298. * Parameters:
  3299. *
  3300. * inView:
  3301. * The view to get the drawing state for.
  3302. *
  3303. * Result:
  3304. * A boolean value indicating whether drawing is on (true) or off
  3305. * (false).
  3306. *
  3307. * Availability:
  3308. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3309. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3310. * Non-Carbon CFM: not available
  3311. }
  3312. function HIViewIsDrawingEnabled( inView: HIViewRef ): Boolean; external name '_HIViewIsDrawingEnabled';
  3313. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3314. {
  3315. * HIViewScrollRect()
  3316. *
  3317. * Discussion:
  3318. * Scrolls a view's contents, or a portion thereof. A view's
  3319. * contents are the pixels that it or any of its descendent views
  3320. * has drawn into. This will actually blit the contents of the view
  3321. * as appropriate to scroll, and then invalidate those portions
  3322. * which need to be redrawn. Be warned that this is a raw bit
  3323. * scroll. Anything that might overlap the target view will get
  3324. * thrashed as well.
  3325. *
  3326. * Mac OS X threading:
  3327. * Not thread safe
  3328. *
  3329. * Parameters:
  3330. *
  3331. * inView:
  3332. * The view to scroll. The bits drawn by the view's descendent
  3333. * views will also be scrolled.
  3334. *
  3335. * inRect:
  3336. * The rect to scroll. Pass NULL to mean the entire view. The rect
  3337. * passed cannot be bigger than the view's bounds. It must be in
  3338. * the local coordinate system of the view.
  3339. *
  3340. * inDX:
  3341. * The horizontal distance to scroll. Positive values shift to the
  3342. * right, negative values shift to the left.
  3343. *
  3344. * inDY:
  3345. * The vertical distance to scroll. Positive values shift
  3346. * downward, negative values shift upward.
  3347. *
  3348. * Result:
  3349. * An operating system result code.
  3350. *
  3351. * Availability:
  3352. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3353. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3354. * Non-Carbon CFM: not available
  3355. }
  3356. function HIViewScrollRect( inView: HIViewRef; {const} inRect: HIRectPtr { can be NULL }; inDX: CGFloat; inDY: CGFloat ): OSStatus; external name '_HIViewScrollRect';
  3357. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3358. {
  3359. * HIViewSetBoundsOrigin()
  3360. *
  3361. * Discussion:
  3362. * This API sets the origin of the view. This effectively also moves
  3363. * all subviews of a view as well. This call will NOT invalidate the
  3364. * view. This is because you might want to move the contents with
  3365. * HIViewScrollRect instead of redrawing the complete content.
  3366. *
  3367. * Mac OS X threading:
  3368. * Not thread safe
  3369. *
  3370. * Parameters:
  3371. *
  3372. * inView:
  3373. * The view whose origin you wish to adjust.
  3374. *
  3375. * inX:
  3376. * The X coordinate.
  3377. *
  3378. * inY:
  3379. * The Y coordinate.
  3380. *
  3381. * Result:
  3382. * An operating system result code.
  3383. *
  3384. * Availability:
  3385. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3386. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3387. * Non-Carbon CFM: not available
  3388. }
  3389. function HIViewSetBoundsOrigin( inView: HIViewRef; inX: CGFloat; inY: CGFloat ): OSStatus; external name '_HIViewSetBoundsOrigin';
  3390. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3391. {==============================================================================}
  3392. { KEYBOARD FOCUS }
  3393. {==============================================================================}
  3394. {$endc} {not TARGET_CPU_64}
  3395. {
  3396. * Summary:
  3397. * Option bits for use with HIViewAdvanceFocusWithOptions and
  3398. * HIViewSetFocus.
  3399. }
  3400. const
  3401. {
  3402. * Explicitly requests "focus on everything" mode. All controls will
  3403. * be considered focusable, regardless of the user's current
  3404. * preferences. If this option is not specified, then setting or
  3405. * advancing focus will obey the user's current preferences for
  3406. * focusing traditionally or focusing on any control.
  3407. }
  3408. kHIViewFocusOnAnyControl = 1 shl 0;
  3409. {
  3410. * Explicitly requests "traditional focus" mode. Only traditionally
  3411. * focusable controls (text and lists) will be considered focusable,
  3412. * regardless of the user's current preference. If this option is not
  3413. * specified, then setting or advancing focus will obey the user's
  3414. * current preferences for focusing traditionally or focusing on any
  3415. * control.
  3416. }
  3417. kHIViewFocusTraditionally = 1 shl 1;
  3418. {
  3419. * If advancing the focus would wrap around to the beginning or end
  3420. * of the focus root, then errCouldntSetFocus is returned. If this
  3421. * option is not specified, then advancing (or reversing) the focus
  3422. * will wrap around to the first (or last) focusable child of the
  3423. * focus root. This option is only valid for the
  3424. * HIViewAdvanceFocusWithOptions API.
  3425. }
  3426. kHIViewFocusWithoutWrapping = 1 shl 2;
  3427. {$ifc not TARGET_CPU_64}
  3428. {
  3429. * HIViewAdvanceFocus()
  3430. *
  3431. * Discussion:
  3432. * Advances the focus to the next most appropriate view. Unless
  3433. * overridden in some fashion (either by overriding certain carbon
  3434. * events or using the HIViewSetNextFocus API), the Toolbox will use
  3435. * a spacially determinant method of focusing, attempting to focus
  3436. * left to right, top to bottom in a window, taking groups of views
  3437. * into account.
  3438. *
  3439. * Mac OS X threading:
  3440. * Not thread safe
  3441. *
  3442. * Parameters:
  3443. *
  3444. * inRootForFocus:
  3445. * The subtree to manipulate. The focus will never leave
  3446. * inRootToFocus. Typically you would pass the content of the
  3447. * window, or the root. If focused on the toolbar, for example,
  3448. * the focus is limited to the toolbar only. In this case, the
  3449. * Toolbox passes the toolbar view in as the focus root for
  3450. * example.
  3451. *
  3452. * inModifiers:
  3453. * The EventModifiers of the keyboard event that ultimately caused
  3454. * the call to HIViewAdvanceFocus. These modifiers are used to
  3455. * determine the focus direction as well as other alternate
  3456. * focusing behaviors.
  3457. *
  3458. * Result:
  3459. * An operating system result code.
  3460. *
  3461. * Availability:
  3462. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3463. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3464. * Non-Carbon CFM: not available
  3465. }
  3466. function HIViewAdvanceFocus( inRootForFocus: HIViewRef; inModifiers: EventModifiers ): OSStatus; external name '_HIViewAdvanceFocus';
  3467. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3468. {
  3469. * HIViewAdvanceFocusWithOptions()
  3470. *
  3471. * Summary:
  3472. * Changes the focus in a window to the next or previous view.
  3473. *
  3474. * Discussion:
  3475. * This API has the same default behavior as HIViewAdvanceFocus, but
  3476. * the options parameter allows you to control some aspects of the
  3477. * focus behavior.
  3478. *
  3479. * Mac OS X threading:
  3480. * Not thread safe
  3481. *
  3482. * Parameters:
  3483. *
  3484. * inRootForFocus:
  3485. * The root of the view hierarchy in which focusing will occur.
  3486. * Typically, this will be the content view of a window, but you
  3487. * may pass in other subviews as well to further constrain the
  3488. * focus.
  3489. *
  3490. * inModifiers:
  3491. * The event modifiers that the user pressed. If the Shift
  3492. * modifier is set, focus will move to the previous view;
  3493. * otherwise, it will move to the next view.
  3494. *
  3495. * inOptions:
  3496. * Options to further customize the focusing behavior. See
  3497. * kHIViewFocus constants.
  3498. *
  3499. * Result:
  3500. * An operating system result code, including errCouldntSetFocus if
  3501. * the focus could not be set.
  3502. *
  3503. * Availability:
  3504. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  3505. * CarbonLib: not available
  3506. * Non-Carbon CFM: not available
  3507. }
  3508. function HIViewAdvanceFocusWithOptions( inRootForFocus: HIViewRef; inModifiers: UInt32; inOptions: OptionBits ): OSStatus; external name '_HIViewAdvanceFocusWithOptions';
  3509. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  3510. {
  3511. * HIViewGetFocusPart()
  3512. *
  3513. * Discussion:
  3514. * Returns the currently focused part of the given view.
  3515. *
  3516. * Mac OS X threading:
  3517. * Not thread safe
  3518. *
  3519. * Parameters:
  3520. *
  3521. * inView:
  3522. * The view to inquire about.
  3523. *
  3524. * outFocusPart:
  3525. * The part currently focused.
  3526. *
  3527. * Result:
  3528. * An operating system result code.
  3529. *
  3530. * Availability:
  3531. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3532. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3533. * Non-Carbon CFM: not available
  3534. }
  3535. function HIViewGetFocusPart( inView: HIViewRef; var outFocusPart: HIViewPartCode ): OSStatus; external name '_HIViewGetFocusPart';
  3536. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3537. {
  3538. * HIViewSubtreeContainsFocus()
  3539. *
  3540. * Discussion:
  3541. * Given a view, this function checks to see if it or any of its
  3542. * children currently are the keyboard focus. If so, true is
  3543. * returned as the function result.
  3544. *
  3545. * Mac OS X threading:
  3546. * Not thread safe
  3547. *
  3548. * Parameters:
  3549. *
  3550. * inSubtreeStart:
  3551. * The view to start searching at.
  3552. *
  3553. * Result:
  3554. * A boolean result.
  3555. *
  3556. * Availability:
  3557. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3558. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3559. * Non-Carbon CFM: not available
  3560. }
  3561. function HIViewSubtreeContainsFocus( inSubtreeStart: HIViewRef ): Boolean; external name '_HIViewSubtreeContainsFocus';
  3562. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3563. {
  3564. * HIViewSetNextFocus()
  3565. *
  3566. * Discussion:
  3567. * This function hard-wires the next sibling view to shift focus to
  3568. * whenever the keyboard focus is advanced.
  3569. *
  3570. * Mac OS X threading:
  3571. * Not thread safe
  3572. *
  3573. * Parameters:
  3574. *
  3575. * inView:
  3576. * The view to set the next focus view for. This parameter and the
  3577. * inNextFocus parameter must both have the same parent view.
  3578. *
  3579. * inNextFocus:
  3580. * The view to set focus to next. This parameter and the inView
  3581. * parameter must both have the same parent view. Pass NULL to
  3582. * tell the view system to use the default rules.
  3583. *
  3584. * Result:
  3585. * An operating system result code.
  3586. *
  3587. * Availability:
  3588. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3589. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3590. * Non-Carbon CFM: not available
  3591. }
  3592. function HIViewSetNextFocus( inView: HIViewRef; inNextFocus: HIViewRef { can be NULL } ): OSStatus; external name '_HIViewSetNextFocus';
  3593. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3594. {
  3595. * HIViewSetFirstSubViewFocus()
  3596. *
  3597. * Discussion:
  3598. * This function hard-wires the first subview to shift focus to
  3599. * whenever the keyboard focus is advanced and the container view is
  3600. * entered.
  3601. *
  3602. * Mac OS X threading:
  3603. * Not thread safe
  3604. *
  3605. * Parameters:
  3606. *
  3607. * inParent:
  3608. * The parent view.
  3609. *
  3610. * inSubView:
  3611. * The first child which should receive focus. Pass NULL to tell
  3612. * the view system to use the default rules.
  3613. *
  3614. * Result:
  3615. * An operating system result code.
  3616. *
  3617. * Availability:
  3618. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  3619. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3620. * Non-Carbon CFM: not available
  3621. }
  3622. function HIViewSetFirstSubViewFocus( inParent: HIViewRef; inSubView: HIViewRef { can be NULL } ): OSStatus; external name '_HIViewSetFirstSubViewFocus';
  3623. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3624. {
  3625. * HIViewSetFocus()
  3626. *
  3627. * Summary:
  3628. * Sets the focused view in a window.
  3629. *
  3630. * Discussion:
  3631. * This API is a replacement for the SetKeyboardFocus API.
  3632. *
  3633. * Mac OS X threading:
  3634. * Not thread safe
  3635. *
  3636. * Parameters:
  3637. *
  3638. * inView:
  3639. * The view that should be focused. The window is implicitly
  3640. * specified by this view.
  3641. *
  3642. * inPart:
  3643. * The view part that should be focused. This parameter may be
  3644. * kHIViewNoPart to remove focus from the view (and the window).
  3645. *
  3646. * inOptions:
  3647. * Options to further customize the focusing behavior. Only
  3648. * kHIViewFocusOnAnyControl and kHIViewFocusTraditionally are
  3649. * currently allowed.
  3650. *
  3651. * Result:
  3652. * An operating system result code.
  3653. *
  3654. * Availability:
  3655. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  3656. * CarbonLib: not available
  3657. * Non-Carbon CFM: not available
  3658. }
  3659. function HIViewSetFocus( inView: HIViewRef; inPart: HIViewPartCode; inOptions: OptionBits ): OSStatus; external name '_HIViewSetFocus';
  3660. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  3661. {
  3662. * HIViewGetFocus()
  3663. *
  3664. * Summary:
  3665. * Retrieves the focused view in a window.
  3666. *
  3667. * Discussion:
  3668. * This API is a replacement for the GetKeyboardFocus API.
  3669. *
  3670. * Mac OS X threading:
  3671. * Not thread safe
  3672. *
  3673. * Parameters:
  3674. *
  3675. * inWindow:
  3676. * The window whose focused view to retrieve.
  3677. *
  3678. * outView:
  3679. * On exit, contains the window's focused view.
  3680. *
  3681. * outPart:
  3682. * On exit, contains the focused part of the focused view. This
  3683. * parameter may be NULL if you don't need this information. You
  3684. * can also get the focused part by calling HIViewGetFocusPart on
  3685. * the focused view.
  3686. *
  3687. * Availability:
  3688. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  3689. * CarbonLib: not available
  3690. * Non-Carbon CFM: not available
  3691. }
  3692. function HIViewGetFocus( inWindow: WindowRef; var outView: HIViewRef; outPart: HIViewPartCodePtr { can be NULL } ): OSStatus; external name '_HIViewGetFocus';
  3693. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  3694. {
  3695. * HIViewShowsFocus()
  3696. *
  3697. * Summary:
  3698. * Indicates whether a view should show focus indicators, such as
  3699. * focus rings.
  3700. *
  3701. * Discussion:
  3702. * There are several factors that control whether a view should show
  3703. * focus indicators, including:
  3704. *
  3705. * - does the view have a focused part?
  3706. * - is the view active?
  3707. * - is the view enabled?
  3708. * - is the view contained in a window that shows focus indicators?
  3709. *
  3710. *
  3711. * This API encapsulates checking for all of these factors.
  3712. * Typically, a view will call this API in its kEventControlDraw
  3713. * handler to determine whether it should draw focus indicators in
  3714. * addition to its normal drawing.
  3715. *
  3716. * Mac OS X threading:
  3717. * Not thread safe
  3718. *
  3719. * Parameters:
  3720. *
  3721. * inView:
  3722. * The view whose state to examine.
  3723. *
  3724. * inPart:
  3725. * A view part code. If this value is kHIViewNoPart, the API
  3726. * returns true if any part of the view is focused. If this value
  3727. * is not kHIViewNoPart, the API returns true if that specific
  3728. * part is focused.
  3729. *
  3730. * Result:
  3731. * Whether the view should draw focus indicators.
  3732. *
  3733. * Availability:
  3734. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  3735. * CarbonLib: not available
  3736. * Non-Carbon CFM: not available
  3737. }
  3738. function HIViewShowsFocus( inView: HIViewRef; inPart: HIViewPartCode ): Boolean; external name '_HIViewShowsFocus';
  3739. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  3740. {==============================================================================}
  3741. { LAYOUT }
  3742. { Mac OS X 10.3 provides a layout engine for HIViews that allows applications }
  3743. { to specify the layout relationships between multiple views. The layout }
  3744. { engine will automatically reposition and resize views that have layout }
  3745. { information when necessary. }
  3746. {==============================================================================}
  3747. {$endc} {not TARGET_CPU_64}
  3748. {
  3749. * Summary:
  3750. * Since horizontal and vertical bindings are very similar in
  3751. * application, except along different axes, the binding kinds have
  3752. * been abstracted to minimum and maximum. Synonyms have been
  3753. * provided for convenience. You are encouraged to use them.
  3754. *
  3755. * Discussion:
  3756. * HIBindingKind constants.
  3757. }
  3758. const
  3759. {
  3760. * No binding is to occur.
  3761. }
  3762. kHILayoutBindNone = 0;
  3763. {
  3764. * Bind to the minimum of the axis.
  3765. }
  3766. kHILayoutBindMin = 1;
  3767. {
  3768. * Bind to the maximum of the axis.
  3769. }
  3770. kHILayoutBindMax = 2;
  3771. kHILayoutBindLeft = kHILayoutBindMin;
  3772. kHILayoutBindRight = kHILayoutBindMax;
  3773. {
  3774. * Synonyms for convenience and clarity.
  3775. }
  3776. kHILayoutBindTop = kHILayoutBindMin;
  3777. kHILayoutBindBottom = kHILayoutBindMax;
  3778. type
  3779. HIBindingKind = UInt16;
  3780. {
  3781. * HISideBinding
  3782. *
  3783. * Summary:
  3784. * A binding for a side of an HIView.
  3785. *
  3786. * Discussion:
  3787. * A side binding is entirely related to the change of the parent's
  3788. * position or size (but only as the size affects the maximum edge
  3789. * position). A side binding doesn't mean "move to where my
  3790. * relative's side is" but rather "move as my relative's side has
  3791. * moved".
  3792. }
  3793. type
  3794. HISideBinding = record
  3795. {
  3796. * An HIViewRef to the view to which this side is bound. Can be NULL,
  3797. * indicating that the the side is bound to its parent view.
  3798. }
  3799. toView: HIViewRef; { NULL means parent}
  3800. {
  3801. * An HIBindingKind indicating the bind kind.
  3802. }
  3803. kind: HIBindingKind;
  3804. {
  3805. * Not currently used. Must be set to 0.
  3806. }
  3807. offset: CGFloat;
  3808. end;
  3809. {
  3810. * HIBinding
  3811. *
  3812. * Summary:
  3813. * A set of Top, Left, Bottom, and Right bindings for an HIView.
  3814. }
  3815. type
  3816. HIBinding = record
  3817. {
  3818. * The top side bindings.
  3819. }
  3820. top: HISideBinding;
  3821. {
  3822. * The left side bindings.
  3823. }
  3824. left: HISideBinding;
  3825. {
  3826. * The bottom side bindings.
  3827. }
  3828. bottom: HISideBinding;
  3829. {
  3830. * The right side bindings.
  3831. }
  3832. right: HISideBinding;
  3833. end;
  3834. {
  3835. * Discussion:
  3836. * HIScaleKind constants.
  3837. }
  3838. const
  3839. {
  3840. * The scale is determined from the axis size.
  3841. }
  3842. kHILayoutScaleAbsolute = 0;
  3843. type
  3844. HIScaleKind = UInt16;
  3845. {
  3846. * HIAxisScale
  3847. *
  3848. * Summary:
  3849. * A scale description for an axis of an HIView.
  3850. }
  3851. type
  3852. HIAxisScale = record
  3853. {
  3854. * An HIViewRef to the view to which this axis is scaled. Can be
  3855. * NULL, indicating that the the axis is scaled relative to its
  3856. * parent view.
  3857. }
  3858. toView: HIViewRef; { NULL means parent}
  3859. {
  3860. * An HIScaleKind describing the type of scaling to be applied.
  3861. * Currently, this field can't be anything other than
  3862. * kHILayoutScaleAbsolute.
  3863. }
  3864. kind: HIScaleKind;
  3865. {
  3866. * A CGFloat indicating how much to scale the HIView. 0 indicates no
  3867. * scaling. A value of 1 indicates that the view is to always have
  3868. * the same axial size.
  3869. }
  3870. ratio: CGFloat;
  3871. end;
  3872. {
  3873. * HIScaling
  3874. *
  3875. * Summary:
  3876. * A set of scaling descriptions for the axes of an HIView.
  3877. }
  3878. type
  3879. HIScaling = record
  3880. {
  3881. * An HIAxisScale describing the horizontal scaling for an HIView.
  3882. }
  3883. x: HIAxisScale;
  3884. {
  3885. * An HIAxisScale describing the vertical scaling for an HIView.
  3886. }
  3887. y: HIAxisScale;
  3888. end;
  3889. {
  3890. * Summary:
  3891. * Since horizontal and vertical positions are very similar in
  3892. * application, except along different axes, the position kinds have
  3893. * been abstracted to minimum and maximum. Synonyms have been
  3894. * provided for convenience. You are encouraged to use them.
  3895. *
  3896. * Discussion:
  3897. * HIPositionKind constants.
  3898. }
  3899. const
  3900. {
  3901. * No positioning is to occur.
  3902. }
  3903. kHILayoutPositionNone = 0;
  3904. {
  3905. * Centered positioning will occur. The view will be centered
  3906. * relative to the specified view.
  3907. }
  3908. kHILayoutPositionCenter = 1;
  3909. {
  3910. * Minimum positioning will occur. The view will be left or top
  3911. * aligned relative to the specified view.
  3912. }
  3913. kHILayoutPositionMin = 2;
  3914. {
  3915. * Maximum positioning will occur. The view will be right or bottom
  3916. * aligned relative to the specified view.
  3917. }
  3918. kHILayoutPositionMax = 3;
  3919. {
  3920. * Synonyms for convenience and clarity.
  3921. }
  3922. kHILayoutPositionLeft = kHILayoutPositionMin;
  3923. kHILayoutPositionRight = kHILayoutPositionMax;
  3924. kHILayoutPositionTop = kHILayoutPositionMin;
  3925. kHILayoutPositionBottom = kHILayoutPositionMax;
  3926. type
  3927. HIPositionKind = UInt16;
  3928. {
  3929. * HIAxisPosition
  3930. *
  3931. * Summary:
  3932. * An axial position description for an HIView.
  3933. }
  3934. type
  3935. HIAxisPosition = record
  3936. {
  3937. * An HIViewRef to the view relative to which a view will be
  3938. * positioned. Can be NULL, indicating that the the view is
  3939. * positioned relative to its parent view.
  3940. }
  3941. toView: HIViewRef; { NULL means parent}
  3942. {
  3943. * An HIPositionKind indicating the kind of positioning to apply.
  3944. }
  3945. kind: HIPositionKind;
  3946. {
  3947. * After the position kind has been applied, the origin component
  3948. * that corresponds to the positioning axis is offet by this value.
  3949. * (ex: Left aligned + 10 ).
  3950. }
  3951. offset: CGFloat;
  3952. end;
  3953. {
  3954. * HIPositioning
  3955. *
  3956. * Summary:
  3957. * A positioning description for an HIView.
  3958. }
  3959. type
  3960. HIPositioning = record
  3961. {
  3962. * An HIAxisPosition describing the horizontal positioning for an
  3963. * HIView.
  3964. }
  3965. x: HIAxisPosition;
  3966. y: HIAxisPosition;
  3967. end;
  3968. {
  3969. * HILayoutInfo
  3970. *
  3971. * Summary:
  3972. * A layout description for an HIView.
  3973. *
  3974. * Discussion:
  3975. * The different layout transformations are applied sequentially to
  3976. * the HIView.
  3977. *
  3978. * First, the bindings are applied. Note that the bindings are
  3979. * applied recursively to a container's HIViews. This requires care
  3980. * on your part, especially when applying inter-relational bindings.
  3981. *
  3982. *
  3983. * Then the scaling is applied (which could potentially override
  3984. * some of the previously applied bindings). Then the positioning is
  3985. * applied (which could potentially override some of the previously
  3986. * applied scaling and bindings).
  3987. }
  3988. type
  3989. HILayoutInfo = record
  3990. {
  3991. * The version of the structure. The current version is
  3992. * kHILayoutInfoVersionZero.
  3993. }
  3994. version: UInt32;
  3995. {
  3996. * An HIBinding structure describing the bindings to apply to the
  3997. * sides of an HIView.
  3998. }
  3999. binding: HIBinding;
  4000. {
  4001. * An HIScaling structure describing the axial scaling to apply to an
  4002. * HIView.
  4003. }
  4004. scale: HIScaling;
  4005. {
  4006. * An HIPositioning structure describing the positioning to apply to
  4007. * an HIView.
  4008. }
  4009. position: HIPositioning;
  4010. end;
  4011. const
  4012. kHILayoutInfoVersionZero = 0;
  4013. {$ifc not TARGET_CPU_64}
  4014. {
  4015. * HIViewGetLayoutInfo()
  4016. *
  4017. * Summary:
  4018. * Get the layout info of an HIView.
  4019. *
  4020. * Mac OS X threading:
  4021. * Not thread safe
  4022. *
  4023. * Parameters:
  4024. *
  4025. * inView:
  4026. * The HIView whose layout info is to be retreived.
  4027. *
  4028. * outLayoutInfo:
  4029. * A pointer to an HILayoutInfo record into which to copy the
  4030. * layout info of the HIView. The version field of this record
  4031. * must be valid or the call will fail.
  4032. *
  4033. * Result:
  4034. * An operating system status code.
  4035. *
  4036. * Availability:
  4037. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  4038. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  4039. * Non-Carbon CFM: not available
  4040. }
  4041. function HIViewGetLayoutInfo( inView: HIViewRef; var outLayoutInfo: HILayoutInfo ): OSStatus; external name '_HIViewGetLayoutInfo';
  4042. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  4043. {
  4044. * HIViewSetLayoutInfo()
  4045. *
  4046. * Summary:
  4047. * Set the layout info of an HIView.
  4048. *
  4049. * Mac OS X threading:
  4050. * Not thread safe
  4051. *
  4052. * Parameters:
  4053. *
  4054. * inView:
  4055. * The HIView whose layout info is to be set.
  4056. *
  4057. * inLayoutInfo:
  4058. * A pointer to an HILayoutInfo record containing the layout
  4059. * values to be set.
  4060. *
  4061. * Result:
  4062. * An operating system status code.
  4063. *
  4064. * Availability:
  4065. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  4066. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  4067. * Non-Carbon CFM: not available
  4068. }
  4069. function HIViewSetLayoutInfo( inView: HIViewRef; const (*var*) inLayoutInfo: HILayoutInfo ): OSStatus; external name '_HIViewSetLayoutInfo';
  4070. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  4071. {
  4072. * HIViewSuspendLayout()
  4073. *
  4074. * Summary:
  4075. * Suspends all layout handling for this layout and its children.
  4076. *
  4077. * Mac OS X threading:
  4078. * Not thread safe
  4079. *
  4080. * Parameters:
  4081. *
  4082. * inView:
  4083. * The HIView whose layout handling is to be suspended.
  4084. *
  4085. * Result:
  4086. * An operating system status code.
  4087. *
  4088. * Availability:
  4089. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  4090. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  4091. * Non-Carbon CFM: not available
  4092. }
  4093. function HIViewSuspendLayout( inView: HIViewRef ): OSStatus; external name '_HIViewSuspendLayout';
  4094. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  4095. {
  4096. * HIViewResumeLayout()
  4097. *
  4098. * Summary:
  4099. * Resumes all layout handling for this layout and its children.
  4100. *
  4101. * Mac OS X threading:
  4102. * Not thread safe
  4103. *
  4104. * Parameters:
  4105. *
  4106. * inView:
  4107. * The HIView whose layout handling is to be resumed.
  4108. *
  4109. * Result:
  4110. * An operating system status code.
  4111. *
  4112. * Availability:
  4113. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  4114. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  4115. * Non-Carbon CFM: not available
  4116. }
  4117. function HIViewResumeLayout( inView: HIViewRef ): OSStatus; external name '_HIViewResumeLayout';
  4118. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  4119. {
  4120. * HIViewIsLayoutActive()
  4121. *
  4122. * Summary:
  4123. * Tests the view to determine if layout is active or suspended.
  4124. * Note that this test does not determine whether or not the view
  4125. * has a valid layout, only whether or not the layout engine is
  4126. * active for the view.
  4127. *
  4128. * Discussion:
  4129. * The view's layout active state is also affected by the layout
  4130. * active state of its parents; if any parent view has inactive
  4131. * layout, this view is considered to have inactive layout as well.
  4132. * See HIViewIsLayoutLatentlyActive if latent layout active state is
  4133. * required.
  4134. *
  4135. * Mac OS X threading:
  4136. * Not thread safe
  4137. *
  4138. * Parameters:
  4139. *
  4140. * inView:
  4141. * The HIView whose layout handling is to be tested.
  4142. *
  4143. * Result:
  4144. * True if the view would respond to any linked relative's changes,
  4145. * otherwise false.
  4146. *
  4147. * Availability:
  4148. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  4149. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  4150. * Non-Carbon CFM: not available
  4151. }
  4152. function HIViewIsLayoutActive( inView: HIViewRef ): Boolean; external name '_HIViewIsLayoutActive';
  4153. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  4154. {
  4155. * HIViewIsLayoutLatentlyActive()
  4156. *
  4157. * Summary:
  4158. * The view's layout active state is also affected by the layout
  4159. * active state of its parents; if any parent view has inactive
  4160. * layout, this view is considered to have inactive layout as well.
  4161. * HIViewIsLayoutLatentlyActive returns whether a view's layout is
  4162. * latently active, even if one of its parent's layouts is not.
  4163. *
  4164. * Mac OS X threading:
  4165. * Not thread safe
  4166. *
  4167. * Parameters:
  4168. *
  4169. * inView:
  4170. * The HIView whose latent layout handling is to be tested.
  4171. *
  4172. * Result:
  4173. * True if the view would latently respond to any linked relative's
  4174. * changes, otherwise false.
  4175. *
  4176. * Availability:
  4177. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  4178. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  4179. * Non-Carbon CFM: not available
  4180. }
  4181. function HIViewIsLayoutLatentlyActive( inView: HIViewRef ): Boolean; external name '_HIViewIsLayoutLatentlyActive';
  4182. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  4183. {
  4184. * HIViewApplyLayout()
  4185. *
  4186. * Summary:
  4187. * Applies the current layout into to the specified view. Side
  4188. * bindings have no effect, but positioning and scaling will occur,
  4189. * in that order.
  4190. *
  4191. * Mac OS X threading:
  4192. * Not thread safe
  4193. *
  4194. * Parameters:
  4195. *
  4196. * inView:
  4197. * The HIView whose layout info is to be applied.
  4198. *
  4199. * Result:
  4200. * An operating system status code.
  4201. *
  4202. * Availability:
  4203. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  4204. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  4205. * Non-Carbon CFM: not available
  4206. }
  4207. function HIViewApplyLayout( inView: HIViewRef ): OSStatus; external name '_HIViewApplyLayout';
  4208. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  4209. {==============================================================================}
  4210. { IMAGE CONTENT MANAGEMENT }
  4211. {==============================================================================}
  4212. {
  4213. * HIViewSetImageContent()
  4214. *
  4215. * Summary:
  4216. * Sets the content of a view to a particular image.
  4217. *
  4218. * Discussion:
  4219. * This API attempts to set the view's image content using
  4220. * SetControlData and the kControlContentTag constant.
  4221. *
  4222. * Mac OS X threading:
  4223. * Not thread safe
  4224. *
  4225. * Parameters:
  4226. *
  4227. * inView:
  4228. * The view whose image content to set.
  4229. *
  4230. * inPart:
  4231. * The view part whose image content to set. For most views, you
  4232. * should pass kHIViewEntireView. Some views, such as the
  4233. * segmented view, allow you to pass a specific partcode here to
  4234. * indicate a particular part of the view.
  4235. *
  4236. * inContent:
  4237. * The image content to set. You may pass NULL to remove content
  4238. * from the view.
  4239. *
  4240. * Availability:
  4241. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  4242. * CarbonLib: not available
  4243. * Non-Carbon CFM: not available
  4244. }
  4245. function HIViewSetImageContent( inView: HIViewRef; inPart: HIViewPartCode; {const} inContent: HIViewContentInfoPtr { can be NULL } ): OSStatus; external name '_HIViewSetImageContent';
  4246. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  4247. {
  4248. * HIViewCopyImageContentWithSize()
  4249. *
  4250. * Summary:
  4251. * Retrieves the image content of a view.
  4252. *
  4253. * Discussion:
  4254. * This API attempts to get the view's image content using
  4255. * GetControlData and the kControlContentTag constant. If
  4256. * successful, it calls HIViewRetainImageContent.
  4257. *
  4258. * Mac OS X threading:
  4259. * Not thread safe
  4260. *
  4261. * Parameters:
  4262. *
  4263. * inView:
  4264. * The view whose image content to retrieve.
  4265. *
  4266. * inPart:
  4267. * The view part whose image content to retrieve. For most views,
  4268. * you should pass kHIViewEntireView. Some views, such as the
  4269. * segmented view, allow you to pass a specific partcode here to
  4270. * indicate a particular part of the view.
  4271. *
  4272. * inContentSize:
  4273. * The size in bytes of the HIViewContentInfo structure that you
  4274. * are passing to the API. At most this many bytes will be written
  4275. * to your HIViewContentInfo structure.
  4276. *
  4277. * outContent:
  4278. * On exit, contains the view's image content. For image content
  4279. * types that support a refcount, the content has been retained
  4280. * before being returned; such content should be released by the
  4281. * caller. For image content that does not support a refcount, the
  4282. * actual content reference used by the view is returned; this
  4283. * content should not be released. You may use
  4284. * HIViewReleaseImageContent to release the content returned by
  4285. * this API.
  4286. *
  4287. * Availability:
  4288. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  4289. * CarbonLib: not available
  4290. * Non-Carbon CFM: not available
  4291. }
  4292. function HIViewCopyImageContentWithSize( inView: HIViewRef; inPart: HIViewPartCode; inContentSize: ByteCount; var outContent: HIViewContentInfo ): OSStatus; external name '_HIViewCopyImageContentWithSize';
  4293. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  4294. {
  4295. * HIViewRetainImageContent()
  4296. *
  4297. * Summary:
  4298. * Retains refcountable content contained in an HIViewContentInfo
  4299. * structure.
  4300. *
  4301. * Discussion:
  4302. * For image content data types that are refcountable, the image
  4303. * content retain count is incremented. Non-refcountable image
  4304. * content is ignored.
  4305. *
  4306. * Mac OS X threading:
  4307. * Not thread safe
  4308. *
  4309. * Parameters:
  4310. *
  4311. * inContent:
  4312. * The image content to retain.
  4313. *
  4314. * Availability:
  4315. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  4316. * CarbonLib: not available
  4317. * Non-Carbon CFM: not available
  4318. }
  4319. procedure HIViewRetainImageContent( const (*var*) inContent: HIViewContentInfo ); external name '_HIViewRetainImageContent';
  4320. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  4321. {
  4322. * HIViewReleaseImageContent()
  4323. *
  4324. * Summary:
  4325. * Releases refcountable content contained in an HIViewContentInfo
  4326. * structure.
  4327. *
  4328. * Discussion:
  4329. * For image content data types that are refcountable, the image
  4330. * content retain count is decremented. Non-refcountable image
  4331. * content is ignored; it is _not_ freed. You must explicitly free
  4332. * non-refcountable image content yourself.
  4333. *
  4334. * Mac OS X threading:
  4335. * Not thread safe
  4336. *
  4337. * Parameters:
  4338. *
  4339. * ioContent:
  4340. * The image content to release. On exit, ioContent->contentType
  4341. * is set to kHIViewContentNone.
  4342. *
  4343. * Availability:
  4344. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  4345. * CarbonLib: not available
  4346. * Non-Carbon CFM: not available
  4347. }
  4348. procedure HIViewReleaseImageContent( var ioContent: HIViewContentInfo ); external name '_HIViewReleaseImageContent';
  4349. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  4350. {==============================================================================}
  4351. { MISCELLANEOUS }
  4352. {==============================================================================}
  4353. {
  4354. * HIViewGetWindow()
  4355. *
  4356. * Discussion:
  4357. * Returns a reference to the window a given view is bound to. If
  4358. * the view reference passed is invalid, or the view is not embedded
  4359. * into any window, NULL is returned.
  4360. *
  4361. * Mac OS X threading:
  4362. * Not thread safe
  4363. *
  4364. * Parameters:
  4365. *
  4366. * inView:
  4367. * The view to query.
  4368. *
  4369. * Result:
  4370. * A window reference.
  4371. *
  4372. * Availability:
  4373. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  4374. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  4375. * Non-Carbon CFM: not available
  4376. }
  4377. function HIViewGetWindow( inView: HIViewRef ): WindowRef; external name '_HIViewGetWindow';
  4378. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  4379. {
  4380. * HIViewFindByID()
  4381. *
  4382. * Discussion:
  4383. * Allows you to find a particular view by its ID. The HIViewID type
  4384. * used by this API is identical to the older ControlID type.
  4385. *
  4386. * Mac OS X threading:
  4387. * Not thread safe
  4388. *
  4389. * Parameters:
  4390. *
  4391. * inStartView:
  4392. * The view to start searching at.
  4393. *
  4394. * inID:
  4395. * The ID of the view you are looking for.
  4396. *
  4397. * outView:
  4398. * Receives the view if found.
  4399. *
  4400. * Result:
  4401. * An operating system result code.
  4402. *
  4403. * Availability:
  4404. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  4405. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4406. * Non-Carbon CFM: not available
  4407. }
  4408. function HIViewFindByID( inStartView: HIViewRef; inID: HIViewID; var outView: HIViewRef ): OSStatus; external name '_HIViewFindByID';
  4409. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4410. {
  4411. * HIViewGetAttributes()
  4412. *
  4413. * Discussion:
  4414. * Allows you to get the attributes of a view.
  4415. *
  4416. * Mac OS X threading:
  4417. * Not thread safe
  4418. *
  4419. * Parameters:
  4420. *
  4421. * inView:
  4422. * The view to inspect.
  4423. *
  4424. * outAttrs:
  4425. * The attributes of the view.
  4426. *
  4427. * Result:
  4428. * An operating system result code.
  4429. *
  4430. * Availability:
  4431. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  4432. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4433. * Non-Carbon CFM: not available
  4434. }
  4435. function HIViewGetAttributes( inView: HIViewRef; var outAttrs: OptionBits ): OSStatus; external name '_HIViewGetAttributes';
  4436. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4437. {
  4438. * HIViewChangeAttributes()
  4439. *
  4440. * Discussion:
  4441. * Allows you to change the attributes of a view. You can
  4442. * simultaneously set and clear attributes.
  4443. *
  4444. * Mac OS X threading:
  4445. * Not thread safe
  4446. *
  4447. * Parameters:
  4448. *
  4449. * inView:
  4450. * The view to muck with.
  4451. *
  4452. * inAttrsToSet:
  4453. * The attributes you wish to set.
  4454. *
  4455. * inAttrsToClear:
  4456. * The attributes you wish to clear.
  4457. *
  4458. * Result:
  4459. * An operating system result code.
  4460. *
  4461. * Availability:
  4462. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  4463. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4464. * Non-Carbon CFM: not available
  4465. }
  4466. function HIViewChangeAttributes( inView: HIViewRef; inAttrsToSet: OptionBits; inAttrsToClear: OptionBits ): OSStatus; external name '_HIViewChangeAttributes';
  4467. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4468. {$endc} {not TARGET_CPU_64}
  4469. {
  4470. * Summary:
  4471. * Option bits for use with HIViewCreateOffscreenImage.
  4472. }
  4473. const
  4474. {
  4475. * Requests that the offscreen image should use the resolution of the
  4476. * window's backing store. If the window is using crisp HiDPI mode,
  4477. * the image size will therefore be equal to the view bounds
  4478. * multiplied by the result of HIWindowGetBackingScaleFactor on the
  4479. * view's window. Available in Mac OS X 10.8 and later.
  4480. }
  4481. kHIViewOffscreenImageUseWindowBackingResolution = 1 shl 0;
  4482. {$ifc not TARGET_CPU_64}
  4483. {
  4484. * HIViewCreateOffscreenImage()
  4485. *
  4486. * Discussion:
  4487. * Creates an CGImageRef for the view passed in. The view and any
  4488. * children it has are rendered in the resultant image.
  4489. *
  4490. * Note that prior to Mac OS X 10.5, we do not recommend passing the
  4491. * root view of a window (returned by HIViewGetRoot) to this API.
  4492. * The API implementation in earlier versions of Mac OS X contained
  4493. * a bug that would corrupt the root view state, such that
  4494. * subsequent QuickDraw drawing in subviews of the root view would
  4495. * not appear in the root view's containing window.
  4496. *
  4497. * Mac OS X threading:
  4498. * Not thread safe
  4499. *
  4500. * Parameters:
  4501. *
  4502. * inView:
  4503. * The view you wish to create an image of.
  4504. *
  4505. * inOptions:
  4506. * Options. In Mac OS X 10.8 and later, you may pass
  4507. * kHIViewOffscreenImageUseWindowBackingResolution. Otherwise this
  4508. * parameter must be 0.
  4509. *
  4510. * outFrame:
  4511. * The frame of the view within the resultant image. It is in the
  4512. * coordinate system of the image, where 0,0 is the top left
  4513. * corner of the image. This is so you can know exactly where the
  4514. * view lives in the image when the view draws outside its bounds
  4515. * for things such as shadows.
  4516. *
  4517. * outImage:
  4518. * The image of the view, including anything that would be drawn
  4519. * outside the view's frame.
  4520. *
  4521. * Result:
  4522. * An operating system status code.
  4523. *
  4524. * Availability:
  4525. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  4526. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4527. * Non-Carbon CFM: not available
  4528. }
  4529. function HIViewCreateOffscreenImage( inView: HIViewRef; inOptions: OptionBits; outFrame: HIRectPtr { can be NULL }; var outImage: CGImageRef ): OSStatus; external name '_HIViewCreateOffscreenImage';
  4530. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4531. {
  4532. * HIViewDrawCGImage()
  4533. *
  4534. * Discussion:
  4535. * Draws an image in the right direction for an HIView. This is
  4536. * functionally the same as CGContextDrawImage, but it flips the
  4537. * context appropriately so that the image is drawn correctly.
  4538. * Because HIViews have their origin at the top, left, you are
  4539. * really drawing upside-down, so if you were to use the CG image
  4540. * drawing, you'd see what I mean! This call attempts to insulate
  4541. * you from that fact.
  4542. *
  4543. * Mac OS X threading:
  4544. * Not thread safe
  4545. *
  4546. * Parameters:
  4547. *
  4548. * inContext:
  4549. * The context to draw in.
  4550. *
  4551. * inBounds:
  4552. * The bounds to draw the image into.
  4553. *
  4554. * inImage:
  4555. * The image to draw.
  4556. *
  4557. * Result:
  4558. * An operating system status code.
  4559. *
  4560. * Availability:
  4561. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  4562. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4563. * Non-Carbon CFM: not available
  4564. }
  4565. function HIViewDrawCGImage( inContext: CGContextRef; const (*var*) inBounds: HIRect; inImage: CGImageRef ): OSStatus; external name '_HIViewDrawCGImage';
  4566. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4567. {$endc} {not TARGET_CPU_64}
  4568. {$ifc not TARGET_CPU_64}
  4569. {
  4570. * HIViewGetFeatures()
  4571. *
  4572. * Discussion:
  4573. * Returns the features for the current view. This only returns
  4574. * feature bits for the HIView space. Older Control Manager features
  4575. * such as kControlSupportsDataAccess are not returned.
  4576. *
  4577. * Mac OS X threading:
  4578. * Not thread safe
  4579. *
  4580. * Parameters:
  4581. *
  4582. * inView:
  4583. * The view to query
  4584. *
  4585. * outFeatures:
  4586. * On output, the features for the view.
  4587. *
  4588. * Result:
  4589. * An operating system status code.
  4590. *
  4591. * Availability:
  4592. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  4593. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  4594. * Non-Carbon CFM: not available
  4595. }
  4596. function HIViewGetFeatures( inView: HIViewRef; var outFeatures: HIViewFeatures ): OSStatus; external name '_HIViewGetFeatures';
  4597. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  4598. {
  4599. * HIViewChangeFeatures()
  4600. *
  4601. * Discussion:
  4602. * Allows you to change a view's features on the fly. Typically,
  4603. * this is up to the view itself to control. For example, it might
  4604. * decide that under some situations it is opaque and in others it
  4605. * is transparent. In general entities outside of the view itself
  4606. * should not call this function. The only exception might be UI
  4607. * building tools, where it would want to make sure a view always
  4608. * responds to clicks, for example, so it could override mouse
  4609. * tracking to drag items around.
  4610. *
  4611. * When implementing a custom HIView, it is common to use
  4612. * HIViewChangeFeatures in the view's kEventHIObjectInitialize
  4613. * function to set up the view's initial feature bits. If your view
  4614. * needs to run on Mac OS X 10.2, however, where
  4615. * HIViewChangeFeatures is not available, you can set the view's
  4616. * initial feature bits by handling kEventControlInitialize and
  4617. * returning the appropriate feature flags in the
  4618. * kEventParamControlFeatures parameter. Note that in this case, you
  4619. * can only return feature flag constants starting with "kControl"
  4620. * from the Control Feature Bits enumeration in Controls.h; you
  4621. * cannot return kHIViewFeature constants.
  4622. *
  4623. * Mac OS X threading:
  4624. * Not thread safe
  4625. *
  4626. * Parameters:
  4627. *
  4628. * inView:
  4629. * The view to change
  4630. *
  4631. * inFeaturesToSet:
  4632. * The features to enable
  4633. *
  4634. * inFeaturesToClear:
  4635. * The features to disable
  4636. *
  4637. * Result:
  4638. * An operating system status code.
  4639. *
  4640. * Availability:
  4641. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  4642. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  4643. * Non-Carbon CFM: not available
  4644. }
  4645. function HIViewChangeFeatures( inView: HIViewRef; inFeaturesToSet: HIViewFeatures; inFeaturesToClear: HIViewFeatures ): OSStatus; external name '_HIViewChangeFeatures';
  4646. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  4647. {$endc} {not TARGET_CPU_64}
  4648. {
  4649. * Summary:
  4650. * Constants for use with the HICreateTransformedCGImage API.
  4651. }
  4652. const
  4653. {
  4654. * No visual transform should be applied.
  4655. }
  4656. kHITransformNone = $00;
  4657. {
  4658. * The image should be transformed to use a disabled appearance. This
  4659. * transform should not be combined with any other transform.
  4660. }
  4661. kHITransformDisabled = $01;
  4662. {
  4663. * The image should be transformed to use a selected appearance. This
  4664. * transform should not be combined with any other transform.
  4665. }
  4666. kHITransformSelected = $4000;
  4667. {$ifc not TARGET_CPU_64}
  4668. {
  4669. * HICreateTransformedCGImage()
  4670. *
  4671. * Summary:
  4672. * Creates a new CGImage with a standard selected or disabled
  4673. * appearance.
  4674. *
  4675. * Mac OS X threading:
  4676. * Not thread safe
  4677. *
  4678. * Parameters:
  4679. *
  4680. * inImage:
  4681. * The original image.
  4682. *
  4683. * inTransform:
  4684. * The transform to apply to the image.
  4685. *
  4686. * outImage:
  4687. * The new image. This image should be released by the caller.
  4688. *
  4689. * Availability:
  4690. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  4691. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  4692. * Non-Carbon CFM: not available
  4693. }
  4694. function HICreateTransformedCGImage( inImage: CGImageRef; inTransform: OptionBits; var outImage: CGImageRef ): OSStatus; external name '_HICreateTransformedCGImage';
  4695. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  4696. {
  4697. * HIViewGetEventTarget()
  4698. *
  4699. * Discussion:
  4700. * Returns the EventTargetRef for the specified view. Once you
  4701. * obtain this reference, you can send events to the target and
  4702. * install event handler on it.
  4703. *
  4704. * Mac OS X threading:
  4705. * Not thread safe
  4706. *
  4707. * Parameters:
  4708. *
  4709. * inView:
  4710. * The view to return the target for.
  4711. *
  4712. * Result:
  4713. * An EventTargetRef.
  4714. *
  4715. * Availability:
  4716. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  4717. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  4718. * Non-Carbon CFM: not available
  4719. }
  4720. function HIViewGetEventTarget( inView: HIViewRef ): EventTargetRef; external name '_HIViewGetEventTarget';
  4721. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  4722. {
  4723. * HIViewSetUpTextColor()
  4724. *
  4725. * Summary:
  4726. * Applies the proper text color for the given view to the current
  4727. * context.
  4728. *
  4729. * Discussion:
  4730. * An embedding-savvy view which draws text must ensure that its
  4731. * text color properly contrasts the background on which it draws.
  4732. * This routine sends kEventControlApplyTextColor to each superview
  4733. * in the view hierarchy to determine and apply the proper text
  4734. * color to the given context until the event is handled. If no
  4735. * superview handles the event, HIView chooses a text color which
  4736. * contrasts any ThemeBrush which has been associated with the
  4737. * owning window (see SetThemeWindowBackground).
  4738. *
  4739. * Mac OS X threading:
  4740. * Not thread safe
  4741. *
  4742. * Parameters:
  4743. *
  4744. * inView:
  4745. * The HIViewRef that wants to draw text.
  4746. *
  4747. * inContext:
  4748. * The context into which drawing will take place.
  4749. *
  4750. * Result:
  4751. * An OSStatus code indicating success or failure. The most likely
  4752. * error is a controlHandleInvalidErr, resulting from a bad
  4753. * HIViewRef. Any non-noErr result indicates that the color set up
  4754. * failed, and that the caller should probably give up its attempt
  4755. * to draw.
  4756. *
  4757. * Availability:
  4758. * Mac OS X: in version 10.5 and later in Carbon.framework [32-bit only]
  4759. * CarbonLib: not available
  4760. * Non-Carbon CFM: not available
  4761. }
  4762. function HIViewSetUpTextColor( inView: HIViewRef; inContext: CGContextRef ): OSStatus; external name '_HIViewSetUpTextColor';
  4763. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  4764. {$endc} {not TARGET_CPU_64}
  4765. {$endc} {TARGET_OS_MAC}
  4766. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  4767. end.
  4768. {$endc} {not MACOSALLINCLUDE}