HIView.pas 215 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820
  1. {
  2. File: HIToolbox/HIView.h
  3. Contains: HIView routines
  4. Version: HIToolbox-219.4.81~2
  5. Copyright: © 2001-2005 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  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. {
  44. Modified for use with Free Pascal
  45. Version 200
  46. Please report any bugs to <[email protected]>
  47. }
  48. {$mode macpas}
  49. {$packenum 1}
  50. {$macro on}
  51. {$inline on}
  52. {$CALLING MWPASCAL}
  53. unit HIView;
  54. interface
  55. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  56. {$setc GAP_INTERFACES_VERSION := $0200}
  57. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  58. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  59. {$endc}
  60. {$ifc defined CPUPOWERPC and defined CPUI386}
  61. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  62. {$endc}
  63. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  64. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  65. {$endc}
  66. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  67. {$setc __ppc__ := 1}
  68. {$elsec}
  69. {$setc __ppc__ := 0}
  70. {$endc}
  71. {$ifc not defined __i386__ and defined CPUI386}
  72. {$setc __i386__ := 1}
  73. {$elsec}
  74. {$setc __i386__ := 0}
  75. {$endc}
  76. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  77. {$error Conflicting definitions for __ppc__ and __i386__}
  78. {$endc}
  79. {$ifc defined __ppc__ and __ppc__}
  80. {$setc TARGET_CPU_PPC := TRUE}
  81. {$setc TARGET_CPU_X86 := FALSE}
  82. {$elifc defined __i386__ and __i386__}
  83. {$setc TARGET_CPU_PPC := FALSE}
  84. {$setc TARGET_CPU_X86 := TRUE}
  85. {$elsec}
  86. {$error Neither __ppc__ nor __i386__ is defined.}
  87. {$endc}
  88. {$setc TARGET_CPU_PPC_64 := FALSE}
  89. {$ifc defined FPC_BIG_ENDIAN}
  90. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  91. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  92. {$elifc defined FPC_LITTLE_ENDIAN}
  93. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  94. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  95. {$elsec}
  96. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  97. {$endc}
  98. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  99. {$setc CALL_NOT_IN_CARBON := FALSE}
  100. {$setc OLDROUTINENAMES := FALSE}
  101. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  102. {$setc OPAQUE_UPP_TYPES := TRUE}
  103. {$setc OTCARBONAPPLICATION := TRUE}
  104. {$setc OTKERNEL := FALSE}
  105. {$setc PM_USE_SESSION_APIS := TRUE}
  106. {$setc TARGET_API_MAC_CARBON := TRUE}
  107. {$setc TARGET_API_MAC_OS8 := FALSE}
  108. {$setc TARGET_API_MAC_OSX := TRUE}
  109. {$setc TARGET_CARBON := TRUE}
  110. {$setc TARGET_CPU_68K := FALSE}
  111. {$setc TARGET_CPU_MIPS := FALSE}
  112. {$setc TARGET_CPU_SPARC := FALSE}
  113. {$setc TARGET_OS_MAC := TRUE}
  114. {$setc TARGET_OS_UNIX := FALSE}
  115. {$setc TARGET_OS_WIN32 := FALSE}
  116. {$setc TARGET_RT_MAC_68881 := FALSE}
  117. {$setc TARGET_RT_MAC_CFM := FALSE}
  118. {$setc TARGET_RT_MAC_MACHO := TRUE}
  119. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  120. {$setc TYPE_BOOL := FALSE}
  121. {$setc TYPE_EXTENDED := FALSE}
  122. {$setc TYPE_LONGLONG := TRUE}
  123. uses MacTypes,CFArray,CFBase,CGContext,CGImage,CarbonEventsCore,Drag,Events,Quickdraw,Menus,Appearance,Controls,CarbonEvents,HIGeometry,Icons,HIShape;
  124. {$ALIGN MAC68K}
  125. type
  126. HIViewRef = ControlRef;
  127. type
  128. HIViewID = ControlID;
  129. {
  130. * kHIViewWindowContentID
  131. *
  132. * Discussion:
  133. * The standard view ID for the content view of a window.
  134. *
  135. * Mac OS X threading:
  136. * Not thread safe
  137. *
  138. * Availability:
  139. * Mac OS X: in version 10.2 and later in Carbon.framework
  140. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  141. * Non-Carbon CFM: not available
  142. }
  143. {GRP translation note: kHIViewWindowContentID is really a C language external constant exported from
  144. CarbonLib (Carbon.framework). Treating it as an externally declared variable works as long as it
  145. used as a READ ONLY variable. CodeWarrior Pascal has no capability for enforcing READ ONLY usage
  146. so it is up to the programmer to obey the READ ONLY rule. GPC does enforce READ ONLY usage with the
  147. attribute (const).}
  148. {WARNING: The CFM CarbonLib export for kHIViewWindowContentID is broken. For CFM CodeWarrior Pascal,
  149. some workarounds are:
  150. 1. Use CFBundle loading and CFBundleGetDataPointerForName to obtain the correct data.
  151. 2. For composting windows, the correct data can be obtained with code similar to:
  152. ignoreResult := GetRootControl( theWind, theContentRoot );
  153. ignoreResult := GetControlID( theContentRoot, theContentControlID );
  154. The correct data for kHIViewWindowContentID is in theContentControlID.
  155. }
  156. var kHIViewWindowContentID: HIViewID; external name '_kHIViewWindowContentID'; (* attribute const *)
  157. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  158. {
  159. * kHIViewWindowGrowBoxID
  160. *
  161. * Discussion:
  162. * The standard view ID for the grow box view of a window. Not all
  163. * windows have grow boxes, so be aware that you might not find this
  164. * view if you look for it.
  165. *
  166. * Mac OS X threading:
  167. * Not thread safe
  168. *
  169. * Availability:
  170. * Mac OS X: in version 10.2 and later in Carbon.framework
  171. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  172. * Non-Carbon CFM: not available
  173. }
  174. {GRP translation note: kHIViewWindowGrowBoxID is really a C language external constant exported from
  175. CarbonLib (Carbon.framework). Treating it as an externally declared variable works as long as it
  176. used as a READ ONLY variable. CodeWarrior Pascal has no capability for enforcing READ ONLY usage
  177. so it is up to the programmer to obey the READ ONLY rule. GPC does enforce READ ONLY usage with the
  178. attribute (const).}
  179. var kHIViewWindowGrowBoxID: HIViewID; external name '_kHIViewWindowGrowBoxID'; (* attribute const *)
  180. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  181. {
  182. * Discussion:
  183. * HIViewZOrderOp
  184. }
  185. const
  186. {
  187. * Indicates we wish to order a view above another view.
  188. }
  189. kHIViewZOrderAbove = 1;
  190. {
  191. * Indicates we wish to order a view below another view.
  192. }
  193. kHIViewZOrderBelow = 2;
  194. type
  195. HIViewZOrderOp = UInt32;
  196. {
  197. * HIViewFrameMetrics
  198. *
  199. * Summary:
  200. * Describes the offsets from the structure to the content area of a
  201. * view; for example, the top metric is the difference between the
  202. * vertical coordinate of the top edge of the viewÕs structure
  203. * region and the vertical coordinate of the top edge of the viewÕs
  204. * content region. This structure is returned by a view in response
  205. * to a kEventControlGetFrameMetrics event.
  206. }
  207. type
  208. HIViewFrameMetrics = record
  209. {
  210. * Height of the top of the structure area.
  211. }
  212. top: Float32;
  213. {
  214. * Width of the left of the structure area.
  215. }
  216. left: Float32;
  217. {
  218. * Height of the bottom of the structure area.
  219. }
  220. bottom: Float32;
  221. {
  222. * Width of the right of the structure area.
  223. }
  224. right: Float32;
  225. end;
  226. {==============================================================================}
  227. { ATTRIBUTES }
  228. {==============================================================================}
  229. {
  230. * Summary:
  231. * View attributes are generally determined by clients of the view;
  232. * the view itself should observe the attributes and behave
  233. * accordingly.
  234. *
  235. * Discussion:
  236. * View Attributes
  237. }
  238. const
  239. {
  240. * When set, the control will send the command it generates to the
  241. * user focus and propagate as it would naturally from there. The
  242. * default is to send the command to itself and then to its parent
  243. * and so forth.
  244. }
  245. kHIViewAttributeSendCommandToUserFocus = 1 shl 0;
  246. {
  247. * Indicates that a text editing control should behave appropriately
  248. * for editing fields in a dialog; specifically, the control should
  249. * ignore the Return, Enter, Escape, and Tab keys, and allow them to
  250. * be processed by other participants in the event flow. Available on
  251. * Mac OS X 10.3 and later.
  252. }
  253. kHIViewAttributeIsFieldEditor = 1 shl 1;
  254. {
  255. * Legacy synonym for kHIViewAttributeSendCommandToUserFocus. Please
  256. * use it instead.
  257. }
  258. kHIViewSendCommandToUserFocus = kHIViewAttributeSendCommandToUserFocus;
  259. {
  260. * HIView features
  261. *
  262. * Summary:
  263. * View feature flags are generally determined by the view itself,
  264. * and are not typically changed by clients of the view.
  265. }
  266. const
  267. {
  268. * This view supports using the ghosting protocol when live tracking
  269. * is not enabled.
  270. }
  271. kHIViewFeatureSupportsGhosting = 1 shl 0;
  272. {
  273. * This view allows subviews to be embedded within it.
  274. }
  275. kHIViewFeatureAllowsSubviews = 1 shl 1;
  276. {
  277. * If this view is clicked, the keyboard focus should be set to this
  278. * view automatically. This is primarily used for edit text controls.
  279. }
  280. kHIViewFeatureGetsFocusOnClick = 1 shl 8;
  281. {
  282. * This view supports the live feedback protocol. Necessary to
  283. * implement live scroll bar tracking. Clients of a view should never
  284. * disable this.
  285. }
  286. kHIViewFeatureSupportsLiveFeedback = 1 shl 10;
  287. {
  288. * This view can be put into a radio group. Radio buttons and bevel
  289. * buttons report this behavior.
  290. }
  291. kHIViewFeatureSupportsRadioBehavior = 1 shl 11;
  292. {
  293. * This view supports the auto-toggle protocol and should at the very
  294. * least auto- toggle from off to on and back. The view can support a
  295. * carbon event for more advanced auto-toggling of its value. The tab
  296. * view supports this, for example, so that when a tab is clicked its
  297. * value changes automatically.
  298. }
  299. kHIViewFeatureAutoToggles = 1 shl 14;
  300. {
  301. * This is merely informational. Turning it off would not necessarily
  302. * disable any timer a view might be using, but it could obey this
  303. * bit if it so desired.
  304. }
  305. kHIViewFeatureIdlesWithTimer = 1 shl 23;
  306. {
  307. * This tells the control manager that the up button part increases
  308. * the value of the control instead of decreasing it. For example,
  309. * the Little Arrows (Spinner) control increase its value when the up
  310. * button is pressed. Scroll bars, on the other hand, decrease the
  311. * value when their up buttons are pressed.
  312. }
  313. kHIViewFeatureInvertsUpDownValueMeaning = 1 shl 24;
  314. {
  315. * This is an optimization for determining a view's opaque region.
  316. * When set, the view system just uses the view's structure region,
  317. * and can usually avoid having to call the view at all.
  318. }
  319. kHIViewFeatureIsOpaque = 1 shl 25;
  320. {
  321. * This is an optimization for determining what gets invalidated when
  322. * views are dirtied. For example, on a metal window, the content
  323. * view is actually fully transparent, so invalidating it doesn't
  324. * really help things. By telling the control manager that the view
  325. * is transparent and does not do any drawing, we can avoid trying to
  326. * invalidate it and instead invalidate views behind it.
  327. }
  328. kHIViewFeatureDoesNotDraw = 1 shl 27;
  329. {
  330. * Indicates to the Control Manager that this view doesn't use the
  331. * special part codes for indicator, inactive, and disabled.
  332. * Available in Mac OS X 10.3 and later.
  333. }
  334. kHIViewFeatureDoesNotUseSpecialParts = 1 shl 28;
  335. {
  336. * This is an optimization for determining the clickable region of a
  337. * window (used for metal windows, for example, when doing async
  338. * window dragging). The presence of this bit tells us not to bother
  339. * asking the control for the clickable region. A view like the
  340. * visual separator would set this bit. It's typically used in
  341. * conjunction with the kHIViewFeatureDoesNotDraw bit.
  342. }
  343. kHIViewFeatureIgnoresClicks = 1 shl 29;
  344. {
  345. * HIView valid feature sets
  346. *
  347. * Summary:
  348. * These are sets of features that are available on the version of
  349. * Mac OS X corresponding to that named in the constant.
  350. }
  351. const
  352. kHIViewValidFeaturesForPanther = $3B804D03;
  353. {
  354. * HIView feature synonyms
  355. *
  356. * Summary:
  357. * Legacy synonyms for HIView feature bit names. Please use the
  358. * newer names.
  359. }
  360. const
  361. kHIViewSupportsGhosting = kHIViewFeatureSupportsGhosting;
  362. kHIViewAllowsSubviews = kHIViewFeatureAllowsSubviews;
  363. kHIViewGetsFocusOnClick = kHIViewFeatureGetsFocusOnClick;
  364. kHIViewSupportsLiveFeedback = kHIViewFeatureSupportsLiveFeedback;
  365. kHIViewSupportsRadioBehavior = kHIViewFeatureSupportsRadioBehavior;
  366. kHIViewAutoToggles = kHIViewFeatureAutoToggles;
  367. kHIViewIdlesWithTimer = kHIViewFeatureIdlesWithTimer;
  368. kHIViewInvertsUpDownValueMeaning = kHIViewFeatureInvertsUpDownValueMeaning;
  369. kHIViewIsOpaque = kHIViewFeatureIsOpaque;
  370. kHIViewDoesNotDraw = kHIViewFeatureDoesNotDraw;
  371. kHIViewDoesNotUseSpecialParts = kHIViewFeatureDoesNotUseSpecialParts;
  372. kHIViewIgnoresClicks = kHIViewFeatureIgnoresClicks;
  373. type
  374. HIViewFeatures = UInt64;
  375. {==============================================================================}
  376. { VIEW PART CODES }
  377. {==============================================================================}
  378. type
  379. HIViewPartCode = ControlPartCode;
  380. HIViewPartCodePtr = ^HIViewPartCode;
  381. {
  382. * HIViewPartCodes
  383. *
  384. }
  385. const
  386. kHIViewNoPart = 0;
  387. kHIViewIndicatorPart = 129;
  388. kHIViewDisabledPart = 254;
  389. kHIViewInactivePart = 255;
  390. {
  391. * Use this constant when not referring to a specific part, but
  392. * rather the entire view.
  393. }
  394. kHIViewEntireView = kHIViewNoPart;
  395. {
  396. * HIView Meta-Parts
  397. *
  398. * Summary:
  399. * A meta-part is a part used in a call to the HIViewCopyShape API.
  400. * These parts are parts that might be defined by a view. They
  401. * define a region of a view. Along with these parts, you can also
  402. * pass in normal part codes to get the regions of those parts. Not
  403. * all views fully support this feature.
  404. }
  405. const
  406. {
  407. * The structure region is the total area over which the view draws.
  408. }
  409. kHIViewStructureMetaPart = -1;
  410. {
  411. * The content region is only defined by views that can embed other
  412. * views. It is the area that embedded content can live.
  413. }
  414. kHIViewContentMetaPart = -2;
  415. {
  416. * Mac OS X 10.2 or later
  417. }
  418. kHIViewOpaqueMetaPart = -3;
  419. {
  420. * Mac OS X 10.3 or later, only used for async window dragging.
  421. * Default is structure region.
  422. }
  423. kHIViewClickableMetaPart = -4;
  424. {
  425. * HIView Focus Parts
  426. *
  427. }
  428. const
  429. {
  430. * Tells view to clear its focus
  431. }
  432. kHIViewFocusNoPart = kHIViewNoPart;
  433. {
  434. * Tells view to focus on the next part
  435. }
  436. kHIViewFocusNextPart = -1;
  437. {
  438. * Tells view to focus on the previous part
  439. }
  440. kHIViewFocusPrevPart = -2;
  441. {==============================================================================}
  442. { CONTENT }
  443. {==============================================================================}
  444. type
  445. HIViewImageContentType = ControlContentType;
  446. type
  447. HIViewImageContentInfo = ControlImageContentInfo;
  448. type
  449. HIViewContentType = SInt16;
  450. {
  451. * HIViewContentTypes
  452. *
  453. }
  454. const
  455. {
  456. * The view has no content besides text.
  457. }
  458. kHIViewContentTextOnly = 0;
  459. {
  460. * The view has no content.
  461. }
  462. kHIViewContentNone = 0;
  463. {
  464. * The view's content is an IconSuiteRef.
  465. }
  466. kHIViewContentIconSuiteRef = 129;
  467. {
  468. * The view's content is an IconRef.
  469. }
  470. kHIViewContentIconRef = 132;
  471. {
  472. * The view's content is a CGImageRef.
  473. }
  474. kHIViewContentCGImageRef = 134;
  475. {
  476. * HIViewContentInfo
  477. }
  478. type
  479. HIViewContentInfo = record
  480. {
  481. * The type of content referenced in the content union.
  482. }
  483. contentType: HIViewContentType;
  484. case SInt16 of
  485. 0: (
  486. iconSuite: IconSuiteRef;
  487. );
  488. 1: (
  489. iconRef: IconRef_fix;
  490. );
  491. 2: (
  492. imageRef: CGImageRef;
  493. );
  494. end;
  495. type
  496. HIViewContentInfoPtr = ^HIViewContentInfo;
  497. {==============================================================================}
  498. { ERROR CODES }
  499. {==============================================================================}
  500. {
  501. * Discussion:
  502. * View/Control Error Codes
  503. }
  504. const
  505. {
  506. * This value will be returned from an HIView API or a Control
  507. * Manager API when an action that is only supported on a compositing
  508. * window is attempted on a non-compositing window. This doesn't
  509. * necessarily mean that the API is only callable for compositing
  510. * windows; sometimes the legality of the action is based on other
  511. * parameters of the API. See HIViewAddSubview for one particular use
  512. * of this error code.
  513. }
  514. errNeedsCompositedWindow = -30598;
  515. {==============================================================================}
  516. { HIOBJECT SUPPORT }
  517. { Setting Initial Bounds }
  518. { When creating a view using HIObjectCreate, you can set the initial bounds }
  519. { automatically by passing in an initialization event into HIObjectCreate }
  520. { with a kEventParamBounds parameter as typeHIRect or typeQDRectangle. }
  521. {==============================================================================}
  522. { The HIObject class ID for the HIView class. }
  523. {$ifc USE_CFSTR_CONSTANT_MACROS}
  524. {$definec kHIViewClassID CFSTRP('com.apple.hiview')}
  525. {$endc}
  526. {==============================================================================}
  527. { EMBEDDING }
  528. {==============================================================================}
  529. {
  530. * HIViewGetRoot()
  531. *
  532. * Discussion:
  533. * Returns the root view for a window.
  534. *
  535. * Mac OS X threading:
  536. * Not thread safe
  537. *
  538. * Parameters:
  539. *
  540. * inWindow:
  541. * The window to get the root for.
  542. *
  543. * Result:
  544. * The root view for the window, or NULL if an invalid window is
  545. * passed.
  546. *
  547. * Availability:
  548. * Mac OS X: in version 10.2 and later in Carbon.framework
  549. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  550. * Non-Carbon CFM: not available
  551. }
  552. function HIViewGetRoot( inWindow: WindowRef ): HIViewRef; external name '_HIViewGetRoot';
  553. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  554. {
  555. * HIViewAddSubview()
  556. *
  557. * Discussion:
  558. * Adds a subview to the given parent. The new subview is added to
  559. * the front of the list of subviews (i.e., it is made topmost).
  560. *
  561. * The subview being added is not retained by the new parent view.
  562. * Do not release the view after adding it, or it will cease to
  563. * exist. All views in a window will be released automatically when
  564. * the window is destroyed.
  565. *
  566. * Mac OS X threading:
  567. * Not thread safe
  568. *
  569. * Parameters:
  570. *
  571. * inParent:
  572. * The view which will receive the new subview.
  573. *
  574. * inNewChild:
  575. * The subview being added.
  576. *
  577. * Result:
  578. * An operating system result code.
  579. * errNeedsCompositedWindow will be returned when you try to embed
  580. * into the content view in a non-compositing window; you can only
  581. * embed into the content view in compositing windows.
  582. *
  583. * Availability:
  584. * Mac OS X: in version 10.2 and later in Carbon.framework
  585. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  586. * Non-Carbon CFM: not available
  587. }
  588. function HIViewAddSubview( inParent: HIViewRef; inNewChild: HIViewRef ): OSStatus; external name '_HIViewAddSubview';
  589. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  590. {
  591. * HIViewRemoveFromSuperview()
  592. *
  593. * Discussion:
  594. * Removes a view from its parent.
  595. * The subview being removed from the parent is not released and
  596. * still exists.
  597. *
  598. * Mac OS X threading:
  599. * Not thread safe
  600. *
  601. * Parameters:
  602. *
  603. * inView:
  604. * The view to remove.
  605. *
  606. * Result:
  607. * An operating system result code.
  608. *
  609. * Availability:
  610. * Mac OS X: in version 10.2 and later in Carbon.framework
  611. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  612. * Non-Carbon CFM: not available
  613. }
  614. function HIViewRemoveFromSuperview( inView: HIViewRef ): OSStatus; external name '_HIViewRemoveFromSuperview';
  615. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  616. {
  617. * HIViewGetSuperview()
  618. *
  619. * Discussion:
  620. * Returns a view's parent view.
  621. *
  622. * Mac OS X threading:
  623. * Not thread safe
  624. *
  625. * Parameters:
  626. *
  627. * inView:
  628. * The view whose parent you are interested in getting.
  629. *
  630. * Result:
  631. * An HIView reference, or NULL if this view has no parent or is
  632. * invalid.
  633. *
  634. * Availability:
  635. * Mac OS X: in version 10.2 and later in Carbon.framework
  636. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  637. * Non-Carbon CFM: not available
  638. }
  639. function HIViewGetSuperview( inView: HIViewRef ): HIViewRef; external name '_HIViewGetSuperview';
  640. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  641. {
  642. * HIViewGetFirstSubview()
  643. *
  644. * Discussion:
  645. * Returns the first subview of a container. The first subview is
  646. * the topmost subview in z-order.
  647. *
  648. * Mac OS X threading:
  649. * Not thread safe
  650. *
  651. * Parameters:
  652. *
  653. * inView:
  654. * The view whose subview you are fetching.
  655. *
  656. * Result:
  657. * An HIView reference, or NULL if this view has no subviews or is
  658. * invalid.
  659. *
  660. * Availability:
  661. * Mac OS X: in version 10.2 and later in Carbon.framework
  662. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  663. * Non-Carbon CFM: not available
  664. }
  665. function HIViewGetFirstSubview( inView: HIViewRef ): HIViewRef; external name '_HIViewGetFirstSubview';
  666. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  667. {
  668. * HIViewGetLastSubview()
  669. *
  670. * Discussion:
  671. * Returns the last subview of a container. The last subview is the
  672. * bottommost subview in z-order.
  673. *
  674. * Mac OS X threading:
  675. * Not thread safe
  676. *
  677. * Parameters:
  678. *
  679. * inView:
  680. * The view whose subview you are fetching.
  681. *
  682. * Result:
  683. * An HIView reference, or NULL if this view has no subviews or is
  684. * invalid.
  685. *
  686. * Availability:
  687. * Mac OS X: in version 10.2 and later in Carbon.framework
  688. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  689. * Non-Carbon CFM: not available
  690. }
  691. function HIViewGetLastSubview( inView: HIViewRef ): HIViewRef; external name '_HIViewGetLastSubview';
  692. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  693. {
  694. * HIViewGetNextView()
  695. *
  696. * Discussion:
  697. * Returns the next view after the one given, in z-order.
  698. *
  699. * Mac OS X threading:
  700. * Not thread safe
  701. *
  702. * Parameters:
  703. *
  704. * inView:
  705. * The view to use as reference.
  706. *
  707. * Result:
  708. * An HIView reference, or NULL if this view has no view behind it
  709. * or is invalid.
  710. *
  711. * Availability:
  712. * Mac OS X: in version 10.2 and later in Carbon.framework
  713. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  714. * Non-Carbon CFM: not available
  715. }
  716. function HIViewGetNextView( inView: HIViewRef ): HIViewRef; external name '_HIViewGetNextView';
  717. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  718. {
  719. * HIViewGetPreviousView()
  720. *
  721. * Discussion:
  722. * Returns the previous view before the one given, in z-order.
  723. *
  724. * Mac OS X threading:
  725. * Not thread safe
  726. *
  727. * Parameters:
  728. *
  729. * inView:
  730. * The view to use as reference.
  731. *
  732. * Result:
  733. * An HIView reference, or NULL if this view has no view in front of
  734. * it or is invalid.
  735. *
  736. * Availability:
  737. * Mac OS X: in version 10.2 and later in Carbon.framework
  738. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  739. * Non-Carbon CFM: not available
  740. }
  741. function HIViewGetPreviousView( inView: HIViewRef ): HIViewRef; external name '_HIViewGetPreviousView';
  742. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  743. {
  744. * HIViewCountSubviews()
  745. *
  746. * Summary:
  747. * Counts the number of subviews embedded in a view.
  748. *
  749. * Mac OS X threading:
  750. * Not thread safe
  751. *
  752. * Parameters:
  753. *
  754. * inView:
  755. * The view for which to count subviews.
  756. *
  757. * outSubviewCount:
  758. *
  759. * Result:
  760. * The number of subviews of the specified view.
  761. *
  762. * Availability:
  763. * Mac OS X: in version 10.4 and later in Carbon.framework
  764. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  765. * Non-Carbon CFM: not available
  766. }
  767. function HIViewCountSubviews( inView: HIViewRef ): CFIndex; external name '_HIViewCountSubviews';
  768. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  769. {
  770. * HIViewGetIndexedSubview()
  771. *
  772. * Summary:
  773. * Get the Nth subview of a view.
  774. *
  775. * Discussion:
  776. * Instead of calling HIViewGetIndexedSubview repeatedly, it may be
  777. * more efficient to iterate through the subviews of a view with
  778. * calls HIViewGetFirstSubview and HIViewGetNextView.
  779. *
  780. * Mac OS X threading:
  781. * Not thread safe
  782. *
  783. * Parameters:
  784. *
  785. * inView:
  786. * The view whose indexed sub-view is being requested.
  787. *
  788. * inSubviewIndex:
  789. * The index of the subview to get.
  790. *
  791. * outSubview:
  792. * An HIViewRef to be filled with the indexed subview.
  793. *
  794. * Result:
  795. * A result code indicating success or failure.
  796. *
  797. * Availability:
  798. * Mac OS X: in version 10.4 and later in Carbon.framework
  799. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  800. * Non-Carbon CFM: not available
  801. }
  802. function HIViewGetIndexedSubview( inView: HIViewRef; inSubviewIndex: CFIndex; var outSubview: HIViewRef ): OSStatus; external name '_HIViewGetIndexedSubview';
  803. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  804. {
  805. * HIViewSetZOrder()
  806. *
  807. * Discussion:
  808. * Allows you to change the front-to-back ordering of sibling views.
  809. *
  810. * Mac OS X threading:
  811. * Not thread safe
  812. *
  813. * Parameters:
  814. *
  815. * inView:
  816. * The view whose Z-order you wish to change.
  817. *
  818. * inOp:
  819. * Indicates to order inView above or below inOther.
  820. *
  821. * inOther:
  822. * Another optional view to use as a reference. You can pass NULL
  823. * to mean an absolute position. For example, passing
  824. * kHIViewZOrderAbove and NULL will move a view to the front of
  825. * all of its siblings. Likewise, passing kHIViewZOrderBelow and
  826. * NULL will move it to the back.
  827. *
  828. * Result:
  829. * An operating system result code.
  830. *
  831. * Availability:
  832. * Mac OS X: in version 10.2 and later in Carbon.framework
  833. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  834. * Non-Carbon CFM: not available
  835. }
  836. function HIViewSetZOrder( inView: HIViewRef; inOp: HIViewZOrderOp; inOther: HIViewRef { can be NULL } ): OSStatus; external name '_HIViewSetZOrder';
  837. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  838. {==============================================================================}
  839. { STATE and VALUES }
  840. {==============================================================================}
  841. {
  842. * HIViewKind
  843. }
  844. type
  845. HIViewKind = record
  846. {
  847. * The signature of the view. Apple reserves all signatures made up
  848. * of only lowercase characters.
  849. }
  850. signature: OSType;
  851. {
  852. * The kind of the view. Apple reserves all kinds made up of only
  853. * lowercase characters.
  854. }
  855. kind: OSType;
  856. end;
  857. {
  858. * View signature kind
  859. *
  860. }
  861. const
  862. {
  863. * The signature of all HIToolbox views.
  864. }
  865. kHIViewKindSignatureApple = $6170706C (* 'appl' *);
  866. {
  867. * HIViewSetVisible()
  868. *
  869. * Discussion:
  870. * Hides or shows a view. Marks the area the view will occupy or
  871. * used to occupy as needing to be redrawn later.
  872. *
  873. * Mac OS X threading:
  874. * Not thread safe
  875. *
  876. * Parameters:
  877. *
  878. * inView:
  879. * The view to hide or show.
  880. *
  881. * inVisible:
  882. * A boolean value which indicates whether you wish to hide the
  883. * view (false) or show the view (true).
  884. *
  885. * Result:
  886. * An operating system result code.
  887. *
  888. * Availability:
  889. * Mac OS X: in version 10.2 and later in Carbon.framework
  890. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  891. * Non-Carbon CFM: not available
  892. }
  893. function HIViewSetVisible( inView: HIViewRef; inVisible: Boolean ): OSStatus; external name '_HIViewSetVisible';
  894. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  895. {
  896. * HIViewIsVisible()
  897. *
  898. * Summary:
  899. * Returns whether a view is visible.
  900. *
  901. * Discussion:
  902. * Note that HIViewIsVisible returns a view's effective visibility,
  903. * which is determined both by the view's own visibility and the
  904. * visibility of its parent views. If a parent view is invisible,
  905. * then this view is considered to be invisible also.
  906. *
  907. * Latent visibility can be determined with HIViewIsLatentlyVisible.
  908. *
  909. * Mac OS X threading:
  910. * Not thread safe
  911. *
  912. * Parameters:
  913. *
  914. * inView:
  915. * The view whose visibility you wish to determine.
  916. *
  917. * Result:
  918. * A boolean value indicating whether the view is visible (true) or
  919. * hidden (false).
  920. *
  921. * Availability:
  922. * Mac OS X: in version 10.2 and later in Carbon.framework
  923. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  924. * Non-Carbon CFM: not available
  925. }
  926. function HIViewIsVisible( inView: HIViewRef ): Boolean; external name '_HIViewIsVisible';
  927. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  928. {
  929. * HIViewIsLatentlyVisible()
  930. *
  931. * Summary:
  932. * Returns whether or not a view is latently visible.
  933. *
  934. * Discussion:
  935. * The view's visibility is also affected by the visibility of its
  936. * parents; if any parent view is invisible, this view is considered
  937. * invisible as well. HIViewIsLatentlyVisible returns whether a view
  938. * is latently visible, even if its parents are invisible.
  939. *
  940. * Mac OS X threading:
  941. * Not thread safe
  942. *
  943. * Parameters:
  944. *
  945. * inView:
  946. * The view whose latent visibility is to be checked.
  947. *
  948. * Result:
  949. * True if the view is latently visible, otherwise false.
  950. *
  951. * Availability:
  952. * Mac OS X: in version 10.4 and later in Carbon.framework
  953. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  954. * Non-Carbon CFM: not available
  955. }
  956. function HIViewIsLatentlyVisible( inView: HIViewRef ): Boolean; external name '_HIViewIsLatentlyVisible';
  957. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  958. {
  959. * HIViewSetHilite()
  960. *
  961. * Summary:
  962. * Changes the highlighting of a view.
  963. *
  964. * Mac OS X threading:
  965. * Not thread safe
  966. *
  967. * Parameters:
  968. *
  969. * inView:
  970. * The view on which to set the highlight.
  971. *
  972. * inHilitePart:
  973. * An HIViewPartCode indicating the part of the view to highlight.
  974. *
  975. * Result:
  976. * A result code indicating success or failure.
  977. *
  978. * Availability:
  979. * Mac OS X: in version 10.4 and later in Carbon.framework
  980. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  981. * Non-Carbon CFM: not available
  982. }
  983. function HIViewSetHilite( inView: HIViewRef; inHilitePart: HIViewPartCode ): OSStatus; external name '_HIViewSetHilite';
  984. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  985. {
  986. * HIViewIsActive()
  987. *
  988. * Summary:
  989. * Returns whether or not a view is active.
  990. *
  991. * Discussion:
  992. * The view's active state is also affected by the active state of
  993. * its parents; if any parent view is inactive, this view is
  994. * considered inactive as well. HIViewIsActive can optionally check
  995. * to see if a view is latently active, even if its parents are
  996. * inactive.
  997. *
  998. * Mac OS X threading:
  999. * Not thread safe
  1000. *
  1001. * Parameters:
  1002. *
  1003. * inView:
  1004. * The view whose active state is to be checked.
  1005. *
  1006. * outIsLatentActive:
  1007. * A pointer to a Boolean to be filled in with the latent active
  1008. * state of the view. The Boolean is set to true if the view is
  1009. * latently active, otherwise false. Can be NULL.
  1010. *
  1011. * Result:
  1012. * True if the view is active, otherwise false.
  1013. *
  1014. * Availability:
  1015. * Mac OS X: in version 10.4 and later in Carbon.framework
  1016. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1017. * Non-Carbon CFM: not available
  1018. }
  1019. function HIViewIsActive( inView: HIViewRef; outIsLatentActive: BooleanPtr { can be NULL } ): Boolean; external name '_HIViewIsActive';
  1020. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1021. {
  1022. * HIViewSetActivated()
  1023. *
  1024. * Summary:
  1025. * Sets whether or not a view is active or inactive. If any children
  1026. * of the view have a latent active state, they will be adjusted
  1027. * accordingly.
  1028. *
  1029. * Mac OS X threading:
  1030. * Not thread safe
  1031. *
  1032. * Parameters:
  1033. *
  1034. * inView:
  1035. * The view to activate or deactivate.
  1036. *
  1037. * inSetActivated:
  1038. * True if setting the view to active, false if setting the view
  1039. * to inactive.
  1040. *
  1041. * Result:
  1042. * A result code indicating success or failure.
  1043. *
  1044. * Availability:
  1045. * Mac OS X: in version 10.4 and later in Carbon.framework
  1046. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1047. * Non-Carbon CFM: not available
  1048. }
  1049. function HIViewSetActivated( inView: HIViewRef; inSetActivated: Boolean ): OSStatus; external name '_HIViewSetActivated';
  1050. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1051. {
  1052. * HIViewIsEnabled()
  1053. *
  1054. * Summary:
  1055. * Tests whether or not a view is enabled.
  1056. *
  1057. * Discussion:
  1058. * The view's enabled state is also affected by the enabled state of
  1059. * its parents; if any parent view is disabled, this view is
  1060. * considered disabled as well. HIViewIsEnabled can optionally check
  1061. * to see if a view is latently enabled, even if its parents are
  1062. * disabled.
  1063. *
  1064. * Mac OS X threading:
  1065. * Not thread safe
  1066. *
  1067. * Parameters:
  1068. *
  1069. * inView:
  1070. * The view to test.
  1071. *
  1072. * outIsLatentEnabled:
  1073. * A pointer to a Boolean to be filled in with the latent enabled
  1074. * state of the view. The Boolean is set to true if the view is
  1075. * latently enabled, otherwise false. Can be NULL.
  1076. *
  1077. * Result:
  1078. * True if the view is enabled, otherwise false.
  1079. *
  1080. * Availability:
  1081. * Mac OS X: in version 10.4 and later in Carbon.framework
  1082. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1083. * Non-Carbon CFM: not available
  1084. }
  1085. function HIViewIsEnabled( inView: HIViewRef; outIsLatentEnabled: BooleanPtr { can be NULL } ): Boolean; external name '_HIViewIsEnabled';
  1086. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1087. {
  1088. * HIViewSetEnabled()
  1089. *
  1090. * Summary:
  1091. * Sets whether or not a view (and any subviews) are enabled or
  1092. * disabled.
  1093. *
  1094. * Mac OS X threading:
  1095. * Not thread safe
  1096. *
  1097. * Parameters:
  1098. *
  1099. * inView:
  1100. * The view to enable or disable.
  1101. *
  1102. * inSetEnabled:
  1103. * True if setting the view to enabled, false if setting the view
  1104. * to disabled.
  1105. *
  1106. * Result:
  1107. * A result code indicating success or failure.
  1108. *
  1109. * Availability:
  1110. * Mac OS X: in version 10.4 and later in Carbon.framework
  1111. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1112. * Non-Carbon CFM: not available
  1113. }
  1114. function HIViewSetEnabled( inView: HIViewRef; inSetEnabled: Boolean ): OSStatus; external name '_HIViewSetEnabled';
  1115. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1116. {
  1117. * HIViewIsCompositingEnabled()
  1118. *
  1119. * Summary:
  1120. * Returns whether a view is being used in a compositing hierarchy.
  1121. *
  1122. * Discussion:
  1123. * A view that supports both compositing mode and non-compositing
  1124. * mode can use this routine to determine which mode it is currently
  1125. * running in. Looking for a window's kWindowCompositingAttribute is
  1126. * not sufficient, since some windows with that attribute have some
  1127. * of its views in non-compositing mode and vice-versa.
  1128. *
  1129. * Mac OS X threading:
  1130. * Not thread safe
  1131. *
  1132. * Parameters:
  1133. *
  1134. * inView:
  1135. * The view whose compositing state you wish to determine.
  1136. *
  1137. * Result:
  1138. * A boolean value indicating whether the view is in compositing
  1139. * mode (true) or non-compositing mode (false).
  1140. *
  1141. * Availability:
  1142. * Mac OS X: in version 10.4 and later in Carbon.framework
  1143. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1144. * Non-Carbon CFM: not available
  1145. }
  1146. function HIViewIsCompositingEnabled( inView: HIViewRef ): Boolean; external name '_HIViewIsCompositingEnabled';
  1147. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1148. {
  1149. * HIViewSetText()
  1150. *
  1151. * Summary:
  1152. * Sets the text of a view to the specified string.
  1153. *
  1154. * Discussion:
  1155. * The "text" of the view is the text that will be displayed when
  1156. * drawing the view. This API first attempts to set the view's text
  1157. * (generally successful on views that handle the
  1158. * kControlEditTextCFStringTag SetControlData tag). If the attempt
  1159. * is unsuccessful, the view's title is set instead.
  1160. *
  1161. * Mac OS X threading:
  1162. * Not thread safe
  1163. *
  1164. * Parameters:
  1165. *
  1166. * inView:
  1167. * The view whose text is being set.
  1168. *
  1169. * inText:
  1170. * The text to set for the view. The string is copied by the view,
  1171. * and may be released by the caller afterwards.
  1172. *
  1173. * Result:
  1174. * A result code indicating success or failure.
  1175. *
  1176. * Availability:
  1177. * Mac OS X: in version 10.4 and later in Carbon.framework
  1178. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1179. * Non-Carbon CFM: not available
  1180. }
  1181. function HIViewSetText( inView: HIViewRef; inText: CFStringRef ): OSStatus; external name '_HIViewSetText';
  1182. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1183. {
  1184. * HIViewCopyText()
  1185. *
  1186. * Summary:
  1187. * Makes a copy of the view's text as a CFString.
  1188. *
  1189. * Discussion:
  1190. * The "text" of the view is the text that will be displayed when
  1191. * drawing the view. This API first attempts to get the view's text
  1192. * (generally successful on views that handle the
  1193. * kControlEditTextCFStringTag GetControlData tag). If the attempt
  1194. * is unsuccessful, the view's title is copied instead.
  1195. *
  1196. * Mac OS X threading:
  1197. * Not thread safe
  1198. *
  1199. * Parameters:
  1200. *
  1201. * inView:
  1202. * The view for which to get the text.
  1203. *
  1204. * Result:
  1205. * A CFStringRef containing a copy of the view's text. The caller of
  1206. * HIViewCopyText is responsible for releasing the returned text.
  1207. *
  1208. * Availability:
  1209. * Mac OS X: in version 10.4 and later in Carbon.framework
  1210. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1211. * Non-Carbon CFM: not available
  1212. }
  1213. function HIViewCopyText( inView: HIViewRef ): CFStringRef; external name '_HIViewCopyText';
  1214. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1215. {
  1216. * HIViewGetValue()
  1217. *
  1218. * Summary:
  1219. * Gets a view's value.
  1220. *
  1221. * Mac OS X threading:
  1222. * Not thread safe
  1223. *
  1224. * Parameters:
  1225. *
  1226. * inView:
  1227. * The view for which to get the value.
  1228. *
  1229. * Result:
  1230. * The view's value.
  1231. *
  1232. * Availability:
  1233. * Mac OS X: in version 10.4 and later in Carbon.framework
  1234. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1235. * Non-Carbon CFM: not available
  1236. }
  1237. function HIViewGetValue( inView: HIViewRef ): SInt32; external name '_HIViewGetValue';
  1238. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1239. {
  1240. * HIViewSetValue()
  1241. *
  1242. * Summary:
  1243. * Sets a view's value.
  1244. *
  1245. * Mac OS X threading:
  1246. * Not thread safe
  1247. *
  1248. * Parameters:
  1249. *
  1250. * inView:
  1251. * The view whose value is to be set.
  1252. *
  1253. * inValue:
  1254. * The new value.
  1255. *
  1256. * Result:
  1257. * A result code indicating success or failure.
  1258. *
  1259. * Availability:
  1260. * Mac OS X: in version 10.4 and later in Carbon.framework
  1261. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1262. * Non-Carbon CFM: not available
  1263. }
  1264. function HIViewSetValue( inView: HIViewRef; inValue: SInt32 ): OSStatus; external name '_HIViewSetValue';
  1265. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1266. {
  1267. * HIViewGetMinimum()
  1268. *
  1269. * Summary:
  1270. * Gets a view's minimum value.
  1271. *
  1272. * Mac OS X threading:
  1273. * Not thread safe
  1274. *
  1275. * Parameters:
  1276. *
  1277. * inView:
  1278. * The view for which to get the minimum value.
  1279. *
  1280. * Result:
  1281. * The view's minimum value.
  1282. *
  1283. * Availability:
  1284. * Mac OS X: in version 10.4 and later in Carbon.framework
  1285. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1286. * Non-Carbon CFM: not available
  1287. }
  1288. function HIViewGetMinimum( inView: HIViewRef ): SInt32; external name '_HIViewGetMinimum';
  1289. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1290. {
  1291. * HIViewSetMinimum()
  1292. *
  1293. * Summary:
  1294. * Sets a view's minimum value.
  1295. *
  1296. * Mac OS X threading:
  1297. * Not thread safe
  1298. *
  1299. * Parameters:
  1300. *
  1301. * inView:
  1302. * The view whose minimum value is to be set.
  1303. *
  1304. * inMinimum:
  1305. * The new minimum value.
  1306. *
  1307. * Result:
  1308. * A result code indicating success or failure.
  1309. *
  1310. * Availability:
  1311. * Mac OS X: in version 10.4 and later in Carbon.framework
  1312. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1313. * Non-Carbon CFM: not available
  1314. }
  1315. function HIViewSetMinimum( inView: HIViewRef; inMinimum: SInt32 ): OSStatus; external name '_HIViewSetMinimum';
  1316. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1317. {
  1318. * HIViewGetMaximum()
  1319. *
  1320. * Summary:
  1321. * Gets a view's maximum value.
  1322. *
  1323. * Mac OS X threading:
  1324. * Not thread safe
  1325. *
  1326. * Parameters:
  1327. *
  1328. * inView:
  1329. * The view for which to get the maximum value.
  1330. *
  1331. * Result:
  1332. * The view's maximum value.
  1333. *
  1334. * Availability:
  1335. * Mac OS X: in version 10.4 and later in Carbon.framework
  1336. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1337. * Non-Carbon CFM: not available
  1338. }
  1339. function HIViewGetMaximum( inView: HIViewRef ): SInt32; external name '_HIViewGetMaximum';
  1340. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1341. {
  1342. * HIViewSetMaximum()
  1343. *
  1344. * Summary:
  1345. * Sets a view's maximum value.
  1346. *
  1347. * Mac OS X threading:
  1348. * Not thread safe
  1349. *
  1350. * Parameters:
  1351. *
  1352. * inView:
  1353. * The view whose maximum value is to be set.
  1354. *
  1355. * inMaximum:
  1356. * The new maximum value.
  1357. *
  1358. * Result:
  1359. * A result code indicating success or failure.
  1360. *
  1361. * Availability:
  1362. * Mac OS X: in version 10.4 and later in Carbon.framework
  1363. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1364. * Non-Carbon CFM: not available
  1365. }
  1366. function HIViewSetMaximum( inView: HIViewRef; inMaximum: SInt32 ): OSStatus; external name '_HIViewSetMaximum';
  1367. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1368. {
  1369. * HIViewGetViewSize()
  1370. *
  1371. * Summary:
  1372. * Gets a view's view size.
  1373. *
  1374. * Discussion:
  1375. * The view size is the size of the content to which a view's
  1376. * display is proportioned. Most commonly used to set the
  1377. * proportional size of a scroll bar's thumb indicator.
  1378. *
  1379. * Mac OS X threading:
  1380. * Not thread safe
  1381. *
  1382. * Parameters:
  1383. *
  1384. * inView:
  1385. * The view for which to get the view size.
  1386. *
  1387. * Result:
  1388. * The view size.
  1389. *
  1390. * Availability:
  1391. * Mac OS X: in version 10.4 and later in Carbon.framework
  1392. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1393. * Non-Carbon CFM: not available
  1394. }
  1395. function HIViewGetViewSize( inView: HIViewRef ): SInt32; external name '_HIViewGetViewSize';
  1396. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1397. {
  1398. * HIViewSetViewSize()
  1399. *
  1400. * Summary:
  1401. * Sets a view's view size.
  1402. *
  1403. * Discussion:
  1404. * The view size is the size of the content to which a view's
  1405. * display is proportioned. Most commonly used to set the
  1406. * proportional size of a scroll bar's thumb indicator.
  1407. *
  1408. * Mac OS X threading:
  1409. * Not thread safe
  1410. *
  1411. * Parameters:
  1412. *
  1413. * inView:
  1414. * The view whose view size is to be set.
  1415. *
  1416. * inViewSize:
  1417. * The new view size.
  1418. *
  1419. * Result:
  1420. * A result code indicating success or failure.
  1421. *
  1422. * Availability:
  1423. * Mac OS X: in version 10.4 and later in Carbon.framework
  1424. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1425. * Non-Carbon CFM: not available
  1426. }
  1427. function HIViewSetViewSize( inView: HIViewRef; inViewSize: SInt32 ): OSStatus; external name '_HIViewSetViewSize';
  1428. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1429. {
  1430. * HIViewIsValid()
  1431. *
  1432. * Summary:
  1433. * HIViewIsValid tests to see if the passed in view is a view that
  1434. * HIToolbox knows about. It does not sanity check the data in the
  1435. * view.
  1436. *
  1437. * Mac OS X threading:
  1438. * Not thread safe
  1439. *
  1440. * Parameters:
  1441. *
  1442. * inView:
  1443. * The view to test for validity.
  1444. *
  1445. * Result:
  1446. * True if the view is a valid view, otherwise, false.
  1447. *
  1448. * Availability:
  1449. * Mac OS X: in version 10.4 and later in Carbon.framework
  1450. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1451. * Non-Carbon CFM: not available
  1452. }
  1453. function HIViewIsValid( inView: HIViewRef ): Boolean; external name '_HIViewIsValid';
  1454. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1455. {
  1456. * HIViewSetID()
  1457. *
  1458. * Summary:
  1459. * Sets the HIViewID of a view.
  1460. *
  1461. * Mac OS X threading:
  1462. * Not thread safe
  1463. *
  1464. * Parameters:
  1465. *
  1466. * inView:
  1467. * The view for which to set the ID.
  1468. *
  1469. * inID:
  1470. * The ID to set on the view.
  1471. *
  1472. * Result:
  1473. * A result code indicating success or failure.
  1474. *
  1475. * Availability:
  1476. * Mac OS X: in version 10.4 and later in Carbon.framework
  1477. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1478. * Non-Carbon CFM: not available
  1479. }
  1480. function HIViewSetID( inView: HIViewRef; inID: HIViewID ): OSStatus; external name '_HIViewSetID';
  1481. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1482. {
  1483. * HIViewGetID()
  1484. *
  1485. * Summary:
  1486. * Gets the HIViewID of a view.
  1487. *
  1488. * Mac OS X threading:
  1489. * Not thread safe
  1490. *
  1491. * Parameters:
  1492. *
  1493. * inView:
  1494. * The view for which to get the ID.
  1495. *
  1496. * outID:
  1497. * A pointer to an HIViewID to be filled with the view's ID.
  1498. *
  1499. * Result:
  1500. * A result code indicating success or failure.
  1501. *
  1502. * Availability:
  1503. * Mac OS X: in version 10.4 and later in Carbon.framework
  1504. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1505. * Non-Carbon CFM: not available
  1506. }
  1507. function HIViewGetID( inView: HIViewRef; var outID: HIViewID ): OSStatus; external name '_HIViewGetID';
  1508. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1509. {
  1510. * HIViewSetCommandID()
  1511. *
  1512. * Summary:
  1513. * Sets the command ID of a view.
  1514. *
  1515. * Mac OS X threading:
  1516. * Not thread safe
  1517. *
  1518. * Parameters:
  1519. *
  1520. * inView:
  1521. * The view for which to set the command ID.
  1522. *
  1523. * inCommandID:
  1524. * The command ID to set on the view.
  1525. *
  1526. * Result:
  1527. * A result code indicating success or failure.
  1528. *
  1529. * Availability:
  1530. * Mac OS X: in version 10.4 and later in Carbon.framework
  1531. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1532. * Non-Carbon CFM: not available
  1533. }
  1534. function HIViewSetCommandID( inView: HIViewRef; inCommandID: UInt32 ): OSStatus; external name '_HIViewSetCommandID';
  1535. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1536. {
  1537. * HIViewGetCommandID()
  1538. *
  1539. * Summary:
  1540. * Gets the command ID of a view.
  1541. *
  1542. * Mac OS X threading:
  1543. * Not thread safe
  1544. *
  1545. * Parameters:
  1546. *
  1547. * inView:
  1548. * The view for which to get the command ID.
  1549. *
  1550. * outCommandID:
  1551. * A pointer to a UInt32 to fill with the view's command id.
  1552. *
  1553. * Result:
  1554. * A result code indicating success or failure.
  1555. *
  1556. * Availability:
  1557. * Mac OS X: in version 10.4 and later in Carbon.framework
  1558. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1559. * Non-Carbon CFM: not available
  1560. }
  1561. function HIViewGetCommandID( inView: HIViewRef; var outCommandID: UInt32 ): OSStatus; external name '_HIViewGetCommandID';
  1562. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1563. {
  1564. * HIViewGetKind()
  1565. *
  1566. * Summary:
  1567. * Returns the kind of the given view.
  1568. *
  1569. * Mac OS X threading:
  1570. * Not thread safe
  1571. *
  1572. * Parameters:
  1573. *
  1574. * inView:
  1575. * The view whose kind to get.
  1576. *
  1577. * outViewKind:
  1578. * On successful exit, this will contain the view signature and
  1579. * kind. See ControlDefinitions.h or HIView.h for the kinds of
  1580. * each system view.
  1581. *
  1582. * Availability:
  1583. * Mac OS X: in version 10.4 and later in Carbon.framework
  1584. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1585. * Non-Carbon CFM: not available
  1586. }
  1587. function HIViewGetKind( inView: HIViewRef; var outViewKind: HIViewKind ): OSStatus; external name '_HIViewGetKind';
  1588. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1589. {==============================================================================}
  1590. { POSITIONING }
  1591. {==============================================================================}
  1592. {
  1593. * HIViewGetBounds()
  1594. *
  1595. * Discussion:
  1596. * Returns the local bounds of a view. The local bounds are the
  1597. * coordinate system that is completely view-relative. A view's top
  1598. * left coordinate starts out at 0, 0. Most operations are done in
  1599. * these local coordinates. Moving a view is done via the frame
  1600. * instead.
  1601. *
  1602. * Mac OS X threading:
  1603. * Not thread safe
  1604. *
  1605. * Parameters:
  1606. *
  1607. * inView:
  1608. * The view whose bounds you wish to determine.
  1609. *
  1610. * outRect:
  1611. * The local bounds of the view.
  1612. *
  1613. * Result:
  1614. * An operating system result code.
  1615. *
  1616. * Availability:
  1617. * Mac OS X: in version 10.2 and later in Carbon.framework
  1618. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1619. * Non-Carbon CFM: not available
  1620. }
  1621. function HIViewGetBounds( inView: HIViewRef; var outRect: HIRect ): OSStatus; external name '_HIViewGetBounds';
  1622. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1623. {
  1624. * HIViewGetFrame()
  1625. *
  1626. * Discussion:
  1627. * Returns the frame of a view. The frame is the bounds of a view
  1628. * relative to its parent's local coordinate system.
  1629. *
  1630. * Mac OS X threading:
  1631. * Not thread safe
  1632. *
  1633. * Parameters:
  1634. *
  1635. * inView:
  1636. * The view whose frame you wish to determine.
  1637. *
  1638. * outRect:
  1639. * The frame of the view.
  1640. *
  1641. * Result:
  1642. * An operating system result code.
  1643. *
  1644. * Availability:
  1645. * Mac OS X: in version 10.2 and later in Carbon.framework
  1646. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1647. * Non-Carbon CFM: not available
  1648. }
  1649. function HIViewGetFrame( inView: HIViewRef; var outRect: HIRect ): OSStatus; external name '_HIViewGetFrame';
  1650. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1651. {
  1652. * HIViewSetFrame()
  1653. *
  1654. * Discussion:
  1655. * Sets the frame of a view. This effectively moves the view within
  1656. * its parent. It also marks the view (and anything that was exposed
  1657. * behind it) to be redrawn.
  1658. *
  1659. * Mac OS X threading:
  1660. * Not thread safe
  1661. *
  1662. * Parameters:
  1663. *
  1664. * inView:
  1665. * The view whose frame you wish to change.
  1666. *
  1667. * inRect:
  1668. * The new frame of the view.
  1669. *
  1670. * Result:
  1671. * An operating system result code.
  1672. *
  1673. * Availability:
  1674. * Mac OS X: in version 10.2 and later in Carbon.framework
  1675. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1676. * Non-Carbon CFM: not available
  1677. }
  1678. function HIViewSetFrame( inView: HIViewRef; const (*var*) inRect: HIRect ): OSStatus; external name '_HIViewSetFrame';
  1679. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1680. {
  1681. * HIViewMoveBy()
  1682. *
  1683. * Discussion:
  1684. * Moves a view by a certain distance, relative to its current
  1685. * location. This affects a view's frame, but not its bounds.
  1686. *
  1687. * Mac OS X threading:
  1688. * Not thread safe
  1689. *
  1690. * Parameters:
  1691. *
  1692. * inView:
  1693. * The view you wish to move.
  1694. *
  1695. * inDX:
  1696. * The horizontal distance to move the view. Negative values move
  1697. * the view to the left, positive values to the right.
  1698. *
  1699. * inDY:
  1700. * The vertical distance to move the view. Negative values move
  1701. * the view upward, positive values downward.
  1702. *
  1703. * Result:
  1704. * An operating system result code.
  1705. *
  1706. * Availability:
  1707. * Mac OS X: in version 10.2 and later in Carbon.framework
  1708. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1709. * Non-Carbon CFM: not available
  1710. }
  1711. function HIViewMoveBy( inView: HIViewRef; inDX: Float32; inDY: Float32 ): OSStatus; external name '_HIViewMoveBy';
  1712. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1713. {
  1714. * HIViewPlaceInSuperviewAt()
  1715. *
  1716. * Discussion:
  1717. * Places a view at an absolute location within its parent. This
  1718. * affects the view's frame, but not its bounds.
  1719. *
  1720. * Mac OS X threading:
  1721. * Not thread safe
  1722. *
  1723. * Parameters:
  1724. *
  1725. * inView:
  1726. * The view you wish to position.
  1727. *
  1728. * inX:
  1729. * The absolute horizontal coordinate at which to position the
  1730. * view.
  1731. *
  1732. * inY:
  1733. * The absolute vertical coordinate at which to position the view.
  1734. *
  1735. * Result:
  1736. * An operating system result code.
  1737. *
  1738. * Availability:
  1739. * Mac OS X: in version 10.2 and later in Carbon.framework
  1740. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1741. * Non-Carbon CFM: not available
  1742. }
  1743. function HIViewPlaceInSuperviewAt( inView: HIViewRef; inX: Float32; inY: Float32 ): OSStatus; external name '_HIViewPlaceInSuperviewAt';
  1744. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1745. {
  1746. * HIViewReshapeStructure()
  1747. *
  1748. * Discussion:
  1749. * This is for use by custom views. If a view decides that its
  1750. * structure will change shape, it should call this. This tells the
  1751. * Toolbox to recalc things and invalidate as appropriate. You might
  1752. * use this when gaining/losing a focus ring, for example.
  1753. *
  1754. * Mac OS X threading:
  1755. * Not thread safe
  1756. *
  1757. * Parameters:
  1758. *
  1759. * inView:
  1760. * The view to reshape and invalidate.
  1761. *
  1762. * Result:
  1763. * An operating system result code.
  1764. *
  1765. * Availability:
  1766. * Mac OS X: in version 10.2 and later in Carbon.framework
  1767. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1768. * Non-Carbon CFM: not available
  1769. }
  1770. function HIViewReshapeStructure( inView: HIViewRef ): OSStatus; external name '_HIViewReshapeStructure';
  1771. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1772. {
  1773. * HIViewRegionChanged()
  1774. *
  1775. * Discussion:
  1776. * Allows a view to tell the view system that a region of itself has
  1777. * changed. The view system might choose to react in some way. For
  1778. * example, if a view's clickable region has changed, this can be
  1779. * called to tell the Toolbox to resync the region it uses for async
  1780. * window dragging, if enabled. Likewise, if a view's opaque region
  1781. * changes, we can adjust the window's opaque shape as well. When
  1782. * views are moved, resizes, this stuff is taken care of for you. So
  1783. * this only need be called when there's a change in your view that
  1784. * occurs outside of those times.
  1785. *
  1786. * Mac OS X threading:
  1787. * Not thread safe
  1788. *
  1789. * Parameters:
  1790. *
  1791. * inView:
  1792. * The view to deal with.
  1793. *
  1794. * inRegionCode:
  1795. * The region that was changed. This can only be the structure
  1796. * opaque, and clickable regions at present.
  1797. *
  1798. * Result:
  1799. * An operating system status code.
  1800. *
  1801. * Availability:
  1802. * Mac OS X: in version 10.3 and later in Carbon.framework
  1803. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  1804. * Non-Carbon CFM: not available
  1805. }
  1806. function HIViewRegionChanged( inView: HIViewRef; inRegionCode: HIViewPartCode ): OSStatus; external name '_HIViewRegionChanged';
  1807. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  1808. {
  1809. * HIViewCopyShape()
  1810. *
  1811. * Summary:
  1812. * Copies the shape of a part of a view. See the discussion on
  1813. * meta-parts in this header for more information
  1814. *
  1815. * Mac OS X threading:
  1816. * Not thread safe
  1817. *
  1818. * Parameters:
  1819. *
  1820. * inView:
  1821. * The view for which to copy the shape.
  1822. *
  1823. * inPart:
  1824. * The part of the view whose shape is to be copied.
  1825. *
  1826. * outShape:
  1827. * On exit, contains a newly created shape. The caller of
  1828. * HIViewCopyShape is responsible for releasing the copied shape.
  1829. *
  1830. * Result:
  1831. * A result code indicating success or failure.
  1832. *
  1833. * Availability:
  1834. * Mac OS X: in version 10.4 and later in Carbon.framework
  1835. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1836. * Non-Carbon CFM: not available
  1837. }
  1838. function HIViewCopyShape( inView: HIViewRef; inPart: HIViewPartCode; var outShape: HIShapeRef ): OSStatus; external name '_HIViewCopyShape';
  1839. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1840. {
  1841. * HIViewGetOptimalBounds()
  1842. *
  1843. * Summary:
  1844. * Obtain a view's optimal size and/or text placement.
  1845. *
  1846. * Mac OS X threading:
  1847. * Not thread safe
  1848. *
  1849. * Parameters:
  1850. *
  1851. * inView:
  1852. * The view to examine.
  1853. *
  1854. * outBounds:
  1855. * A pointer to an HIRect to be filled with the view's optimal
  1856. * bounds. Can be NULL.
  1857. *
  1858. * outBaseLineOffset:
  1859. * A pointer to a float to be filled with the view's optimal text
  1860. * placement. Can be NULL.
  1861. *
  1862. * Result:
  1863. * A result code indicating success or failure.
  1864. *
  1865. * Availability:
  1866. * Mac OS X: in version 10.4 and later in Carbon.framework
  1867. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1868. * Non-Carbon CFM: not available
  1869. }
  1870. function HIViewGetOptimalBounds( inView: HIViewRef; outBounds: HIRectPtr { can be NULL }; outBaseLineOffset: Float32Ptr { can be NULL } ): OSStatus; external name '_HIViewGetOptimalBounds';
  1871. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1872. {==============================================================================}
  1873. { HIT TESTING/EVENT HANDLING }
  1874. {==============================================================================}
  1875. {
  1876. * HIViewGetViewForMouseEvent()
  1877. *
  1878. * Discussion:
  1879. * Returns the appropriate view to handle a mouse event. This is a
  1880. * little higher-level than HIViewGetSubviewHit. This routine will
  1881. * find the deepest view that should handle the mouse event, but
  1882. * along the way, it sends Carbon Events to each view asking it to
  1883. * return the appropriate subview. This allows parent views to catch
  1884. * clicks on their subviews. This is the recommended function to use
  1885. * before processing mouse events. Using one of the more primitive
  1886. * functions may result in an undefined behavior. In general we
  1887. * recommend the use of the Standard Window Handler instead of
  1888. * calling this function yourself.
  1889. *
  1890. * Mac OS X threading:
  1891. * Not thread safe
  1892. *
  1893. * Parameters:
  1894. *
  1895. * inView:
  1896. * The view to start from. You should pass the window's root view.
  1897. *
  1898. * inEvent:
  1899. * The mouse event in question.
  1900. *
  1901. * outView:
  1902. * The view that the mouse event should be sent to.
  1903. *
  1904. * Result:
  1905. * An operating system result code.
  1906. *
  1907. * Availability:
  1908. * Mac OS X: in version 10.2 and later in Carbon.framework
  1909. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1910. * Non-Carbon CFM: not available
  1911. }
  1912. function HIViewGetViewForMouseEvent( inView: HIViewRef; inEvent: EventRef; var outView: HIViewRef ): OSStatus; external name '_HIViewGetViewForMouseEvent';
  1913. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1914. {
  1915. * HIViewClick()
  1916. *
  1917. * Discussion:
  1918. * After a successful call to HIViewGetViewForMouseEvent for a mouse
  1919. * down event, you should call this function to have the view handle
  1920. * the click. In general we recommend the use of the Standard Window
  1921. * Handler instead of calling this function yourself.
  1922. *
  1923. * Mac OS X threading:
  1924. * Not thread safe
  1925. *
  1926. * Parameters:
  1927. *
  1928. * inView:
  1929. * The view to handle the event.
  1930. *
  1931. * inEvent:
  1932. * The mouse event to handle.
  1933. *
  1934. * Result:
  1935. * An operating system result code.
  1936. *
  1937. * Availability:
  1938. * Mac OS X: in version 10.2 and later in Carbon.framework
  1939. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1940. * Non-Carbon CFM: not available
  1941. }
  1942. function HIViewClick( inView: HIViewRef; inEvent: EventRef ): OSStatus; external name '_HIViewClick';
  1943. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1944. {
  1945. * HIViewSimulateClick()
  1946. *
  1947. * Discussion:
  1948. * This function is used to simulate a mouse click on a given view.
  1949. * It sends a kEventControlSimulateHit event to the specified view,
  1950. * and also sends kEventControlHit and (if the Hit event is not
  1951. * handled) kEventCommandProcess events.
  1952. *
  1953. * Note that not all windows will respond to the events that are
  1954. * sent by this API. A fully Carbon-event-based window most likely
  1955. * will respond exactly as if the user had really clicked in the
  1956. * view. A window that is handled using classic EventRecord-based
  1957. * APIs (WaitNextEvent or ModalDialog) will typically not respond at
  1958. * all; to simulate a click in such a window, you may need to post a
  1959. * mouse-down/mouse-up pair, or use a Dialog Manager event filter
  1960. * proc to simulate a hit in a dialog item.
  1961. *
  1962. * Mac OS X threading:
  1963. * Not thread safe
  1964. *
  1965. * Parameters:
  1966. *
  1967. * inView:
  1968. * The view to test the part hit.
  1969. *
  1970. * inPartToClick:
  1971. * The part the view should consider to be clicked.
  1972. *
  1973. * inModifiers:
  1974. * The modifiers the view can consider for its click action.
  1975. *
  1976. * outPartClicked:
  1977. * The part that was hit, can be kControlNoPart if no action
  1978. * occurred. May be NULL if you don't need the part code returned.
  1979. *
  1980. * Result:
  1981. * An operating system result code.
  1982. *
  1983. * Availability:
  1984. * Mac OS X: in version 10.2 and later in Carbon.framework
  1985. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1986. * Non-Carbon CFM: not available
  1987. }
  1988. function HIViewSimulateClick( inView: HIViewRef; inPartToClick: HIViewPartCode; inModifiers: UInt32; outPartClicked: HIViewPartCodePtr { can be NULL } ): OSStatus; external name '_HIViewSimulateClick';
  1989. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1990. {
  1991. * HIViewGetPartHit()
  1992. *
  1993. * Discussion:
  1994. * Given a view, and a view-relative point, this function returns
  1995. * the part code hit as determined by the view.
  1996. *
  1997. * Mac OS X threading:
  1998. * Not thread safe
  1999. *
  2000. * Parameters:
  2001. *
  2002. * inView:
  2003. * The view to test the part hit.
  2004. *
  2005. * inPoint:
  2006. * The view-relative point to use.
  2007. *
  2008. * outPart:
  2009. * The part hit by inPoint.
  2010. *
  2011. * Result:
  2012. * An operating system result code.
  2013. *
  2014. * Availability:
  2015. * Mac OS X: in version 10.2 and later in Carbon.framework
  2016. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2017. * Non-Carbon CFM: not available
  2018. }
  2019. function HIViewGetPartHit( inView: HIViewRef; const (*var*) inPoint: HIPoint; var outPart: HIViewPartCode ): OSStatus; external name '_HIViewGetPartHit';
  2020. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2021. {
  2022. * HIViewGetSubviewHit()
  2023. *
  2024. * Discussion:
  2025. * Returns the child of the given view hit by the point passed in.
  2026. * This is more primitive than using HIViewGetViewForMouseEvent, and
  2027. * should be used only in non-event-handling cases.
  2028. *
  2029. * Mac OS X threading:
  2030. * Not thread safe
  2031. *
  2032. * Parameters:
  2033. *
  2034. * inView:
  2035. * The view you wish to start from.
  2036. *
  2037. * inPoint:
  2038. * The mouse coordinate to use. This is passed in the local
  2039. * coordinate system of inView.
  2040. *
  2041. * inDeep:
  2042. * Pass true to find the deepest child hit, false to go only one
  2043. * level deep (just check direct children of inView).
  2044. *
  2045. * outView:
  2046. * The view hit by inPoint, or NULL if no subview was hit.
  2047. *
  2048. * Result:
  2049. * An operating system result code.
  2050. *
  2051. * Availability:
  2052. * Mac OS X: in version 10.2 and later in Carbon.framework
  2053. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2054. * Non-Carbon CFM: not available
  2055. }
  2056. function HIViewGetSubviewHit( inView: HIViewRef; const (*var*) inPoint: HIPoint; inDeep: Boolean; var outView: HIViewRef ): OSStatus; external name '_HIViewGetSubviewHit';
  2057. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2058. {==============================================================================}
  2059. { HIView-based tracking areas }
  2060. {==============================================================================}
  2061. type
  2062. HIViewTrackingAreaRef = ^SInt32; { an opaque 32-bit type }
  2063. const
  2064. kEventParamHIViewTrackingArea = $63747261 (* 'ctra' *); { typeHIViewTrackingAreaRef}
  2065. typeHIViewTrackingAreaRef = $63747261 (* 'ctra' *);
  2066. {
  2067. * kEventClassControl / kEventControlTrackingAreaEntered
  2068. *
  2069. * Summary:
  2070. * The mouse has entered a tracking area owned by your control.
  2071. *
  2072. * Discussion:
  2073. * If you have installed a mouse tracking area in your view, you
  2074. * will receive this event when the mouse enters that area. The
  2075. * tracking area reference is sent with the event.
  2076. *
  2077. * Mac OS X threading:
  2078. * Not thread safe
  2079. *
  2080. * Parameters:
  2081. *
  2082. * --> kEventParamHIViewTrackingArea (in, typeHIViewTrackingAreaRef)
  2083. * The tracking area that was entered.
  2084. *
  2085. * --> kEventParamKeyModifiers (in, typeUInt32)
  2086. * The keyboard modifiers that were in effect when the mouse
  2087. * entered.
  2088. *
  2089. * --> kEventParamMouseLocation (in, typeHIPoint)
  2090. * The location of the mouse in view coordinates.
  2091. *
  2092. * Availability:
  2093. * Mac OS X: in version 10.4 and later in Carbon.framework
  2094. * CarbonLib: not available
  2095. }
  2096. const
  2097. kEventControlTrackingAreaEntered = 23;
  2098. {
  2099. * kEventClassControl / kEventControlTrackingAreaExited
  2100. *
  2101. * Summary:
  2102. * The mouse has exited a tracking area owned by your control.
  2103. *
  2104. * Discussion:
  2105. * If you have installed a mouse tracking area in your view, you
  2106. * will receive this event when the mouse leaves that area. The
  2107. * tracking area reference is sent with the event.
  2108. *
  2109. * Mac OS X threading:
  2110. * Not thread safe
  2111. *
  2112. * Parameters:
  2113. *
  2114. * --> kEventParamHIViewTrackingArea (in, typeHIViewTrackingAreaRef)
  2115. * The tracking area that was entered.
  2116. *
  2117. * --> kEventParamKeyModifiers (in, typeUInt32)
  2118. * The keyboard modifiers that were in effect when the mouse
  2119. * left.
  2120. *
  2121. * --> kEventParamMouseLocation (in, typeHIPoint)
  2122. * The location of the mouse in view coordinates. This point
  2123. * may or may not lie on the boundary of the mouse region. It
  2124. * is merely where the mouse was relative to the view when the
  2125. * exit event was generated.
  2126. *
  2127. * Availability:
  2128. * Mac OS X: in version 10.4 and later in Carbon.framework
  2129. * CarbonLib: not available
  2130. }
  2131. const
  2132. kEventControlTrackingAreaExited = 24;
  2133. type
  2134. HIViewTrackingAreaID = UInt64;
  2135. {
  2136. * HIViewNewTrackingArea()
  2137. *
  2138. * Summary:
  2139. * Creates a new tracking area for a view.
  2140. *
  2141. * Mac OS X threading:
  2142. * Not thread safe
  2143. *
  2144. * Parameters:
  2145. *
  2146. * inView:
  2147. * The view to create a tracking area for.
  2148. *
  2149. * inShape:
  2150. * The shape to use. Pass NULL to indicate the entire structure
  2151. * region of the view is to be used.
  2152. *
  2153. * inID:
  2154. * An identifier for this tracking area. This value is completely
  2155. * up to the view to define. Pass zero if you don't care.
  2156. *
  2157. * outRef:
  2158. * A reference to the newly created tracking area. This references
  2159. * is NOT refcounted.
  2160. *
  2161. * Result:
  2162. * An operating system status code.
  2163. *
  2164. * Availability:
  2165. * Mac OS X: in version 10.4 and later in Carbon.framework
  2166. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2167. * Non-Carbon CFM: not available
  2168. }
  2169. function HIViewNewTrackingArea( inView: HIViewRef; inShape: HIShapeRef { can be NULL }; inID: HIViewTrackingAreaID; var outRef: HIViewTrackingAreaRef ): OSStatus; external name '_HIViewNewTrackingArea';
  2170. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2171. {
  2172. * HIViewChangeTrackingArea()
  2173. *
  2174. * Summary:
  2175. * Alters the shape of an existing tracking area.
  2176. *
  2177. * Mac OS X threading:
  2178. * Not thread safe
  2179. *
  2180. * Parameters:
  2181. *
  2182. * inArea:
  2183. * The area to change.
  2184. *
  2185. * inShape:
  2186. * The shape to use. Pass NULL to indicate the entire structure
  2187. * region of the view is to be used.
  2188. *
  2189. * Result:
  2190. * An operating system status code.
  2191. *
  2192. * Availability:
  2193. * Mac OS X: in version 10.4 and later in Carbon.framework
  2194. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2195. * Non-Carbon CFM: not available
  2196. }
  2197. function HIViewChangeTrackingArea( inArea: HIViewTrackingAreaRef; inShape: HIShapeRef ): OSStatus; external name '_HIViewChangeTrackingArea';
  2198. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2199. {
  2200. * HIViewGetTrackingAreaID()
  2201. *
  2202. * Summary:
  2203. * Retrieves the HIViewTrackingAreaID of an existing tracking area.
  2204. * This value was set upon creation of the HIViewTrackingArea.
  2205. *
  2206. * Mac OS X threading:
  2207. * Not thread safe
  2208. *
  2209. * Parameters:
  2210. *
  2211. * inArea:
  2212. * The area whose HIViewTrackingAreaID to retrieve.
  2213. *
  2214. * outID:
  2215. * The HIViewTrackingAreaID for this tracking area.
  2216. *
  2217. * Result:
  2218. * An operating system status code.
  2219. *
  2220. * Availability:
  2221. * Mac OS X: in version 10.4 and later in Carbon.framework
  2222. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2223. * Non-Carbon CFM: not available
  2224. }
  2225. function HIViewGetTrackingAreaID( inArea: HIViewTrackingAreaRef; var outID: HIViewTrackingAreaID ): OSStatus; external name '_HIViewGetTrackingAreaID';
  2226. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2227. {
  2228. * HIViewDisposeTrackingArea()
  2229. *
  2230. * Summary:
  2231. * Disposes an existing tracking area. The reference is considered
  2232. * to be invalid after calling this function.
  2233. *
  2234. * Mac OS X threading:
  2235. * Not thread safe
  2236. *
  2237. * Parameters:
  2238. *
  2239. * inArea:
  2240. * The area to dispose.
  2241. *
  2242. * Result:
  2243. * An operating system status code.
  2244. *
  2245. * Availability:
  2246. * Mac OS X: in version 10.4 and later in Carbon.framework
  2247. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2248. * Non-Carbon CFM: not available
  2249. }
  2250. function HIViewDisposeTrackingArea( inArea: HIViewTrackingAreaRef ): OSStatus; external name '_HIViewDisposeTrackingArea';
  2251. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2252. {==============================================================================}
  2253. { DISPLAY }
  2254. {==============================================================================}
  2255. {
  2256. * HIViewGetNeedsDisplay()
  2257. *
  2258. * Discussion:
  2259. * Returns true if the view passed in or any subview of it requires
  2260. * redrawing (i.e. part of it has been invalidated).
  2261. *
  2262. * Mac OS X threading:
  2263. * Not thread safe
  2264. *
  2265. * Parameters:
  2266. *
  2267. * inView:
  2268. * The view to inspect.
  2269. *
  2270. * Result:
  2271. * A boolean result code.
  2272. *
  2273. * Availability:
  2274. * Mac OS X: in version 10.2 and later in Carbon.framework
  2275. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2276. * Non-Carbon CFM: not available
  2277. }
  2278. function HIViewGetNeedsDisplay( inView: HIViewRef ): Boolean; external name '_HIViewGetNeedsDisplay';
  2279. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2280. {
  2281. * HIViewSetNeedsDisplay()
  2282. *
  2283. * Discussion:
  2284. * Marks a view as needing to be completely redrawn, or completely
  2285. * valid. If the view is not visible, or is obscured completely by
  2286. * other views, no action is taken.
  2287. *
  2288. * Mac OS X threading:
  2289. * Not thread safe
  2290. *
  2291. * Parameters:
  2292. *
  2293. * inView:
  2294. * The view to mark dirty.
  2295. *
  2296. * inNeedsDisplay:
  2297. * A boolean which indicates whether inView needs to be redrawn or
  2298. * not.
  2299. *
  2300. * Result:
  2301. * An operating system result code.
  2302. *
  2303. * Availability:
  2304. * Mac OS X: in version 10.2 and later in Carbon.framework
  2305. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2306. * Non-Carbon CFM: not available
  2307. }
  2308. function HIViewSetNeedsDisplay( inView: HIViewRef; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplay';
  2309. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2310. {
  2311. * HIViewSetNeedsDisplayInRect()
  2312. *
  2313. * Discussion:
  2314. * Marks a portion of a view as needing to be redrawn, or valid. If
  2315. * the view is not visible, or is obscured completely by other
  2316. * views, no action is taken. The rectangle passed is effectively
  2317. * intersected with the view's visible region. It should be in
  2318. * view-relative coordinates.
  2319. *
  2320. * Mac OS X threading:
  2321. * Not thread safe
  2322. *
  2323. * Parameters:
  2324. *
  2325. * inView:
  2326. * The view to mark dirty.
  2327. *
  2328. * inRect:
  2329. * The rectangle encompassing the area to mark dirty or clean.
  2330. *
  2331. * inNeedsDisplay:
  2332. * A boolean which indicates whether or not inRect should be added
  2333. * to the invalid region or removed from it.
  2334. *
  2335. * Result:
  2336. * An operating system result code.
  2337. *
  2338. * Availability:
  2339. * Mac OS X: in version 10.4 and later in Carbon.framework
  2340. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2341. * Non-Carbon CFM: not available
  2342. }
  2343. function HIViewSetNeedsDisplayInRect( inView: HIViewRef; const (*var*) inRect: HIRect; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplayInRect';
  2344. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2345. {
  2346. * HIViewSetNeedsDisplayInShape()
  2347. *
  2348. * Discussion:
  2349. * Marks a portion of a view as needing to be redrawn, or valid. If
  2350. * the view is not visible, or is obscured completely by other
  2351. * views, no action is taken. The shape passed is effectively
  2352. * intersected with the view's visible region. It should be in
  2353. * view-relative coordinates.
  2354. *
  2355. * Mac OS X threading:
  2356. * Not thread safe
  2357. *
  2358. * Parameters:
  2359. *
  2360. * inView:
  2361. * The view to mark dirty.
  2362. *
  2363. * inArea:
  2364. * The area to mark dirty or clean.
  2365. *
  2366. * inNeedsDisplay:
  2367. * A boolean which indicates whether or not inArea should be added
  2368. * to the invalid region or removed from it.
  2369. *
  2370. * Result:
  2371. * An operating system result code.
  2372. *
  2373. * Availability:
  2374. * Mac OS X: in version 10.4 and later in Carbon.framework
  2375. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  2376. * Non-Carbon CFM: not available
  2377. }
  2378. function HIViewSetNeedsDisplayInShape( inView: HIViewRef; inArea: HIShapeRef; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplayInShape';
  2379. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  2380. {
  2381. * HIViewSetNeedsDisplayInRegion()
  2382. *
  2383. * Discussion:
  2384. * Marks a portion of a view as needing to be redrawn, or valid. If
  2385. * the view is not visible, or is obscured completely by other
  2386. * views, no action is taken. The region passed is effectively
  2387. * intersected with the view's visible region. It should be in
  2388. * view-relative coordinates.
  2389. *
  2390. * Mac OS X threading:
  2391. * Not thread safe
  2392. *
  2393. * Parameters:
  2394. *
  2395. * inView:
  2396. * The view to mark dirty.
  2397. *
  2398. * inRgn:
  2399. * The region to mark dirty or clean.
  2400. *
  2401. * inNeedsDisplay:
  2402. * A boolean which indicates whether or not inRgn should be added
  2403. * to the invalid region or removed from it.
  2404. *
  2405. * Result:
  2406. * An operating system result code.
  2407. *
  2408. * Availability:
  2409. * Mac OS X: in version 10.2 and later in Carbon.framework
  2410. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2411. * Non-Carbon CFM: not available
  2412. }
  2413. function HIViewSetNeedsDisplayInRegion( inView: HIViewRef; inRgn: RgnHandle; inNeedsDisplay: Boolean ): OSStatus; external name '_HIViewSetNeedsDisplayInRegion';
  2414. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2415. {
  2416. * HIViewRender()
  2417. *
  2418. * Discussion:
  2419. * Renders the invalid portions of a view (as marked with
  2420. * HIViewSetNeedsDisplay[InRegion]) immediately. Normally, these
  2421. * areas are redrawn at event loop time, but there might be
  2422. * situations where you need an immediate draw. Use this sparingly,
  2423. * as it does cause a fully composited draw for the area of the
  2424. * view; that is, all other views that intersect the area of the
  2425. * specified view will also be drawn. Calling this for several views
  2426. * at a particular level of a hierarchy can be costly. We highly
  2427. * recommend that you only pass the root view of a window to this
  2428. * API. The behavior of this API when passed a non-root view was
  2429. * poorly defined in Mac OS X 10.3 and has changed in Mac OS X 10.4.
  2430. * In 10.3, calling this API on a non-root view would entirely
  2431. * validate all of the views in the window that intersect the
  2432. * specified view, including portions that did not intersect the
  2433. * specified view and so were not actually drawn. In 10.4, calling
  2434. * this API on a non-root view will only validate those portions of
  2435. * each view that intersect the specified view.
  2436. *
  2437. * Mac OS X threading:
  2438. * Not thread safe
  2439. *
  2440. * Parameters:
  2441. *
  2442. * inView:
  2443. * The view to draw.
  2444. *
  2445. * Result:
  2446. * An operating system result code.
  2447. *
  2448. * Availability:
  2449. * Mac OS X: in version 10.3 and later in Carbon.framework
  2450. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2451. * Non-Carbon CFM: not available
  2452. }
  2453. function HIViewRender( inView: HIViewRef ): OSStatus; external name '_HIViewRender';
  2454. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2455. {
  2456. * HIViewFlashDirtyArea()
  2457. *
  2458. * Discussion:
  2459. * Debugging aid. Flashes the region which would be redrawn at the
  2460. * next draw time for an entire window.
  2461. *
  2462. * Mac OS X threading:
  2463. * Not thread safe
  2464. *
  2465. * Parameters:
  2466. *
  2467. * inWindow:
  2468. * The window to flash the dirty region for.
  2469. *
  2470. * Result:
  2471. * An operating system result code.
  2472. *
  2473. * Availability:
  2474. * Mac OS X: in version 10.2 and later in Carbon.framework
  2475. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2476. * Non-Carbon CFM: not available
  2477. }
  2478. function HIViewFlashDirtyArea( inWindow: WindowRef ): OSStatus; external name '_HIViewFlashDirtyArea';
  2479. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2480. {
  2481. * HIViewGetSizeConstraints()
  2482. *
  2483. * Discussion:
  2484. * Return the minimum and maximum size for a control. A control must
  2485. * respond to this protocol to get meaningful results. These sizes
  2486. * can be used to help autoposition subviews, for example.
  2487. *
  2488. * Mac OS X threading:
  2489. * Not thread safe
  2490. *
  2491. * Parameters:
  2492. *
  2493. * inView:
  2494. * The view to inspect.
  2495. *
  2496. * outMinSize:
  2497. * The minimum size the view can be. May be NULL if you don't need
  2498. * this information.
  2499. *
  2500. * outMaxSize:
  2501. * The maximum size the view can be. May be NULL if you don't need
  2502. * this information.
  2503. *
  2504. * Result:
  2505. * An operating system result code.
  2506. *
  2507. * Availability:
  2508. * Mac OS X: in version 10.2 and later in Carbon.framework
  2509. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2510. * Non-Carbon CFM: not available
  2511. }
  2512. function HIViewGetSizeConstraints( inView: HIViewRef; outMinSize: HISizePtr { can be NULL }; outMaxSize: HISizePtr { can be NULL } ): OSStatus; external name '_HIViewGetSizeConstraints';
  2513. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2514. {==============================================================================}
  2515. { COORDINATE SYSTEM CONVERSION }
  2516. {==============================================================================}
  2517. {
  2518. * HIViewConvertPoint()
  2519. *
  2520. * Discussion:
  2521. * Converts a point from one view to another. Both views must have a
  2522. * common ancestor, i.e. they must both be in the same window.
  2523. *
  2524. * Mac OS X threading:
  2525. * Not thread safe
  2526. *
  2527. * Parameters:
  2528. *
  2529. * ioPoint:
  2530. * The point to convert.
  2531. *
  2532. * inSourceView:
  2533. * The view whose coordinate system ioPoint is starting out in.
  2534. * You can pass NULL to indicate that ioPoint is a window-relative
  2535. * point.
  2536. *
  2537. * inDestView:
  2538. * The view whose coordinate system ioPoint should end up in. You
  2539. * can pass NULL to indicate that ioPoint is a window-relative
  2540. * point.
  2541. *
  2542. * Result:
  2543. * An operating system result code.
  2544. *
  2545. * Availability:
  2546. * Mac OS X: in version 10.2 and later in Carbon.framework
  2547. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2548. * Non-Carbon CFM: not available
  2549. }
  2550. function HIViewConvertPoint( var ioPoint: HIPoint; inSourceView: HIViewRef; inDestView: HIViewRef ): OSStatus; external name '_HIViewConvertPoint';
  2551. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2552. {
  2553. * HIViewConvertRect()
  2554. *
  2555. * Discussion:
  2556. * Converts a rectangle from one view to another. Both views must
  2557. * have a common ancestor, i.e. they must both be in the same window.
  2558. *
  2559. * Mac OS X threading:
  2560. * Not thread safe
  2561. *
  2562. * Parameters:
  2563. *
  2564. * ioRect:
  2565. * The rectangle to convert.
  2566. *
  2567. * inSourceView:
  2568. * The view whose coordinate system ioRect is starting out in. You
  2569. * can pass NULL to indicate that ioRect is a window-relative
  2570. * rectangle.
  2571. *
  2572. * inDestView:
  2573. * The view whose coordinate system ioRect should end up in. You
  2574. * can pass NULL to indicate that ioRect is a window-relative
  2575. * rectangle.
  2576. *
  2577. * Result:
  2578. * An operating system result code.
  2579. *
  2580. * Availability:
  2581. * Mac OS X: in version 10.2 and later in Carbon.framework
  2582. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2583. * Non-Carbon CFM: not available
  2584. }
  2585. function HIViewConvertRect( var ioRect: HIRect; inSourceView: HIViewRef; inDestView: HIViewRef ): OSStatus; external name '_HIViewConvertRect';
  2586. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2587. {
  2588. * HIViewConvertRegion()
  2589. *
  2590. * Discussion:
  2591. * Converts a region from one view to another. Both views must have
  2592. * a common ancestor, i.e. they must both be in the same window.
  2593. *
  2594. * Mac OS X threading:
  2595. * Not thread safe
  2596. *
  2597. * Parameters:
  2598. *
  2599. * ioRgn:
  2600. * The region to convert.
  2601. *
  2602. * inSourceView:
  2603. * The view whose coordinate system ioRgn is starting out in. You
  2604. * can pass NULL to indicate that ioRgn is a window-relative
  2605. * region.
  2606. *
  2607. * inDestView:
  2608. * The view whose coordinate system ioRgn should end up in. You
  2609. * can pass NULL to indicate that ioRgn is a window-relative
  2610. * region.
  2611. *
  2612. * Result:
  2613. * An operating system result code.
  2614. *
  2615. * Availability:
  2616. * Mac OS X: in version 10.2 and later in Carbon.framework
  2617. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2618. * Non-Carbon CFM: not available
  2619. }
  2620. function HIViewConvertRegion( ioRgn: RgnHandle; inSourceView: HIViewRef; inDestView: HIViewRef ): OSStatus; external name '_HIViewConvertRegion';
  2621. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2622. {
  2623. * HIViewSetDrawingEnabled()
  2624. *
  2625. * Discussion:
  2626. * Turns control drawing on or off. You can use this to ensure that
  2627. * no drawing events are sent to the control. Even Draw1Control will
  2628. * not draw! HIViewSetNeedsDisplay is also rendered useless when
  2629. * drawing is off.
  2630. *
  2631. * Mac OS X threading:
  2632. * Not thread safe
  2633. *
  2634. * Parameters:
  2635. *
  2636. * inView:
  2637. * The view to enable or disable drawing for.
  2638. *
  2639. * inEnabled:
  2640. * A boolean value indicating whether drawing should be on (true)
  2641. * or off (false).
  2642. *
  2643. * Result:
  2644. * An operating system result code.
  2645. *
  2646. * Availability:
  2647. * Mac OS X: in version 10.2 and later in Carbon.framework
  2648. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2649. * Non-Carbon CFM: not available
  2650. }
  2651. function HIViewSetDrawingEnabled( inView: HIViewRef; inEnabled: Boolean ): OSStatus; external name '_HIViewSetDrawingEnabled';
  2652. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2653. {
  2654. * HIViewIsDrawingEnabled()
  2655. *
  2656. * Discussion:
  2657. * Determines if drawing is currently enabled for a control.
  2658. *
  2659. * Mac OS X threading:
  2660. * Not thread safe
  2661. *
  2662. * Parameters:
  2663. *
  2664. * inView:
  2665. * The view to get the drawing state for.
  2666. *
  2667. * Result:
  2668. * A boolean value indicating whether drawing is on (true) or off
  2669. * (false).
  2670. *
  2671. * Availability:
  2672. * Mac OS X: in version 10.2 and later in Carbon.framework
  2673. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2674. * Non-Carbon CFM: not available
  2675. }
  2676. function HIViewIsDrawingEnabled( inView: HIViewRef ): Boolean; external name '_HIViewIsDrawingEnabled';
  2677. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2678. {
  2679. * HIViewScrollRect()
  2680. *
  2681. * Discussion:
  2682. * Scrolls a view's contents, or a portion thereof. A view's
  2683. * contents are the pixels that it or any of its descendent views
  2684. * has drawn into. This will actually blit the contents of the view
  2685. * as appropriate to scroll, and then invalidate those portions
  2686. * which need to be redrawn. Be warned that this is a raw bit
  2687. * scroll. Anything that might overlap the target view will get
  2688. * thrashed as well.
  2689. *
  2690. * Mac OS X threading:
  2691. * Not thread safe
  2692. *
  2693. * Parameters:
  2694. *
  2695. * inView:
  2696. * The view to scroll. The bits drawn by the view's descendent
  2697. * views will also be scrolled.
  2698. *
  2699. * inRect:
  2700. * The rect to scroll. Pass NULL to mean the entire view. The rect
  2701. * passed cannot be bigger than the view's bounds. It must be in
  2702. * the local coordinate system of the view.
  2703. *
  2704. * inDX:
  2705. * The horizontal distance to scroll. Positive values shift to the
  2706. * right, negative values shift to the left.
  2707. *
  2708. * inDY:
  2709. * The vertical distance to scroll. Positive values shift
  2710. * downward, negative values shift upward.
  2711. *
  2712. * Result:
  2713. * An operating system result code.
  2714. *
  2715. * Availability:
  2716. * Mac OS X: in version 10.2 and later in Carbon.framework
  2717. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2718. * Non-Carbon CFM: not available
  2719. }
  2720. function HIViewScrollRect( inView: HIViewRef; {const} inRect: HIRectPtr { can be NULL }; inDX: Float32; inDY: Float32 ): OSStatus; external name '_HIViewScrollRect';
  2721. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2722. {
  2723. * HIViewSetBoundsOrigin()
  2724. *
  2725. * Discussion:
  2726. * This API sets the origin of the view. This effectively also moves
  2727. * all subcontrols of a view as well. This call will NOT invalidate
  2728. * the view. This is because you might want to move the contents
  2729. * with HIViewScrollRect instead of redrawing the complete content.
  2730. *
  2731. * Mac OS X threading:
  2732. * Not thread safe
  2733. *
  2734. * Parameters:
  2735. *
  2736. * inView:
  2737. * The view whose origin you wish to adjust.
  2738. *
  2739. * inX:
  2740. * The X coordinate.
  2741. *
  2742. * inY:
  2743. * The Y coordinate.
  2744. *
  2745. * Result:
  2746. * An operating system result code.
  2747. *
  2748. * Availability:
  2749. * Mac OS X: in version 10.2 and later in Carbon.framework
  2750. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2751. * Non-Carbon CFM: not available
  2752. }
  2753. function HIViewSetBoundsOrigin( inView: HIViewRef; inX: Float32; inY: Float32 ): OSStatus; external name '_HIViewSetBoundsOrigin';
  2754. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2755. {==============================================================================}
  2756. { KEYBOARD FOCUS }
  2757. {==============================================================================}
  2758. {
  2759. * HIViewAdvanceFocus()
  2760. *
  2761. * Discussion:
  2762. * Advances the focus to the next most appropriate view. Unless
  2763. * overriden in some fashion (either by overriding certain carbon
  2764. * events or using the HIViewSetNextFocus API), the Toolbox will use
  2765. * a spacially determinant method of focusing, attempting to focus
  2766. * left to right, top to bottom in a window, taking groups of
  2767. * controls into account.
  2768. *
  2769. * Mac OS X threading:
  2770. * Not thread safe
  2771. *
  2772. * Parameters:
  2773. *
  2774. * inRootForFocus:
  2775. * The subtree to manipulate. The focus will never leave
  2776. * inRootToFocus. Typically you would pass the content of the
  2777. * window, or the root. If focused on the toolbar, for example,
  2778. * the focus is limited to the toolbar only. In this case, the
  2779. * Toolbox passes the toolbar view in as the focus root for
  2780. * example.
  2781. *
  2782. * inModifiers:
  2783. * The EventModifiers of the keyboard event that ultimately caused
  2784. * the call to HIViewAdvanceFocus. These modifiers are used to
  2785. * determine the focus direction as well as other alternate
  2786. * focusing behaviors.
  2787. *
  2788. * Result:
  2789. * An operating system result code.
  2790. *
  2791. * Availability:
  2792. * Mac OS X: in version 10.2 and later in Carbon.framework
  2793. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2794. * Non-Carbon CFM: not available
  2795. }
  2796. function HIViewAdvanceFocus( inRootForFocus: HIViewRef; inModifiers: EventModifiers ): OSStatus; external name '_HIViewAdvanceFocus';
  2797. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2798. {
  2799. * HIViewGetFocusPart()
  2800. *
  2801. * Discussion:
  2802. * Returns the currently focused part of the given view.
  2803. *
  2804. * Mac OS X threading:
  2805. * Not thread safe
  2806. *
  2807. * Parameters:
  2808. *
  2809. * inView:
  2810. * The view to inquire about.
  2811. *
  2812. * outFocusPart:
  2813. * The part currently focused.
  2814. *
  2815. * Result:
  2816. * An operating system result code.
  2817. *
  2818. * Availability:
  2819. * Mac OS X: in version 10.2 and later in Carbon.framework
  2820. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2821. * Non-Carbon CFM: not available
  2822. }
  2823. function HIViewGetFocusPart( inView: HIViewRef; var outFocusPart: HIViewPartCode ): OSStatus; external name '_HIViewGetFocusPart';
  2824. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2825. {
  2826. * HIViewSubtreeContainsFocus()
  2827. *
  2828. * Discussion:
  2829. * Given a view, this function checks to see if it or any of its
  2830. * children currently are the keyboard focus. If so, true is
  2831. * returned as the function result.
  2832. *
  2833. * Mac OS X threading:
  2834. * Not thread safe
  2835. *
  2836. * Parameters:
  2837. *
  2838. * inSubtreeStart:
  2839. * The view to start searching at.
  2840. *
  2841. * Result:
  2842. * A boolean result.
  2843. *
  2844. * Availability:
  2845. * Mac OS X: in version 10.2 and later in Carbon.framework
  2846. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2847. * Non-Carbon CFM: not available
  2848. }
  2849. function HIViewSubtreeContainsFocus( inSubtreeStart: HIViewRef ): Boolean; external name '_HIViewSubtreeContainsFocus';
  2850. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2851. {
  2852. * HIViewSetNextFocus()
  2853. *
  2854. * Discussion:
  2855. * This function hard-wires the next sibling view to shift focus to
  2856. * whenever the keyboard focus is advanced.
  2857. *
  2858. * Mac OS X threading:
  2859. * Not thread safe
  2860. *
  2861. * Parameters:
  2862. *
  2863. * inView:
  2864. * The view to set the next focus view for. This parameter and the
  2865. * inNextFocus parameter must both have the same parent view.
  2866. *
  2867. * inNextFocus:
  2868. * The view to set focus to next. This parameter and the inView
  2869. * parameter must both have the same parent view. Pass NULL to
  2870. * tell the view system to use the default rules.
  2871. *
  2872. * Result:
  2873. * An operating system result code.
  2874. *
  2875. * Availability:
  2876. * Mac OS X: in version 10.2 and later in Carbon.framework
  2877. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2878. * Non-Carbon CFM: not available
  2879. }
  2880. function HIViewSetNextFocus( inView: HIViewRef; inNextFocus: HIViewRef { can be NULL } ): OSStatus; external name '_HIViewSetNextFocus';
  2881. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2882. {
  2883. * HIViewSetFirstSubViewFocus()
  2884. *
  2885. * Discussion:
  2886. * This function hard-wires the first subview to shift focus to
  2887. * whenever the keyboard focus is advanced and the container view is
  2888. * entered.
  2889. *
  2890. * Mac OS X threading:
  2891. * Not thread safe
  2892. *
  2893. * Parameters:
  2894. *
  2895. * inParent:
  2896. * The parent view.
  2897. *
  2898. * inSubView:
  2899. * The first child which should receive focus. Pass NULL to tell
  2900. * the view system to use the default rules.
  2901. *
  2902. * Result:
  2903. * An operating system result code.
  2904. *
  2905. * Availability:
  2906. * Mac OS X: in version 10.2 and later in Carbon.framework
  2907. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2908. * Non-Carbon CFM: not available
  2909. }
  2910. function HIViewSetFirstSubViewFocus( inParent: HIViewRef; inSubView: HIViewRef { can be NULL } ): OSStatus; external name '_HIViewSetFirstSubViewFocus';
  2911. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2912. {==============================================================================}
  2913. { LAYOUT }
  2914. { Mac OS X 10.3 provides a layout engine for HIViews that allows applications }
  2915. { to specify the layout relationships between multiple views. The layout }
  2916. { engine will automatically reposition and resize views that have layout }
  2917. { information when necessary. }
  2918. {==============================================================================}
  2919. {
  2920. * Summary:
  2921. * Since horizontal and vertical bindings are very similar in
  2922. * application, except along different axes, the binding kinds have
  2923. * been abstracted to minimum and maximum. Synonyms have been
  2924. * provided for convenience. You are encouraged to use them.
  2925. *
  2926. * Discussion:
  2927. * HIBindingKind constants.
  2928. }
  2929. const
  2930. {
  2931. * No binding is to occur.
  2932. }
  2933. kHILayoutBindNone = 0;
  2934. {
  2935. * Bind to the minimum of the axis.
  2936. }
  2937. kHILayoutBindMin = 1;
  2938. {
  2939. * Bind to the maximum of the axis.
  2940. }
  2941. kHILayoutBindMax = 2;
  2942. kHILayoutBindLeft = kHILayoutBindMin;
  2943. kHILayoutBindRight = kHILayoutBindMax;
  2944. {
  2945. * Synonyms for convenience and clarity.
  2946. }
  2947. kHILayoutBindTop = kHILayoutBindMin;
  2948. kHILayoutBindBottom = kHILayoutBindMax;
  2949. type
  2950. HIBindingKind = UInt16;
  2951. {
  2952. * HISideBinding
  2953. *
  2954. * Summary:
  2955. * A binding for a side of an HIView.
  2956. *
  2957. * Discussion:
  2958. * A side binding is entirely related to the change of the parent's
  2959. * position or size (but only as the size affects the maximum edge
  2960. * position). A side binding doesn't mean "move to where my
  2961. * relative's side is" but rather "move as my relative's side has
  2962. * moved".
  2963. }
  2964. type
  2965. HISideBinding = record
  2966. {
  2967. * An HIViewRef to the view to which this side is bound. Can be NULL,
  2968. * indicating that the the side is bound to its parent view.
  2969. }
  2970. toView: HIViewRef; { NULL means parent}
  2971. {
  2972. * An HIBindingKind indicating the bind kind.
  2973. }
  2974. kind: HIBindingKind;
  2975. {
  2976. * Not currently used. Must be set to 0.
  2977. }
  2978. offset: Float32;
  2979. end;
  2980. {
  2981. const HISideBinding kHISideNoBinding = ( NULL, kHILayoutBindNone );
  2982. }
  2983. {
  2984. * HIBinding
  2985. *
  2986. * Summary:
  2987. * A set of Top, Left, Bottom, and Right bindings for an HIView.
  2988. }
  2989. type
  2990. HIBinding = record
  2991. {
  2992. * The top side bindings.
  2993. }
  2994. top: HISideBinding;
  2995. {
  2996. * The left side bindings.
  2997. }
  2998. left: HISideBinding;
  2999. {
  3000. * The bottom side bindings.
  3001. }
  3002. bottom: HISideBinding;
  3003. {
  3004. * The right side bindings.
  3005. }
  3006. right: HISideBinding;
  3007. end;
  3008. {
  3009. const HIBinding kHINoBinding = ( kHISideNoBinding, kHISideNoBinding, kHISideNoBinding, kHISideNoBinding );
  3010. }
  3011. {
  3012. * Discussion:
  3013. * HIScaleKind constants.
  3014. }
  3015. const
  3016. {
  3017. * The scale is determined from the axis size.
  3018. }
  3019. kHILayoutScaleAbsolute = 0;
  3020. type
  3021. HIScaleKind = UInt16;
  3022. {
  3023. * HIAxisScale
  3024. *
  3025. * Summary:
  3026. * A scale description for an axis of an HIView.
  3027. }
  3028. type
  3029. HIAxisScale = record
  3030. {
  3031. * An HIViewRef to the view to which this axis is scaled. Can be
  3032. * NULL, indicating that the the axis is scaled relative to its
  3033. * parent view.
  3034. }
  3035. toView: HIViewRef; { NULL means parent}
  3036. {
  3037. * An HIScaleKind describing the type of scaling to be applied.
  3038. * Currently, this field can't be anything other than
  3039. * kScalingAbsolute.
  3040. }
  3041. kind: HIScaleKind;
  3042. {
  3043. * A float indicating how much to scale the HIView. 0 indicates no
  3044. * scaling. A value of 1 indicates that the view is to always have
  3045. * the same axial size.
  3046. }
  3047. ratio: Float32;
  3048. end;
  3049. {
  3050. * HIScaling
  3051. *
  3052. * Summary:
  3053. * A set of scaling descriptions for the axes of an HIView.
  3054. }
  3055. type
  3056. HIScaling = record
  3057. {
  3058. * An HIAxisScale describing the horizontal scaling for an HIView.
  3059. }
  3060. x: HIAxisScale;
  3061. y: HIAxisScale;
  3062. end;
  3063. {
  3064. * Summary:
  3065. * Since horizontal and vertical positions are very similar in
  3066. * application, except along different axes, the position kinds have
  3067. * been abstracted to minimum and maximum. Synonyms have been
  3068. * provided for convenience. You are encouraged to use them.
  3069. *
  3070. * Discussion:
  3071. * HIPositionKind constants.
  3072. }
  3073. const
  3074. {
  3075. * No positioning is to occur.
  3076. }
  3077. kHILayoutPositionNone = 0;
  3078. {
  3079. * Centered positioning will occur. The view will be centered
  3080. * relative to the specified view.
  3081. }
  3082. kHILayoutPositionCenter = 1;
  3083. {
  3084. * Minimum positioning will occur. The view will be left or top
  3085. * aligned relative to the specified view.
  3086. }
  3087. kHILayoutPositionMin = 2;
  3088. {
  3089. * Maximum positioning will occur. The view will be right or bottom
  3090. * aligned relative to the specified view.
  3091. }
  3092. kHILayoutPositionMax = 3;
  3093. {
  3094. * Synonyms for convenience and clarity.
  3095. }
  3096. kHILayoutPositionLeft = kHILayoutPositionMin;
  3097. kHILayoutPositionRight = kHILayoutPositionMax;
  3098. kHILayoutPositionTop = kHILayoutPositionMin;
  3099. kHILayoutPositionBottom = kHILayoutPositionMax;
  3100. type
  3101. HIPositionKind = UInt16;
  3102. {
  3103. * HIAxisPosition
  3104. *
  3105. * Summary:
  3106. * An axial position description for an HIView.
  3107. }
  3108. type
  3109. HIAxisPosition = record
  3110. {
  3111. * An HIViewRef to the view relative to which a view will be
  3112. * positioned. Can be NULL, indicating that the the view is
  3113. * positioned relative to its parent view.
  3114. }
  3115. toView: HIViewRef; { NULL means parent}
  3116. {
  3117. * An HIPositionKind indicating the kind of positioning to apply.
  3118. }
  3119. kind: HIPositionKind;
  3120. {
  3121. * After the position kind has been applied, the origin component
  3122. * that corresponds to the positioning axis is offet by this value.
  3123. * (ex: Left aligned + 10 ).
  3124. }
  3125. offset: Float32;
  3126. end;
  3127. {
  3128. * HIPositioning
  3129. *
  3130. * Summary:
  3131. * A positioning description for an HIView.
  3132. }
  3133. type
  3134. HIPositioning = record
  3135. {
  3136. * An HIAxisPosition describing the horizontal positioning for an
  3137. * HIView.
  3138. }
  3139. x: HIAxisPosition;
  3140. y: HIAxisPosition;
  3141. end;
  3142. {
  3143. * HILayoutInfo
  3144. *
  3145. * Summary:
  3146. * A layout description for an HIView.
  3147. *
  3148. * Discussion:
  3149. * The different layout transformations are applied sequentially to
  3150. * the HIView. First, the bindings are applied. Note that the
  3151. * bindings are applied recursively to a container's HIViews. This
  3152. * requires care on your part, especially when applying
  3153. * inter-relational bindings. Then the scaling (which could
  3154. * potentially override some of the previously applied bindings).
  3155. * Then the positioning (which could potentially override some of
  3156. * the previously applied bindings).
  3157. }
  3158. type
  3159. HILayoutInfo = record
  3160. {
  3161. * The version of the structure. The current version is
  3162. * kHILayoutInfoVersionZero.
  3163. }
  3164. version: UInt32;
  3165. {
  3166. * An HIBinding structure describing the kinds of bindings to apply
  3167. * to the sides of an HIView.
  3168. }
  3169. binding: HIBinding;
  3170. {
  3171. * An HIScaling structure describing the axial scaling to apply to an
  3172. * HIView.
  3173. }
  3174. scale: HIScaling;
  3175. {
  3176. * An HIPositioning structure positioning to apply to an HIView.
  3177. }
  3178. position: HIPositioning;
  3179. end;
  3180. const
  3181. kHILayoutInfoVersionZero = 0;
  3182. {
  3183. const HILayoutInfo kHILayoutInfoNone = (
  3184. kHILayoutInfoVersionZero,
  3185. kHINoBinding,
  3186. ( ( NULL, 0.0 ), ( NULL, 0.0 ) ),
  3187. ( ( NULL, kHILayoutPositionNone ), ( NULL, kHILayoutPositionNone ) ) );
  3188. }
  3189. {
  3190. * HIViewGetLayoutInfo()
  3191. *
  3192. * Summary:
  3193. * Get the layout info of an HIView.
  3194. *
  3195. * Mac OS X threading:
  3196. * Not thread safe
  3197. *
  3198. * Parameters:
  3199. *
  3200. * inView:
  3201. * The HIView whose layout info is to be retreived.
  3202. *
  3203. * outLayoutInfo:
  3204. * A pointer to an HILayoutInfo record into which to copy the
  3205. * layout info of the HIView. The version field of this record
  3206. * must be valid or the call will fail.
  3207. *
  3208. * Result:
  3209. * An operating system status code.
  3210. *
  3211. * Availability:
  3212. * Mac OS X: in version 10.3 and later in Carbon.framework
  3213. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3214. * Non-Carbon CFM: not available
  3215. }
  3216. function HIViewGetLayoutInfo( inView: HIViewRef; var outLayoutInfo: HILayoutInfo ): OSStatus; external name '_HIViewGetLayoutInfo';
  3217. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3218. {
  3219. * HIViewSetLayoutInfo()
  3220. *
  3221. * Summary:
  3222. * Set the layout info of an HIView.
  3223. *
  3224. * Mac OS X threading:
  3225. * Not thread safe
  3226. *
  3227. * Parameters:
  3228. *
  3229. * inView:
  3230. * The HIView whose layout info is to be retreived.
  3231. *
  3232. * inLayoutInfo:
  3233. * A pointer to an HILayoutInfo record from which to copy the
  3234. * layout info for the HIView.
  3235. *
  3236. * Result:
  3237. * An operating system status code.
  3238. *
  3239. * Availability:
  3240. * Mac OS X: in version 10.3 and later in Carbon.framework
  3241. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3242. * Non-Carbon CFM: not available
  3243. }
  3244. function HIViewSetLayoutInfo( inView: HIViewRef; const (*var*) inLayoutInfo: HILayoutInfo ): OSStatus; external name '_HIViewSetLayoutInfo';
  3245. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3246. {
  3247. * HIViewSuspendLayout()
  3248. *
  3249. * Summary:
  3250. * Suspends all layout handling for this layout and its children.
  3251. *
  3252. * Mac OS X threading:
  3253. * Not thread safe
  3254. *
  3255. * Parameters:
  3256. *
  3257. * inView:
  3258. * The HIView whose layout handling is to be suspended.
  3259. *
  3260. * Result:
  3261. * An operating system status code.
  3262. *
  3263. * Availability:
  3264. * Mac OS X: in version 10.3 and later in Carbon.framework
  3265. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3266. * Non-Carbon CFM: not available
  3267. }
  3268. function HIViewSuspendLayout( inView: HIViewRef ): OSStatus; external name '_HIViewSuspendLayout';
  3269. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3270. {
  3271. * HIViewResumeLayout()
  3272. *
  3273. * Summary:
  3274. * Resumes all layout handling for this layout and its children.
  3275. *
  3276. * Mac OS X threading:
  3277. * Not thread safe
  3278. *
  3279. * Parameters:
  3280. *
  3281. * inView:
  3282. * The HIView whose layout handling is to be resumed.
  3283. *
  3284. * Result:
  3285. * An operating system status code.
  3286. *
  3287. * Availability:
  3288. * Mac OS X: in version 10.3 and later in Carbon.framework
  3289. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3290. * Non-Carbon CFM: not available
  3291. }
  3292. function HIViewResumeLayout( inView: HIViewRef ): OSStatus; external name '_HIViewResumeLayout';
  3293. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3294. {
  3295. * HIViewIsLayoutActive()
  3296. *
  3297. * Summary:
  3298. * Tests the view to determine if layout is active or suspended.
  3299. * Note that this test does not determine whether or not the view
  3300. * has a valid layout, only whether or not the layout engine is
  3301. * active for the view.
  3302. *
  3303. * Discussion:
  3304. * The view's layout active state is also affected by the layout
  3305. * active state of its parents; if any parent view has inactive
  3306. * layout, this view is considered to have inactive layout as well.
  3307. * See HIViewIsLayoutLatentlyActive if latent layout active state is
  3308. * required.
  3309. *
  3310. * Mac OS X threading:
  3311. * Not thread safe
  3312. *
  3313. * Parameters:
  3314. *
  3315. * inView:
  3316. * The HIView whose layout handling is to be tested.
  3317. *
  3318. * Result:
  3319. * True if the view would respond to any linked relative's changes,
  3320. * otherwise false.
  3321. *
  3322. * Availability:
  3323. * Mac OS X: in version 10.3 and later in Carbon.framework
  3324. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3325. * Non-Carbon CFM: not available
  3326. }
  3327. function HIViewIsLayoutActive( inView: HIViewRef ): Boolean; external name '_HIViewIsLayoutActive';
  3328. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3329. {
  3330. * HIViewIsLayoutLatentlyActive()
  3331. *
  3332. * Summary:
  3333. * The view's layout active state is also affected by the layout
  3334. * active state of its parents; if any parent view has inactive
  3335. * layout, this view is considered to have inactive layout as well.
  3336. * HIViewIsLayoutLatentlyActive returns whether a view's layout is
  3337. * latently active, even if one of its parent's layouts is not.
  3338. *
  3339. * Mac OS X threading:
  3340. * Not thread safe
  3341. *
  3342. * Parameters:
  3343. *
  3344. * inView:
  3345. * The HIView whose latent layout handling is to be tested.
  3346. *
  3347. * Result:
  3348. * True if the view would latently respond to any linked relative's
  3349. * changes, otherwise false.
  3350. *
  3351. * Availability:
  3352. * Mac OS X: in version 10.4 and later in Carbon.framework
  3353. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  3354. * Non-Carbon CFM: not available
  3355. }
  3356. function HIViewIsLayoutLatentlyActive( inView: HIViewRef ): Boolean; external name '_HIViewIsLayoutLatentlyActive';
  3357. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  3358. {
  3359. * HIViewApplyLayout()
  3360. *
  3361. * Summary:
  3362. * Applies the current layout into to the specified view. Side
  3363. * bindings have no effect, but positioning and scaling will occur,
  3364. * in that order.
  3365. *
  3366. * Mac OS X threading:
  3367. * Not thread safe
  3368. *
  3369. * Parameters:
  3370. *
  3371. * inView:
  3372. * The HIView whose layout info is to be applied.
  3373. *
  3374. * Result:
  3375. * An operating system status code.
  3376. *
  3377. * Availability:
  3378. * Mac OS X: in version 10.3 and later in Carbon.framework
  3379. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3380. * Non-Carbon CFM: not available
  3381. }
  3382. function HIViewApplyLayout( inView: HIViewRef ): OSStatus; external name '_HIViewApplyLayout';
  3383. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3384. {==============================================================================}
  3385. { MISCELLANEOUS }
  3386. {==============================================================================}
  3387. {
  3388. * HIViewGetWindow()
  3389. *
  3390. * Discussion:
  3391. * Returns a reference to the window a given view is bound to. If
  3392. * the view reference passed is invalid, or the view is not embedded
  3393. * into any window, NULL is returned.
  3394. *
  3395. * Mac OS X threading:
  3396. * Not thread safe
  3397. *
  3398. * Parameters:
  3399. *
  3400. * inView:
  3401. * The view to query.
  3402. *
  3403. * Result:
  3404. * A window reference.
  3405. *
  3406. * Availability:
  3407. * Mac OS X: in version 10.3 and later in Carbon.framework
  3408. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3409. * Non-Carbon CFM: not available
  3410. }
  3411. function HIViewGetWindow( inView: HIViewRef ): WindowRef; external name '_HIViewGetWindow';
  3412. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3413. {
  3414. * HIViewFindByID()
  3415. *
  3416. * Discussion:
  3417. * Allows you to find a particular view by its ID. Currently, this
  3418. * call uses the ControlID type as its IDs.
  3419. *
  3420. * Mac OS X threading:
  3421. * Not thread safe
  3422. *
  3423. * Parameters:
  3424. *
  3425. * inStartView:
  3426. * The view to start searching at.
  3427. *
  3428. * inID:
  3429. * The ID of the view you are looking for.
  3430. *
  3431. * outControl:
  3432. * Receives the control if found.
  3433. *
  3434. * Result:
  3435. * An operating system result code.
  3436. *
  3437. * Availability:
  3438. * Mac OS X: in version 10.2 and later in Carbon.framework
  3439. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3440. * Non-Carbon CFM: not available
  3441. }
  3442. function HIViewFindByID( inStartView: HIViewRef; inID: HIViewID; var outControl: HIViewRef ): OSStatus; external name '_HIViewFindByID';
  3443. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3444. {
  3445. * HIViewGetAttributes()
  3446. *
  3447. * Discussion:
  3448. * Allows you to get the attributes of a view.
  3449. *
  3450. * Mac OS X threading:
  3451. * Not thread safe
  3452. *
  3453. * Parameters:
  3454. *
  3455. * inView:
  3456. * The view to inspect.
  3457. *
  3458. * outAttrs:
  3459. * The attributes of the view.
  3460. *
  3461. * Result:
  3462. * An operating system result code.
  3463. *
  3464. * Availability:
  3465. * Mac OS X: in version 10.2 and later in Carbon.framework
  3466. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3467. * Non-Carbon CFM: not available
  3468. }
  3469. function HIViewGetAttributes( inView: HIViewRef; var outAttrs: OptionBits ): OSStatus; external name '_HIViewGetAttributes';
  3470. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3471. {
  3472. * HIViewChangeAttributes()
  3473. *
  3474. * Discussion:
  3475. * Allows you to change the attributes of a view. You can
  3476. * simultaneously set and clear attributes.
  3477. *
  3478. * Mac OS X threading:
  3479. * Not thread safe
  3480. *
  3481. * Parameters:
  3482. *
  3483. * inView:
  3484. * The view to muck with.
  3485. *
  3486. * inAttrsToSet:
  3487. * The attributes you wish to set.
  3488. *
  3489. * inAttrsToClear:
  3490. * The attributes you wish to clear.
  3491. *
  3492. * Result:
  3493. * An operating system result code.
  3494. *
  3495. * Availability:
  3496. * Mac OS X: in version 10.2 and later in Carbon.framework
  3497. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3498. * Non-Carbon CFM: not available
  3499. }
  3500. function HIViewChangeAttributes( inView: HIViewRef; inAttrsToSet: OptionBits; inAttrsToClear: OptionBits ): OSStatus; external name '_HIViewChangeAttributes';
  3501. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3502. {
  3503. * HIViewCreateOffscreenImage()
  3504. *
  3505. * Discussion:
  3506. * Creates an CGImageRef for the view passed in. The view and any
  3507. * children it has are rendered in the resultant image.
  3508. *
  3509. * Mac OS X threading:
  3510. * Not thread safe
  3511. *
  3512. * Parameters:
  3513. *
  3514. * inView:
  3515. * The view you wish to create an image of.
  3516. *
  3517. * inOptions:
  3518. * Options. Currently you must pass 0.
  3519. *
  3520. * outFrame:
  3521. * The frame of the view within the resultant image. It is in the
  3522. * coordinate system of the image, where 0,0 is the top left
  3523. * corner of the image. This is so you can know exactly where the
  3524. * control lives in the image when the control draws outside its
  3525. * bounds for things such as shadows.
  3526. *
  3527. * outImage:
  3528. * The image of the view, including anything that would be drawn
  3529. * outside the view's frame.
  3530. *
  3531. * Result:
  3532. * An operating system status code.
  3533. *
  3534. * Availability:
  3535. * Mac OS X: in version 10.2 and later in Carbon.framework
  3536. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3537. * Non-Carbon CFM: not available
  3538. }
  3539. function HIViewCreateOffscreenImage( inView: HIViewRef; inOptions: OptionBits; outFrame: HIRectPtr { can be NULL }; var outImage: CGImageRef ): OSStatus; external name '_HIViewCreateOffscreenImage';
  3540. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3541. {
  3542. * HIViewDrawCGImage()
  3543. *
  3544. * Discussion:
  3545. * Draws an image in the right direction for an HIView. This is
  3546. * functionally the same as CGContextDrawImage, but it flips the
  3547. * context appropriately so that the image is drawn correctly.
  3548. * Because HIViews have their origin at the top, left, you are
  3549. * really drawing upside-down, so if you were to use the CG image
  3550. * drawing, you'd see what I mean! This call attempts to insulate
  3551. * you from that fact.
  3552. *
  3553. * Mac OS X threading:
  3554. * Not thread safe
  3555. *
  3556. * Parameters:
  3557. *
  3558. * inContext:
  3559. * The context to draw in.
  3560. *
  3561. * inBounds:
  3562. * The bounds to draw the image into.
  3563. *
  3564. * inImage:
  3565. * The image to draw.
  3566. *
  3567. * Result:
  3568. * An operating system status code.
  3569. *
  3570. * Availability:
  3571. * Mac OS X: in version 10.2 and later in Carbon.framework
  3572. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3573. * Non-Carbon CFM: not available
  3574. }
  3575. function HIViewDrawCGImage( inContext: CGContextRef; const (*var*) inBounds: HIRect; inImage: CGImageRef ): OSStatus; external name '_HIViewDrawCGImage';
  3576. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3577. {
  3578. * HIViewGetFeatures()
  3579. *
  3580. * Discussion:
  3581. * Returns the features for the current view. This only returns
  3582. * feature bits for the HIView space. Older Control Manager features
  3583. * such as kControlSupportsDataAccess are not returned.
  3584. *
  3585. * Mac OS X threading:
  3586. * Not thread safe
  3587. *
  3588. * Parameters:
  3589. *
  3590. * inView:
  3591. * The view to query
  3592. *
  3593. * outFeatures:
  3594. * On output, the features for the view.
  3595. *
  3596. * Result:
  3597. * An operating system status code.
  3598. *
  3599. * Availability:
  3600. * Mac OS X: in version 10.3 and later in Carbon.framework
  3601. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3602. * Non-Carbon CFM: not available
  3603. }
  3604. function HIViewGetFeatures( inView: HIViewRef; var outFeatures: HIViewFeatures ): OSStatus; external name '_HIViewGetFeatures';
  3605. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3606. {
  3607. * HIViewChangeFeatures()
  3608. *
  3609. * Discussion:
  3610. * Allows you to change a view's features on the fly. Typically,
  3611. * this is up to the view itself to control. For example, it might
  3612. * decide that under some situations it is opaque and other others
  3613. * it is transparent. In general entities outside of the view itself
  3614. * should not call this function. The only exception might be UI
  3615. * building tools, where it would want to make sure a view always
  3616. * responds to clicks, for example, so it could override mouse
  3617. * tracking to drag items around.
  3618. *
  3619. * Mac OS X threading:
  3620. * Not thread safe
  3621. *
  3622. * Parameters:
  3623. *
  3624. * inView:
  3625. * The view to change
  3626. *
  3627. * inFeaturesToSet:
  3628. * The features to enable
  3629. *
  3630. * inFeaturesToClear:
  3631. * The features to disable
  3632. *
  3633. * Result:
  3634. * An operating system status code.
  3635. *
  3636. * Availability:
  3637. * Mac OS X: in version 10.3 and later in Carbon.framework
  3638. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3639. * Non-Carbon CFM: not available
  3640. }
  3641. function HIViewChangeFeatures( inView: HIViewRef; inFeaturesToSet: HIViewFeatures; inFeaturesToClear: HIViewFeatures ): OSStatus; external name '_HIViewChangeFeatures';
  3642. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3643. {
  3644. * Summary:
  3645. * Constants for use with the HICreateTransformedCGImage API.
  3646. }
  3647. const
  3648. {
  3649. * No visual transform should be applied.
  3650. }
  3651. kHITransformNone = $00;
  3652. {
  3653. * The image should be transformed to use a disabled appearance. This
  3654. * transform should not be combined with any other transform.
  3655. }
  3656. kHITransformDisabled = $01;
  3657. {
  3658. * The image should be transformed to use a selected appearance. This
  3659. * transform should not be combined with any other transform.
  3660. }
  3661. kHITransformSelected = $4000;
  3662. {
  3663. * HICreateTransformedCGImage()
  3664. *
  3665. * Summary:
  3666. * Creates a new CGImage with a standard selected or disabled
  3667. * appearance.
  3668. *
  3669. * Mac OS X threading:
  3670. * Not thread safe
  3671. *
  3672. * Parameters:
  3673. *
  3674. * inImage:
  3675. * The original image.
  3676. *
  3677. * inTransform:
  3678. * The transform to apply to the image.
  3679. *
  3680. * outImage:
  3681. * The new image. This image should be released by the caller.
  3682. *
  3683. * Availability:
  3684. * Mac OS X: in version 10.4 and later in Carbon.framework
  3685. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  3686. * Non-Carbon CFM: not available
  3687. }
  3688. function HICreateTransformedCGImage( inImage: CGImageRef; inTransform: OptionBits; var outImage: CGImageRef ): OSStatus; external name '_HICreateTransformedCGImage';
  3689. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  3690. {
  3691. * HIViewGetEventTarget()
  3692. *
  3693. * Discussion:
  3694. * Returns the EventTargetRef for the specified view. Once you
  3695. * obtain this reference, you can send events to the target and
  3696. * install event handler on it.
  3697. *
  3698. * Mac OS X threading:
  3699. * Not thread safe
  3700. *
  3701. * Parameters:
  3702. *
  3703. * inView:
  3704. * The view to return the target for.
  3705. *
  3706. * Result:
  3707. * An EventTargetRef.
  3708. *
  3709. * Availability:
  3710. * Mac OS X: in version 10.4 and later in Carbon.framework
  3711. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  3712. * Non-Carbon CFM: not available
  3713. }
  3714. function HIViewGetEventTarget( inView: HIViewRef ): EventTargetRef; external name '_HIViewGetEventTarget';
  3715. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  3716. {==============================================================================}
  3717. { HIGrowBoxView }
  3718. { The grow box view is a new view starting in Mac OS 10.2. It can be used in }
  3719. { both the new compositing mode, as well as the traditional control manager }
  3720. { mode. Like all new HIFoo views, this view is created invisibly. You must }
  3721. { show the view after creation if you want to, like, see it and stuff. }
  3722. {==============================================================================}
  3723. { The HIObject class ID for the HIGrowBoxView class. }
  3724. {$ifc USE_CFSTR_CONSTANT_MACROS}
  3725. {$definec kHIGrowBoxViewClassID CFSTRP('com.apple.higrowboxview')}
  3726. {$endc}
  3727. { Control Kind}
  3728. const
  3729. kControlKindHIGrowBoxView = $67726F77 (* 'grow' *);
  3730. { Currently there is no direct creation API for the grow box, so you must use }
  3731. { HIObjectCreate if you wish to create one directly. Normally, a window will }
  3732. { create one for you, so you should generally never need to do this. }
  3733. {
  3734. * HIGrowBoxViewSetTransparent()
  3735. *
  3736. * Discussion:
  3737. * Sets a grow box view as transparent, meaning it will draw the
  3738. * grow box lines over any content below it. When not transparent,
  3739. * it's an opaque white square with the grow lines.
  3740. *
  3741. * Mac OS X threading:
  3742. * Not thread safe
  3743. *
  3744. * Parameters:
  3745. *
  3746. * inGrowBoxView:
  3747. * The grow box view reference.
  3748. *
  3749. * inTransparent:
  3750. * Pass true to make the grow view use its transparent look, false
  3751. * to give it the opaque look.
  3752. *
  3753. * Result:
  3754. * An operating system result code.
  3755. *
  3756. * Availability:
  3757. * Mac OS X: in version 10.2 and later in Carbon.framework
  3758. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3759. * Non-Carbon CFM: not available
  3760. }
  3761. function HIGrowBoxViewSetTransparent( inGrowBoxView: HIViewRef; inTransparent: Boolean ): OSStatus; external name '_HIGrowBoxViewSetTransparent';
  3762. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3763. {
  3764. * HIGrowBoxViewIsTransparent()
  3765. *
  3766. * Discussion:
  3767. * Returns true if a grow box view is set to be transparent.
  3768. *
  3769. * Mac OS X threading:
  3770. * Not thread safe
  3771. *
  3772. * Parameters:
  3773. *
  3774. * inGrowBoxView:
  3775. * The grow box view reference.
  3776. *
  3777. * Result:
  3778. * A boolean result.
  3779. *
  3780. * Availability:
  3781. * Mac OS X: in version 10.2 and later in Carbon.framework
  3782. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  3783. * Non-Carbon CFM: not available
  3784. }
  3785. function HIGrowBoxViewIsTransparent( inGrowBoxView: HIViewRef ): Boolean; external name '_HIGrowBoxViewIsTransparent';
  3786. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  3787. {==============================================================================}
  3788. { HIScrollView }
  3789. { The scroll view is a new view starting in Mac OS 10.2. It can be used in }
  3790. { the new compositing mode ONLY due to the nature of how it works. Like all }
  3791. { new HIFoo views, this view is created invisibly. You must show the view }
  3792. { after creation if you want to, like, see it and stuff. }
  3793. { The HIScrollView will set the frame of the contained view when its bounds }
  3794. { change, so it is not necessary to set up the layout of the embedded view. }
  3795. { Using an HIScrollView requires a few steps: }
  3796. { 1. Install your scrollable content view into the HIScrollView instance using }
  3797. { HIViewAddSubview. }
  3798. { 2. If the scrollable content view doesn't already handle the }
  3799. { kEventScrollableGetInfo and kEventScrollableScrollTo events, you must }
  3800. { install handlers on your scrollable content view and handle those events }
  3801. { manually. More details on those events can be found below. }
  3802. { 3. If the scrollable content view doesn't already send out the }
  3803. { kEventScrollableInfoChanged event to its parent view, you must send this }
  3804. { event to the HIScrollView instance whenever your scrollable content }
  3805. { view's size or origin changes. More details on this even can be found }
  3806. { below. }
  3807. {==============================================================================}
  3808. { The HIObject class ID for the HIScrollView class. }
  3809. {$ifc USE_CFSTR_CONSTANT_MACROS}
  3810. {$definec kHIScrollViewClassID CFSTRP('com.apple.HIScrollView')}
  3811. {$endc}
  3812. { Control Kind}
  3813. const
  3814. kControlKindHIScrollView = $7363726C (* 'scrl' *);
  3815. {
  3816. kEventClassScrollable quick reference:
  3817. kEventScrollableGetInfo = 1,
  3818. kEventScrollableInfoChanged = 2,
  3819. %% kEventScrollableEmbedded = 3,
  3820. %% kEventScrollableRemoved = 4,
  3821. kEventScrollableScrollTo = 10
  3822. }
  3823. const
  3824. kEventClassScrollable = $7363726C (* 'scrl' *);
  3825. const
  3826. kEventParamImageSize = $696D737A (* 'imsz' *); { typeHISize}
  3827. kEventParamViewSize = $7677737A (* 'vwsz' *); { typeHISize}
  3828. kEventParamLineSize = $6C6E737A (* 'lnsz' *); { typeHISize}
  3829. kEventParamOrigin = $6F72676E (* 'orgn' *); { typeHIPoint}
  3830. {
  3831. * kEventClassScrollable / kEventScrollableGetInfo
  3832. *
  3833. * Summary:
  3834. * Requests information from an HIScrollViewÕs scrollable view about
  3835. * its size and origin.
  3836. *
  3837. * Discussion:
  3838. * This event is sent by an HIScrollView to its scrollable view to
  3839. * determine the current size and origin of the scrollable view. A
  3840. * scrollable view must implement this event in order to scroll
  3841. * properly inside an HIScrollView.
  3842. *
  3843. * Mac OS X threading:
  3844. * Not thread safe
  3845. *
  3846. * Parameters:
  3847. *
  3848. * <-- kEventParamImageSize (out, typeHISize)
  3849. * On exit, contains the size of the entire scrollable view.
  3850. *
  3851. * <-- kEventParamViewSize (out, typeHISize)
  3852. * On exit, contains the amount of the scrollable view that is
  3853. * visible.
  3854. *
  3855. * <-- kEventParamLineSize (out, typeHISize)
  3856. * On exit, contains the amount that should be scrolled in
  3857. * response to a single click on a scrollbar arrow.
  3858. *
  3859. * <-- kEventParamOrigin (out, typeHIPoint)
  3860. * On exit, contains the scrollable viewÕs current origin (the
  3861. * view-relative coordinate that is drawn at the top left
  3862. * corner of its frame). These coordinates should always be
  3863. * greater than or equal to zero. They should be less than or
  3864. * equal to the viewÕs image size minus its view size.
  3865. *
  3866. * Availability:
  3867. * Mac OS X: in version 10.2 and later in Carbon.framework
  3868. * CarbonLib: not available
  3869. }
  3870. const
  3871. kEventScrollableGetInfo = 1;
  3872. {
  3873. * kEventClassScrollable / kEventScrollableInfoChanged
  3874. *
  3875. * Summary:
  3876. * Notification that the size or origin of an HIScrollViewÕs
  3877. * scrollable view has changed.
  3878. *
  3879. * Discussion:
  3880. * This event is not sent by HIScrollView itself; rather, it may be
  3881. * sent to an instance of HIScrollView to notify the scroll view
  3882. * that the size or origin of its scrollable view have changed. The
  3883. * HIScrollView responds to this event by sending a
  3884. * kEventScrollableGetInfo to its scrollable view. It then updates
  3885. * the scroll bars appropriately to reflect the new reality of the
  3886. * scrollable view. It does NOT move the origin of the scrollable
  3887. * view at all. It is just a notification to allow the scroll view
  3888. * to sync up with its scrollable view.
  3889. *
  3890. * Mac OS X threading:
  3891. * Not thread safe
  3892. *
  3893. * Availability:
  3894. * Mac OS X: in version 10.2 and later in Carbon.framework
  3895. * CarbonLib: not available
  3896. }
  3897. const
  3898. kEventScrollableInfoChanged = 2;
  3899. {
  3900. * kEventClassScrollable / kEventScrollableScrollTo
  3901. *
  3902. * Summary:
  3903. * Requests that an HIScrollViewÕs scrollable view should scroll to
  3904. * a particular origin.
  3905. *
  3906. * Discussion:
  3907. * This event is sent by an HIScrollView to its scrollable view to
  3908. * request that the scrollable view update its current origin and
  3909. * redraw. Typically, a scrollable view will record its current
  3910. * origin in its own instance data; it should update the origin in
  3911. * response to this event. A scrollable view should also use either
  3912. * HIViewScrollRect to scroll its content, or HIViewSetNeedsDisplay
  3913. * to cause itself to redraw using the new origin point. A
  3914. * scrollable view must implement this event in order to scroll
  3915. * properly inside an HIScrollView.
  3916. *
  3917. * Mac OS X threading:
  3918. * Not thread safe
  3919. *
  3920. * Parameters:
  3921. *
  3922. * --> kEventParamOrigin (in, typeHIPoint)
  3923. * The new origin for the scrollable view. The origin
  3924. * coordinates will vary from (0,0) to scrollable viewÕs image
  3925. * size minus its view size.
  3926. *
  3927. * Availability:
  3928. * Mac OS X: in version 10.2 and later in Carbon.framework
  3929. * CarbonLib: not available
  3930. }
  3931. const
  3932. kEventScrollableScrollTo = 10;
  3933. {
  3934. * Summary:
  3935. * HIScrollView options
  3936. }
  3937. const
  3938. {
  3939. * This indicates that a vertical scroll bar is desired.
  3940. }
  3941. kHIScrollViewOptionsVertScroll = 1 shl 0;
  3942. {
  3943. * This indicates that a horizontal scroll bar is desired.
  3944. }
  3945. kHIScrollViewOptionsHorizScroll = 1 shl 1;
  3946. {
  3947. * This indicates that space for a grow box should be taken into
  3948. * account when laying out scroll bars. On Mac OS X 10.3 and earlier,
  3949. * if both the horizontal and vertical scroll bars are requested,
  3950. * this attribute is assumed. On Mac OS X 10.4 and later, this
  3951. * attribute is *NOT* assumed; this allows the scroll view to support
  3952. * auto-hiding of the two scroll bars independently on Mac OS X 10.4
  3953. * and later. If you want to preserve space for the grow box on all
  3954. * systems, specify this option bit.
  3955. }
  3956. kHIScrollViewOptionsAllowGrow = 1 shl 2;
  3957. kHIScrollViewValidOptions = kHIScrollViewOptionsVertScroll or kHIScrollViewOptionsHorizScroll or kHIScrollViewOptionsAllowGrow;
  3958. {
  3959. * HIScrollViewAction
  3960. *
  3961. * Summary:
  3962. * HIScrollView navigation actions. See HIScrollViewNavigate for
  3963. * more information.
  3964. }
  3965. type
  3966. HIScrollViewAction = UInt32;
  3967. const
  3968. {
  3969. * The scroll view should move to the top of the content.
  3970. }
  3971. kHIScrollViewScrollToTop = 1 shl 0;
  3972. {
  3973. * The scroll view should move to the bottom of the content.
  3974. }
  3975. kHIScrollViewScrollToBottom = 1 shl 1;
  3976. {
  3977. * The scroll view should move to the left of the content.
  3978. }
  3979. kHIScrollViewScrollToLeft = 1 shl 2;
  3980. {
  3981. * The scroll view should move to the right of the content.
  3982. }
  3983. kHIScrollViewScrollToRight = 1 shl 3;
  3984. {
  3985. * The scroll view should page up.
  3986. }
  3987. kHIScrollViewPageUp = 1 shl 4;
  3988. {
  3989. * The scroll view should page down.
  3990. }
  3991. kHIScrollViewPageDown = 1 shl 5;
  3992. {
  3993. * The scroll view should page left.
  3994. }
  3995. kHIScrollViewPageLeft = 1 shl 6;
  3996. {
  3997. * The scroll view should page right.
  3998. }
  3999. kHIScrollViewPageRight = 1 shl 7;
  4000. {
  4001. * HIScrollViewCreate()
  4002. *
  4003. * Discussion:
  4004. * Creates a scroll view. This view has 3 parts, essentially. It can
  4005. * have one or two scroll bars (horizontal/vertical), and a view to
  4006. * be scrolled. The view to be scrolled is merely added via
  4007. * HIViewAddSubview. The scroll view will automatically connect it
  4008. * up appropriately. **** THIS MAY CHANGE
  4009. *
  4010. * Mac OS X threading:
  4011. * Not thread safe
  4012. *
  4013. * Parameters:
  4014. *
  4015. * inOptions:
  4016. * Options for our scroll view. You must specify either a
  4017. * horizontal or a vertical scroll bar. If neither is passed, an
  4018. * error is returned.
  4019. *
  4020. * outView:
  4021. * The new scroll view.
  4022. *
  4023. * Result:
  4024. * An operating system result code.
  4025. *
  4026. * Availability:
  4027. * Mac OS X: in version 10.2 and later in Carbon.framework
  4028. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4029. * Non-Carbon CFM: not available
  4030. }
  4031. function HIScrollViewCreate( inOptions: OptionBits; var outView: HIViewRef ): OSStatus; external name '_HIScrollViewCreate';
  4032. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4033. {
  4034. * HIScrollViewSetScrollBarAutoHide()
  4035. *
  4036. * Discussion:
  4037. * Sets a scroll view's scroll bars to auto-hide when the entire
  4038. * scrollable view it is managing can be fully displayed in its
  4039. * bounds. This is similar to the behavior you see in the Preview
  4040. * application.
  4041. *
  4042. * Mac OS X threading:
  4043. * Not thread safe
  4044. *
  4045. * Parameters:
  4046. *
  4047. * inView:
  4048. * The view to affect.
  4049. *
  4050. * inAutoHide:
  4051. * The new auto-hide setting (true == auto-hide).
  4052. *
  4053. * Result:
  4054. * An operating system result code.
  4055. *
  4056. * Availability:
  4057. * Mac OS X: in version 10.2 and later in Carbon.framework
  4058. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4059. * Non-Carbon CFM: not available
  4060. }
  4061. function HIScrollViewSetScrollBarAutoHide( inView: HIViewRef; inAutoHide: Boolean ): OSStatus; external name '_HIScrollViewSetScrollBarAutoHide';
  4062. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4063. {
  4064. * HIScrollViewGetScrollBarAutoHide()
  4065. *
  4066. * Discussion:
  4067. * Gets a scroll view's current scroll bar auto-hide setting.
  4068. *
  4069. * Mac OS X threading:
  4070. * Not thread safe
  4071. *
  4072. * Parameters:
  4073. *
  4074. * inView:
  4075. * The view to examine.
  4076. *
  4077. * Result:
  4078. * A boolean result.
  4079. *
  4080. * Availability:
  4081. * Mac OS X: in version 10.2 and later in Carbon.framework
  4082. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4083. * Non-Carbon CFM: not available
  4084. }
  4085. function HIScrollViewGetScrollBarAutoHide( inView: HIViewRef ): Boolean; external name '_HIScrollViewGetScrollBarAutoHide';
  4086. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4087. {
  4088. * HIScrollViewNavigate()
  4089. *
  4090. * Discussion:
  4091. * Allows you to programmatically change what portion of a scroll
  4092. * view's target you are seeing. For example, you can move to the
  4093. * beginning or end of a document. You can also page up, down, left
  4094. * and right. In general, you should not call this from embedded
  4095. * content (i.e. the scrollable view inside the scroll view). For
  4096. * those cases, you should instead position yourself appropriately
  4097. * and tell the scroll view you changed via the
  4098. * kEventScrollableInfoChanged carbon event. This routine merely is
  4099. * a programmatic way to scroll as one would by hand using the
  4100. * scroll bars.
  4101. *
  4102. * Mac OS X threading:
  4103. * Not thread safe
  4104. *
  4105. * Parameters:
  4106. *
  4107. * inView:
  4108. * The scroll view to affect.
  4109. *
  4110. * inAction:
  4111. * The action to take.
  4112. *
  4113. * Result:
  4114. * A operating system status code.
  4115. *
  4116. * Availability:
  4117. * Mac OS X: in version 10.3 and later in Carbon.framework
  4118. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  4119. * Non-Carbon CFM: not available
  4120. }
  4121. function HIScrollViewNavigate( inView: HIViewRef; inAction: HIScrollViewAction ): OSStatus; external name '_HIScrollViewNavigate';
  4122. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  4123. {
  4124. * HIScrollViewCanNavigate()
  4125. *
  4126. * Discussion:
  4127. * Allows you to tell whether it is currently possible to navigate
  4128. * somehow in a scroll view. For example, if a scroll view is
  4129. * already at the top of the scrollable content, it is not possible
  4130. * to navigate upward, so home and page up actions would not be
  4131. * possible. You might use this function to help you update the
  4132. * state of menu items or the like.
  4133. *
  4134. * Mac OS X threading:
  4135. * Not thread safe
  4136. *
  4137. * Parameters:
  4138. *
  4139. * inView:
  4140. * The view to examine.
  4141. *
  4142. * inAction:
  4143. * The action to test.
  4144. *
  4145. * Result:
  4146. * A boolean result.
  4147. *
  4148. * Availability:
  4149. * Mac OS X: in version 10.3 and later in Carbon.framework
  4150. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  4151. * Non-Carbon CFM: not available
  4152. }
  4153. function HIScrollViewCanNavigate( inView: HIViewRef; inAction: HIScrollViewAction ): Boolean; external name '_HIScrollViewCanNavigate';
  4154. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  4155. {==============================================================================}
  4156. { HIImageView }
  4157. { The image view is a new view starting in Mac OS 10.2. It can only be used }
  4158. { in a compositing window. Like all new HIFoo views, this view is initially }
  4159. { invisible. You must show the view after creation. }
  4160. {==============================================================================}
  4161. { The HIObject class ID for the HIImageView class. }
  4162. {$ifc USE_CFSTR_CONSTANT_MACROS}
  4163. {$definec kHIImageViewClassID CFSTRP('com.apple.HIImageView')}
  4164. {$endc}
  4165. { ControlKind}
  4166. const
  4167. kControlKindHIImageView = $696D6167 (* 'imag' *);
  4168. {
  4169. * HIImageViewCreate()
  4170. *
  4171. * Discussion:
  4172. * Creates an image view. The view responds to the scrollable
  4173. * interface and can be used in a scrolling view. You can pass an
  4174. * image initially, or set one later.
  4175. *
  4176. * Mac OS X threading:
  4177. * Not thread safe
  4178. *
  4179. * Parameters:
  4180. *
  4181. * inImage:
  4182. * An initial image, or NULL. You can set the image later via
  4183. * SetControlData.
  4184. *
  4185. * outControl:
  4186. * The new image view.
  4187. *
  4188. * Result:
  4189. * An operating system result code.
  4190. *
  4191. * Availability:
  4192. * Mac OS X: in version 10.2 and later in Carbon.framework
  4193. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4194. * Non-Carbon CFM: not available
  4195. }
  4196. function HIImageViewCreate( inImage: CGImageRef { can be NULL }; var outControl: ControlRef ): OSStatus; external name '_HIImageViewCreate';
  4197. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4198. const
  4199. kHIImageViewImageTag = $696D6167 (* 'imag' *); { CGImageRef (THIS TAG IS GOING AWAY!!! USE THE APIS BELOW!)}
  4200. {
  4201. * HIImageViewSetOpaque()
  4202. *
  4203. * Discussion:
  4204. * Allows you to set whether an image view should be treated as
  4205. * opaque. If this is set to true, the image view can make certain
  4206. * optimizations for compositing and scrolling. The alpha-related
  4207. * image view APIs are rendered useless if opacity it set to true.
  4208. * An image view, when created, is transparent by default.
  4209. *
  4210. * NOTE: In Mac OS X 10.2, this control was documented as being
  4211. * opaque by default, but the implementation did not enforce that.
  4212. * So in Mac OS X 10.3 and beyond, the control is transparent by
  4213. * default, and you can make it opaque by calling
  4214. * HIImageViewSetOpaque.
  4215. *
  4216. * Mac OS X threading:
  4217. * Not thread safe
  4218. *
  4219. * Parameters:
  4220. *
  4221. * inView:
  4222. * The image view to affect.
  4223. *
  4224. * inOpaque:
  4225. * The new opacity setting. Pass true to indicate you want the
  4226. * image to be treated as opaque.
  4227. *
  4228. * Result:
  4229. * An operating system result code.
  4230. *
  4231. * Availability:
  4232. * Mac OS X: in version 10.2 and later in Carbon.framework
  4233. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4234. * Non-Carbon CFM: not available
  4235. }
  4236. function HIImageViewSetOpaque( inView: HIViewRef; inOpaque: Boolean ): OSStatus; external name '_HIImageViewSetOpaque';
  4237. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4238. {
  4239. * HIImageViewIsOpaque()
  4240. *
  4241. * Discussion:
  4242. * Allows you to determine whether an image view is opaque or not.
  4243. *
  4244. * Mac OS X threading:
  4245. * Not thread safe
  4246. *
  4247. * Parameters:
  4248. *
  4249. * inView:
  4250. * The image view to query.
  4251. *
  4252. * Result:
  4253. * A boolean result, where true indicates the image view is opaque.
  4254. *
  4255. * Availability:
  4256. * Mac OS X: in version 10.2 and later in Carbon.framework
  4257. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4258. * Non-Carbon CFM: not available
  4259. }
  4260. function HIImageViewIsOpaque( inView: HIViewRef ): Boolean; external name '_HIImageViewIsOpaque';
  4261. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4262. {
  4263. * HIImageViewSetAlpha()
  4264. *
  4265. * Discussion:
  4266. * Allows you to set the alpha for an image, making it more or less
  4267. * transparent. An alpha of 1.0 is fully opaque, and 0.0 is fully
  4268. * transparent. The default alpha for an image is 1.0.
  4269. *
  4270. * Mac OS X threading:
  4271. * Not thread safe
  4272. *
  4273. * Parameters:
  4274. *
  4275. * inView:
  4276. * The image view to affect.
  4277. *
  4278. * inAlpha:
  4279. * The new alpha value.
  4280. *
  4281. * Result:
  4282. * An operating system result code.
  4283. *
  4284. * Availability:
  4285. * Mac OS X: in version 10.2 and later in Carbon.framework
  4286. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4287. * Non-Carbon CFM: not available
  4288. }
  4289. function HIImageViewSetAlpha( inView: HIViewRef; inAlpha: Float32 ): OSStatus; external name '_HIImageViewSetAlpha';
  4290. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4291. {
  4292. * HIImageViewGetAlpha()
  4293. *
  4294. * Discussion:
  4295. * Allows you to get the alpha for an image. An alpha of 1.0 is
  4296. * fully opaque, and 0.0 is fully transparent.
  4297. *
  4298. * Mac OS X threading:
  4299. * Not thread safe
  4300. *
  4301. * Parameters:
  4302. *
  4303. * inView:
  4304. * The image view to query.
  4305. *
  4306. * Result:
  4307. * A floating point number representing the alpha from 0.0 through
  4308. * 1.0.
  4309. *
  4310. * Availability:
  4311. * Mac OS X: in version 10.2 and later in Carbon.framework
  4312. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4313. * Non-Carbon CFM: not available
  4314. }
  4315. function HIImageViewGetAlpha( inView: HIViewRef ): Float32; external name '_HIImageViewGetAlpha';
  4316. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4317. {
  4318. * HIImageViewSetScaleToFit()
  4319. *
  4320. * Discussion:
  4321. * Normally an image view will clip to the view's bounds. Using this
  4322. * API, you can instead tell the image view to size the image to fit
  4323. * into the view bounds specified.
  4324. *
  4325. * Mac OS X threading:
  4326. * Not thread safe
  4327. *
  4328. * Parameters:
  4329. *
  4330. * inView:
  4331. * The image view to affect.
  4332. *
  4333. * inScaleToFit:
  4334. * A boolean indicating whether the image should be scaled to fit
  4335. * the view bounds (true) or merely clip to the view bounds
  4336. * (false).
  4337. *
  4338. * Result:
  4339. * An operating system status code.
  4340. *
  4341. * Availability:
  4342. * Mac OS X: in version 10.2 and later in Carbon.framework
  4343. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4344. * Non-Carbon CFM: not available
  4345. }
  4346. function HIImageViewSetScaleToFit( inView: HIViewRef; inScaleToFit: Boolean ): OSStatus; external name '_HIImageViewSetScaleToFit';
  4347. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4348. {
  4349. * HIImageViewGetScaleToFit()
  4350. *
  4351. * Discussion:
  4352. * Returns whether or not an image view will scale the image it
  4353. * displays to the view bounds or merely clip to the view bounds. A
  4354. * true result means it scales.
  4355. *
  4356. * Mac OS X threading:
  4357. * Not thread safe
  4358. *
  4359. * Parameters:
  4360. *
  4361. * inView:
  4362. * The image view to query.
  4363. *
  4364. * Result:
  4365. * A boolean result.
  4366. *
  4367. * Availability:
  4368. * Mac OS X: in version 10.2 and later in Carbon.framework
  4369. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4370. * Non-Carbon CFM: not available
  4371. }
  4372. function HIImageViewGetScaleToFit( inView: HIViewRef ): Boolean; external name '_HIImageViewGetScaleToFit';
  4373. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4374. {
  4375. * HIImageViewSetImage()
  4376. *
  4377. * Discussion:
  4378. * Sets the image to display in an image view. The image passed in
  4379. * is retained by the view, so you may release the image after
  4380. * calling this API if you no longer need to reference it.
  4381. *
  4382. * Mac OS X threading:
  4383. * Not thread safe
  4384. *
  4385. * Parameters:
  4386. *
  4387. * inView:
  4388. * The image view to affect.
  4389. *
  4390. * inImage:
  4391. * The image to set.
  4392. *
  4393. * Result:
  4394. * An operating system status code.
  4395. *
  4396. * Availability:
  4397. * Mac OS X: in version 10.2 and later in Carbon.framework
  4398. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4399. * Non-Carbon CFM: not available
  4400. }
  4401. function HIImageViewSetImage( inView: HIViewRef; inImage: CGImageRef { can be NULL } ): OSStatus; external name '_HIImageViewSetImage';
  4402. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4403. {
  4404. * HIImageViewCopyImage()
  4405. *
  4406. * Discussion:
  4407. * Gets the image for an image view. If there is no image set on the
  4408. * view, or the view ref is invalid, NULL is returned. The image is
  4409. * retained, so you should take care to release it when you are
  4410. * finished with it.
  4411. *
  4412. * Mac OS X threading:
  4413. * Not thread safe
  4414. *
  4415. * Parameters:
  4416. *
  4417. * inView:
  4418. * The image view to query.
  4419. *
  4420. * Result:
  4421. * A CoreGraphics (Quartz) image ref.
  4422. *
  4423. * Availability:
  4424. * Mac OS X: in version 10.2 and later in Carbon.framework
  4425. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4426. * Non-Carbon CFM: not available
  4427. }
  4428. function HIImageViewCopyImage( inView: HIViewRef ): CGImageRef; external name '_HIImageViewCopyImage';
  4429. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4430. {==============================================================================}
  4431. { HIComboBox }
  4432. { The combo box is a new view starting in Mac OS 10.2. It can be used in }
  4433. { both the new compositing mode, as well as the traditional control manager }
  4434. { mode. Like all new HIFoo views, this view is created invisible. You must }
  4435. { show the view after creation if you want to, like, see it and stuff. }
  4436. {==============================================================================}
  4437. { The HIObject class ID for the HIComboBox class. }
  4438. {$ifc USE_CFSTR_CONSTANT_MACROS}
  4439. {$definec kHIComboBoxClassID CFSTRP('com.apple.HIComboBox')}
  4440. {$endc}
  4441. {
  4442. kEventClassHIComboBox quick reference:
  4443. kEventComboBoxListItemSelected = 1
  4444. }
  4445. const
  4446. kEventClassHIComboBox = $68696362 (* 'hicb' *);
  4447. const
  4448. kEventParamComboBoxListSelectedItemIndex = $63626C69 (* 'cbli' *);
  4449. {
  4450. * kEventClassHIComboBox / kEventComboBoxListItemSelected
  4451. *
  4452. * Summary:
  4453. * Notification that an item in the ComboBox disclosure list has
  4454. * been selected.
  4455. *
  4456. * Discussion:
  4457. * This event is sent as a notification when an item in the ComboBox
  4458. * disclosure list has been selected. This event is sent to all
  4459. * handlers installed on the control. This does not imply that the
  4460. * selection has been accepted; for that you will need to register
  4461. * for the kEventClassTextField/kEventTextAccepted event; you can
  4462. * register for that event in order to make live selections however.
  4463. *
  4464. * Mac OS X threading:
  4465. * Not thread safe
  4466. *
  4467. * Parameters:
  4468. *
  4469. * --> kEventParamDirectObject (in, typeControlRef)
  4470. * The ComboBox view that has sent the notification.
  4471. *
  4472. * --> kEventParamComboBoxListSelectedItemIndex (in, typeCFIndex)
  4473. * The index of the combo box list item that has been selected.
  4474. *
  4475. * Availability:
  4476. * Mac OS X: in version 10.4 and later in Carbon.framework
  4477. * CarbonLib: not available
  4478. }
  4479. const
  4480. kEventComboBoxListItemSelected = 1;
  4481. {
  4482. * Summary:
  4483. * ComboBox attributes
  4484. }
  4485. const
  4486. {
  4487. * A constant with value zero; the lack of any attributes.
  4488. }
  4489. kHIComboBoxNoAttributes = 0;
  4490. {
  4491. * The control will attempt to auto complete the text the user is
  4492. * typing with an item in the ComboBox list that is the closest
  4493. * appropriate match.
  4494. }
  4495. kHIComboBoxAutoCompletionAttribute = 1 shl 0;
  4496. {
  4497. * The control will disclose the ComboBox list after the user enters
  4498. * text.
  4499. }
  4500. kHIComboBoxAutoDisclosureAttribute = 1 shl 1;
  4501. {
  4502. * The items in the ComboBox list will be automatically sorted in
  4503. * alphabetical order.
  4504. }
  4505. kHIComboBoxAutoSortAttribute = 1 shl 2;
  4506. {
  4507. * The ComboBox list will be automatically sized to fit the Human
  4508. * Interface Guidelines.
  4509. }
  4510. kHIComboBoxAutoSizeListAttribute = 1 shl 3;
  4511. {
  4512. * The minimum set of ComboBox attributes commonly used.
  4513. }
  4514. kHIComboBoxStandardAttributes = kHIComboBoxAutoCompletionAttribute or kHIComboBoxAutoDisclosureAttribute or kHIComboBoxAutoSizeListAttribute;
  4515. { ControlKind}
  4516. const
  4517. kControlKindHIComboBox = $63626278 (* 'cbbx' *);
  4518. { ComboBox Part codes}
  4519. const
  4520. kHIComboBoxEditTextPart = 5;
  4521. kHIComboBoxDisclosurePart = 28;
  4522. {
  4523. The ComboBox view supports these tags previously defined for the EditUnicodeText control.
  4524. These tags are available through Get/SetControlData with a ControlPartCode of kHIComboBoxEditTextPart:
  4525. kControlFontStyleTag
  4526. kControlEditTextFixedTextTag
  4527. kControlEditTextTextTag
  4528. kControlEditTextKeyFilterTag
  4529. kControlEditTextValidationProcTag
  4530. kControlEditUnicodeTextPostUpdateProcTag
  4531. kControlEditTextSelectionTag
  4532. kControlEditTextKeyScriptBehaviorTag
  4533. kControlEditTextCharCount
  4534. kControlEditTextCFStringTag
  4535. }
  4536. {
  4537. * Discussion:
  4538. * ComboBox ControlData tags available with Mac OS X 10.2 and later.
  4539. }
  4540. const
  4541. {
  4542. * Extract the contents of the ComboBox list as a CFArray. The
  4543. * CFArray will be retained: if you get the array, you own it and
  4544. * will be required to release it; if you set it the toolbox makes a
  4545. * copy of it and you are free to release your reference.
  4546. }
  4547. kHIComboBoxListTag = $63626C73 (* 'cbls' *); { CFArrayRef; bumps the refCount on get/retains on set}
  4548. {
  4549. * The width of the ComboBox list. This can be customized. This
  4550. * disables the autosize attribute.
  4551. }
  4552. kHIComboBoxListPixelWidthTag = $63626C77 (* 'cblw' *); { UInt32 }
  4553. {
  4554. * The height of the ComboBox list. This can be customized. This
  4555. * disables the autosize attribute.
  4556. }
  4557. kHIComboBoxListPixelHeightTag = $63626C68 (* 'cblh' *); { UInt32}
  4558. {
  4559. * The number of visible items in the list. This can be customized.
  4560. * This disables the autosize attribute.
  4561. }
  4562. kHIComboBoxNumVisibleItemsTag = $63626E69 (* 'cbni' *); { UInt32}
  4563. {
  4564. * HIComboBoxCreate()
  4565. *
  4566. * Summary:
  4567. * Creates a combo box control. The new control is initially
  4568. * invisible.
  4569. *
  4570. * Mac OS X threading:
  4571. * Not thread safe
  4572. *
  4573. * Parameters:
  4574. *
  4575. * boundsRect:
  4576. * The bounding box of the control.
  4577. *
  4578. * text:
  4579. * The default text in the editable portion of the control. Can be
  4580. * NULL.
  4581. *
  4582. * style:
  4583. * The font style of the both editable text and the text in the
  4584. * disclosure list. Can be NULL.
  4585. *
  4586. * list:
  4587. * The default values available in the disclosure list. Can be
  4588. * NULL.
  4589. *
  4590. * inAttributes:
  4591. * The default attributes of the combo box.
  4592. *
  4593. * outComboBox:
  4594. * On exit, contains the new control.
  4595. *
  4596. * Availability:
  4597. * Mac OS X: in version 10.2 and later in Carbon.framework
  4598. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4599. * Non-Carbon CFM: not available
  4600. }
  4601. function HIComboBoxCreate( const (*var*) boundsRect: HIRect; text: CFStringRef { can be NULL }; {const} style: ControlFontStyleRecPtr { can be NULL }; list: CFArrayRef { can be NULL }; inAttributes: OptionBits; var outComboBox: HIViewRef ): OSStatus; external name '_HIComboBoxCreate';
  4602. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4603. {
  4604. * HIComboBoxGetItemCount()
  4605. *
  4606. * Summary:
  4607. * Get the number of items in the combo box disclosure list.
  4608. *
  4609. * Mac OS X threading:
  4610. * Not thread safe
  4611. *
  4612. * Parameters:
  4613. *
  4614. * inComboBox:
  4615. * The combo box.
  4616. *
  4617. * Result:
  4618. * The number of items in the combo box disclosure list.
  4619. *
  4620. * Availability:
  4621. * Mac OS X: in version 10.2 and later in Carbon.framework
  4622. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4623. * Non-Carbon CFM: not available
  4624. }
  4625. function HIComboBoxGetItemCount( inComboBox: HIViewRef ): ItemCount; external name '_HIComboBoxGetItemCount';
  4626. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4627. {
  4628. * HIComboBoxInsertTextItemAtIndex()
  4629. *
  4630. * Summary:
  4631. * Inserts a CFString in the disclosure list
  4632. *
  4633. * Mac OS X threading:
  4634. * Not thread safe
  4635. *
  4636. * Parameters:
  4637. *
  4638. * inComboBox:
  4639. * The combo box whose disclosure list the text will be inserted
  4640. * in.
  4641. *
  4642. * inIndex:
  4643. * The index that the text should be inserted in. If the index
  4644. * does not fall within the number of items in the combo box list,
  4645. * it will be appended to the end of the list.
  4646. *
  4647. * inText:
  4648. * The text item to be inserted in the combo box disclosure list.
  4649. *
  4650. * Result:
  4651. * An operating system status code.
  4652. *
  4653. * Availability:
  4654. * Mac OS X: in version 10.2 and later in Carbon.framework
  4655. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4656. * Non-Carbon CFM: not available
  4657. }
  4658. function HIComboBoxInsertTextItemAtIndex( inComboBox: HIViewRef; inIndex: CFIndex; inText: CFStringRef ): OSStatus; external name '_HIComboBoxInsertTextItemAtIndex';
  4659. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4660. {
  4661. * HIComboBoxAppendTextItem()
  4662. *
  4663. * Summary:
  4664. * Appends a text item to the combo box disclosure list.
  4665. *
  4666. * Mac OS X threading:
  4667. * Not thread safe
  4668. *
  4669. * Parameters:
  4670. *
  4671. * inComboBox:
  4672. * The combo box whose disclosure list the text will be appended
  4673. * to.
  4674. *
  4675. * inText:
  4676. * The text item to be appended to the combo box disclosure list.
  4677. *
  4678. * outIndex:
  4679. * On exit, the index of the new item. Can be NULL if the caller
  4680. * does not require this information.
  4681. *
  4682. * Result:
  4683. * An operating system status code.
  4684. *
  4685. * Availability:
  4686. * Mac OS X: in version 10.2 and later in Carbon.framework
  4687. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4688. * Non-Carbon CFM: not available
  4689. }
  4690. function HIComboBoxAppendTextItem( inComboBox: HIViewRef; inText: CFStringRef; outIndex: CFIndexPtr { can be NULL } ): OSStatus; external name '_HIComboBoxAppendTextItem';
  4691. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4692. {
  4693. * HIComboBoxCopyTextItemAtIndex()
  4694. *
  4695. * Summary:
  4696. * Copy the text from the combo box disclosure list
  4697. *
  4698. * Mac OS X threading:
  4699. * Not thread safe
  4700. *
  4701. * Parameters:
  4702. *
  4703. * inComboBox:
  4704. * The combo box that contains the text item you would like to
  4705. * copy.
  4706. *
  4707. * inIndex:
  4708. * The index of the text item. Will return paramErr if the index
  4709. * is out of bounds of the combo box list.
  4710. *
  4711. * outString:
  4712. * A copy of the string at the given index. Remember this is now
  4713. * your copy that you will need to release.
  4714. *
  4715. * Result:
  4716. * An operating system status code.
  4717. *
  4718. * Availability:
  4719. * Mac OS X: in version 10.2 and later in Carbon.framework
  4720. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4721. * Non-Carbon CFM: not available
  4722. }
  4723. function HIComboBoxCopyTextItemAtIndex( inComboBox: HIViewRef; inIndex: CFIndex; var outString: CFStringRef ): OSStatus; external name '_HIComboBoxCopyTextItemAtIndex';
  4724. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4725. {
  4726. * HIComboBoxRemoveItemAtIndex()
  4727. *
  4728. * Summary:
  4729. * Remove an item from a combo box disclosure list.
  4730. *
  4731. * Mac OS X threading:
  4732. * Not thread safe
  4733. *
  4734. * Parameters:
  4735. *
  4736. * inComboBox:
  4737. * The combo box that contains the disclosure list that you would
  4738. * like to remove an item from.
  4739. *
  4740. * inIndex:
  4741. * The index of the item to remove.
  4742. *
  4743. * Result:
  4744. * An operating system status code.
  4745. *
  4746. * Availability:
  4747. * Mac OS X: in version 10.2 and later in Carbon.framework
  4748. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4749. * Non-Carbon CFM: not available
  4750. }
  4751. function HIComboBoxRemoveItemAtIndex( inComboBox: HIViewRef; inIndex: CFIndex ): OSStatus; external name '_HIComboBoxRemoveItemAtIndex';
  4752. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4753. {
  4754. * HIComboBoxChangeAttributes()
  4755. *
  4756. * Summary:
  4757. * Change the attributes of a combo box
  4758. *
  4759. * Mac OS X threading:
  4760. * Not thread safe
  4761. *
  4762. * Parameters:
  4763. *
  4764. * inComboBox:
  4765. * The combo box whose attributes you would like to change.
  4766. *
  4767. * inAttributesToSet:
  4768. * The attributes to set.
  4769. *
  4770. * inAttributesToClear:
  4771. * The attributes to clear.
  4772. *
  4773. * Result:
  4774. * An operating system status code.
  4775. *
  4776. * Availability:
  4777. * Mac OS X: in version 10.2 and later in Carbon.framework
  4778. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4779. * Non-Carbon CFM: not available
  4780. }
  4781. function HIComboBoxChangeAttributes( inComboBox: HIViewRef; inAttributesToSet: OptionBits; inAttributesToClear: OptionBits ): OSStatus; external name '_HIComboBoxChangeAttributes';
  4782. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4783. {
  4784. * HIComboBoxGetAttributes()
  4785. *
  4786. * Summary:
  4787. * Get the attributes of a combo box.
  4788. *
  4789. * Mac OS X threading:
  4790. * Not thread safe
  4791. *
  4792. * Parameters:
  4793. *
  4794. * inComboBox:
  4795. * The combo box whose attributes you would like to obtain.
  4796. *
  4797. * outAttributes:
  4798. * The attributes of the combo box.
  4799. *
  4800. * Result:
  4801. * An operating system status code.
  4802. *
  4803. * Availability:
  4804. * Mac OS X: in version 10.2 and later in Carbon.framework
  4805. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4806. * Non-Carbon CFM: not available
  4807. }
  4808. function HIComboBoxGetAttributes( inComboBox: HIViewRef; var outAttributes: OptionBits ): OSStatus; external name '_HIComboBoxGetAttributes';
  4809. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  4810. {
  4811. * HIComboBoxIsListVisible()
  4812. *
  4813. * Summary:
  4814. * Returns whether the combo box list is currently disclosed.
  4815. *
  4816. * Mac OS X threading:
  4817. * Not thread safe
  4818. *
  4819. * Parameters:
  4820. *
  4821. * inComboBox:
  4822. * The combo box whose list visibility you would like to obtain.
  4823. *
  4824. * Result:
  4825. * A boolean value indicating whether the combo box list is
  4826. * disclosed (true) or hidden (false).
  4827. *
  4828. * Availability:
  4829. * Mac OS X: in version 10.4 and later in Carbon.framework
  4830. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  4831. * Non-Carbon CFM: not available
  4832. }
  4833. function HIComboBoxIsListVisible( inComboBox: HIViewRef ): Boolean; external name '_HIComboBoxIsListVisible';
  4834. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  4835. {
  4836. * HIComboBoxSetListVisible()
  4837. *
  4838. * Summary:
  4839. * Hides or shows the combo box list.
  4840. *
  4841. * Mac OS X threading:
  4842. * Not thread safe
  4843. *
  4844. * Parameters:
  4845. *
  4846. * inComboBox:
  4847. * The combo box whose list will be hidden or shown.
  4848. *
  4849. * inVisible:
  4850. * A boolean value indicating whether you wish to hide the list
  4851. * (false) or show the list (true).
  4852. *
  4853. * Result:
  4854. * An operating system result code.
  4855. *
  4856. * Availability:
  4857. * Mac OS X: in version 10.4 and later in Carbon.framework
  4858. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  4859. * Non-Carbon CFM: not available
  4860. }
  4861. function HIComboBoxSetListVisible( inComboBox: HIViewRef; inVisible: Boolean ): OSStatus; external name '_HIComboBoxSetListVisible';
  4862. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  4863. {==============================================================================}
  4864. { HISearchField }
  4865. { HISearchField is a new view available in Mac OS X 10.3. }
  4866. { This view is designed to be used for applications that provide searching }
  4867. { functionality. Visually, it is a standard text field optionally adorned }
  4868. { with a search icon on the left and/or a cancel image on the right. }
  4869. { When the user has accepted the text by pressing the return or enter key }
  4870. { a Carbon Event of kEventClassTextField / kEventTextAccepted will be sent }
  4871. { to the control. This will be the indication that the search should begin. }
  4872. { This control will also respond to all the standard control tags that are }
  4873. { used by the EditUnicodeText control. }
  4874. {==============================================================================}
  4875. { The HIObject class ID for the HISearchField class. }
  4876. {$ifc USE_CFSTR_CONSTANT_MACROS}
  4877. {$definec kHISearchFieldClassID CFSTRP('com.apple.HISearchField')}
  4878. {$endc}
  4879. { ControlKind}
  4880. const
  4881. kControlKindHISearchField = $73726664 (* 'srfd' *);
  4882. { HISearchField part codes}
  4883. const
  4884. kControlSearchFieldCancelPart = 30;
  4885. kControlSearchFieldMenuPart = 31;
  4886. {
  4887. The SearchField view supports those tags previously defined for the EditUnicodeText control.
  4888. These tags are available through Get/SetControlData with ControlPartCode of kControlEditTextPart:
  4889. kControlFontStyleTag
  4890. kControlEditTextFixedTextTag
  4891. kControlEditTextTextTag
  4892. kControlEditTextKeyFilterTag
  4893. kControlEditTextValidationProcTag
  4894. kControlEditUnicodeTextPostUpdateProcTag
  4895. kControlEditTextSelectionTag
  4896. kControlEditTextKeyScriptBehaviorTag
  4897. kControlEditTextCharCount
  4898. kControlEditTextCFStringTag
  4899. }
  4900. {
  4901. * Summary:
  4902. * HISearchField attributes
  4903. }
  4904. const
  4905. {
  4906. * A constant with value zero; the lack of any attributes.
  4907. }
  4908. kHISearchFieldNoAttributes = 0;
  4909. {
  4910. * This view contains the cancel icon in the text field.
  4911. }
  4912. kHISearchFieldAttributesCancel = 1 shl 0;
  4913. {
  4914. * This view contains the search icon in the text field. If a menu is
  4915. * associated with the search field, this attribute is implicitly set
  4916. * and the search icon will display with a menu disclosure badge.
  4917. * Available in Mac OS X 10.4 and later.
  4918. }
  4919. kHISearchFieldAttributesSearchIcon = 1 shl 1;
  4920. { Event Classes}
  4921. const
  4922. kEventClassSearchField = $73726664 (* 'srfd' *);
  4923. {
  4924. * kEventClassSearchField / kEventSearchFieldCancelClicked
  4925. *
  4926. * Summary:
  4927. * Notification that the cancel icon has been depressed.
  4928. *
  4929. * Discussion:
  4930. * This event is sent by the HISearchField view if the cancel icon
  4931. * is enabled (attribute of kHISearchFieldAtttributesCancel), and
  4932. * the cancel has been clicked.
  4933. *
  4934. * Mac OS X threading:
  4935. * Not thread safe
  4936. *
  4937. * Parameters:
  4938. *
  4939. * --> kEventParamDirectObject (in, typeControlRef)
  4940. * The HISearchField that has sent the notification.
  4941. *
  4942. * Availability:
  4943. * Mac OS X: in version 10.3 and later in Carbon.framework
  4944. * CarbonLib: not available
  4945. }
  4946. const
  4947. kEventSearchFieldCancelClicked = 1;
  4948. {
  4949. * kEventClassSearchField / kEventSearchFieldSearchClicked
  4950. *
  4951. * Summary:
  4952. * Notification that the search icon has been depressed.
  4953. *
  4954. * Discussion:
  4955. * This event is sent by the HISearchField view if the search icon
  4956. * is enabled (attribute of kHISearchFieldAttributesSearchIcon or a
  4957. * menu is associated with the search field), and the search icon
  4958. * has been clicked. If a menu is associated with the search field,
  4959. * the search field will handle the display and tracking of the menu
  4960. * by default. This event is sent to the search field only, it will
  4961. * not propagate.
  4962. *
  4963. * Mac OS X threading:
  4964. * Not thread safe
  4965. *
  4966. * Parameters:
  4967. *
  4968. * --> kEventParamDirectObject (in, typeControlRef)
  4969. * The HISearchField that has sent the notification.
  4970. *
  4971. * Availability:
  4972. * Mac OS X: in version 10.4 and later in Carbon.framework
  4973. * CarbonLib: not available
  4974. }
  4975. const
  4976. kEventSearchFieldSearchClicked = 2;
  4977. {
  4978. * HISearchFieldCreate()
  4979. *
  4980. * Summary:
  4981. * Creates a search field control. The new control is initially
  4982. * invisible.
  4983. *
  4984. * Mac OS X threading:
  4985. * Not thread safe
  4986. *
  4987. * Parameters:
  4988. *
  4989. * inBounds:
  4990. * The initial bounds of the view. If this parameter is NULL, the
  4991. * view defaults to have empty bounds ( 0, 0, 0, 0 ).
  4992. *
  4993. * inAttributes:
  4994. * The initial attributes of the search field. Indicates whether
  4995. * the field should contain the cancel icon.
  4996. *
  4997. * inSearchMenu:
  4998. * The menu to be associated with this search field. If
  4999. * inSearchMenu is non-NULL, it will be retained by the search
  5000. * field and the search icon will be enabled in the left side of
  5001. * the text field. If this parameter is NULL, the view will not
  5002. * display the search icon in the left portion of the text field.
  5003. * You are expected to install handlers on this menu to handle the
  5004. * visual appearance of the menu (for example, to draw check marks
  5005. * or enable items when the menu receives the
  5006. * kEventMenuEnableItems Carbon Event), and to keep track of what
  5007. * action should be performed by associating HICommands with each
  5008. * menu item and installing a handler for the (
  5009. * kEventClassCommand, kEventCommandProcess ) Carbon Event.
  5010. *
  5011. * inDescriptiveText:
  5012. * The text to be displayed in the text field when the field does
  5013. * not have focus and contains no user entered text. This is meant
  5014. * to be an indication of what the search criteria is. For
  5015. * example, you may wish to identify to the user that the search
  5016. * will cover the "Subject" or "Contents" of a selected range of
  5017. * items. If inDescriptiveText is non-NULL it will be retained by
  5018. * the search field.
  5019. *
  5020. * outRef:
  5021. * On exit, contains the new view.
  5022. *
  5023. * Result:
  5024. * An operating system status code.
  5025. *
  5026. * Availability:
  5027. * Mac OS X: in version 10.3 and later in Carbon.framework
  5028. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5029. * Non-Carbon CFM: not available
  5030. }
  5031. function HISearchFieldCreate( {const} inBounds: HIRectPtr { can be NULL }; inAttributes: OptionBits; inSearchMenu: MenuRef { can be NULL }; inDescriptiveText: CFStringRef { can be NULL }; var outRef: HIViewRef ): OSStatus; external name '_HISearchFieldCreate';
  5032. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5033. {
  5034. * HISearchFieldSetSearchMenu()
  5035. *
  5036. * Summary:
  5037. * Set the search menu associated with the view.
  5038. *
  5039. * Mac OS X threading:
  5040. * Not thread safe
  5041. *
  5042. * Parameters:
  5043. *
  5044. * inSearchField:
  5045. * The search field to associate the search menu with.
  5046. *
  5047. * inSearchMenu:
  5048. * The menu to associate with the search field. If there is
  5049. * already a menu associated with the search field, that menu will
  5050. * be released. If inSearchMenu is non-NULL, it will be retained
  5051. * by the search field and the search icon will be enabled in the
  5052. * left side of the text field. You are expected to install
  5053. * handlers on this menu to handle the visual appearance of the
  5054. * menu (for example, to draw check marks or enable items when the
  5055. * menu receives the kEventMenuEnableItems Carbon Event), and to
  5056. * keep track of what action should be performed by associating
  5057. * HICommands with each menu item and installing a handler for the
  5058. * ( kEventClassCommand, kEventCommandProcess ) Carbon Event. If
  5059. * inSearchMenu is NULL, the search icon will be removed from the
  5060. * left side of the text field and no menu will be associated with
  5061. * this field.
  5062. *
  5063. * Result:
  5064. * An operating system status code.
  5065. *
  5066. * Availability:
  5067. * Mac OS X: in version 10.3 and later in Carbon.framework
  5068. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5069. * Non-Carbon CFM: not available
  5070. }
  5071. function HISearchFieldSetSearchMenu( inSearchField: HIViewRef; inSearchMenu: MenuRef { can be NULL } ): OSStatus; external name '_HISearchFieldSetSearchMenu';
  5072. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5073. {
  5074. * HISearchFieldGetSearchMenu()
  5075. *
  5076. * Summary:
  5077. * Get the menu that is associated with the search field
  5078. *
  5079. * Mac OS X threading:
  5080. * Not thread safe
  5081. *
  5082. * Parameters:
  5083. *
  5084. * inSearchField:
  5085. * The search field you wish to retrieve the search menu from.
  5086. *
  5087. * outSearchMenu:
  5088. * On exit, will contain the menu that is associated with search
  5089. * field. The menu will _not_ be retained on output and this
  5090. * parameter cannot be NULL.
  5091. *
  5092. * Result:
  5093. * An operating system status code.
  5094. *
  5095. * Availability:
  5096. * Mac OS X: in version 10.3 and later in Carbon.framework
  5097. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5098. * Non-Carbon CFM: not available
  5099. }
  5100. function HISearchFieldGetSearchMenu( inSearchField: HIViewRef; var outSearchMenu: MenuRef ): OSStatus; external name '_HISearchFieldGetSearchMenu';
  5101. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5102. {
  5103. * HISearchFieldChangeAttributes()
  5104. *
  5105. * Summary:
  5106. * Set the attributes for the given search field.
  5107. *
  5108. * Mac OS X threading:
  5109. * Not thread safe
  5110. *
  5111. * Parameters:
  5112. *
  5113. * inSearchField:
  5114. * The search field to change the attributes of.
  5115. *
  5116. * inAttributesToSet:
  5117. * The attributes to set.
  5118. *
  5119. * inAttributesToClear:
  5120. * The attributes to clear.
  5121. *
  5122. * Result:
  5123. * An operating system status code.
  5124. *
  5125. * Availability:
  5126. * Mac OS X: in version 10.3 and later in Carbon.framework
  5127. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5128. * Non-Carbon CFM: not available
  5129. }
  5130. function HISearchFieldChangeAttributes( inSearchField: HIViewRef; inAttributesToSet: OptionBits; inAttributesToClear: OptionBits ): OSStatus; external name '_HISearchFieldChangeAttributes';
  5131. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5132. {
  5133. * HISearchFieldGetAttributes()
  5134. *
  5135. * Summary:
  5136. * Returns the attributes of the search field.
  5137. *
  5138. * Mac OS X threading:
  5139. * Not thread safe
  5140. *
  5141. * Parameters:
  5142. *
  5143. * inSearchField:
  5144. * The search field to get the attributes of.
  5145. *
  5146. * outAttributes:
  5147. * On exit, will contain the attributes of the search field. This
  5148. * parameter cannot be NULL.
  5149. *
  5150. * Result:
  5151. * An operating system status code.
  5152. *
  5153. * Availability:
  5154. * Mac OS X: in version 10.3 and later in Carbon.framework
  5155. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5156. * Non-Carbon CFM: not available
  5157. }
  5158. function HISearchFieldGetAttributes( inSearchField: HIViewRef; var outAttributes: OptionBits ): OSStatus; external name '_HISearchFieldGetAttributes';
  5159. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5160. {
  5161. * HISearchFieldSetDescriptiveText()
  5162. *
  5163. * Summary:
  5164. * Set the description of the search action of the search field.
  5165. *
  5166. * Mac OS X threading:
  5167. * Not thread safe
  5168. *
  5169. * Parameters:
  5170. *
  5171. * inSearchField:
  5172. * The search field to change the description of.
  5173. *
  5174. * inDescription:
  5175. * The new description for the search field. If the search field
  5176. * contains a description, it will be released. If inDescription
  5177. * is non-NULL, it will be retained by the search field. If it is
  5178. * NULL, no description will be associated with the search field.
  5179. *
  5180. * Result:
  5181. * An operating system status code.
  5182. *
  5183. * Availability:
  5184. * Mac OS X: in version 10.3 and later in Carbon.framework
  5185. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5186. * Non-Carbon CFM: not available
  5187. }
  5188. function HISearchFieldSetDescriptiveText( inSearchField: HIViewRef; inDescription: CFStringRef { can be NULL } ): OSStatus; external name '_HISearchFieldSetDescriptiveText';
  5189. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5190. {
  5191. * HISearchFieldCopyDescriptiveText()
  5192. *
  5193. * Summary:
  5194. * Get the description that is associated with the search field.
  5195. *
  5196. * Mac OS X threading:
  5197. * Not thread safe
  5198. *
  5199. * Parameters:
  5200. *
  5201. * inSearchField:
  5202. * The search field you wish to retrieve the description from.
  5203. *
  5204. * outDescription:
  5205. * On exit, will contain the description that is associated with
  5206. * the search field. This parameter cannot be NULL. If there is no
  5207. * description associated with the search field, outDescription
  5208. * will be set to NULL. If there is a description, a CFStringRef
  5209. * will be created that contains the contents of the description.
  5210. * You posess ownership of this string and will need to release it
  5211. * when you no longer need it.
  5212. *
  5213. * Result:
  5214. * An operating system status code.
  5215. *
  5216. * Availability:
  5217. * Mac OS X: in version 10.3 and later in Carbon.framework
  5218. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5219. * Non-Carbon CFM: not available
  5220. }
  5221. function HISearchFieldCopyDescriptiveText( inSearchField: HIViewRef; var outDescription: CFStringRef ): OSStatus; external name '_HISearchFieldCopyDescriptiveText';
  5222. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5223. {==============================================================================}
  5224. { Text field events }
  5225. { A text field is the part of some controls that you can enter text into. }
  5226. { A text field is common to the EditText, EditUnicodeText, ComboBox, }
  5227. { HISearchField, and HITextView views. The kEventClassTextField event allows }
  5228. { you to receive notifications when the text has been accepted by the user. }
  5229. { For example, you can install a handler for a }
  5230. { kEventClassTextField / kEventTextAccepted event on a HISearchField view to }
  5231. { receive a notification that the user has initiated a search by hitting the }
  5232. { return or enter key. You can also filter the text that will replace a }
  5233. { selection before the change has been made to either accept or reject the }
  5234. { replacement. }
  5235. {==============================================================================}
  5236. {
  5237. kEventClassTextField quick reference:
  5238. kEventTextAccepted = 1,
  5239. kEventTextShouldChangeInRange = 2,
  5240. kEventTextDidChange = 3
  5241. }
  5242. const
  5243. kEventClassTextField = $74786664 (* 'txfd' *);
  5244. const
  5245. kEventParamTextSelection = $7478736C (* 'txsl' *); { typeCFRange}
  5246. kEventParamCandidateText = $74737478 (* 'tstx' *); { typeCFStringRef}
  5247. kEventParamReplacementText = $74727478 (* 'trtx' *); { typeCFStringRef}
  5248. kEventParamUnconfirmedRange = $74756E72 (* 'tunr' *); { typeCFRange}
  5249. kEventParamUnconfirmedText = $7478756E (* 'txun' *); { typeCFStringRef}
  5250. {
  5251. * kEventClassTextField / kEventTextAccepted
  5252. *
  5253. * Summary:
  5254. * Notification that the text in a control's editable text field has
  5255. * been accepted.
  5256. *
  5257. * Discussion:
  5258. * This event is sent as a notification when the text contained in a
  5259. * control's editable text field has been accepted by the user. Text
  5260. * is accepted when the user presses return or enter on the keyboard
  5261. * for the EditUnicodeText, HIComboBox, and HISearchField controls,
  5262. * or when the text has changed in the field and the field loses
  5263. * focus for the EditUnicodeText, HIComboBox, HISearchField and
  5264. * HITextView controls.
  5265. *
  5266. * This event is sent to the control containing the text field only,
  5267. * it will not propagate. It is sent to all handlers installed on
  5268. * the control containing the text field.
  5269. *
  5270. * Mac OS X threading:
  5271. * Not thread safe
  5272. *
  5273. * Parameters:
  5274. *
  5275. * --> kEventParamDirectObject (in, typeControlRef)
  5276. * The editable text field that has sent the notification.
  5277. *
  5278. * Availability:
  5279. * Mac OS X: in version 10.3 and later in Carbon.framework
  5280. * CarbonLib: not available
  5281. }
  5282. const
  5283. kEventTextAccepted = 1;
  5284. {
  5285. * kEventClassTextField / kEventTextShouldChangeInRange
  5286. *
  5287. * Summary:
  5288. * Returns whether the text should be changed in editable text
  5289. * fields.
  5290. *
  5291. * Discussion:
  5292. * There are several editable text field views, such as the
  5293. * HIComboBox, HISearchField, HITextView, and EditUnicodeText
  5294. * controls. There are times when you may require fine-grained
  5295. * control over what text is inserted into the text field and either
  5296. * accept the changes, reject them or modify what is to be entered.
  5297. * This event is sent whenever the text is about to be modified in a
  5298. * text field, either by user input or in other scenarios such as a
  5299. * paste from the clipboard, spell-checking word correction, or Mac
  5300. * OS X Service operation. You can change what text is inserted by
  5301. * providing a replacement string as a parameter to this event. This
  5302. * event is only sent for Unicode text controls; it is not sent for
  5303. * the classic non-Unicode EditText control.
  5304. *
  5305. * This event is not sent prior to programmatic modification of the
  5306. * text field contents using SetControlData.
  5307. *
  5308. * This event is not sent while an active inline editing session is
  5309. * in progress. Once the inline text has been confirmed, this event
  5310. * will be sent prior to the confirmed text being inserted into the
  5311. * text field. If you need control over keystrokes during an inline
  5312. * editing session, you can use the kEventTextInputFilterText event.
  5313. *
  5314. *
  5315. * This event is sent to the control containing the text field only;
  5316. * it will not propagate.
  5317. *
  5318. * Mac OS X threading:
  5319. * Not thread safe
  5320. *
  5321. * Parameters:
  5322. *
  5323. * --> kEventParamTextSelection (in, typeCFRange)
  5324. * The range of the selection that is about to be changed. The
  5325. * units of the selection are in the same units that are
  5326. * returned in a EditTextSelectionRec, when called with
  5327. * GetControlData using kControlEditTextSelectionTag.
  5328. *
  5329. * --> kEventParamCandidateText (in, typeCFStringRef)
  5330. * The text that is going to replace the selection. Note that
  5331. * this string was originally created with
  5332. * CFStringCreateWithCharactersNoCopy, and the original text
  5333. * has a limited lifespan. If for some reason you need to
  5334. * retain the text past the end of your event handler, you
  5335. * should extract the characters from the string with
  5336. * CFStringGetCharacters, and then store those characters or
  5337. * create a new CFString from them.
  5338. *
  5339. * <-- kEventParamReplacementText (out, typeCFStringRef)
  5340. * On output, can contain optional replacement text.
  5341. *
  5342. * Result:
  5343. * If noErr is returned from your handler and the
  5344. * kEventParamReplacementText parameter is added to the event, then
  5345. * the contents of that parameter, rather than the candidate text,
  5346. * will be added to the text field.
  5347. *
  5348. * If noErr is returned from your handler and the
  5349. * kEventParamReplacementText parameter is _not_ added to the event,
  5350. * then the candidate text will be filtered out and no text will be
  5351. * entered in the text field. The current selection will be deleted,
  5352. * however.
  5353. *
  5354. * If userCanceledErr is returned from your handler, then no text
  5355. * will be entered in the text field and the current selection will
  5356. * remain unchanged. Effectively, the editing operation will be
  5357. * ignored.
  5358. *
  5359. * If eventNotHandledErr is returned from your handler, the contents
  5360. * of the kEventParamReplacementText parameter are ignored, and the
  5361. * candidate text will replace the selection.
  5362. *
  5363. * Any other return value will result in the default behavior, as if
  5364. * eventNotHandledErr had been returned.
  5365. *
  5366. * Availability:
  5367. * Mac OS X: in version 10.4 and later in Carbon.framework
  5368. * CarbonLib: not available
  5369. }
  5370. const
  5371. kEventTextShouldChangeInRange = 2;
  5372. {
  5373. * kEventClassTextField / kEventTextDidChange
  5374. *
  5375. * Summary:
  5376. * Indicates that the contents of an editable text field have
  5377. * changed.
  5378. *
  5379. * Discussion:
  5380. * This event is sent by all of the Unicode-based editable text
  5381. * views: HIComboBox, HISearchField, HITextView and EditUnicodeText.
  5382. * This event is not sent for the classic non-Unicode EditText
  5383. * control.
  5384. *
  5385. * Note that this event is sent after inline editing operations,
  5386. * such as pressing a dead key, or using a input method that creates
  5387. * an inline editing hole. Most clients of this event should ignore
  5388. * the event during inline editing, and only respond to changes to
  5389. * the text after inline editing completes. A client can check for
  5390. * the presence of the kEventParamUnconfirmedRange parameter to
  5391. * determine whether inline editing is currently active; if this
  5392. * parameter is present, the client may wish to ignore the event.
  5393. *
  5394. *
  5395. * This event is not sent after programmatic modification of the
  5396. * text field contents using SetControlData.
  5397. *
  5398. * This event is sent only to the control containing the text field;
  5399. * it will not propagate. It is sent to all handlers registered for
  5400. * it.
  5401. *
  5402. * Mac OS X threading:
  5403. * Not thread safe
  5404. *
  5405. * Parameters:
  5406. *
  5407. * --> kEventParamUnconfirmedRange (in, typeCFRange)
  5408. * If the text field currently has an open inline hole, this
  5409. * parameter contains the range of text inside the hole. This
  5410. * parameter is optional and is only present during inline
  5411. * editing.
  5412. *
  5413. * --> kEventParamUnconfirmedText (in, typeCFStringRef)
  5414. * If the text field currently has an open inline hole, this
  5415. * parameter contains the non-confirmed text currently being
  5416. * edited inside the hole. This parameter is optional and is
  5417. * only present during inline editing. Note that this string
  5418. * was originally created with
  5419. * CFStringCreateWithCharactersNoCopy, and the original text
  5420. * has a limited lifespan. If for some reason you need to
  5421. * retain the text past the end of your event handler, you
  5422. * should extract the characters from the string with
  5423. * CFStringGetCharacters, and then store those characters or
  5424. * create a new CFString from them.
  5425. *
  5426. * Availability:
  5427. * Mac OS X: in version 10.4 and later in Carbon.framework
  5428. * CarbonLib: not available
  5429. }
  5430. const
  5431. kEventTextDidChange = 3;
  5432. {==============================================================================}
  5433. { HIMenuView }
  5434. { HIMenuView and HIStandardMenuView are new views available in Mac OS X 10.3. }
  5435. { HIMenuView is intended for use as a base class for custom menu item views; }
  5436. { it does not draw or handle events itself, but provides useful functionality }
  5437. { that all menu views need to implement. HIStandardMenuView is the standard }
  5438. { HIView used by the Menu Manager to draw menu item content, beginning with }
  5439. { Mac OS X 10.3. It can also be subclassed by custom menu item views. }
  5440. { Both of these views are meant to be used only in compositing windows. }
  5441. { Because HIMenuView and HIStandardMenuView are not typically created }
  5442. { directly by applications, no API is provided to create instances of these }
  5443. { views. If you need to create an instance of either view, you can use }
  5444. { HIObjectCreate. }
  5445. {==============================================================================}
  5446. { the HIObject class ID for the HIMenuView class}
  5447. {$ifc USE_CFSTR_CONSTANT_MACROS}
  5448. {$definec kHIMenuViewClassID CFSTRP('com.apple.HIMenuView')}
  5449. {$endc}
  5450. { the HIObject class ID for the standard menu HIView class}
  5451. {$ifc USE_CFSTR_CONSTANT_MACROS}
  5452. {$definec kHIStandardMenuViewClassID CFSTRP('com.apple.HIStandardMenuView')}
  5453. {$endc}
  5454. { Control Kinds (only used in Mac OS X 10.4 and later)}
  5455. const
  5456. kControlKindHIMenuView = $6D656E75 (* 'menu' *);
  5457. kControlKindHIStandardMenuView = $736D6E75 (* 'smnu' *);
  5458. {
  5459. The kEventHIObjectInitialize event for HIMenuView and HIStandardMenuView is expected to contain
  5460. the following parameters. Be sure to include these parameters in the init event if you create an
  5461. instance of these views with HIObjectCreate.
  5462. --> kEventParamMenuRef (in, typeMenuRef)
  5463. The menu that the view should draw.
  5464. }
  5465. {
  5466. * kHIViewMenuContentID
  5467. *
  5468. * Summary:
  5469. * The HIViewID for the menu content view. The Menu Manager assigns
  5470. * this view ID to all menu content views.
  5471. *
  5472. * Mac OS X threading:
  5473. * Not thread safe
  5474. *
  5475. * Availability:
  5476. * Mac OS X: in version 10.4 and later in Carbon.framework
  5477. * CarbonLib: not available
  5478. * Non-Carbon CFM: not available
  5479. }
  5480. var kHIViewMenuContentID: HIViewID; external name '_kHIViewMenuContentID'; (* attribute const *)
  5481. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  5482. {
  5483. * HIMenuViewGetMenu()
  5484. *
  5485. * Summary:
  5486. * Returns the MenuRef that is associated with an HIView that is a
  5487. * subclass of HIMenuView.
  5488. *
  5489. * Discussion:
  5490. * An HIMenuView subclass might use this API to determine the menu
  5491. * that it should draw.
  5492. *
  5493. * Mac OS X threading:
  5494. * Not thread safe
  5495. *
  5496. * Parameters:
  5497. *
  5498. * inView:
  5499. * The view whose menu to return.
  5500. *
  5501. * Result:
  5502. * The MenuRef associated with the HIView, or NULL if an HIView is
  5503. * passed that is not a subclass of HIMenuView.
  5504. *
  5505. * Availability:
  5506. * Mac OS X: in version 10.3 and later in Carbon.framework
  5507. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5508. * Non-Carbon CFM: not available
  5509. }
  5510. function HIMenuViewGetMenu( inView: HIViewRef ): MenuRef; external name '_HIMenuViewGetMenu';
  5511. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5512. {
  5513. * HIMenuGetContentView()
  5514. *
  5515. * Summary:
  5516. * Returns the HIViewRef that will be used to draw menu content for
  5517. * this menu, if any.
  5518. *
  5519. * Discussion:
  5520. * If the content view has not yet been created, the Menu Manager
  5521. * will create the content view using the view class ID and
  5522. * initialization event associated with the menu. Note that the menu
  5523. * content view is not the same as the window content view; the menu
  5524. * content view is embedded inside the window content view. If the
  5525. * menu uses an MDEF instead of an HIView to draw its content, noErr
  5526. * is returned but the output HIViewRef is set to NULL.
  5527. *
  5528. * Mac OS X threading:
  5529. * Not thread safe
  5530. *
  5531. * Parameters:
  5532. *
  5533. * inMenu:
  5534. * The menu.
  5535. *
  5536. * inMenuType:
  5537. * The type of menu for which the menu content view should be
  5538. * returned. The same MenuRef may have multiple content views,
  5539. * depending on the menu type being displayed.
  5540. *
  5541. * outView:
  5542. * On exit, contains the view. May be set to NULL if the menu does
  5543. * not use an HIView to draw its content. The caller should not
  5544. * release this view.
  5545. *
  5546. * Availability:
  5547. * Mac OS X: in version 10.3 and later in Carbon.framework
  5548. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5549. * Non-Carbon CFM: not available
  5550. }
  5551. function HIMenuGetContentView( inMenu: MenuRef; inMenuType: ThemeMenuType; var outView: HIViewRef ): OSStatus; external name '_HIMenuGetContentView';
  5552. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5553. {==============================================================================}
  5554. { HISegmentedView }
  5555. { HISegmentedView is a new view available in Mac OS X 10.3. }
  5556. { Examples of the segmented view are the Finder's icon/column/list view }
  5557. { switcher, and the back/forward buttons in Open panels. }
  5558. { The segmented view operates as a group of buttons, each of which can be }
  5559. { configured with different behaviors and content. }
  5560. { Accessibility Notes: Those of you who wish to customize the accessibility }
  5561. { information provided for individual segments of the segmented view -- by }
  5562. { handling various kEventClassAccessibility Carbon Events, by calling }
  5563. { HIObjectSetAuxiliaryAccessibilityAttribute, etc. -- need to know how to }
  5564. { interpret and/or build AXUIElementRefs that represent individual segments. }
  5565. { The AXUIElement representing an individual segment will/must be constructed }
  5566. { using the segmented view's HIViewRef and the UInt64 identifier of the }
  5567. { one-based index of the segment the element refers to. As usual, a UInt64 }
  5568. { identifier of zero represents the segmented view as a whole. You must }
  5569. { neither interpret nor create segmented view elements whose identifiers are }
  5570. { greater than the count of segments in the segmented view. }
  5571. {==============================================================================}
  5572. { The HIObject class ID for the HISegmentedView class. }
  5573. {$ifc USE_CFSTR_CONSTANT_MACROS}
  5574. {$definec kHISegmentedViewClassID CFSTRP('com.apple.HISegmentedView')}
  5575. {$endc}
  5576. { Control Kind}
  5577. const
  5578. kHISegmentedViewKind = $73676D74 (* 'sgmt' *);
  5579. {
  5580. * HISegmentedViewCreate()
  5581. *
  5582. * Summary:
  5583. * Creates a segmented view. This is the type of view you would use
  5584. * to implement the icon/column/list view switcher as seen in the
  5585. * Finder. After creating a segmented view, you need to set the
  5586. * number of segments via HISegmentedViewSetSegmentCount. Each
  5587. * segment can be configured independently with via the other
  5588. * HISegmentedView APIs. Changing the number of segments and
  5589. * configuring each segment will change the appearance of the
  5590. * segmented view. After you configure the view, you may want to
  5591. * call GetBestControlRect on the view and resize it so the content
  5592. * will fit optimally. The value of the whole segmented view
  5593. * corresponds to the index of the currently selected segment with
  5594. * the radio behavior. If you set the value of the whole segmented
  5595. * view to n via SetControl32BitValue, every radio-behavior segment
  5596. * will have its value set to zero except for the segment at index
  5597. * n; if segment n also has the radio behavior, it will have its
  5598. * value set to one. When a radio-behavior segment is clicked, the
  5599. * value of the whole segmented view will be set to the segment's
  5600. * index. The segmented view works in both compositing and
  5601. * non-compositing modes.
  5602. *
  5603. * Mac OS X threading:
  5604. * Not thread safe
  5605. *
  5606. * Parameters:
  5607. *
  5608. * inBounds:
  5609. * The bounds of the view to be created. Can be NULL, in which
  5610. * case the view is created with CGRectZero bounds.
  5611. *
  5612. * outRef:
  5613. * A valid pointer to an HIViewRef. On successful completion of
  5614. * this routine, the destination HIViewRef will be filled with the
  5615. * HIViewRef of the newly created view.
  5616. *
  5617. * Availability:
  5618. * Mac OS X: in version 10.3 and later in Carbon.framework
  5619. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5620. * Non-Carbon CFM: not available
  5621. }
  5622. function HISegmentedViewCreate( {const} inBounds: HIRectPtr { can be NULL }; var outRef: HIViewRef ): OSStatus; external name '_HISegmentedViewCreate';
  5623. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5624. {
  5625. * HISegmentedViewSetSegmentCount()
  5626. *
  5627. * Summary:
  5628. * Sets the number of segments for the segmented view. Any previous
  5629. * segments beyond the new count will have their content released.
  5630. * All new segments beyond the previous count be initialized with
  5631. * the most basic settings possible: Momentary, no attributes, zero
  5632. * value, enabled, no command, no label, no content, and
  5633. * auto-calculated content width. You should configure any new
  5634. * segments to match your needs.
  5635. *
  5636. * Mac OS X threading:
  5637. * Not thread safe
  5638. *
  5639. * Parameters:
  5640. *
  5641. * inSegmentedView:
  5642. * The segmented view for which the content is to be set.
  5643. *
  5644. * inSegmentCount:
  5645. * A positive integer indicating how many segments the view is to
  5646. * have.
  5647. *
  5648. * Availability:
  5649. * Mac OS X: in version 10.3 and later in Carbon.framework
  5650. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5651. * Non-Carbon CFM: not available
  5652. }
  5653. function HISegmentedViewSetSegmentCount( inSegmentedView: HIViewRef; inSegmentCount: UInt32 ): OSStatus; external name '_HISegmentedViewSetSegmentCount';
  5654. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5655. {
  5656. * HISegmentedViewGetSegmentCount()
  5657. *
  5658. * Summary:
  5659. * Get the number of segments in the segmented view.
  5660. *
  5661. * Mac OS X threading:
  5662. * Not thread safe
  5663. *
  5664. * Parameters:
  5665. *
  5666. * inSegmentedView:
  5667. * The segmented view for which the content is to be set.
  5668. *
  5669. * Result:
  5670. * A UInt32 indicating the number of segments in the segmented view.
  5671. *
  5672. * Availability:
  5673. * Mac OS X: in version 10.3 and later in Carbon.framework
  5674. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5675. * Non-Carbon CFM: not available
  5676. }
  5677. function HISegmentedViewGetSegmentCount( inSegmentedView: HIViewRef ): UInt32; external name '_HISegmentedViewGetSegmentCount';
  5678. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5679. {
  5680. * Summary:
  5681. * HISegmentBehavior constants
  5682. }
  5683. const
  5684. {
  5685. * Pops back up after being pressed, just like a push button.
  5686. }
  5687. kHISegmentBehaviorMomentary = 1;
  5688. {
  5689. * Stays pressed until another segment with the radio behavior is
  5690. * pressed. This makes the segment behave like a radio button. After
  5691. * this segment is clicked, the segmented view's value will be
  5692. * changed to this segment's one-based index.
  5693. }
  5694. kHISegmentBehaviorRadio = 2;
  5695. {
  5696. * Like a check box. When clicked, it toggles back and forth between
  5697. * checked and unchecked states.
  5698. }
  5699. kHISegmentBehaviorToggles = 3;
  5700. {
  5701. * After being pressed, this type of segment stays pressed until you
  5702. * programatically unpress it.
  5703. }
  5704. kHISegmentBehaviorSticky = 4;
  5705. type
  5706. HISegmentBehavior = UInt32;
  5707. {
  5708. * HISegmentedViewSetSegmentBehavior()
  5709. *
  5710. * Summary:
  5711. * Changes the behavior of an individual segment of a segmented
  5712. * view. By default, a segment has the kHISegmentBehaviorMomentary
  5713. * behavior.
  5714. *
  5715. * Mac OS X threading:
  5716. * Not thread safe
  5717. *
  5718. * Parameters:
  5719. *
  5720. * inSegmentedView:
  5721. * The segmented view which owns the segment whose behavior you
  5722. * want to change.
  5723. *
  5724. * inSegmentIndexOneBased:
  5725. * The one-based index of the segment whose behavior you want to
  5726. * change. This must be a non-zero value that is no higher than
  5727. * the segmented view's current segment count.
  5728. *
  5729. * inBehavior:
  5730. * A HISegmentBehavior describing the behavior you wish the
  5731. * segment to have.
  5732. *
  5733. * Availability:
  5734. * Mac OS X: in version 10.3 and later in Carbon.framework
  5735. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5736. * Non-Carbon CFM: not available
  5737. }
  5738. function HISegmentedViewSetSegmentBehavior( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inBehavior: HISegmentBehavior ): OSStatus; external name '_HISegmentedViewSetSegmentBehavior';
  5739. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5740. {
  5741. * HISegmentedViewGetSegmentBehavior()
  5742. *
  5743. * Summary:
  5744. * Returns the behavior of an individual segment of a segmented view.
  5745. *
  5746. * Mac OS X threading:
  5747. * Not thread safe
  5748. *
  5749. * Parameters:
  5750. *
  5751. * inSegmentedView:
  5752. * The segmented view which owns the segment being queried.
  5753. *
  5754. * inSegmentIndexOneBased:
  5755. * The one-based index of the segment whose behavior you desire.
  5756. * This must be a non-zero value that is no higher than the
  5757. * segmented view's current segment count.
  5758. *
  5759. * Result:
  5760. * A HISegmentBehavior describing the behavior of the given segment.
  5761. * If you pass an illegal segment index, the result is undefined.
  5762. *
  5763. * Availability:
  5764. * Mac OS X: in version 10.3 and later in Carbon.framework
  5765. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5766. * Non-Carbon CFM: not available
  5767. }
  5768. function HISegmentedViewGetSegmentBehavior( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): HISegmentBehavior; external name '_HISegmentedViewGetSegmentBehavior';
  5769. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5770. {
  5771. * Summary:
  5772. * HISegmentedView segment attributes
  5773. *
  5774. * Discussion:
  5775. * These attribute bits are for use with
  5776. * HISegmentedViewChangeSegmentAttributes and
  5777. * HISegmentedViewGetSegmentAttributes.
  5778. }
  5779. const
  5780. {
  5781. * Pass this to indicate no attributes at all.
  5782. }
  5783. kHISegmentNoAttributes = 0;
  5784. {
  5785. * If this attribute bit is set, the command that gets sent out when
  5786. * the segment is clicked will be directed at the user focus instead
  5787. * of up the segmented view's containment hierarchy.
  5788. }
  5789. kHISegmentSendCmdToUserFocus = 1 shl 0;
  5790. {
  5791. * HISegmentedViewChangeSegmentAttributes()
  5792. *
  5793. * Summary:
  5794. * Changes the attributes of an individual segment of a segmented
  5795. * view. By default, a segment has no attribute bits set.
  5796. *
  5797. * Mac OS X threading:
  5798. * Not thread safe
  5799. *
  5800. * Parameters:
  5801. *
  5802. * inSegmentedView:
  5803. * The segmented view which owns the segment whose attributes you
  5804. * want to change.
  5805. *
  5806. * inSegmentIndexOneBased:
  5807. * The one-based index of the segment whose attributes you want to
  5808. * change. This must be a non-zero value that is no higher than
  5809. * the segmented view's current segment count.
  5810. *
  5811. * inAttributesToSet:
  5812. * The attribute bits you wish to set/enable for the segment.
  5813. *
  5814. * inAttributesToClear:
  5815. * The attribute bits you wish to clear/disable for the segment.
  5816. *
  5817. * Availability:
  5818. * Mac OS X: in version 10.3 and later in Carbon.framework
  5819. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5820. * Non-Carbon CFM: not available
  5821. }
  5822. function HISegmentedViewChangeSegmentAttributes( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inAttributesToSet: OptionBits; inAttributesToClear: OptionBits ): OSStatus; external name '_HISegmentedViewChangeSegmentAttributes';
  5823. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5824. {
  5825. * HISegmentedViewGetSegmentAttributes()
  5826. *
  5827. * Summary:
  5828. * Returns the attributes of an individual segment of a segmented
  5829. * view.
  5830. *
  5831. * Mac OS X threading:
  5832. * Not thread safe
  5833. *
  5834. * Parameters:
  5835. *
  5836. * inSegmentedView:
  5837. * The segmented view which owns the segment being queried.
  5838. *
  5839. * inSegmentIndexOneBased:
  5840. * The one-based index of the segment whose attributes you desire.
  5841. * This must be a non-zero value that is no higher than the
  5842. * segmented view's current segment count.
  5843. *
  5844. * Result:
  5845. * The attribute bits that are set/enabled for the given segment. If
  5846. * you pass an illegal segment index, the result is undefined.
  5847. *
  5848. * Availability:
  5849. * Mac OS X: in version 10.3 and later in Carbon.framework
  5850. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5851. * Non-Carbon CFM: not available
  5852. }
  5853. function HISegmentedViewGetSegmentAttributes( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): OptionBits; external name '_HISegmentedViewGetSegmentAttributes';
  5854. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5855. {
  5856. * HISegmentedViewSetSegmentValue()
  5857. *
  5858. * Summary:
  5859. * Change the value of an individual segment of a segmented view.
  5860. * This is only meaningful for segments with the sticky, toggles, or
  5861. * radio behaviors. If you set the value of momentary segments to
  5862. * something other than zero, the behavior is undefined.
  5863. *
  5864. * Mac OS X threading:
  5865. * Not thread safe
  5866. *
  5867. * Parameters:
  5868. *
  5869. * inSegmentedView:
  5870. * The segmented view which owns the segment whose value you want
  5871. * to change.
  5872. *
  5873. * inSegmentIndexOneBased:
  5874. * The one-based index of the segment whose value you want to
  5875. * change. This must be a non-zero value that is no higher than
  5876. * the segmented view's current segment count.
  5877. *
  5878. * inValue:
  5879. * The value you wish the segment to have. Zero means
  5880. * unpressed/unselected and one means pressed/selected. Other
  5881. * values will result in undefined behavior.
  5882. *
  5883. * Availability:
  5884. * Mac OS X: in version 10.3 and later in Carbon.framework
  5885. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5886. * Non-Carbon CFM: not available
  5887. }
  5888. function HISegmentedViewSetSegmentValue( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inValue: SInt32 ): OSStatus; external name '_HISegmentedViewSetSegmentValue';
  5889. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5890. {
  5891. * HISegmentedViewGetSegmentValue()
  5892. *
  5893. * Summary:
  5894. * Determine the value of an individual segment of a segmented view.
  5895. * This is only meaningful for segments with the sticky, toggles, or
  5896. * radio behaviors. The value of a momentary segment is undefined.
  5897. *
  5898. * Mac OS X threading:
  5899. * Not thread safe
  5900. *
  5901. * Parameters:
  5902. *
  5903. * inSegmentedView:
  5904. * The segmented view which owns the segment being queried.
  5905. *
  5906. * inSegmentIndexOneBased:
  5907. * The one-based index of the segment whose value you desire. This
  5908. * must be a non-zero value that is no higher than the segmented
  5909. * view's current segment count.
  5910. *
  5911. * Result:
  5912. * A SInt32 indicating the value of the given segment. If you pass
  5913. * an illegal segment index, the result is undefined.
  5914. *
  5915. * Availability:
  5916. * Mac OS X: in version 10.3 and later in Carbon.framework
  5917. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5918. * Non-Carbon CFM: not available
  5919. }
  5920. function HISegmentedViewGetSegmentValue( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): SInt32; external name '_HISegmentedViewGetSegmentValue';
  5921. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5922. {
  5923. * HISegmentedViewSetSegmentEnabled()
  5924. *
  5925. * Summary:
  5926. * Enable or disable an individual segment of a segmented view.
  5927. *
  5928. * Mac OS X threading:
  5929. * Not thread safe
  5930. *
  5931. * Parameters:
  5932. *
  5933. * inSegmentedView:
  5934. * The segmented view which owns the segment to enable or disable.
  5935. *
  5936. * inSegmentIndexOneBased:
  5937. * The one-based index of the segment to disable or enable. This
  5938. * must be a non-zero value that is no higher than the segmented
  5939. * view's current segment count.
  5940. *
  5941. * inEnabled:
  5942. * A Boolean indicating whether the segment is to become enabled
  5943. * or disabled.
  5944. *
  5945. * Availability:
  5946. * Mac OS X: in version 10.3 and later in Carbon.framework
  5947. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5948. * Non-Carbon CFM: not available
  5949. }
  5950. function HISegmentedViewSetSegmentEnabled( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inEnabled: Boolean ): OSStatus; external name '_HISegmentedViewSetSegmentEnabled';
  5951. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5952. {
  5953. * HISegmentedViewIsSegmentEnabled()
  5954. *
  5955. * Summary:
  5956. * Test an individual segment of a segmented view to see if it is
  5957. * enabled or disabled.
  5958. *
  5959. * Mac OS X threading:
  5960. * Not thread safe
  5961. *
  5962. * Parameters:
  5963. *
  5964. * inSegmentedView:
  5965. * The segmented view which owns the segment being queried.
  5966. *
  5967. * inSegmentIndexOneBased:
  5968. * The one-based index of the segment to test. This must be a
  5969. * non-zero value that is no higher than the segmented view's
  5970. * current segment count.
  5971. *
  5972. * Result:
  5973. * True if the segment is enabled or false if the segment is
  5974. * disabled. If you pass an illegal segment index, the result is
  5975. * undefined.
  5976. *
  5977. * Availability:
  5978. * Mac OS X: in version 10.3 and later in Carbon.framework
  5979. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  5980. * Non-Carbon CFM: not available
  5981. }
  5982. function HISegmentedViewIsSegmentEnabled( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): Boolean; external name '_HISegmentedViewIsSegmentEnabled';
  5983. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  5984. {
  5985. * HISegmentedViewSetSegmentCommand()
  5986. *
  5987. * Summary:
  5988. * Set the command ID for the given segment. By default, the command
  5989. * is zero. If you set any non-zero command ID, the segmented view
  5990. * will send an HICommand whenever the segment is clicked. By
  5991. * default, the command is sent to the segmented view and up the
  5992. * containment hierarchy. You can request that the command start at
  5993. * the user focus instead by turning on the
  5994. * kHISegmentSendCmdToUserFocus attribute for the segment.
  5995. *
  5996. * Mac OS X threading:
  5997. * Not thread safe
  5998. *
  5999. * Parameters:
  6000. *
  6001. * inSegmentedView:
  6002. * The segmented view which owns the segment whose command you
  6003. * wish to set.
  6004. *
  6005. * inSegmentIndexOneBased:
  6006. * The one-based index of the segment whose command you wish to
  6007. * set. This must be a non-zero value that is no higher than the
  6008. * segmented view's current segment count.
  6009. *
  6010. * inCommand:
  6011. * The command ID you wish to associate with the segment. A value
  6012. * of zero signifies "no command".
  6013. *
  6014. * Availability:
  6015. * Mac OS X: in version 10.3 and later in Carbon.framework
  6016. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  6017. * Non-Carbon CFM: not available
  6018. }
  6019. function HISegmentedViewSetSegmentCommand( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inCommand: UInt32 ): OSStatus; external name '_HISegmentedViewSetSegmentCommand';
  6020. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  6021. {
  6022. * HISegmentedViewGetSegmentCommand()
  6023. *
  6024. * Summary:
  6025. * Get the command ID associated with the given segment.
  6026. *
  6027. * Mac OS X threading:
  6028. * Not thread safe
  6029. *
  6030. * Parameters:
  6031. *
  6032. * inSegmentedView:
  6033. * The segmented view which owns the segment being queried.
  6034. *
  6035. * inSegmentIndexOneBased:
  6036. * The one-based index of the segment to query. This must be a
  6037. * non-zero value that is no higher than the segmented view's
  6038. * current segment count.
  6039. *
  6040. * Result:
  6041. * Returns the command ID associated with the segment. If you pass
  6042. * an illegal segment index, the result is undefined.
  6043. *
  6044. * Availability:
  6045. * Mac OS X: in version 10.3 and later in Carbon.framework
  6046. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  6047. * Non-Carbon CFM: not available
  6048. }
  6049. function HISegmentedViewGetSegmentCommand( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): UInt32; external name '_HISegmentedViewGetSegmentCommand';
  6050. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  6051. {
  6052. * HISegmentedViewSetSegmentLabel()
  6053. *
  6054. * Summary:
  6055. * Set the label string for the given segment. By default, a segment
  6056. * has no label string.
  6057. *
  6058. * Mac OS X threading:
  6059. * Not thread safe
  6060. *
  6061. * Parameters:
  6062. *
  6063. * inSegmentedView:
  6064. * The segmented view which owns the segment whose label you wish
  6065. * to set.
  6066. *
  6067. * inSegmentIndexOneBased:
  6068. * The one-based index of the segment whose label you wish to set.
  6069. * This must be a non-zero value that is no higher than the
  6070. * segmented view's current segment count.
  6071. *
  6072. * inLabel:
  6073. * A CFStringRef with the text of the label. The segmented view
  6074. * will copy the string passed in. You may pass NULL or an empty
  6075. * CFStringRef if you wish to eliminate the label from the segment.
  6076. *
  6077. * Availability:
  6078. * Mac OS X: in version 10.3 and later in Carbon.framework
  6079. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  6080. * Non-Carbon CFM: not available
  6081. }
  6082. function HISegmentedViewSetSegmentLabel( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inLabel: CFStringRef ): OSStatus; external name '_HISegmentedViewSetSegmentLabel';
  6083. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  6084. {
  6085. * HISegmentedViewCopySegmentLabel()
  6086. *
  6087. * Summary:
  6088. * Get the label associated with the given segment.
  6089. *
  6090. * Mac OS X threading:
  6091. * Not thread safe
  6092. *
  6093. * Parameters:
  6094. *
  6095. * inSegmentedView:
  6096. * The segmented view which owns the segment being queried.
  6097. *
  6098. * inSegmentIndexOneBased:
  6099. * The one-based index of the segment to query. This must be a
  6100. * non-zero value that is no higher than the segmented view's
  6101. * current segment count.
  6102. *
  6103. * outLabel:
  6104. * On exit, outLabel will be a copy of the label associated with
  6105. * the segment; you must release this string. If there is no label
  6106. * associated with the segment, outLabel will be set to NULL.
  6107. *
  6108. * Availability:
  6109. * Mac OS X: in version 10.3 and later in Carbon.framework
  6110. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  6111. * Non-Carbon CFM: not available
  6112. }
  6113. function HISegmentedViewCopySegmentLabel( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; var outLabel: CFStringRef ): OSStatus; external name '_HISegmentedViewCopySegmentLabel';
  6114. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  6115. {
  6116. * HISegmentedViewSetSegmentContentWidth()
  6117. *
  6118. * Summary:
  6119. * Sets whether you want the segment to automatically calculate its
  6120. * own width or whether you want to determine the segment's width
  6121. * manually. The content width is the horizontal area taken up by a
  6122. * segment's label and/or image.
  6123. *
  6124. * Mac OS X threading:
  6125. * Not thread safe
  6126. *
  6127. * Parameters:
  6128. *
  6129. * inSegmentedView:
  6130. * The segmented view which owns the segment whose content width
  6131. * you wish to set.
  6132. *
  6133. * inSegmentIndexOneBased:
  6134. * The one-based index of the segment whose content width you wish
  6135. * to set. This must be a non-zero value that is no higher than
  6136. * the segmented view's current segment count.
  6137. *
  6138. * inAutoCalculateWidth:
  6139. * A Boolean indicating whether you want the segment to calculate
  6140. * its own width. If you pass true, the inWidth parameter is
  6141. * ignored.
  6142. *
  6143. * inWidth:
  6144. * If you passed false in inAutoCalculateWidth, this parameter
  6145. * specifies the width you want to manually associate with the
  6146. * segment. If you pass a negative width, the behavior is
  6147. * undefined.
  6148. *
  6149. * Availability:
  6150. * Mac OS X: in version 10.3 and later in Carbon.framework
  6151. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  6152. * Non-Carbon CFM: not available
  6153. }
  6154. function HISegmentedViewSetSegmentContentWidth( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; inAutoCalculateWidth: Boolean; inWidth: Float32 ): OSStatus; external name '_HISegmentedViewSetSegmentContentWidth';
  6155. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  6156. {
  6157. * HISegmentedViewGetSegmentContentWidth()
  6158. *
  6159. * Summary:
  6160. * Get the content width of the given segment. This also optionall
  6161. * passes back a Boolean indicating whether the width was
  6162. * automatically calculated. The content width is the horizontal
  6163. * area taken up by a segment's label and/or image.
  6164. *
  6165. * Mac OS X threading:
  6166. * Not thread safe
  6167. *
  6168. * Parameters:
  6169. *
  6170. * inSegmentedView:
  6171. * The segmented view which owns the segment being queried.
  6172. *
  6173. * inSegmentIndexOneBased:
  6174. * The one-based index of the segment to query. This must be a
  6175. * non-zero value that is no higher than the segmented view's
  6176. * current segment count.
  6177. *
  6178. * outAutoCalculated:
  6179. * On exit, this is a Boolean indicating whether the width was
  6180. * automatically calculated. You may pass NULL if you don't need
  6181. * this information.
  6182. *
  6183. * Result:
  6184. * Returns the width of the content for the given segment. If you
  6185. * pass an illegal segment index, the result is undefined.
  6186. *
  6187. * Availability:
  6188. * Mac OS X: in version 10.3 and later in Carbon.framework
  6189. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  6190. * Non-Carbon CFM: not available
  6191. }
  6192. function HISegmentedViewGetSegmentContentWidth( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; outAutoCalculated: BooleanPtr { can be NULL } ): Float32; external name '_HISegmentedViewGetSegmentContentWidth';
  6193. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  6194. {
  6195. * HISegmentedViewSetSegmentImage()
  6196. *
  6197. * Summary:
  6198. * Sets or clears the image associated with a given segment.
  6199. *
  6200. * Mac OS X threading:
  6201. * Not thread safe
  6202. *
  6203. * Parameters:
  6204. *
  6205. * inSegmentedView:
  6206. * The segmented view which owns the segment whose image you wish
  6207. * to set.
  6208. *
  6209. * inSegmentIndexOneBased:
  6210. * The one-based index of the segment whose image you wish to set.
  6211. * This must be a non-zero value that is no higher than the
  6212. * segmented view's current segment count.
  6213. *
  6214. * inImage:
  6215. * An HIViewImageContentInfo structure with the image information
  6216. * for the given segment. Segments only support three types of
  6217. * image content: kControlNoContent (no image),
  6218. * kControlContentIconRef, and kControlContentCGImageRef.
  6219. *
  6220. * Availability:
  6221. * Mac OS X: in version 10.3 and later in Carbon.framework
  6222. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  6223. * Non-Carbon CFM: not available
  6224. }
  6225. function HISegmentedViewSetSegmentImage( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; const (*var*) inImage: HIViewImageContentInfo ): OSStatus; external name '_HISegmentedViewSetSegmentImage';
  6226. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  6227. {
  6228. * HISegmentedViewGetSegmentImageContentType()
  6229. *
  6230. * Summary:
  6231. * Get the type of image content drawn by the given segment. You
  6232. * will need to call this before calling
  6233. * HISegmentedViewCopySegmentImage so you know what type of image
  6234. * content to request from the latter API.
  6235. *
  6236. * Mac OS X threading:
  6237. * Not thread safe
  6238. *
  6239. * Parameters:
  6240. *
  6241. * inSegmentedView:
  6242. * The segmented view which owns the segment being queried.
  6243. *
  6244. * inSegmentIndexOneBased:
  6245. * The one-based index of the segment to query. This must be a
  6246. * non-zero value that is no higher than the segmented view's
  6247. * current segment count.
  6248. *
  6249. * Result:
  6250. * Returns the image content type of the image drawn by the given
  6251. * segment. If you pass an illegal segment index, the result is
  6252. * undefined.
  6253. *
  6254. * Availability:
  6255. * Mac OS X: in version 10.3 and later in Carbon.framework
  6256. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  6257. * Non-Carbon CFM: not available
  6258. }
  6259. function HISegmentedViewGetSegmentImageContentType( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32 ): HIViewImageContentType; external name '_HISegmentedViewGetSegmentImageContentType';
  6260. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  6261. {
  6262. * HISegmentedViewCopySegmentImage()
  6263. *
  6264. * Summary:
  6265. * Gives you a copy of the image (if any) drawn by the given
  6266. * segment. You are responsible for releasing any image passed back
  6267. * by this function. You request the image by asking for a
  6268. * particular type of image. If the segment isn't using the
  6269. * requested type of image, an error will be returned. If you wish
  6270. * to know the actual type of image displayed by the segment, you
  6271. * can call HISegmentedViewGetSegmentImageContentType.
  6272. *
  6273. * Mac OS X threading:
  6274. * Not thread safe
  6275. *
  6276. * Parameters:
  6277. *
  6278. * inSegmentedView:
  6279. * The segmented view which owns the segment being queried.
  6280. *
  6281. * inSegmentIndexOneBased:
  6282. * The one-based index of the segment to query. This must be a
  6283. * non-zero value that is no higher than the segmented view's
  6284. * current segment count.
  6285. *
  6286. * ioImage:
  6287. * On entry, you must fill out the contentType field of this
  6288. * structure with the type of image you desire. On exit, if that
  6289. * type of image is used by the segment, the appropriate field of
  6290. * the union will be filled in with a copy of the image. You are
  6291. * responsible for releasing the image.
  6292. *
  6293. * Availability:
  6294. * Mac OS X: in version 10.3 and later in Carbon.framework
  6295. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  6296. * Non-Carbon CFM: not available
  6297. }
  6298. function HISegmentedViewCopySegmentImage( inSegmentedView: HIViewRef; inSegmentIndexOneBased: UInt32; var ioImage: HIViewImageContentInfo ): OSStatus; external name '_HISegmentedViewCopySegmentImage';
  6299. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  6300. {==============================================================================}
  6301. { Clock view events }
  6302. {==============================================================================}
  6303. const
  6304. kEventClassClockView = $636C6F63 (* 'cloc' *);
  6305. {
  6306. * kEventClassClockView / kEventClockDateOrTimeChanged
  6307. *
  6308. * Summary:
  6309. * Allows clients to determine when the user has changed the date or
  6310. * time in the clock control.
  6311. *
  6312. * Discussion:
  6313. * This event is sent by the clock control when the user has changed
  6314. * the date or time. Clients could register for this notification in
  6315. * order to update some state based on the date or time in the
  6316. * clock, for instance. This event is sent to the view only, it will
  6317. * not propagate. It is sent to all handlers installed on the
  6318. * control.
  6319. *
  6320. * Mac OS X threading:
  6321. * Not thread safe
  6322. *
  6323. * Parameters:
  6324. *
  6325. * --> kEventParamDirectObject (in, typeControlRef)
  6326. * The view whose date has changed.
  6327. *
  6328. * Availability:
  6329. * Mac OS X: in version 10.4 and later in Carbon.framework
  6330. * CarbonLib: not available
  6331. }
  6332. const
  6333. kEventClockDateOrTimeChanged = 1;
  6334. end.