CarbonEvents.pas 526 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255
  1. {
  2. File: HIToolbox/CarbonEvents.h
  3. Contains: Carbon Event Manager
  4. Version: HIToolbox-219.4.81~2
  5. Copyright: © 1999-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. { Pascal Translation Updated: Peter N Lewis, <[email protected]>, August 2005 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit CarbonEvents;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,CFBase,CGContext,Quickdraw,AXUIElement,Drag,CFArray,HIObjectCore,Events,Menus,Controls,CFString,AERegistry,AEDataModel,CarbonEventsCore,HIGeometry;
  92. {$ALIGN MAC68K}
  93. {--------------------------------------------------------------------------------------}
  94. { Parameter names and types }
  95. {--------------------------------------------------------------------------------------}
  96. const
  97. {
  98. * This event parameter may be added to any event that is posted to
  99. * the main event queue. When the event is removed from the queue and
  100. * sent to the event dispatcher, the dispatcher will retrieve the
  101. * EventTargetRef contained in this parameter and send the event
  102. * directly to that event target. If this parameter is not available
  103. * in the event, the dispatcher will send the event to a suitable
  104. * target, or to the application target if no more specific target is
  105. * appropriate. Available in CarbonLib 1.3.1 and later, and Mac OS X.
  106. }
  107. kEventParamPostTarget = $70747267 (* 'ptrg' *); { typeEventTargetRef}
  108. {
  109. * Indicates an event parameter of type EventTargetRef.
  110. }
  111. typeEventTargetRef = $65747267 (* 'etrg' *); { EventTargetRef}
  112. { Generic toolbox parameters and types}
  113. {
  114. *** NOTE ON AUTOMATIC TYPE CONVERSIONS
  115. Please keep in mind that some of these types can be automatically converted
  116. to other types just by asking for them as different types. The following
  117. type conversions are automatic:
  118. typeQDRectangle <--> typeHIRect
  119. typeQDPoint <--> typeHIPoint
  120. In addition, if a CFBoolean type is added to an event, a request to receive
  121. the data as typeBoolean (instead of typeCFType), will be automatically honored.
  122. }
  123. const
  124. kEventParamWindowRef = $77696E64 (* 'wind' *); { typeWindowRef}
  125. kEventParamGrafPort = $67726166 (* 'graf' *); { typeGrafPtr}
  126. kEventParamMenuRef = $6D656E75 (* 'menu' *); { typeMenuRef}
  127. kEventParamEventRef = $65766E74 (* 'evnt' *); { typeEventRef}
  128. kEventParamControlRef = $6374726C (* 'ctrl' *); { typeControlRef}
  129. kEventParamRgnHandle = $72676E68 (* 'rgnh' *); { typeQDRgnHandle}
  130. kEventParamEnabled = $656E6162 (* 'enab' *); { typeBoolean}
  131. kEventParamDimensions = $64696D73 (* 'dims' *); { typeQDPoint}
  132. kEventParamBounds = $626F756E (* 'boun' *); { typeQDRectangle}
  133. kEventParamAvailableBounds = $61766C62 (* 'avlb' *); { typeQDRectangle}
  134. kEventParamAEEventID = keyAEEventID; { typeType}
  135. kEventParamAEEventClass = keyAEEventClass; { typeType}
  136. kEventParamCGContextRef = $636E7478 (* 'cntx' *); { typeCGContextRef}
  137. kEventParamDeviceDepth = $64657664 (* 'devd' *); { typeShortInteger}
  138. kEventParamDeviceColor = $64657663 (* 'devc' *); { typeBoolean}
  139. kEventParamMutableArray = $6D617272 (* 'marr' *); { typeCFMutableArrayRef}
  140. kEventParamResult = $616E7372 (* 'ansr' *); { any type - depends on event like direct object}
  141. kEventParamMinimumSize = $6D6E737A (* 'mnsz' *); { typeHISize}
  142. kEventParamMaximumSize = $6D78737A (* 'mxsz' *); { typeHISize}
  143. kEventParamAttributes = $61747472 (* 'attr' *); { typeUInt32}
  144. kEventParamReason = $7768793F (* 'why?' *); { typeUInt32}
  145. kEventParamTransactionID = $74726E73 (* 'trns' *); { typeUInt32}
  146. kEventParamGDevice = $67646576 (* 'gdev' *); { typeGDHandle}
  147. kEventParamIndex = $696E6478 (* 'indx' *); { typeCFIndex}
  148. kEventParamUserData = $75737264 (* 'usrd' *); { typeVoidPtr}
  149. kEventParamShape = $73686170 (* 'shap' *); { typeHIShapeRef}
  150. typeWindowRef = $77696E64 (* 'wind' *); { WindowRef}
  151. typeGrafPtr = $67726166 (* 'graf' *); { CGrafPtr}
  152. typeGWorldPtr = $67776C64 (* 'gwld' *); { GWorldPtr}
  153. typeMenuRef = $6D656E75 (* 'menu' *); { MenuRef}
  154. typeControlRef = $6374726C (* 'ctrl' *); { ControlRef}
  155. typeCollection = $636C746E (* 'cltn' *); { Collection}
  156. typeQDRgnHandle = $72676E68 (* 'rgnh' *); { RgnHandle}
  157. typeOSStatus = $6F737374 (* 'osst' *); { OSStatus}
  158. typeCFIndex = $63666978 (* 'cfix' *); { CFIndex}
  159. typeCGContextRef = $636E7478 (* 'cntx' *); { CGContextRef}
  160. typeHIPoint = $68697074 (* 'hipt' *); { HIPoint}
  161. typeHISize = $6869737A (* 'hisz' *); { HISize}
  162. typeHIRect = $68697263 (* 'hirc' *); { HIRect}
  163. typeHIShapeRef = $73686170 (* 'shap' *); { HIShapeRef}
  164. typeVoidPtr = $766F6964 (* 'void' *); { void * (used for HIObject fun)}
  165. typeGDHandle = $67646576 (* 'gdev' *); { GDHandle}
  166. { Mouse event parameters and types}
  167. const
  168. kEventParamMouseLocation = $6D6C6F63 (* 'mloc' *); { typeHIPoint}
  169. kEventParamWindowMouseLocation = $776D6F75 (* 'wmou' *); { typeHIPoint (Mac OS X 10.1 or later)}
  170. kEventParamMouseButton = $6D62746E (* 'mbtn' *); { typeMouseButton}
  171. kEventParamClickCount = $63636E74 (* 'ccnt' *); { typeUInt32}
  172. kEventParamMouseWheelAxis = $6D776178 (* 'mwax' *); { typeMouseWheelAxis}
  173. kEventParamMouseWheelDelta = $6D77646C (* 'mwdl' *); { typeSInt32}
  174. kEventParamMouseDelta = $6D647461 (* 'mdta' *); { typeHIPoint (10.2 or later) or typeQDPoint}
  175. kEventParamMouseChord = $63686F72 (* 'chor' *); { typeUInt32}
  176. kEventParamTabletEventType = $74626C74 (* 'tblt' *); { typeUInt32}
  177. kEventParamMouseTrackingRef = $6D747266 (* 'mtrf' *); { typeMouseTrackingRef}
  178. typeMouseButton = $6D62746E (* 'mbtn' *); { EventMouseButton}
  179. typeMouseWheelAxis = $6D776178 (* 'mwax' *); { EventMouseWheelAxis}
  180. typeMouseTrackingRef = $6D747266 (* 'mtrf' *); { MouseTrackingRef}
  181. { Keyboard event parameter and types}
  182. const
  183. kEventParamKeyCode = $6B636F64 (* 'kcod' *); { typeUInt32}
  184. kEventParamKeyMacCharCodes = $6B636872 (* 'kchr' *); { typeChar}
  185. kEventParamKeyModifiers = $6B6D6F64 (* 'kmod' *); { typeUInt32}
  186. kEventParamKeyUnicodes = $6B756E69 (* 'kuni' *); { typeUnicodeText}
  187. kEventParamKeyboardType = $6B626474 (* 'kbdt' *); { typeUInt32}
  188. typeEventHotKeyID = $686B6964 (* 'hkid' *); { EventHotKeyID}
  189. { General TSM event parameters}
  190. const
  191. kEventParamTSMSendRefCon = $74737263 (* 'tsrc' *); { typeLongInteger}
  192. kEventParamTSMSendComponentInstance = $74736369 (* 'tsci' *); { typeComponentInstance}
  193. { TextInput event parameters}
  194. const
  195. kEventParamTextInputSendRefCon = kEventParamTSMSendRefCon; { typeLongInteger}
  196. kEventParamTextInputSendComponentInstance = kEventParamTSMSendComponentInstance; { typeComponentInstance}
  197. kEventParamTextInputSendSLRec = $7473736C (* 'tssl' *); { typeIntlWritingCode}
  198. kEventParamTextInputReplySLRec = $7472736C (* 'trsl' *); { typeIntlWritingCode}
  199. kEventParamTextInputSendText = $74737478 (* 'tstx' *); { typeUnicodeText (if TSMDocument is Unicode), otherwise typeChar}
  200. kEventParamTextInputReplyText = $74727478 (* 'trtx' *); { typeUnicodeText (if TSMDocument is Unicode), otherwise typeChar}
  201. kEventParamTextInputSendUpdateRng = $74737570 (* 'tsup' *); { typeTextRangeArray}
  202. kEventParamTextInputSendHiliteRng = $74736869 (* 'tshi' *); { typeTextRangeArray}
  203. kEventParamTextInputSendClauseRng = $7473636C (* 'tscl' *); { typeOffsetArray}
  204. kEventParamTextInputSendPinRng = $7473706E (* 'tspn' *); { typeTextRange}
  205. kEventParamTextInputSendFixLen = $74736678 (* 'tsfx' *); { typeLongInteger}
  206. kEventParamTextInputSendLeadingEdge = $74736C65 (* 'tsle' *); { typeBoolean}
  207. kEventParamTextInputReplyLeadingEdge = $74726C65 (* 'trle' *); { typeBoolean}
  208. kEventParamTextInputSendTextOffset = $7473746F (* 'tsto' *); { typeLongInteger}
  209. kEventParamTextInputReplyTextOffset = $7472746F (* 'trto' *); { typeLongInteger}
  210. kEventParamTextInputReplyRegionClass = $74727267 (* 'trrg' *); { typeLongInteger}
  211. kEventParamTextInputSendCurrentPoint = $74736370 (* 'tscp' *); { typeQDPoint}
  212. kEventParamTextInputSendDraggingMode = $7473646D (* 'tsdm' *); { typeBoolean}
  213. kEventParamTextInputReplyPoint = $74727074 (* 'trpt' *); { typeQDPoint}
  214. kEventParamTextInputReplyFont = $74726674 (* 'trft' *); { typeLongInteger}
  215. kEventParamTextInputReplyFMFont = $7472666D (* 'trfm' *); { typeUInt32}
  216. kEventParamTextInputReplyPointSize = $7472707A (* 'trpz' *); { typeFixed}
  217. kEventParamTextInputReplyLineHeight = $74726C68 (* 'trlh' *); { typeShortInteger}
  218. kEventParamTextInputReplyLineAscent = $74726C61 (* 'trla' *); { typeShortInteger}
  219. kEventParamTextInputReplyTextAngle = $74727461 (* 'trta' *); { typeFixed}
  220. kEventParamTextInputSendShowHide = $74737368 (* 'tssh' *); { typeBoolean}
  221. kEventParamTextInputReplyShowHide = $74727368 (* 'trsh' *); { typeBoolean}
  222. kEventParamTextInputSendKeyboardEvent = $74736B65 (* 'tske' *); { typeEventRef}
  223. kEventParamTextInputSendTextServiceEncoding = $74737365 (* 'tsse' *); { typeUInt32}
  224. kEventParamTextInputSendTextServiceMacEncoding = $7473736D (* 'tssm' *); { typeUInt32}
  225. kEventParamTextInputReplyMacEncoding = $74726D65 (* 'trme' *); { typeUInt32}
  226. kEventParamTextInputGlyphInfoArray = $676C7068 (* 'glph' *); { typeGlyphInfoArray}
  227. kEventParamTextInputSendGlyphInfoArray = kEventParamTextInputGlyphInfoArray;
  228. kEventParamTextInputReplyGlyphInfoArray = $72677068 (* 'rgph' *); { typeGlyphInfoArray}
  229. kEventParamTextInputSendReplaceRange = $74737270 (* 'tsrp' *); { typeCFRange}
  230. { TSMDocumentAccess event parameters and types}
  231. const
  232. kEventParamTSMDocAccessSendRefCon = kEventParamTSMSendRefCon; { typeLongInteger}
  233. kEventParamTSMDocAccessSendComponentInstance = kEventParamTSMSendComponentInstance; { typeComponentInstance}
  234. kEventParamTSMDocAccessCharacterCount = $74646374 (* 'tdct' *); { typeCFIndex}
  235. kEventParamTSMDocAccessReplyCharacterRange = $74647272 (* 'tdrr' *); { typeCFRange}
  236. kEventParamTSMDocAccessReplyCharactersPtr = $74647270 (* 'tdrp' *); { typePtr}
  237. kEventParamTSMDocAccessSendCharacterIndex = $74647369 (* 'tdsi' *); { typeCFIndex}
  238. kEventParamTSMDocAccessSendCharacterRange = $74647372 (* 'tdsr' *); { typeCFRange}
  239. kEventParamTSMDocAccessSendCharactersPtr = $74647370 (* 'tdsp' *); { typePtr}
  240. kEventParamTSMDocAccessRequestedCharacterAttributes = $74646361 (* 'tdca' *); { typeUInt32}
  241. kEventParamTSMDocAccessReplyATSFont = $74646166 (* 'tdaf' *); { typeATSFontRef}
  242. kEventParamTSMDocAccessReplyFontSize = $74647273 (* 'tdrs' *); { typeFloat}
  243. kEventParamTSMDocAccessEffectiveRange = $74646572 (* 'tder' *); { typeRange}
  244. kEventParamTSMDocAccessReplyATSUGlyphSelector = $74647267 (* 'tdrg' *); { typeGlyphSelector}
  245. kEventParamTSMDocAccessLockCount = $74646C63 (* 'tdlc' *); { typeCFIndex}
  246. kEventParamTSMDocAccessLineBounds = $74646C62 (* 'tdlb' *); { typeCFMutableArrayRef}
  247. typeATSFontRef = $61747366 (* 'atsf' *); { ATSFontRef}
  248. typeGlyphSelector = $676C6673 (* 'glfs' *); { ATSUGlyphSelector}
  249. { Command event parameters and types}
  250. const
  251. kEventParamHICommand = $68636D64 (* 'hcmd' *); { typeHICommand}
  252. typeHICommand = $68636D64 (* 'hcmd' *); { HICommand}
  253. { Window event parameters and types}
  254. const
  255. kEventParamWindowFeatures = $77667472 (* 'wftr' *); { typeUInt32}
  256. kEventParamWindowDefPart = $77647063 (* 'wdpc' *); { typeWindowDefPartCode}
  257. kEventParamWindowPartCode = $77706172 (* 'wpar' *); { typeWindowPartCode}
  258. kEventParamCurrentBounds = $63726374 (* 'crct' *); { typeQDRectangle}
  259. kEventParamOriginalBounds = $6F726374 (* 'orct' *); { typeQDRectangle}
  260. kEventParamPreviousBounds = $70726374 (* 'prct' *); { typeQDRectangle}
  261. kEventParamClickActivation = $636C6163 (* 'clac' *); { typeClickActivationResult}
  262. kEventParamWindowRegionCode = $77736870 (* 'wshp' *); { typeWindowRegionCode}
  263. kEventParamWindowDragHiliteFlag = $77646866 (* 'wdhf' *); { typeBoolean}
  264. kEventParamWindowModifiedFlag = $776D6666 (* 'wmff' *); { typeBoolean}
  265. kEventParamWindowProxyGWorldPtr = $77706777 (* 'wpgw' *); { typeGWorldPtr}
  266. kEventParamWindowProxyImageRgn = $77706972 (* 'wpir' *); { typeQDRgnHandle}
  267. kEventParamWindowProxyOutlineRgn = $77706F72 (* 'wpor' *); { typeQDRgnHandle}
  268. kEventParamWindowStateChangedFlags = $77736366 (* 'wscf' *); { typeUInt32 }
  269. kEventParamWindowTitleFullWidth = $77746677 (* 'wtfw' *); { typeSInt16}
  270. kEventParamWindowTitleTextWidth = $77747477 (* 'wttw' *); { typeSInt16}
  271. kEventParamWindowGrowRect = $67726374 (* 'grct' *); { typeQDRectangle}
  272. kEventParamPreviousDockRect = $70647263 (* 'pdrc' *); { typeHIRect}
  273. kEventParamPreviousDockDevice = $70646764 (* 'pdgd' *); { typeGDHandle}
  274. kEventParamCurrentDockRect = $63647263 (* 'cdrc' *); { typeHIRect}
  275. kEventParamCurrentDockDevice = $63646764 (* 'cdgd' *); { typeGDHandle}
  276. kEventParamWindowTransitionAction = $77746163 (* 'wtac' *); { typeWindowTransitionAction}
  277. kEventParamWindowTransitionEffect = $77746566 (* 'wtef' *); { typeWindowTransitionEffect}
  278. typeWindowRegionCode = $77736870 (* 'wshp' *); { WindowRegionCode}
  279. typeWindowDefPartCode = $77647074 (* 'wdpt' *); { WindowDefPartCode}
  280. typeWindowPartCode = $77706172 (* 'wpar' *); { WindowPartCode}
  281. typeClickActivationResult = $636C6163 (* 'clac' *); { ClickActivationResult}
  282. typeWindowTransitionAction = $77746163 (* 'wtac' *); { WindowTransitionAction}
  283. typeWindowTransitionEffect = $77746566 (* 'wtef' *); { WindowTransitionEffect}
  284. { Control event parameters and types}
  285. const
  286. kEventParamControlPart = $63707274 (* 'cprt' *); { typeControlPartCode}
  287. kEventParamInitCollection = $69636F6C (* 'icol' *); { typeCollection}
  288. kEventParamControlMessage = $636D7367 (* 'cmsg' *); { typeShortInteger}
  289. kEventParamControlParam = $6370726D (* 'cprm' *); { typeLongInteger}
  290. kEventParamControlResult = $6372736C (* 'crsl' *); { typeLongInteger}
  291. kEventParamControlRegion = $6372676E (* 'crgn' *); { typeQDRgnHandle}
  292. kEventParamControlAction = $63617570 (* 'caup' *); { typeControlActionUPP}
  293. kEventParamControlIndicatorDragConstraint = $63696463 (* 'cidc' *); { typeIndicatorDragConstraint}
  294. kEventParamControlIndicatorRegion = $6369726E (* 'cirn' *); { typeQDRgnHandle}
  295. kEventParamControlIsGhosting = $63677374 (* 'cgst' *); { typeBoolean}
  296. kEventParamControlIndicatorOffset = $63696F66 (* 'ciof' *); { typeQDPoint}
  297. kEventParamControlClickActivationResult = $63636172 (* 'ccar' *); { typeClickActivationResult}
  298. kEventParamControlSubControl = $63737562 (* 'csub' *); { typeControlRef}
  299. kEventParamControlOptimalBounds = $636F626E (* 'cobn' *); { typeQDRectangle}
  300. kEventParamControlOptimalBaselineOffset = $636F626F (* 'cobo' *); { typeShortInteger}
  301. kEventParamControlDataTag = $63647467 (* 'cdtg' *); { typeEnumeration}
  302. kEventParamControlDataBuffer = $63646266 (* 'cdbf' *); { typePtr}
  303. kEventParamControlDataBufferSize = $63646273 (* 'cdbs' *); { typeLongInteger}
  304. kEventParamControlDrawDepth = $63646470 (* 'cddp' *); { typeShortInteger}
  305. kEventParamControlDrawInColor = $63646963 (* 'cdic' *); { typeBoolean}
  306. kEventParamControlFeatures = $63667472 (* 'cftr' *); { typeUInt32}
  307. kEventParamControlPartBounds = $63706264 (* 'cpbd' *); { typeQDRectangle}
  308. kEventParamControlOriginalOwningWindow = $636F6F77 (* 'coow' *); { typeWindowRef}
  309. kEventParamControlCurrentOwningWindow = $63636F77 (* 'ccow' *); { typeWindowRef}
  310. kEventParamControlFocusEverything = $63666576 (* 'cfev' *); { typeBoolean}
  311. kEventParamNextControl = $636E7863 (* 'cnxc' *); { typeControlRef}
  312. kEventParamStartControl = $63737463 (* 'cstc' *); { typeControlRef}
  313. kEventParamControlSubview = $63737677 (* 'csvw' *); { typeControlRef}
  314. kEventParamControlPreviousPart = $636F7063 (* 'copc' *); { typeControlPartCode}
  315. kEventParamControlCurrentPart = $636E7063 (* 'cnpc' *); { typeControlPartCode}
  316. kEventParamControlInvalRgn = $63697672 (* 'civr' *); { typeQDRgnHandle}
  317. kEventParamControlValue = $6376616C (* 'cval' *); { typeLongInteger}
  318. kEventParamControlHit = $63686974 (* 'chit' *); { typeBoolean}
  319. kEventParamControlPartAutoRepeats = $63617572 (* 'caur' *); { typeBoolean}
  320. kEventParamControlFrameMetrics = $63666D74 (* 'cfmt' *); { typeControlFrameMetrics}
  321. kEventParamControlWouldAcceptDrop = $636C6467 (* 'cldg' *); { typeBoolean}
  322. kEventParamControlPrefersShape = $63707368 (* 'cpsh' *); { typeBoolean}
  323. typeControlActionUPP = $63617570 (* 'caup' *); { ControlActionUPP}
  324. typeIndicatorDragConstraint = $63696463 (* 'cidc' *); { IndicatorDragConstraint}
  325. typeControlPartCode = $63707274 (* 'cprt' *); { ControlPartCode}
  326. typeControlFrameMetrics = $63696E73 (* 'cins' *); { HIViewFrameMetrics}
  327. { Menu event parameters and types}
  328. const
  329. kEventParamCurrentMenuTrackingMode = $636D746D (* 'cmtm' *); { typeMenuTrackingMode}
  330. kEventParamNewMenuTrackingMode = $6E6D746D (* 'nmtm' *); { typeMenuTrackingMode}
  331. kEventParamMenuFirstOpen = $3173746F (* '1sto' *); { typeBoolean}
  332. kEventParamMenuItemIndex = $6974656D (* 'item' *); { typeMenuItemIndex}
  333. kEventParamMenuCommand = $6D636D64 (* 'mcmd' *); { typeMenuCommand}
  334. kEventParamEnableMenuForKeyEvent = $666F726B (* 'fork' *); { typeBoolean}
  335. kEventParamMenuEventOptions = $6D656F70 (* 'meop' *); { typeMenuEventOptions}
  336. kEventParamMenuContext = $6D637478 (* 'mctx' *); { typeUInt32}
  337. kEventParamMenuDismissed = $6D646973 (* 'mdis' *); { typeUInt32}
  338. kEventParamMenuItemBounds = $6D697462 (* 'mitb' *); { typeQDRectangle}
  339. kEventParamMenuMarkBounds = $6D6D6B62 (* 'mmkb' *); { typeQDRectangle}
  340. kEventParamMenuIconBounds = $6D696362 (* 'micb' *); { typeQDRectangle}
  341. kEventParamMenuTextBounds = $6D747862 (* 'mtxb' *); { typeQDRectangle}
  342. kEventParamMenuTextBaseline = $6D74626C (* 'mtbl' *); { typeShortInteger}
  343. kEventParamMenuCommandKeyBounds = $6D636D62 (* 'mcmb' *); { typeQDRectangle}
  344. kEventParamMenuVirtualTop = $6D767274 (* 'mvrt' *); { typeLongInteger}
  345. kEventParamMenuVirtualBottom = $6D767262 (* 'mvrb' *); { typeLongInteger}
  346. kEventParamMenuDrawState = $6D647273 (* 'mdrs' *); { typeThemeMenuState}
  347. kEventParamMenuItemType = $6D697470 (* 'mitp' *); { typeThemeMenuItemType}
  348. kEventParamMenuItemWidth = $6D697477 (* 'mitw' *); { typeShortInteger}
  349. kEventParamMenuItemHeight = $6D697468 (* 'mith' *); { typeShortInteger}
  350. kEventParamMenuFrameView = $6D667276 (* 'mfrv' *); { typeControlRef}
  351. kEventParamMenuType = $6D747970 (* 'mtyp' *); { typeThemeMenuType}
  352. kEventParamMenuIsPopup = $6D706F70 (* 'mpop' *); { typeBoolean}
  353. kEventParamMenuDirection = $6D646972 (* 'mdir' *); { typeMenuDirection}
  354. kEventParamParentMenu = $6D70726D (* 'mprm' *); { typeMenuRef}
  355. kEventParamParentMenuItem = $6D707269 (* 'mpri' *); { typeMenuItemIndex}
  356. kEventParamMenuPopupItem = $6D706974 (* 'mpit' *); { typeMenuItemIndex}
  357. typeMenuItemIndex = $6D696478 (* 'midx' *); { MenuItemIndex}
  358. typeMenuCommand = $6D636D64 (* 'mcmd' *); { MenuCommand}
  359. typeMenuTrackingMode = $6D746D64 (* 'mtmd' *); { MenuTrackingMode}
  360. typeMenuEventOptions = $6D656F70 (* 'meop' *); { MenuEventOptions}
  361. typeThemeMenuState = $746D6E73 (* 'tmns' *); { ThemeMenuState}
  362. typeThemeMenuItemType = $746D6974 (* 'tmit' *); { ThemeMenuItemType}
  363. typeMenuDirection = $6D646972 (* 'mdir' *); { UInt32}
  364. typeThemeMenuType = $746D7479 (* 'tmty' *); { ThemeMenuType}
  365. { Application event parameters}
  366. const
  367. kEventParamProcessID = $70736E20 (* 'psn ' *); { typeProcessSerialNumber}
  368. kEventParamLaunchRefCon = $6C726566 (* 'lref' *); { typeUInt32}
  369. kEventParamLaunchErr = $65727220 (* 'err ' *); { typeOSStatus}
  370. kEventParamSystemUIMode = $75696D64 (* 'uimd' *); { typeUInt32}
  371. kEventParamIsInInstantMouser = $696D6F75 (* 'imou' *); { typeBoolean}
  372. kEventParamPreviousWindow = $70727677 (* 'prvw' *); { typeWindowRef}
  373. kEventParamCurrentWindow = $63757277 (* 'curw' *); { typeWindowRef}
  374. { Tablet event parameters and types}
  375. const
  376. kEventParamTabletPointRec = $74627263 (* 'tbrc' *); { typeTabletPointRec}
  377. kEventParamTabletProximityRec = $74627078 (* 'tbpx' *); { typeTabletProximityRec}
  378. typeTabletPointRec = $74627263 (* 'tbrc' *); { kEventParamTabletPointRec}
  379. typeTabletProximityRec = $74627078 (* 'tbpx' *); { kEventParamTabletProximityRec}
  380. { Appearance event parameters}
  381. const
  382. kEventParamNewScrollBarVariant = $6E736276 (* 'nsbv' *); { typeShortInteger}
  383. { Service event parameters}
  384. const
  385. kEventParamPasteboardRef = $70627264 (* 'pbrd' *); { typePasteboardRef}
  386. kEventParamScrapRef = $73637270 (* 'scrp' *); { typeScrapRef}
  387. kEventParamServiceCopyTypes = $73767364 (* 'svsd' *); { typeCFMutableArrayRef}
  388. kEventParamServicePasteTypes = $73767074 (* 'svpt' *); { typeCFMutableArrayRef}
  389. kEventParamServiceMessageName = $73766D67 (* 'svmg' *); { typeCFStringRef}
  390. kEventParamServiceUserData = $73767564 (* 'svud' *); { typeCFStringRef}
  391. typePasteboardRef = $70627264 (* 'pbrd' *); { PasteboardRef}
  392. typeScrapRef = $73637270 (* 'scrp' *); { ScrapRef}
  393. { Accessibility event parameters}
  394. const
  395. kEventParamAccessibleObject = $616F626A (* 'aobj' *); { typeCFTypeRef with an AXUIElementRef}
  396. kEventParamAccessibleChild = $6163686C (* 'achl' *); { typeCFTypeRef with an AXUIElementRef}
  397. kEventParamAccessibleAttributeName = $61746E6D (* 'atnm' *); { typeCFStringRef}
  398. kEventParamAccessibleAttributeNames = $61746E73 (* 'atns' *); { typeCFMutableArrayRef of CFStringRefs}
  399. kEventParamAccessibleAttributeValue = $6174766C (* 'atvl' *); { variable}
  400. kEventParamAccessibleAttributeSettable = $61747374 (* 'atst' *); { typeBoolean}
  401. kEventParamAccessibleAttributeParameter = $61747061 (* 'atpa' *); { typeCFTypeRef}
  402. kEventParamAccessibleActionName = $61636E6D (* 'acnm' *); { typeCFStringRef}
  403. kEventParamAccessibleActionNames = $61636E73 (* 'acns' *); { typeCFMutableArrayRef of CFStringRefs}
  404. kEventParamAccessibleActionDescription = $61636473 (* 'acds' *); { typeCFMutableStringRef}
  405. kEventParamAccessibilityEventQueued = $61657175 (* 'aequ' *); { typeBoolean}
  406. { Text field event type}
  407. const
  408. typeCFRange = $6366726E (* 'cfrn' *); { CFRange}
  409. {--------------------------------------------------------------------------------------}
  410. { ¥ Helpful utilities }
  411. {--------------------------------------------------------------------------------------}
  412. {
  413. * Discussion:
  414. * These are returned from calls to TrackMouseLocation and
  415. * TrackMouseRegion. Those routines are designed as replacements to
  416. * calls such as StillDown and WaitMouseUp. The advantage over those
  417. * routines is that TrackMouseLocation and TrackMouseRegion will
  418. * block if the user is not moving the mouse, whereas mouse tracking
  419. * loops based on StillDown and WaitMouseUp will spin, chewing up
  420. * valuable CPU time that could be better spent elsewhere. It is
  421. * highly recommended that any tracking loops in your application
  422. * stop using StillDown and WaitMouseUp and start using
  423. * TrackMouseLocation/Region. See the notes on those routines for
  424. * more information.
  425. }
  426. const
  427. kTrackMouseLocationOptionDontConsumeMouseUp = 1 shl 0;
  428. type
  429. MouseTrackingResult = UInt16;
  430. const
  431. kMouseTrackingMouseDown = 1;
  432. kMouseTrackingMouseUp = 2;
  433. kMouseTrackingMouseExited = 3;
  434. kMouseTrackingMouseEntered = 4;
  435. kMouseTrackingMouseDragged = 5;
  436. kMouseTrackingKeyModifiersChanged = 6;
  437. kMouseTrackingUserCancelled = 7;
  438. kMouseTrackingTimedOut = 8;
  439. kMouseTrackingMouseMoved = 9;
  440. {
  441. * IsUserCancelEventRef()
  442. *
  443. * Discussion:
  444. * Tests the event given to see whether the event represents a 'user
  445. * cancel' event. Currently this is defined to be either the escape
  446. * key being pressed, or command-period being pressed.
  447. *
  448. * Mac OS X threading:
  449. * Not thread safe
  450. *
  451. * Result:
  452. * A boolean value indicating whether the event is a user cancel
  453. * event.
  454. *
  455. * Availability:
  456. * Mac OS X: in version 10.0 and later in Carbon.framework
  457. * CarbonLib: in CarbonLib 1.1 and later
  458. * Non-Carbon CFM: not available
  459. }
  460. function IsUserCancelEventRef( event: EventRef ): Boolean; external name '_IsUserCancelEventRef';
  461. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  462. {
  463. * TrackMouseLocation()
  464. *
  465. * Discussion:
  466. * Once entered, this routine waits for certain mouse events (move,
  467. * mouse down, mouse up). When one of these events occurs, the
  468. * function returns and tells the caller what happened and where the
  469. * mouse is currently located. While there is no activity, the
  470. * current event loop is run, effectively blocking the current
  471. * thread (save for any timers that fire). This helps to minimize
  472. * CPU usage when there is nothing going on.
  473. *
  474. * On Mac OS X 10.1 and earlier, and CarbonLib 1.5 and earlier,
  475. * TrackMouseLocation, TrackMouseLocationWithOptions, and
  476. * TrackMouseRegion only support mouse-tracking when a mouse button
  477. * is pressed. They cannot be used for mouse-tracking when no mouse
  478. * button is pressed; if called when no button is pressed, they will
  479. * simply block until a button is pressed and will not return when
  480. * the mouse is moved. On Mac OS X 10.2 and CarbonLib 1.6 and later,
  481. * TrackMouseLocation, TrackMouseLocationWithOptions, and
  482. * TrackMouseRegion support mouse-tracking without a pressed mouse
  483. * button; TrackMouseLocation and TrackMouseLocationWithOptions
  484. * return kMouseTrackingMouseMoved if the mouse is moved while no
  485. * button is pressed, and TrackMouseRegion returns
  486. * kMouseTrackingMouseEntered/Exited if the mouse moves into or out
  487. * of the specified region while no button is pressed.
  488. *
  489. * Mac OS X threading:
  490. * Not thread safe
  491. *
  492. * Parameters:
  493. *
  494. * inPort:
  495. * The grafport to consider for mouse coordinates. You can pass
  496. * NULL for this parameter to indicate the current port. The mouse
  497. * location is returned in terms of local coordinates of this
  498. * port. You can pass -1 for this parameter to indicate that the
  499. * mouse location should be returned in global coordinates instead
  500. * of local coordinates.
  501. *
  502. * outPt:
  503. * On exit, this parameter receives the mouse location from the
  504. * last mouse event that caused this function to exit.
  505. *
  506. * outResult:
  507. * On exit, this parameter receives a value representing what kind
  508. * of event was received that cause the function to exit, such as
  509. * kMouseTrackingMouseUp.
  510. *
  511. * Result:
  512. * An operating system result code.
  513. *
  514. * Availability:
  515. * Mac OS X: in version 10.0 and later in Carbon.framework
  516. * CarbonLib: in CarbonLib 1.1 and later
  517. * Non-Carbon CFM: not available
  518. }
  519. function TrackMouseLocation( inPort: GrafPtr { can be NULL }; var outPt: Point; var outResult: MouseTrackingResult ): OSStatus; external name '_TrackMouseLocation';
  520. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  521. {
  522. * TrackMouseLocationWithOptions()
  523. *
  524. * Discussion:
  525. * This routine is largely identical to TrackMouseLocation. Please
  526. * read the notes on that function as well.
  527. * TrackMouseLocationWithOptions supports additional parameters for
  528. * leaving mouse-up events in the event queue, specifying a timeout,
  529. * and retrieving the current mouse position and keyboard modifiers.
  530. *
  531. * Mac OS X threading:
  532. * Not thread safe
  533. *
  534. * Parameters:
  535. *
  536. * inPort:
  537. * The grafport to consider for mouse coordinates. You can pass
  538. * NULL for this parameter to indicate the current port. The mouse
  539. * location is returned in terms of local coordinates of this
  540. * port. You can pass -1 for this parameter to indicate that the
  541. * mouse location should be returned in global coordinates instead
  542. * of local coordinates.
  543. *
  544. * inOptions:
  545. * The only option supported by this routine at present is
  546. * kTrackMouseLocationOptionDontConsumeMouseUp, which indicates
  547. * that the toolbox should leave mouse-up events in the queue. You
  548. * may also pass zero for this parameter to get the default
  549. * behavior, which is to remove mouse-up events from the queue
  550. * before returning.
  551. *
  552. * inTimeout:
  553. * The amount of time to wait for an event. If no events arrive
  554. * within this time, kMouseTrackingTimedOut is returned in
  555. * outResult.
  556. *
  557. * outPt:
  558. * On exit, this parameter receives the mouse location from the
  559. * last mouse event that caused this function to exit. If a
  560. * timeout or key modifiers changed event caused this function to
  561. * exit, the current mouse position at the time is returned.
  562. *
  563. * outModifiers:
  564. * On exit, this parameter receives the most recent state of the
  565. * keyboard modifiers. If a timeout caused this function to exit,
  566. * the current keyboard modifiers at the time are returned.
  567. *
  568. * outResult:
  569. * On exit, this parameter receives a value representing what kind
  570. * of event was received that cause the function to exit, such as
  571. * kMouseTrackingMouseUp.
  572. *
  573. * Result:
  574. * An operating system result code.
  575. *
  576. * Availability:
  577. * Mac OS X: in version 10.0 and later in Carbon.framework
  578. * CarbonLib: in CarbonLib 1.3 and later
  579. * Non-Carbon CFM: not available
  580. }
  581. function TrackMouseLocationWithOptions( inPort: GrafPtr { can be NULL }; inOptions: OptionBits; inTimeout: EventTimeout; var outPt: Point; outModifiers: UInt32Ptr { can be NULL }; var outResult: MouseTrackingResult ): OSStatus; external name '_TrackMouseLocationWithOptions';
  582. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  583. {
  584. * TrackMouseRegion()
  585. *
  586. * Discussion:
  587. * This routine is largely identical to TrackMouseLocation. Please
  588. * read the notes on that function as well. TrackMouseRegion differs
  589. * from TrackMouseLocation by only returning when the mouse enters
  590. * or exits a specified region that you pass in to the function, as
  591. * opposed to whenever the mouse moves (it also returns for mouse
  592. * up/down events). This is useful if you don't need to know
  593. * intermediate mouse events, but rather just if the mouse enters or
  594. * leaves an area.
  595. *
  596. * Mac OS X threading:
  597. * Not thread safe
  598. *
  599. * Parameters:
  600. *
  601. * inPort:
  602. * The grafport to consider for mouse coordinates. You can pass
  603. * NULL for this parameter to indicate the current port. You can
  604. * pass -1 for this parameter to indicate that the mouse region
  605. * should be interpreted in global coordinates instead of local
  606. * coordinates.
  607. *
  608. * inRegion:
  609. * The region to consider. This should be in the coordinates of
  610. * the port you passed to inPort, or global coordinates if you
  611. * passed -1 for the inPort parameter.
  612. *
  613. * ioWasInRgn:
  614. * On entry, this parameter should be set to true if the mouse is
  615. * currently inside the region passed in inRegion, or false if the
  616. * mouse is currently outside the region. On exit, this parameter
  617. * is updated to reflect the current reality; e.g. if the
  618. * outResult parameter returns kMouseTrackingMouseExited,
  619. * ioWasInRgn will be set to false when this function exits.
  620. * Because it is updated from within, you should only need to set
  621. * this yourself before the first call to this function in your
  622. * tracking loop.
  623. *
  624. * outResult:
  625. * On exit, this parameter receives a value representing what kind
  626. * of event was received that cause the function to exit, such as
  627. * kMouseTrackingMouseEntered.
  628. *
  629. * Result:
  630. * An operating system result code.
  631. *
  632. * Availability:
  633. * Mac OS X: in version 10.0 and later in Carbon.framework
  634. * CarbonLib: in CarbonLib 1.1 and later
  635. * Non-Carbon CFM: not available
  636. }
  637. function TrackMouseRegion( inPort: GrafPtr { can be NULL }; inRegion: RgnHandle; var ioWasInRgn: Boolean; var outResult: MouseTrackingResult ): OSStatus; external name '_TrackMouseRegion';
  638. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  639. {
  640. * Summary:
  641. * Mouse tracking info selectors for HIMouseTrackingGetParameters.
  642. }
  643. const
  644. {
  645. * Requests the time and distance for determining ÒstickyÓ mouse
  646. * tracking. When the mouse is clicked on a menu title, the toolbox
  647. * will enter a sticky mouse-tracking mode depending on the time and
  648. * distance between the mouse-down event and the mouse-up event. In
  649. * this mode, the menu is tracked even though the mouse has already
  650. * been released.
  651. }
  652. kMouseParamsSticky = $73746963 (* 'stic' *);
  653. {
  654. * HIMouseTrackingGetParameters()
  655. *
  656. * Summary:
  657. * Returns information about how mouse tracking loops should behave.
  658. *
  659. * Discussion:
  660. * Mouse tracking loops may use different timeouts and wander
  661. * distances to determine their behavior. This API provides a
  662. * generic service for requesting this information. Currently, the
  663. * only supported selector is kMouseParamsSticky.
  664. *
  665. * Mac OS X threading:
  666. * Not thread safe
  667. *
  668. * Parameters:
  669. *
  670. * inSelector:
  671. * Indicates which type of information should be returned.
  672. *
  673. * outTime:
  674. * If selector is kMouseParamsSticky, returns the maximum time
  675. * between mouse-down and mouse-up. If the time between events is
  676. * longer than this value, sticky mode should not be invoked. May
  677. * be NULL if this information is not required.
  678. *
  679. * outDistance:
  680. * If selector is kMouseParamsSticky, returns the maximum distance
  681. * between mouse-down and mouse-up. If the distance between events
  682. * is longer than this value, sticky mode should not be invoked.
  683. * May be NULL if this information is not required.
  684. *
  685. * Availability:
  686. * Mac OS X: in version 10.3 and later in Carbon.framework
  687. * CarbonLib: not available in CarbonLib 1.x
  688. * Non-Carbon CFM: not available
  689. }
  690. function HIMouseTrackingGetParameters( inSelector: OSType; outTime: EventTimePtr { can be NULL }; outDistance: HISizePtr { can be NULL } ): OSStatus; external name '_HIMouseTrackingGetParameters';
  691. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  692. {
  693. * ConvertEventRefToEventRecord()
  694. *
  695. * Discussion:
  696. * This is a convenience routine to help you if there are places in
  697. * your application where you need an EventRecord and all you have
  698. * is an EventRef. If the event can be converted, outEvent is filled
  699. * in and the function returns true. If not, false is returned and
  700. * outEvent will contain a nullEvent.
  701. *
  702. * Currently, the following events can be converted:
  703. *
  704. * kEventClassMouse: kEventMouseDown, kEventMouseUp,
  705. * kEventMouseMoved, kEventMouseDragged.
  706. *
  707. * kEventClassKeyboard: kEventRawKeyDown, kEventRawKeyUp,
  708. * kEventRawKeyRepeat.
  709. *
  710. * kEventClassControl: kEventControlTrack (in Mac OS X 10.4 and
  711. * later; converts to a mouseDown event).
  712. *
  713. * kEventClassWindow: kEventWindowUpdate, kEventWindowActivate,
  714. * kEventWindowDeactivate, kEventWindowCursorChange.
  715. *
  716. * kEventClassApplication: kEventAppActivated, kEventAppDeactivated.
  717. * <BR><BR> kEventClassAppleEvent: kEventAppleEvent.
  718. *
  719. * Mac OS X threading:
  720. * Not thread safe
  721. *
  722. * Parameters:
  723. *
  724. * inEvent:
  725. * The EventRef to convert into an EventRecord.
  726. *
  727. * outEvent:
  728. * The EventRecord to fill out.
  729. *
  730. * Result:
  731. * A boolean indicating if the conversion was successful (true) or
  732. * not (false).
  733. *
  734. * Availability:
  735. * Mac OS X: in version 10.0 and later in Carbon.framework
  736. * CarbonLib: in CarbonLib 1.1 and later
  737. * Non-Carbon CFM: not available
  738. }
  739. function ConvertEventRefToEventRecord( inEvent: EventRef; var outEvent: EventRecord ): Boolean; external name '_ConvertEventRefToEventRecord';
  740. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  741. {
  742. * IsEventInMask()
  743. *
  744. * Discussion:
  745. * This is a companion function for ConvertEventRefToEventRecord,
  746. * and is provided as a convenience routine to help you if there are
  747. * places in your application where you want to check an EventRef to
  748. * see if it matches a classic EventMask bitfield. If the event
  749. * matches, the function returns true.
  750. *
  751. * Mac OS X threading:
  752. * Not thread safe
  753. *
  754. * Parameters:
  755. *
  756. * inEvent:
  757. * The EventRef to convert into an EventRecord.
  758. *
  759. * inMask:
  760. * The mask to consider.
  761. *
  762. * Result:
  763. * A boolean indicating if the event was considered to be in the
  764. * mask provided.
  765. *
  766. * Availability:
  767. * Mac OS X: in version 10.0 and later in Carbon.framework
  768. * CarbonLib: in CarbonLib 1.1 and later
  769. * Non-Carbon CFM: not available
  770. }
  771. function IsEventInMask( inEvent: EventRef; inMask: EventMask ): Boolean; external name '_IsEventInMask';
  772. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  773. {
  774. * GetLastUserEventTime()
  775. *
  776. * Mac OS X threading:
  777. * Not thread safe
  778. *
  779. * Availability:
  780. * Mac OS X: in version 10.0 and later in Carbon.framework
  781. * CarbonLib: in CarbonLib 1.1 and later
  782. * Non-Carbon CFM: not available
  783. }
  784. function GetLastUserEventTime: EventTime; external name '_GetLastUserEventTime';
  785. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  786. {--------------------------------------------------------------------------------------}
  787. { ¥ Mouse Coalescing }
  788. {--------------------------------------------------------------------------------------}
  789. {
  790. * IsMouseCoalescingEnabled()
  791. *
  792. * Discussion:
  793. * Returns true if mouse coalescing is current enabled. When
  794. * enabled, we coalesce mouse moved and mouse dragged events. By
  795. * default, coalescing is on, but you can use
  796. * SetMouseCoalescingEnabled to disable it if you want finer-grained
  797. * mouse movement events, which is useful for drawing with tablets.
  798. *
  799. * Mac OS X threading:
  800. * Not thread safe
  801. *
  802. * Result:
  803. * A boolean indicating if coalescing is enabled.
  804. *
  805. * Availability:
  806. * Mac OS X: in version 10.1 and later in Carbon.framework
  807. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  808. * Non-Carbon CFM: not available
  809. }
  810. function IsMouseCoalescingEnabled: Boolean; external name '_IsMouseCoalescingEnabled';
  811. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  812. {
  813. * SetMouseCoalescingEnabled()
  814. *
  815. * Discussion:
  816. * Allows you to set mouse move/drag event coalescing on or off. By
  817. * default, coalescing is on, but you can use this function to
  818. * disable it if you want finer-grained mouse movement events, which
  819. * is useful for drawing with tablets.
  820. *
  821. * Mac OS X threading:
  822. * Not thread safe
  823. *
  824. * Parameters:
  825. *
  826. * inNewState:
  827. * A boolean indicating if coalescing should be enabled (true) or
  828. * disabled (false).
  829. *
  830. * outOldState:
  831. * A boolean which receives the prior state of mouse coalescing
  832. * for restoration later. You can pass NULL for this parameter if
  833. * you don't care.
  834. *
  835. * Result:
  836. * An operating system result code.
  837. *
  838. * Availability:
  839. * Mac OS X: in version 10.1 and later in Carbon.framework
  840. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  841. * Non-Carbon CFM: not available
  842. }
  843. function SetMouseCoalescingEnabled( inNewState: Boolean; outOldState: BooleanPtr { can be NULL } ): OSStatus; external name '_SetMouseCoalescingEnabled';
  844. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  845. {======================================================================================}
  846. { EVENT CLASSES }
  847. {======================================================================================}
  848. {
  849. * Summary:
  850. * Event classes
  851. }
  852. const
  853. {
  854. * Events related to the mouse (mouse down/up/moved).
  855. }
  856. kEventClassMouse = $6D6F7573 (* 'mous' *);
  857. {
  858. * Events related to the keyboard.
  859. }
  860. kEventClassKeyboard = $6B657962 (* 'keyb' *);
  861. {
  862. * Events related to text input (by keyboard, or by input method).
  863. }
  864. kEventClassTextInput = $74657874 (* 'text' *);
  865. {
  866. * Application-level events (launch, quit, etc.).
  867. }
  868. kEventClassApplication = $6170706C (* 'appl' *);
  869. {
  870. * Apple Events.
  871. }
  872. kEventClassAppleEvent = $65707063 (* 'eppc' *);
  873. {
  874. * Events related to menus.
  875. }
  876. kEventClassMenu = $6D656E75 (* 'menu' *);
  877. {
  878. * Events related to windows.
  879. }
  880. kEventClassWindow = $77696E64 (* 'wind' *);
  881. {
  882. * Events related to controls.
  883. }
  884. kEventClassControl = $636E746C (* 'cntl' *);
  885. {
  886. * Events related to commands generated by menu items or controls.
  887. * These events contain HICommand structures.
  888. }
  889. kEventClassCommand = $636D6473 (* 'cmds' *);
  890. {
  891. * Events related to tablets.
  892. }
  893. kEventClassTablet = $74626C74 (* 'tblt' *);
  894. {
  895. * Events related to File Manager volumes.
  896. }
  897. kEventClassVolume = $766F6C20 (* 'vol ' *);
  898. {
  899. * Events related to the Appearance Manager.
  900. }
  901. kEventClassAppearance = $6170706D (* 'appm' *);
  902. {
  903. * Events related to the Services Manager.
  904. }
  905. kEventClassService = $73657276 (* 'serv' *);
  906. {
  907. * Events related to toolbars.
  908. }
  909. kEventClassToolbar = $74626172 (* 'tbar' *);
  910. {
  911. * Events related to toolbar items.
  912. }
  913. kEventClassToolbarItem = $74626974 (* 'tbit' *);
  914. {
  915. * Events related to toolbar item views.
  916. }
  917. kEventClassToolbarItemView = $74626976 (* 'tbiv' *);
  918. {
  919. * Events related to application accessibility.
  920. }
  921. kEventClassAccessibility = $61636365 (* 'acce' *);
  922. {
  923. * Events related to the system.
  924. }
  925. kEventClassSystem = $6D616373 (* 'macs' *);
  926. {
  927. * Events related to Ink.
  928. }
  929. kEventClassInk = $696E6B20 (* 'ink ' *);
  930. kEventClassTSMDocumentAccess = $74646163 (* 'tdac' *);
  931. {--------------------------------------------------------------------------------------}
  932. { Mouse Events }
  933. {--------------------------------------------------------------------------------------}
  934. {
  935. kEventClassMouse quick reference:
  936. kEventMouseDown = 1,
  937. kEventMouseUp = 2,
  938. kEventMouseMoved = 5,
  939. kEventMouseDragged = 6,
  940. kEventMouseEntered = 8,
  941. kEventMouseExited = 9,
  942. kEventMouseWheelMoved = 10
  943. NOTE: As of Mac OS X 10.1, mouse events carry more information which allow you
  944. to do less work and gain accuracy of hit testing. First, there is the
  945. kEventParamWindowRef parameter. This parameter tells you over which window
  946. the mouse click/move/etc occurred. In mouse dragged events, this is the
  947. window the mouse went down in, NOT the window the mouse is currently over.
  948. Next, there is the kEventParamWindowMouseLocation parameter. This is the
  949. window-relative position of the mouse in the window given in the
  950. kEventParamWindowRef parameter. 0,0 is at the top left of the structure
  951. of the window.
  952. }
  953. {
  954. * EventMouseButton
  955. *
  956. }
  957. type
  958. EventMouseButton = UInt16;
  959. const
  960. {
  961. * Only button for a one-button mouse (usually left button for
  962. * multi-button mouse)
  963. }
  964. kEventMouseButtonPrimary = 1;
  965. {
  966. * Usually right button for a multi-button mouse
  967. }
  968. kEventMouseButtonSecondary = 2;
  969. {
  970. * Usually middle button for a three-button mouse
  971. }
  972. kEventMouseButtonTertiary = 3;
  973. {
  974. * EventMouseWheelAxis
  975. *
  976. }
  977. type
  978. EventMouseWheelAxis = UInt16;
  979. const
  980. {
  981. * The X axis (left or right)
  982. }
  983. kEventMouseWheelAxisX = 0;
  984. {
  985. * The Y axis (up or down)
  986. }
  987. kEventMouseWheelAxisY = 1;
  988. {
  989. * kEventClassMouse / kEventMouseDown
  990. *
  991. * Summary:
  992. * A mouse button was pressed.
  993. *
  994. * Discussion:
  995. * All windows have a default handler installed on the window target
  996. * that handles this event by calling SetFrontProcess on the current
  997. * process if the current process is not already the front process.
  998. * It is very important that an event handler for this event always
  999. * return eventNotHandledErr, so that the default handler can run
  1000. * and can activate the current process.
  1001. *
  1002. * Mac OS X threading:
  1003. * Not thread safe
  1004. *
  1005. * Parameters:
  1006. *
  1007. * --> kEventParamMouseLocation (in, typeHIPoint)
  1008. * The mouse location, in global coordinates.
  1009. *
  1010. * --> kEventParamWindowRef (in, typeWindowRef)
  1011. * The window under the mouse. Available in Mac OS X 10.1 and
  1012. * later.
  1013. *
  1014. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  1015. * The window-relative position of the mouse in the window
  1016. * given in the kEventParamWindowRef parameter. 0,0 is at the
  1017. * top left of the structure of the window. Available in Mac
  1018. * OS X 10.1 and later.
  1019. *
  1020. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  1021. * The part code that the mouse location hit in the window.
  1022. * This parameter only exists if the WindowRef parameter
  1023. * exists. This saves you the trouble of calling FindWindow,
  1024. * which is expensive on Mac OS X as it needs to call the
  1025. * Window Server. Available in Mac OS X 10.3 and later.
  1026. *
  1027. * --> kEventParamKeyModifiers (in, typeUInt32)
  1028. * The keyboard modifiers that were pressed when the event was
  1029. * generated.
  1030. *
  1031. * --> kEventParamMouseButton (in, typeMouseButton)
  1032. * Which mouse button was pressed.
  1033. *
  1034. * --> kEventParamClickCount (in, typeUInt32)
  1035. * Whether this is a single click, double click, etc.
  1036. *
  1037. * --> kEventParamMouseChord (in, typeUInt32)
  1038. * Which other mouse buttons were pressed when the event was
  1039. * generated. Available on Mac OS X only.
  1040. *
  1041. * --> kEventParamTabletEventType (in, typeUInt32)
  1042. * The type of tablet event which generated this mouse event;
  1043. * contains either kEventTabletPoint or kEventTabletProximity.
  1044. * Only present if the event was generated from a tablet.
  1045. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  1046. *
  1047. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  1048. * Further information about the tablet event which generated
  1049. * this mouse event. Present if the the
  1050. * kEventParamTabletEventType parameter contains
  1051. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  1052. * 1.5, and later.
  1053. *
  1054. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  1055. * Further information about the tablet event which generated
  1056. * this mouse event. Present if the the
  1057. * kEventParamTabletEventType parameter contains
  1058. * kEventTabletProximity. Available on Mac OS X 10.1 and
  1059. * CarbonLib 1.5, and later.
  1060. *
  1061. * Availability:
  1062. * Mac OS X: in version 10.0 and later in Carbon.framework
  1063. * CarbonLib: in CarbonLib 1.1 and later
  1064. }
  1065. const
  1066. kEventMouseDown = 1;
  1067. {
  1068. * kEventClassMouse / kEventMouseUp
  1069. *
  1070. * Summary:
  1071. * A mouse button was released.
  1072. *
  1073. * Mac OS X threading:
  1074. * Not thread safe
  1075. *
  1076. * Parameters:
  1077. *
  1078. * --> kEventParamMouseLocation (in, typeHIPoint)
  1079. * The mouse location, in global coordinates.
  1080. *
  1081. * --> kEventParamWindowRef (in, typeWindowRef)
  1082. * The window in which the mouse was original pressed.
  1083. * Available in Mac OS X 10.1 and later.
  1084. *
  1085. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  1086. * The window-relative position of the mouse in the window
  1087. * given in the kEventParamWindowRef parameter. 0,0 is at the
  1088. * top left of the structure of the window. Available in Mac
  1089. * OS X 10.1 and later.
  1090. *
  1091. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  1092. * The part code that the mouse location hit in the window.
  1093. * This parameter only exists if the WindowRef parameter
  1094. * exists. This saves you the trouble of calling FindWindow,
  1095. * which is expensive on Mac OS X as it needs to call the
  1096. * Window Server. Available in Mac OS X 10.3 and later.
  1097. *
  1098. * --> kEventParamKeyModifiers (in, typeUInt32)
  1099. * The keyboard modifiers that were pressed when the event was
  1100. * generated.
  1101. *
  1102. * --> kEventParamMouseButton (in, typeMouseButton)
  1103. * Which mouse button was released.
  1104. *
  1105. * --> kEventParamClickCount (in, typeUInt32)
  1106. * Whether this is a single click, double click, etc.
  1107. *
  1108. * --> kEventParamMouseChord (in, typeUInt32)
  1109. * Which other mouse buttons were pressed when the event was
  1110. * generated. Available on Mac OS X only.
  1111. *
  1112. * --> kEventParamTabletEventType (in, typeUInt32)
  1113. * The type of tablet event which generated this mouse event;
  1114. * contains either kEventTabletPoint or kEventTabletProximity.
  1115. * Only present if the event was generated from a tablet.
  1116. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  1117. *
  1118. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  1119. * Further information about the tablet event which generated
  1120. * this mouse event. Present if the the
  1121. * kEventParamTabletEventType parameter contains
  1122. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  1123. * 1.5, and later.
  1124. *
  1125. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  1126. * Further information about the tablet event which generated
  1127. * this mouse event. Present if the the
  1128. * kEventParamTabletEventType parameter contains
  1129. * kEventTabletProximity. Available on Mac OS X 10.1 and
  1130. * CarbonLib 1.5, and later.
  1131. *
  1132. * Availability:
  1133. * Mac OS X: in version 10.0 and later in Carbon.framework
  1134. * CarbonLib: in CarbonLib 1.1 and later
  1135. }
  1136. const
  1137. kEventMouseUp = 2;
  1138. {
  1139. * kEventClassMouse / kEventMouseMoved
  1140. *
  1141. * Summary:
  1142. * The mouse was moved.
  1143. *
  1144. * Mac OS X threading:
  1145. * Not thread safe
  1146. *
  1147. * Parameters:
  1148. *
  1149. * --> kEventParamMouseLocation (in, typeHIPoint)
  1150. * The mouse location, in global coordinates.
  1151. *
  1152. * --> kEventParamWindowRef (in, typeWindowRef)
  1153. * The window under the mouse. Available in Mac OS X 10.3 and
  1154. * later.
  1155. *
  1156. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  1157. * The window-relative position of the mouse in the window
  1158. * given in the kEventParamWindowRef parameter. 0,0 is at the
  1159. * top left of the structure of the window. Available in Mac
  1160. * OS X 10.3 and later.
  1161. *
  1162. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  1163. * The part code that the mouse location hit in the window.
  1164. * This parameter only exists if the WindowRef parameter
  1165. * exists. This saves you the trouble of calling FindWindow,
  1166. * which is expensive on Mac OS X as it needs to call the
  1167. * Window Server. Available in Mac OS X 10.3 and later.
  1168. *
  1169. * --> kEventParamKeyModifiers (in, typeUInt32)
  1170. * The keyboard modifiers that were pressed when the event was
  1171. * generated.
  1172. *
  1173. * --> kEventParamMouseDelta (in, typeHIPoint)
  1174. * The change in mouse position, in absolute units, ignoring
  1175. * scaling. Available in Mac OS X only.
  1176. *
  1177. * --> kEventParamTabletEventType (in, typeUInt32)
  1178. * The type of tablet event which generated this mouse event;
  1179. * contains either kEventTabletPoint or kEventTabletProximity.
  1180. * Only present if the event was generated from a tablet.
  1181. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  1182. *
  1183. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  1184. * Further information about the tablet event which generated
  1185. * this mouse event. Present if the the
  1186. * kEventParamTabletEventType parameter contains
  1187. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  1188. * 1.5, and later.
  1189. *
  1190. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  1191. * Further information about the tablet event which generated
  1192. * this mouse event. Present if the the
  1193. * kEventParamTabletEventType parameter contains
  1194. * kEventTabletProximity. Available on Mac OS X 10.1 and
  1195. * CarbonLib 1.5, and later.
  1196. *
  1197. * Availability:
  1198. * Mac OS X: in version 10.0 and later in Carbon.framework
  1199. * CarbonLib: in CarbonLib 1.1 and later
  1200. }
  1201. const
  1202. kEventMouseMoved = 5;
  1203. {
  1204. * kEventClassMouse / kEventMouseDragged
  1205. *
  1206. * Summary:
  1207. * The mouse was moved, and a button was down.
  1208. *
  1209. * Mac OS X threading:
  1210. * Not thread safe
  1211. *
  1212. * Parameters:
  1213. *
  1214. * --> kEventParamMouseLocation (in, typeHIPoint)
  1215. * The mouse location, in global coordinates.
  1216. *
  1217. * --> kEventParamWindowRef (in, typeWindowRef)
  1218. * The window in which the mouse was original pressed.
  1219. * Available in Mac OS X 10.1 and later.
  1220. *
  1221. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  1222. * The window-relative position of the mouse in the window
  1223. * given in the kEventParamWindowRef parameter. 0,0 is at the
  1224. * top left of the structure of the window. Available in Mac
  1225. * OS X 10.1 and later.
  1226. *
  1227. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  1228. * The part code that the mouse location hit in the window.
  1229. * This parameter only exists if the WindowRef parameter
  1230. * exists. This saves you the trouble of calling FindWindow,
  1231. * which is expensive on Mac OS X as it needs to call the
  1232. * Window Server. Available in Mac OS X 10.3 and later.
  1233. *
  1234. * --> kEventParamKeyModifiers (in, typeUInt32)
  1235. * The keyboard modifiers that were pressed when the event was
  1236. * generated.
  1237. *
  1238. * --> kEventParamMouseDelta (in, typeHIPoint)
  1239. * The change in mouse position, in absolute units, ignoring
  1240. * scaling. Available in Mac OS X only.
  1241. *
  1242. * --> kEventParamTabletEventType (in, typeUInt32)
  1243. * The type of tablet event which generated this mouse event;
  1244. * contains either kEventTabletPoint or kEventTabletProximity.
  1245. * Only present if the event was generated from a tablet.
  1246. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  1247. *
  1248. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  1249. * Further information about the tablet event which generated
  1250. * this mouse event. Present if the the
  1251. * kEventParamTabletEventType parameter contains
  1252. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  1253. * 1.5, and later.
  1254. *
  1255. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  1256. * Further information about the tablet event which generated
  1257. * this mouse event. Present if the the
  1258. * kEventParamTabletEventType parameter contains
  1259. * kEventTabletProximity. Available on Mac OS X 10.1 and
  1260. * CarbonLib 1.5, and later.
  1261. *
  1262. * Availability:
  1263. * Mac OS X: in version 10.0 and later in Carbon.framework
  1264. * CarbonLib: in CarbonLib 1.1 and later
  1265. }
  1266. const
  1267. kEventMouseDragged = 6;
  1268. {
  1269. * kEventClassMouse / kEventMouseEntered
  1270. *
  1271. * Summary:
  1272. * The mouse entered a tracking area.
  1273. *
  1274. * Mac OS X threading:
  1275. * Not thread safe
  1276. *
  1277. * Parameters:
  1278. *
  1279. * --> kEventParamMouseTrackingRef (in, typeMouseTrackingRef)
  1280. * The MouseTrackingRef whose region the mouse has just
  1281. * entered.
  1282. *
  1283. * --> kEventParamMouseLocation (in, typeHIPoint)
  1284. * The mouse location, in global coordinates.
  1285. *
  1286. * --> kEventParamWindowRef (in, typeWindowRef)
  1287. * The window under the mouse.
  1288. *
  1289. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  1290. * The window-relative position of the mouse in the window
  1291. * given in the kEventParamWindowRef parameter. 0,0 is at the
  1292. * top left of the structure of the window.
  1293. *
  1294. * --> kEventParamKeyModifiers (in, typeUInt32)
  1295. * The keyboard modifiers that were pressed when the event was
  1296. * generated.
  1297. *
  1298. * Availability:
  1299. * Mac OS X: in version 10.2 and later in Carbon.framework
  1300. * CarbonLib: not available
  1301. }
  1302. const
  1303. kEventMouseEntered = 8;
  1304. {
  1305. * kEventClassMouse / kEventMouseExited
  1306. *
  1307. * Summary:
  1308. * The mouse exited a tracking area.
  1309. *
  1310. * Mac OS X threading:
  1311. * Not thread safe
  1312. *
  1313. * Parameters:
  1314. *
  1315. * --> kEventParamMouseTrackingRef (in, typeMouseTrackingRef)
  1316. * The MouseTrackingRef whose region the mouse has just exited.
  1317. *
  1318. * --> kEventParamMouseLocation (in, typeHIPoint)
  1319. * The mouse location, in global coordinates.
  1320. *
  1321. * --> kEventParamWindowRef (in, typeWindowRef)
  1322. * The window under the mouse.
  1323. *
  1324. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  1325. * The window-relative position of the mouse in the window
  1326. * given in the kEventParamWindowRef parameter. 0,0 is at the
  1327. * top left of the structure of the window.
  1328. *
  1329. * --> kEventParamKeyModifiers (in, typeUInt32)
  1330. * The keyboard modifiers that were pressed when the event was
  1331. * generated.
  1332. *
  1333. * Availability:
  1334. * Mac OS X: in version 10.2 and later in Carbon.framework
  1335. * CarbonLib: not available
  1336. }
  1337. const
  1338. kEventMouseExited = 9;
  1339. {
  1340. * kEventClassMouse / kEventMouseWheelMoved
  1341. *
  1342. * Summary:
  1343. * The mouse wheel was moved.
  1344. *
  1345. * Mac OS X threading:
  1346. * Not thread safe
  1347. *
  1348. * Parameters:
  1349. *
  1350. * --> kEventParamMouseLocation (in, typeHIPoint)
  1351. * The mouse location, in global coordinates.
  1352. *
  1353. * --> kEventParamWindowRef (in, typeWindowRef)
  1354. * The window under the mouse. Available in Mac OS X 10.1 and
  1355. * later.
  1356. *
  1357. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  1358. * The window-relative position of the mouse in the window
  1359. * given in the kEventParamWindowRef parameter. 0,0 is at the
  1360. * top left of the structure of the window. Available in Mac
  1361. * OS X 10.1 and later.
  1362. *
  1363. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  1364. * The part code that the mouse location hit in the window.
  1365. * This parameter only exists if the WindowRef parameter
  1366. * exists. This saves you the trouble of calling FindWindow,
  1367. * which is expensive on Mac OS X as it needs to call the
  1368. * Window Server. Available in Mac OS X 10.3 and later.
  1369. *
  1370. * --> kEventParamKeyModifiers (in, typeUInt32)
  1371. * The keyboard modifiers that were pressed when the event was
  1372. * generated.
  1373. *
  1374. * --> kEventParamMouseWheelAxis (in, typeMouseWheelAxis)
  1375. * The wheel axis which moved. Contains either
  1376. * kEventMouseWheelAxisX or kEventMouseWheelAxisY.
  1377. *
  1378. * --> kEventParamMouseWheelDelta (in, typeLongInteger)
  1379. * The amount of change in the wheel position. Generally, a
  1380. * positive change should be interpreted as an upward scroll
  1381. * (equivalent to a click in the up arrow of a scrollbar); a
  1382. * negative change should be interpreted as a downward scroll
  1383. * (equivalent to a click in the down arrow of a scrollbar).
  1384. * Applications should not scale the delta value provided in
  1385. * the event; the Mac OS X input device system provides
  1386. * pre-scaling according to the userÕs desired mouse wheel
  1387. * speed.
  1388. *
  1389. * Availability:
  1390. * Mac OS X: in version 10.0 and later in Carbon.framework
  1391. * CarbonLib: not available
  1392. }
  1393. const
  1394. kEventMouseWheelMoved = 10;
  1395. {--------------------------------------------------------------------------------------}
  1396. { TSM Document Access Events }
  1397. {--------------------------------------------------------------------------------------}
  1398. {
  1399. kEventClassTSMDocumentAccess quick reference:
  1400. ** Text Access **
  1401. kEventTSMDocumentAccessGetLength = 1,
  1402. kEventTSMDocumentAccessGetSelectedRange = 2,
  1403. kEventTSMDocumentAccessGetCharactersPtr = 3,
  1404. kEventTSMDocumentAccessGetCharactersPtrForLargestBuffer = 4,
  1405. kEventTSMDocumentAccessGetCharacters = 5,
  1406. ** Text Attribute Access **
  1407. kEventTSMDocumentAccessGetFont = 6,
  1408. kEventTSMDocumentAccessGetGlyphInfo = 7,
  1409. ** Transaction control **
  1410. kEventTSMDocumentAccessLockDocument = 8,
  1411. kEventTSMDocumentAccessUnlockDocument = 9
  1412. These events allow access to a document's content. They are grouped in the following
  1413. categories: text access, text attribute, and transaction related events.
  1414. NOTE: TSM dispatches events of the TSMDocumentAccess class only as Carbon events. These
  1415. are not converted for TSM clients that still install AppleEvent handlers for TSM events.
  1416. NOTE: Text Services dispatch these Carbon events through TSM's SendTextInputEvent API.
  1417. Normally only used for TextInput class TSM events, but this SendTextInputEvent is a bit
  1418. of a misnomer. You should use it for TSMDocumentAccess class events as well.
  1419. }
  1420. {
  1421. ** Document Access Text events **
  1422. The following Text Access events are very similar in design to the CFString API.
  1423. The entire document can be conceived as a flattened Unicode string, and the
  1424. events in this interface can access any portion of it. The GetSelectedRange() method
  1425. allow a text service to obtain text near the insertion point (or selection), but access
  1426. is by no means restricted to this vicinity. Use the GetLength() method to obtain the
  1427. size of the document.
  1428. Supporting these events effectively provide hooks into the text engine, but it is
  1429. understood that access to a document in this way is to be strictly Read-Only. Where
  1430. direct access to a document's content cannot be provided through a pointer, the requested
  1431. text can be copied instead. Situations where a pointer may not be available from the
  1432. text engine include the following:
  1433. -A pointer would require conversion of text in Mac encodings to Unicode
  1434. -A pointer would require sparse Unicode text blocks to be flattened into a single
  1435. buffer.
  1436. The idea is to minimize copying and converting text encodings where possible. The text
  1437. service will typically begin by asking for a document pointer via
  1438. kEventTSMDocumentAccessGetCharactersPtr. If this fails, it will typically fallback to
  1439. kEventTSMDocumentAccessGetCharactersPtrForLargestBuffer, specifying a location of interest.
  1440. If this fails, it will fallback to kEventTSMDocumentAccessGetCharacters, specifying a range
  1441. of interest. Of course, when requesting small amounts of data such a few characters on either
  1442. side of the insertion point, there is no obligation to optimize in this way. It's valid to
  1443. simply use kEventTSMDocumentAccessGetCharacters.
  1444. The text engine is entirely free to deny a request for a text pointer for these or any other
  1445. implementation specific reason.
  1446. }
  1447. {
  1448. * kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetLength
  1449. *
  1450. * Summary:
  1451. * Returns the number of 16-bit Unicode characters in the document.
  1452. *
  1453. * Discussion:
  1454. * This event is equivalent to calling CFStringGetLength() on the
  1455. * app's document.
  1456. *
  1457. * Mac OS X threading:
  1458. * Not thread safe
  1459. *
  1460. * Parameters:
  1461. *
  1462. * --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
  1463. * This parameter is provided by the input method originating
  1464. * the event. (Required parameter)
  1465. *
  1466. * --> kEventParamTSMDocAccessSendRefCon (in, typeLongInteger)
  1467. * TSM's SendTextInputEvent, called by an input method,
  1468. * inserts this parameter before dispatching the event to the
  1469. * user focus. (Required Parameter)
  1470. *
  1471. * <-- kEventParamTSMDocAccessCharacterCount (out, typeCFIndex)
  1472. * The size of the document in UniChar. Required reply
  1473. * parameter.
  1474. *
  1475. * Availability:
  1476. * Mac OS X: in version 10.3 and later in Carbon.framework
  1477. * CarbonLib: not available
  1478. }
  1479. const
  1480. kEventTSMDocumentAccessGetLength = 1;
  1481. {
  1482. * kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetSelectedRange
  1483. *
  1484. * Summary:
  1485. * Returns the selection range in the document.
  1486. *
  1487. * Mac OS X threading:
  1488. * Not thread safe
  1489. *
  1490. * Parameters:
  1491. *
  1492. * --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
  1493. * This parameter is provided by the input method originating
  1494. * the event. (Required parameter)
  1495. *
  1496. * --> kEventParamTSMDocAccessSendRefCon (in, typeLongInteger)
  1497. * TSM's SendTextInputEvent, called by an input method,
  1498. * inserts this parameter before dispatching the event to the
  1499. * user focus. (Required Parameter)
  1500. *
  1501. * <-- kEventParamTSMDocAccessReplyCharacterRange (out, typeCFRange)
  1502. * The selection range as a CFRange in UniChar. If the
  1503. * selection is empty, the range identifies the insertion
  1504. * point and the range will specify a length of 0. Required
  1505. * reply parameter.
  1506. *
  1507. * Availability:
  1508. * Mac OS X: in version 10.3 and later in Carbon.framework
  1509. * CarbonLib: not available
  1510. }
  1511. const
  1512. kEventTSMDocumentAccessGetSelectedRange = 2;
  1513. {
  1514. * kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetCharactersPtr
  1515. *
  1516. * Summary:
  1517. * Returns a Unicode pointer to the entire document content.
  1518. *
  1519. * Discussion:
  1520. * This event is equivalent to calling CFStringGetCharactersPtr() on
  1521. * the app's document treated as a CFString. Some text engines may
  1522. * not support this event for reasons that are implementation
  1523. * dependent. For example, a text engine's backing store may consist
  1524. * of legacy encoding runs. It may also consist of unflattened
  1525. * Unicode, stored as a B-tree of text blocks. For such reasons, a
  1526. * text engine may reject a request for a pointer to a flattened
  1527. * Unicode buffer. It is also understood that text access through
  1528. * this pointer is to be strictly READ-ONLY. Any changes to the
  1529. * document should be made through TSM TextInput events, such as
  1530. * kEventTextInputUpdateActiveInputArea or
  1531. * kEventTextInputUnicodeText. NOTE: This pointer is valid only
  1532. * during a transaction surrounded by document lock/unlock events,
  1533. * or until an event causes the document to change, such as
  1534. * dispatching kEventTextInputUpdateActiveInputArea or
  1535. * kEventTextInputUnicodeText events, whichever occurs first.
  1536. *
  1537. * Mac OS X threading:
  1538. * Not thread safe
  1539. *
  1540. * Parameters:
  1541. *
  1542. * --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
  1543. * This parameter is provided by the input method originating
  1544. * the event. (Required parameter)
  1545. *
  1546. * --> kEventParamTSMDocAccessSendRefCon (in, typeLongInteger)
  1547. * TSM's SendTextInputEvent, called by an input method,
  1548. * inserts this parameter before dispatching the event to the
  1549. * user focus. (Required Parameter)
  1550. *
  1551. * <-- kEventParamTSMDocAccessReplyCharactersPtr (out, typePtr)
  1552. * The UniChar pointer to the document. Required reply
  1553. * parameter, if the event is supported.
  1554. *
  1555. * Availability:
  1556. * Mac OS X: in version 10.3 and later in Carbon.framework
  1557. * CarbonLib: not available
  1558. }
  1559. const
  1560. kEventTSMDocumentAccessGetCharactersPtr = 3;
  1561. {
  1562. * kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetCharactersPtrForLargestBuffer
  1563. *
  1564. * Summary:
  1565. * Returns a Unicode pointer to a portion of the document.
  1566. *
  1567. * Discussion:
  1568. * This event is similar to calling CFStringGetCharactersPtr() on a
  1569. * portion of the app's document treated as a CFString, except that
  1570. * the substring is determined by the text engine. Some text engines
  1571. * may keep text in unflattened Unicode, stored as a B-tree of text
  1572. * blocks, for example. In some cases, especially near locations
  1573. * such as the insertion point, the text engine may have cached a
  1574. * good chunk of text to which it can readily provide a pointer. A
  1575. * text engine may reject a request for such a pointer. It is also
  1576. * understood that text access through this pointer is to be
  1577. * strictly READ-ONLY. Any changes to the document should be made
  1578. * through TSM TextInput events, such as
  1579. * kEventTextInputUpdateActiveInputArea or
  1580. * kEventTextInputUnicodeText. NOTE: This pointer is valid only
  1581. * during a transaction surrounded by document lock/unlock, or until
  1582. * an event causes the document to change, such as dispatching
  1583. * kEventTextInputUpdateActiveInputArea or
  1584. * kEventTextInputUnicodeText events.
  1585. *
  1586. * Mac OS X threading:
  1587. * Not thread safe
  1588. *
  1589. * Parameters:
  1590. *
  1591. * --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
  1592. * This parameter is provided by the input method originating
  1593. * the event. (Required parameter)
  1594. *
  1595. * --> kEventParamTSMDocAccessSendRefCon (in, typeLongInteger)
  1596. * TSM's SendTextInputEvent, called by an input method,
  1597. * inserts this parameter before dispatching the event to the
  1598. * user focus. (Required Parameter)
  1599. *
  1600. * --> kEventParamTSMDocAccessSendCharacterIndex (in, typeCFIndex)
  1601. * The location in the document for which the caller would
  1602. * like a pointer to a buffer of text that includes that
  1603. * location. This buffer could be available from a cache
  1604. * due to recent interaction near that location, such as the
  1605. * insertion point. Required parameter.
  1606. *
  1607. * <-- kEventParamTSMDocAccessReplyCharactersPtr (out, typePtr)
  1608. * The UniChar pointer to a portion of the document text.
  1609. * Required reply parameter, if the event is handled.
  1610. *
  1611. * <-- kEventParamTSMDocAccessReplyCharacterRange (out, typeCFRange)
  1612. * The document-relative range of text represented by the
  1613. * returned text pointer. Required reply parameter, if the
  1614. * event is handled.
  1615. *
  1616. * Availability:
  1617. * Mac OS X: in version 10.3 and later in Carbon.framework
  1618. * CarbonLib: not available
  1619. }
  1620. const
  1621. kEventTSMDocumentAccessGetCharactersPtrForLargestBuffer = 4;
  1622. {
  1623. * kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetCharacters
  1624. *
  1625. * Summary:
  1626. * Fills caller provided buffer with Unicode characters in the
  1627. * specified range.
  1628. *
  1629. * Discussion:
  1630. * This event is equivalent to calling CFStringGetCharacters() on
  1631. * the app's document treated as a CFString.
  1632. *
  1633. * Mac OS X threading:
  1634. * Not thread safe
  1635. *
  1636. * Parameters:
  1637. *
  1638. * --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
  1639. * This parameter is provided by the input method originating
  1640. * the event. (Required parameter)
  1641. *
  1642. * --> kEventParamTSMDocAccessSendRefCon (in, typeLongInteger)
  1643. * TSM's SendTextInputEvent, called by an input method,
  1644. * inserts this parameter before dispatching the event to the
  1645. * user focus. (Required Parameter)
  1646. *
  1647. * --> kEventParamTSMDocAccessSendCharacterRange (in, typeCFRange)
  1648. * The range of text that should be copied into the buffer
  1649. * provided by the caller. Required parameter.
  1650. *
  1651. * --> kEventParamTSMDocAccessSendCharactersPtr (in, typePtr)
  1652. * A buffer provided by the caller to contain the specified
  1653. * range of UniChars. This buffer is identical in usage to
  1654. * that of CFStringGetCharacters(). Required parameter.
  1655. *
  1656. * Availability:
  1657. * Mac OS X: in version 10.3 and later in Carbon.framework
  1658. * CarbonLib: not available
  1659. }
  1660. const
  1661. kEventTSMDocumentAccessGetCharacters = 5;
  1662. {
  1663. ** Document Access Attribute events **
  1664. The following Text Attribute events define how a text service can obtain certain attributes
  1665. at text locations throughout an application's document.
  1666. Currently, the only attributes supported by these events are font (and font size)
  1667. via kEventTSMDocumentAccessGetFont and glyphID/CID info via kEventTSMDocumentAccessGetGlyphInfo.
  1668. Where these attributes span multiple characters, effective ranges (over which
  1669. the attribute is constant) are returned by the text engine.
  1670. }
  1671. {
  1672. * Summary:
  1673. * Values used TSMDocAccessAttributes bit field
  1674. *
  1675. * Discussion:
  1676. * The following bit assignments are used for TSMDocAccessAttributes
  1677. * parameters. This parameter is used to specify desired (optional)
  1678. * attributes in the kEventTSMDocumentAccessGetFont and
  1679. * kEventTSMDocumentAccessGetGlyphInfo events. They are specified in
  1680. * the kEventParamTSMDocAccessRequestedCharacterAttributes parameter.
  1681. }
  1682. const
  1683. {
  1684. * Font size information is desired. Used in
  1685. * kEventTSMDocumentAccessGetFont event.
  1686. }
  1687. kTSMDocAccessFontSizeAttributeBit = 0;
  1688. {
  1689. * Effective Range information is desired. Used in
  1690. * kEventTSMDocumentAccessGetFont and
  1691. * kEventTSMDocumentAccessGetGlyphInfo events.
  1692. }
  1693. kTSMDocAccessEffectiveRangeAttributeBit = 1;
  1694. type
  1695. TSMDocAccessAttributes = UInt32;
  1696. const
  1697. kTSMDocAccessFontSizeAttribute = 1 shl kTSMDocAccessFontSizeAttributeBit;
  1698. kTSMDocAccessEffectiveRangeAttribute = 1 shl kTSMDocAccessEffectiveRangeAttributeBit; { More attributes may be added in the future}
  1699. {
  1700. * kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetFont
  1701. *
  1702. * Summary:
  1703. * Returns font, font size, and the range over which these
  1704. * attributes are constant.
  1705. *
  1706. * Discussion:
  1707. * Where the font/font size attributes span multiple characters, an
  1708. * effective range (over which requested attributes are constant) is
  1709. * returned by the text engine.
  1710. *
  1711. * Mac OS X threading:
  1712. * Not thread safe
  1713. *
  1714. * Parameters:
  1715. *
  1716. * --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
  1717. * This parameter is provided by the input method originating
  1718. * the event. (Required parameter)
  1719. *
  1720. * --> kEventParamTSMDocAccessSendRefCon (in, typeLongInteger)
  1721. * TSM's SendTextInputEvent, called by an input method,
  1722. * inserts this parameter before dispatching the event to the
  1723. * user focus. (Required Parameter)
  1724. *
  1725. * --> kEventParamTSMDocAccessSendCharacterIndex (in, typeCFIndex)
  1726. * The location in the document for which the caller would
  1727. * like font information. Required parameter.
  1728. *
  1729. * --> kEventParamTSMDocAccessRequestedCharacterAttributes (in, typeUInt32)
  1730. * A TSMDocAccessAttributes bit field filled out with the
  1731. * attributes desired. Applicable values for this event are :
  1732. * kTSMDocAccessFontSizeAttribute which requests font size
  1733. * information through the
  1734. * kEventParamTSMDocAccessReplyFontSize parameter, and
  1735. * kTSMDocAccessEffectiveRangeAttribute which requests the
  1736. * text range over which font or font/size is constant.
  1737. * Required parameter.
  1738. *
  1739. * <-- kEventParamTSMDocAccessReplyATSFont (out, typeATSFontRef)
  1740. * The ATSFontRef for the location specified by the caller.
  1741. * Required reply parameter.
  1742. *
  1743. * <-- kEventParamTSMDocAccessReplyFontSize (out, typeFloat)
  1744. * The font size for the requested location. Optional reply
  1745. * parameter. Return this information if
  1746. * kTSMDocAccessFontSizeAttribute is specified in the bit
  1747. * field passed as the
  1748. * kEventParamTSMDocAccessRequestedCharacterAttributes
  1749. * parameter.
  1750. *
  1751. * --> kEventParamTSMDocAccessSendCharacterRange (in, typeCFRange)
  1752. * The maximum range of text the caller cares about. This is
  1753. * used to "clip" the area of interest to the caller so the
  1754. * text engine doesn't need to process a style run all the way
  1755. * back to, say, the beginning of a line or a document, in
  1756. * order to return an effective range. Required parameter.
  1757. *
  1758. * <-- kEventParamTSMDocAccessEffectiveRange (out, typeCFRange)
  1759. * The range of text over which both font and size are
  1760. * constant, within the bounds of the
  1761. * kEventParamTSMDocAccessSendCharacterRange parameter.
  1762. * Optional reply parameter. Return this information if
  1763. * kTSMDocAccessEffectiveRangeAttribute is specified in the
  1764. * bit field passed as the
  1765. * kEventParamTSMDocAccessRequestedCharacterAttributes
  1766. * parameter.
  1767. *
  1768. * Availability:
  1769. * Mac OS X: in version 10.3 and later in Carbon.framework
  1770. * CarbonLib: not available
  1771. }
  1772. const
  1773. kEventTSMDocumentAccessGetFont = 6;
  1774. {
  1775. * kEventClassTSMDocumentAccess / kEventTSMDocumentAccessGetGlyphInfo
  1776. *
  1777. * Summary:
  1778. * Returns glyph info and the range covered by that glyph.
  1779. *
  1780. * Discussion:
  1781. * Where a glyph spans multiple characters, the effective range,
  1782. * represented by the glyph, is returned by the app.
  1783. *
  1784. * Mac OS X threading:
  1785. * Not thread safe
  1786. *
  1787. * Parameters:
  1788. *
  1789. * --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
  1790. * This parameter is provided by the input method originating
  1791. * the event. (Required parameter)
  1792. *
  1793. * --> kEventParamTSMDocAccessSendRefCon (in, typeLongInteger)
  1794. * TSM's SendTextInputEvent, called by an input method,
  1795. * inserts this parameter before dispatching the event to the
  1796. * user focus. (Required Parameter)
  1797. *
  1798. * --> kEventParamTSMDocAccessSendCharacterIndex (in, typeCFIndex)
  1799. * The location in the document for which the caller would
  1800. * like glyph information. Required parameter.
  1801. *
  1802. * --> kEventParamTSMDocAccessRequestedCharacterAttributes (in, typeUInt32)
  1803. * A TSMDocAccessAttributes bit field filled out with the
  1804. * information desired. Applicable values for this event are :
  1805. * kTSMDocAccessEffectiveRangeAttribute which requests the
  1806. * text range represented by a glyph. Required parameter.
  1807. *
  1808. * <-- kEventParamTSMDocAccessReplyATSUGlyphSelector (out, typeGlyphSelector)
  1809. * The glyph used to display the range of text returned in the
  1810. * kEventParamTSMDocAccessEffectiveRange parameter. If the
  1811. * glyph used is the one that ATSUI would normally derive,
  1812. * this parameter can be omitted. Optional reply parameter.
  1813. *
  1814. * <-- kEventParamTSMDocAccessEffectiveRange (out, typeCFRange)
  1815. * The range of text displayed as a glyph ID or CID. Optional
  1816. * reply parameter. Return this information if
  1817. * kTSMDocAccessEffectiveRangeAttribute is specified in the
  1818. * bit field passed as the
  1819. * kEventParamTSMDocAccessRequestedCharacterAttributes
  1820. * parameter.
  1821. *
  1822. * Availability:
  1823. * Mac OS X: in version 10.3 and later in Carbon.framework
  1824. * CarbonLib: not available
  1825. }
  1826. const
  1827. kEventTSMDocumentAccessGetGlyphInfo = 7;
  1828. {
  1829. ** Document Access Lock/Unlock events **
  1830. }
  1831. {
  1832. * kEventClassTSMDocumentAccess / kEventTSMDocumentAccessLockDocument
  1833. *
  1834. * Summary:
  1835. * Notifies the app that it should not change its document's text
  1836. * content (on its own) while a text service is involved in a
  1837. * transaction. The app should not allow changes, for example, by
  1838. * its secondary threads.
  1839. *
  1840. * Discussion:
  1841. * These events define how a text service can obtain access to a
  1842. * document in a way that ensures data integrity during its
  1843. * transaction. The primary motivation of these events is to
  1844. * prevent the application from letting its secondary threads modify
  1845. * the document while a text service is busy servicing an event,
  1846. * such as a key event, or some user interaction with text service
  1847. * provided UI such as a menu selection. Also, while the document is
  1848. * locked, a text service is free to request pointer access to the
  1849. * document's text content (if this is supported by the app's text
  1850. * engine.) These lock-related events should be implemented using a
  1851. * ref counting scheme. Most apps will not support this kind of
  1852. * threading, so implementation of these events in the text engine
  1853. * will be optional. In most text engines, the implementation of
  1854. * these events should be trivial, i.e. just maintain a simple
  1855. * semaphore. TSM itself will implicitly lock/unlock around normal
  1856. * entry points into a text service, such as when it delivers key
  1857. * events to an input method, but there may be times when document
  1858. * changes can be driven by an input method without TSM involvement,
  1859. * such as the Carbon events involved when the user interacts with
  1860. * some UI. In this case, the input method must manage locking, if
  1861. * the app supports it. However, the logic in an input method
  1862. * should not have to care whether TSM is in the call chain or
  1863. * not... and TSM should not have to care whether an input method
  1864. * will do the right thing. This is why the lock mechanism needs to
  1865. * be some kind of refcounting scheme instead of a simple on/off
  1866. * mechanism. This document lock support is completely optional on
  1867. * the part of the text engine (if it is not threaded). TSM will
  1868. * implicitly lock/unlock the document around delivery of events to
  1869. * input methods, if the app supports it.
  1870. *
  1871. * Mac OS X threading:
  1872. * Not thread safe
  1873. *
  1874. * Parameters:
  1875. *
  1876. * --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
  1877. * This parameter is provided by the input method originating
  1878. * the event. (Required parameter)
  1879. *
  1880. * --> kEventParamTSMDocAccessSendRefCon (in, typeLongInteger)
  1881. * TSM's SendTextInputEvent, called by an input method,
  1882. * inserts this parameter before dispatching the event to the
  1883. * user focus. (Required Parameter)
  1884. *
  1885. * <-- kEventParamTSMDocAccessLockCount (out, typeCFIndex)
  1886. * The resulting refCount of locks on the document. Required
  1887. * reply parameter, if the event is handled.
  1888. *
  1889. * Availability:
  1890. * Mac OS X: in version 10.3 and later in Carbon.framework
  1891. * CarbonLib: not available
  1892. }
  1893. const
  1894. kEventTSMDocumentAccessLockDocument = 8;
  1895. {
  1896. * kEventClassTSMDocumentAccess / kEventTSMDocumentAccessUnlockDocument
  1897. *
  1898. * Summary:
  1899. * Unlock the document so the app's text engine is free to initiate
  1900. * changes again.
  1901. *
  1902. * Discussion:
  1903. * (see kEventTSMDocumentAccessLockDocument)
  1904. *
  1905. * Mac OS X threading:
  1906. * Not thread safe
  1907. *
  1908. * Parameters:
  1909. *
  1910. * --> kEventParamTSMDocAccessSendComponentInstance (in, typeComponentInstance)
  1911. * This parameter is provided by the input method originating
  1912. * the event. (Required parameter)
  1913. *
  1914. * --> kEventParamTSMDocAccessSendRefCon (in, typeLongInteger)
  1915. * TSM's SendTextInputEvent, called by an input method,
  1916. * inserts this parameter before dispatching the event to the
  1917. * user focus. (Required Parameter)
  1918. *
  1919. * <-- kEventParamTSMDocAccessLockCount (out, typeCFIndex)
  1920. * The resulting refCount of locks on the document. Required
  1921. * reply parameter, if the event is handled.
  1922. *
  1923. * Availability:
  1924. * Mac OS X: in version 10.3 and later in Carbon.framework
  1925. * CarbonLib: not available
  1926. }
  1927. const
  1928. kEventTSMDocumentAccessUnlockDocument = 9;
  1929. {--------------------------------------------------------------------------------------}
  1930. { Text Input Events }
  1931. {--------------------------------------------------------------------------------------}
  1932. {
  1933. kEventClassTextInput quick reference:
  1934. kEventTextInputUpdateActiveInputArea = 1,
  1935. kEventTextInputUnicodeForKeyEvent = 2,
  1936. kEventTextInputOffsetToPos = 3,
  1937. kEventTextInputPosToOffset = 4,
  1938. kEventTextInputShowHideBottomWindow = 5,
  1939. kEventTextInputGetSelectedText = 6,
  1940. kEventTextInputUnicodeText = 7,
  1941. kEventTextInputFilterText = 14
  1942. The following TextInput events (UpdateActiveInputArea thru GetSelectedText) reimplement
  1943. the AppleEvents defined in Inside Mac Text: Text Services Manager, and provide the benefits
  1944. of Carbon Event targeting, dispatching, and propagation to applications that have formerly
  1945. handled the TSM suite of AppleEvents.
  1946. TextInput handlers may be installed on controls, windows, or the application event target
  1947. (equivalent to AppleEvent-based handling). In all cases, if a given TextInput handler is
  1948. not installed, TSM will convert that TextInput to an AppleEvent and redispatch via AESend
  1949. to the current process, making adoption as gradual as is desired.
  1950. }
  1951. {
  1952. * kEventClassTextInput / kEventTextInputUpdateActiveInputArea
  1953. *
  1954. * Summary:
  1955. * Tells the application/text engine to initiate/terminate or manage
  1956. * the content of an inline input session.
  1957. *
  1958. * Mac OS X threading:
  1959. * Not thread safe
  1960. *
  1961. * Parameters:
  1962. *
  1963. * --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
  1964. * This parameter is provided by the input method originating
  1965. * the event. (Required parameter)
  1966. *
  1967. * --> kEventParamTextInputSendRefCon (in, typeLongInteger)
  1968. * TSM's SendTextInputEvent, called by an input method,
  1969. * inserts this parameter before dispatching the event to the
  1970. * user focus. (Required Parameter)
  1971. *
  1972. * --> kEventParamTextInputSendSLRec (in, typeIntlWritingCode)
  1973. * The ScriptLanguageRecord associated with the contents of an
  1974. * inline input session. This parameter is normally provided
  1975. * by the input method originating the event. TSM's
  1976. * SendTextInputEvent will construct this parameter, when
  1977. * missing, based on the input method component description.
  1978. * (Required Parameter)
  1979. *
  1980. * --> kEventParamTextInputSendFixLen (in, typeLongInteger)
  1981. * This parameter indicates how much, if any, of the inline
  1982. * input session is being confirmed (or commited) to the
  1983. * application. A value of -1 indicates the entire inline
  1984. * session is being confirmed. A value of 0 indicates that
  1985. * none of the text is being confirmed (yet), although there
  1986. * may be some change to the contents of the inline input
  1987. * session. This parameter is provided by the input method
  1988. * originating the event. (Required Parameter)
  1989. *
  1990. * --> kEventParamTextInputSendText (in, typeUnicodeText)
  1991. * The text to be added to the inline input session. The data
  1992. * type of this parameter actually depends on the TSMDocument
  1993. * type created via NewTSMDocument: it will be typeChar for
  1994. * kTextService documents, or typeUnicodeText for
  1995. * kUnicodeDocument documents. (Required Parameter)
  1996. *
  1997. * --> kEventParamTextInputSendUpdateRng (in, typeTextRangeArray)
  1998. * An array of text-range records (see TextRangeArray) that
  1999. * indicates how to update (a subrange of) the active input
  2000. * area (aka. inline input session). The TextRange structures
  2001. * occur in pairs, the first of which identifies a subrange of
  2002. * the existing active input area (in the app's backing store,
  2003. * resulting from a previous UpdateActiveInputArea event) to
  2004. * be replaced by a new subrange of text, identified by the
  2005. * second TextRange in the pair. The new text subrange is
  2006. * obtained from the contents of the
  2007. * kEventParamTextInputSendText parameter. In general, the
  2008. * Nth array element, where N is even, specifies the range of
  2009. * old text to be updated and array element N+1 specifies the
  2010. * range of new text to replace the corresponding old text.
  2011. * The fHiliteStyle field of the TextRange records is ignored
  2012. * in this parameter. NOTE: There are some "loose ends" in
  2013. * the TSM event protocol that were never clearly defined, but
  2014. * which have been introduced over the years by input methods
  2015. * themselves, probably through some trial and error. The
  2016. * conventions regarding this optional parameter seem to be as
  2017. * follows: If the UpdateRng parameter is missing from the
  2018. * event, the input method is requesting that the entire
  2019. * contents of the existing inline input session (if there is
  2020. * one) is to be replaced "wholesale" by the new text
  2021. * contained in the kEventParamTextInputSendText parameter. If
  2022. * the UpdateRng parameter exists, but contains no ranges
  2023. * (i.e. fNumOfRanges == 0), this seems to be hint from the
  2024. * input method that no text in the active input area is
  2025. * changing. It may be that the existing active input area is
  2026. * being confirmed "as is", or that the input method is
  2027. * modifying its highlite attributes in some way, due to some
  2028. * user action, such as changing the selected clause or
  2029. * highlited subrange of text in the active input area, or
  2030. * that the input method is changing the caret position in the
  2031. * active input area (if it uses the kTSMHiliteCaretPosition
  2032. * hilite style). Depending on how your text engine draws
  2033. * hilite styles supported in the
  2034. * kEventParamTextInputSendHiliteRng parameter, you may or may
  2035. * not need to redraw the text itself, simply change the
  2036. * hilite. This parameter is optional and may not be present
  2037. * in all instances of this event.
  2038. *
  2039. * --> kEventParamTextInputSendHiliteRng (in, typeTextRangeArray)
  2040. * An array of text-range records (see TextRangeArray) that
  2041. * specifies how various subranges of the active input area
  2042. * are to be highlited, and possibly specifies caret position
  2043. * within the active input area. NOTE: The text offsets used
  2044. * in the HiliteRng parameter are relative to the beginning of
  2045. * the active input area AFTER all text has been updated (per
  2046. * the SendUpdateRng parameter) and any (subrange of) text has
  2047. * been confirmed. Specifically, if the entire text is being
  2048. * confirmed, it is clear that any contents of this parameter
  2049. * should be ignored, especially non-zero values
  2050. * kTSMHiliteCaretPosition. This parameter is optional and may
  2051. * not be present in all instances of this event.
  2052. *
  2053. * --> kEventParamTextInputSendClauseRng (in, typeOffsetArray)
  2054. * An array of offsets (see OffsetArray) used by an input
  2055. * method to specify word or clause boundaries in the
  2056. * resulting active input area. Offsets are relative to the
  2057. * start of the resulting active input area. This parameter is
  2058. * optional and may not be present in all instances of this
  2059. * event.
  2060. *
  2061. * --> kEventParamTextInputSendPinRng (in, typeTextRange)
  2062. * A TextRange record that specifies a start offset and an end
  2063. * offset that should be scrolled into view if the text
  2064. * specified by these offsets is not already in view. The
  2065. * fHiliteStyle field of the TextRange records is ignored in
  2066. * this parameter. This parameter is optional and may not be
  2067. * present in all instances of this event.
  2068. *
  2069. * --> kEventParamTextInputSendTextServiceEncoding (in, typeUInt32)
  2070. * The encoding associated with the text sent by an input
  2071. * method. On MacOS X, this parameter is not commonly used
  2072. * because all TSM input methods produce Unicode, but TSM will
  2073. * respect a Unicode encoding variant here, if specified. In
  2074. * CarbonLib, this parameter identifies the Mac encoding
  2075. * (usually an encoding variant) of the text produced by the
  2076. * input method on MacOS, where it is not a requirement that
  2077. * input methods be Unicode-savvy. On this platform, TSM
  2078. * needs the information to convert text to Unicode from a Mac
  2079. * encoding variant which cannot be derived from the
  2080. * ScriptLanguage record associated with the input method
  2081. * component. This parameter is optional and may not be
  2082. * present in all instances of this event.
  2083. *
  2084. * --> kEventParamTextInputSendTextServiceMacEncoding (in, typeUInt32)
  2085. * The Mac encoding (variant) associated with the text sent by
  2086. * an input method. On Mac OS X, this parameter is needed by
  2087. * TSM to convert input method produced Unicodes to a Mac
  2088. * encoding when the application that has focus is not
  2089. * Unicode-savvy in the TSM sense... i.e. the current
  2090. * TSMDocument is not of type kUnicodeDocument. This parameter
  2091. * can also be useful if a Unicode-savvy handler should need
  2092. * to convert from Unicode. This parameter is optional and may
  2093. * not be present in all instances of this event.
  2094. *
  2095. * --> kEventParamTextInputSendGlyphInfoArray (in, typeGlyphInfoArray)
  2096. * A TSMGlyphInfoArray structure in which an input method can
  2097. * associate unencoded glyphs IDs and/or fonts with
  2098. * (sub)ranges of text it produces. The array elements
  2099. * identify non-overlapping ranges of text and the glyph ID
  2100. * (character collection is 0) such as in an OpenType font, or
  2101. * the CID (collection is non-zero) such as in TrueType fonts.
  2102. * If the glyphID itself is 0, only the font specified is to
  2103. * be applied to the text range. This is useful for
  2104. * characters in Unicode private use area, such as Windings,
  2105. * but note that this capability should be used with care
  2106. * because changing the font of an input text stream can lead
  2107. * to a confusing user interface. An input method will only
  2108. * include this parameter if the text engine has indicated it
  2109. * supports this feature via the
  2110. * kTSMDocumentSupportGlyphInfoPropertyTag TSMDocumentProperty
  2111. * tag. For more information, see the Glyph Access protocol
  2112. * described in Technote TN2079. This parameter is optional
  2113. * and may not be present in all instances of this event.
  2114. *
  2115. * --> kEventParamTextInputSendReplaceRange (in, typeCFRange)
  2116. * The CFRange in the application's document that should be
  2117. * replaced by the contents of the inline input session
  2118. * defined by other parameters in this event. The text
  2119. * service will have obtained and calculated this range by
  2120. * accessing the document's text via events of the
  2121. * TSMDocumentAccess class. This CFRange parameter refers to
  2122. * text in flat Unicode space (UniChar) offsets, and its
  2123. * location is document relative, not relative to the
  2124. * insertion point or any inline session. A text service may
  2125. * include this parameter only if the text engine has
  2126. * indicated it supports this feature via the
  2127. * kTSMDocumentSupportDocumentAccessPropertyTag
  2128. * TSMDocumentProperty tag. This parameter is optional and may
  2129. * not be present in all instances of this event. NOTE: This
  2130. * parameter is supported by the TSM Carbon event only, not by
  2131. * TSM's kUpdateActiveInputArea AppleEvent. If a text engine
  2132. * developer wishes to support this parameter, it must
  2133. * implement a Carbon event handler for this event and set the
  2134. * kTSMDocumentSupportDocumentAccessPropertyTag property tag.
  2135. * NOTE: Care must be exercised by the app when there is an
  2136. * active inline input session. A text service that sends an a
  2137. * UpdateActiveInputArea event specifying this parameter
  2138. * should not be the same text service that owns the inline
  2139. * input session, since the text engine would need to call
  2140. * FixTSMDocument(). This, in turn, would cause recursion
  2141. * through that same text service via FixTextService().
  2142. * However, the app should be prepared for recursion
  2143. * regardless of which text service owns the inline input
  2144. * session because it will call FixTSMDocument() to confirm
  2145. * the inline input session, and "somebody" will likely send
  2146. * an UpdateActiveInputArea event as a result. Therefore,
  2147. * document state obtained before the call to FixTSMDocument()
  2148. * may not be valid after this call completes.
  2149. *
  2150. * Availability:
  2151. * Mac OS X: in version 10.0 and later in Carbon.framework
  2152. * CarbonLib: in CarbonLib 1.1 and later
  2153. }
  2154. const
  2155. kEventTextInputUpdateActiveInputArea = 1;
  2156. {
  2157. * kEventClassTextInput / kEventTextInputUnicodeForKeyEvent
  2158. *
  2159. * Summary:
  2160. * Provides Unicode text input resulting from either a key event
  2161. * (TSM originates the event in this case) or from a
  2162. * kEventTextInputUnicodeText event produced by an input method,
  2163. * such as a Character Palette class input method, or a HandWriting
  2164. * input method.
  2165. *
  2166. * Discussion:
  2167. * This is the primary event by which applications should receive
  2168. * text input on Mac OS X. Apple recommends that applications use
  2169. * this event rather than the kEventRawKeyDown event to handle text
  2170. * input.
  2171. *
  2172. * A client need not be fully TSM-aware to process or receive this
  2173. * event. You can also get Mac encoding characters from the raw
  2174. * keyboard event contained in this event. If no UnicodeForKeyEvent
  2175. * handler is installed, and no kUnicodeNotFromInputMethod
  2176. * AppleEvent handler is installed (or the application has not
  2177. * created a Unicode TSMDocument), the Mac encoding charCodes (if
  2178. * these can be converted from the Unicodes) are provided to
  2179. * WaitNextEvent.
  2180. *
  2181. * This event is generated automatically by TSM when a
  2182. * kEventRawKeyDown event is sent to the application event target.
  2183. * The typical keyboard event flow begins with a kEventRawKeyDown
  2184. * event posted to the event queue. This event is dequeued during
  2185. * WaitNextEvent or RunApplicationEventLoop, and sent to the event
  2186. * dispatcher target. If the keydown event reaches the application
  2187. * target, it is handled by TSM, which generates a
  2188. * kEventTextInputUnicodeForKeyEvent and sends it to the event
  2189. * dispatcher target. The event dispatcher will resend the event to
  2190. * the user focus target, which sends it to the focused control in
  2191. * the focused window.
  2192. *
  2193. * Mac OS X threading:
  2194. * Not thread safe
  2195. *
  2196. * Parameters:
  2197. *
  2198. * --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
  2199. * This parameter is provided by the input method originating
  2200. * the event. (Required parameter)
  2201. *
  2202. * --> kEventParamTextInputSendRefCon (in, typeLongInteger)
  2203. * TSM's SendTextInputEvent, called by an input method,
  2204. * inserts this parameter before dispatching the event to the
  2205. * user focus. (Required Parameter)
  2206. *
  2207. * --> kEventParamTextInputSendSLRec (in, typeIntlWritingCode)
  2208. * The ScriptLanguageRecord associated with the text contained
  2209. * in the event. This parameter is normally provided by the
  2210. * input method originating the event. TSM's
  2211. * SendTextInputEvent will construct this parameter from
  2212. * current script information as a result of a key event, or
  2213. * using input method provided information when TSM receives a
  2214. * kEventTextInputUnicodeText event. (Required Parameter)
  2215. *
  2216. * --> kEventParamTextInputSendText (in, typeUnicodeText)
  2217. * The Unicode characters that were entered by the user.
  2218. *
  2219. * --> kEventParamTextInputSendKeyboardEvent (in, typeEventRef)
  2220. * This parameter is the original raw keyboard event that
  2221. * produced the text. It enables access to
  2222. * kEventParamKeyModifiers and kEventParamKeyCode parameters.
  2223. * Note that when contents of TSMÕs bottom-line input window
  2224. * are confirmed (i.e., during typing of Chinese, Korean, or
  2225. * Japanese), the raw keyboard eventÕs keyCode and modifiers
  2226. * are set to default values.
  2227. *
  2228. * You can also extract from the RawKeyDown event either
  2229. * Unicodes or Mac encoding characters as follows:
  2230. *
  2231. * kEventParamKeyUnicodes typeUnicodeText
  2232. * kEventParamKeyMacCharCodes typeChar (if available)
  2233. *
  2234. * The kEventParamKeyUnicodes parameter of the raw keyboard
  2235. * event is identical to the TextInput eventÕs
  2236. * kEventParamTextInputSendText parameter.
  2237. *
  2238. * --> kEventParamTextInputSendGlyphInfoArray (in, typeGlyphInfoArray)
  2239. * A TSMGlyphInfoArray structure in which an input method can
  2240. * associate unencoded glyphs IDs and/or fonts with
  2241. * (sub)ranges of text it produces. The array elements
  2242. * identify non-overlapping ranges of text and the glyph ID
  2243. * (character collection is 0) such as in an OpenType font, or
  2244. * the CID (collection is non-zero) such as in TrueType fonts.
  2245. * If the glyphID itself is 0, only the font specified is to
  2246. * be applied to the text range. This is useful for
  2247. * characters in Unicode private use area, such as Windings,
  2248. * but note that this capability should be used with care
  2249. * because changing the font of an input text stream can lead
  2250. * to a confusing user interface. For more information, see
  2251. * the Glyph Access protocol described in Technote TN2079.
  2252. * This parameter is optional and may not be present in all
  2253. * instances of this event.
  2254. *
  2255. * Availability:
  2256. * Mac OS X: in version 10.0 and later in Carbon.framework
  2257. * CarbonLib: in CarbonLib 1.1 and later
  2258. }
  2259. const
  2260. kEventTextInputUnicodeForKeyEvent = 2;
  2261. {
  2262. * kEventClassTextInput / kEventTextInputOffsetToPos
  2263. *
  2264. * Summary:
  2265. * Requests conversion from inline session text offset to global QD
  2266. * coordinate.
  2267. *
  2268. * Discussion:
  2269. * This event is typically produced by an input method so that it
  2270. * can best position a palette near the text being edited by the
  2271. * user.
  2272. *
  2273. * Mac OS X threading:
  2274. * Not thread safe
  2275. *
  2276. * Parameters:
  2277. *
  2278. * --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
  2279. * This parameter is provided by the input method originating
  2280. * the event. (Required parameter)
  2281. *
  2282. * --> kEventParamTextInputSendRefCon (in, typeLongInteger)
  2283. * TSM's SendTextInputEvent, called by an input method,
  2284. * inserts this parameter before dispatching the event to the
  2285. * user focus. (Required Parameter)
  2286. *
  2287. * --> kEventParamTextInputSendTextOffset (in, typeLongInteger)
  2288. * Specifies the text offset in an active input area for which
  2289. * the global position (in QD coordinates) is desired.
  2290. * Because an inline input session always begins at the
  2291. * insertion point, the offset is always considered relative
  2292. * to the insertion point, even when there is no active input
  2293. * area. (Required Parameter)
  2294. *
  2295. * If an offset is outside the bounds of the document text,
  2296. * errOffsetInvalid should be returned. Negative offsets are
  2297. * not valid when an inline input session exists, but are
  2298. * valid when none exists, to allow query of offsets before
  2299. * the insertion point.
  2300. *
  2301. * NOTE: Non-zero offsets in the absence of an active input
  2302. * area can only be specified when the originator of the event
  2303. * is certain that the character encoding used by the target
  2304. * (the current TSMDocument) is the same as its own encoding.
  2305. * When there is no active input area, TSM is unable to
  2306. * convert offsets between different encodings that might be
  2307. * used by the app and an input method (as it normally does)
  2308. * since TSM does not have access to the document text.
  2309. * Practically, this means that both the originator and event
  2310. * target must be Unicode-savvy, i.e. the current TSMDocument
  2311. * was created with kUnicodeDocumentInterfaceType.
  2312. *
  2313. * NOTE: Insertion point relative offsets when there is no
  2314. * active input area is contrary to the original definition of
  2315. * this parameter in IM-Text 7-74 which states that the offset
  2316. * is "relative to the start of the current text body" in this
  2317. * case. However, most applications and text engines have
  2318. * already implemented the case offset = 0 as being the
  2319. * insertion point. This allows an input method to display
  2320. * some UI near the the insertion point even before typing
  2321. * takes place.
  2322. *
  2323. * --> kEventParamTextInputSendSLRec (in, typeIntlWritingCode)
  2324. * Specifies which glyph on either side of the supplied text
  2325. * offset that should be used to compute the on-screen
  2326. * position returned. This value is similar to the
  2327. * leadingEdge parameter of the QuickDraw PixelToChar
  2328. * function. If this parameter is true, the location of the
  2329. * character (or characters if the glyph is represented by
  2330. * multiple characters) at the specified text offset is
  2331. * returned. If this parameter is false, the on-screen
  2332. * position returned should be the trailing edge of the glyph
  2333. * represented by the character (or characters) immediately
  2334. * preceding (in memory order) the supplied text offset. Note
  2335. * also that while the on-screen position for a given offset
  2336. * and leading/trailing edge value is affected by this
  2337. * parameter, it also affects what should be returned for the
  2338. * other optional parameters at style run boundaries, such as
  2339. * script and font information. This parameter is optional and
  2340. * may not be present in all instances of this event. The
  2341. * default value for this parameter is 'true'.
  2342. *
  2343. * --> kEventParamTextInputSendLeadingEdge (in, typeBoolean)
  2344. * The position on screen (in QD coordinates) of the requested
  2345. * text offset and leading/trailing edge value. (Required
  2346. * reply parameter)
  2347. *
  2348. * <-- kEventParamTextInputReplyPoint (out, typeQDPoint)
  2349. * The ScriptLanguageRecord associated with the text at the
  2350. * offset specified in the event, either the
  2351. * ScriptLanguageRecord of the active input area if one
  2352. * exists, or of the text at the specified offset and
  2353. * specified leading/ trailing edge value. At a script run
  2354. * boundary, such as where a Japanese text run ends, and a
  2355. * Roman begins, a leading edge value of 'true' should return
  2356. * the Roman script/language while a leading edge value of
  2357. * 'false' should return the Japanese script/language. This
  2358. * parameter is optional and may not be returned to the caller.
  2359. *
  2360. * <-- kEventParamTextInputReplySLRec (out, typeIntlWritingCode)
  2361. * The QD Font associated with the text at the offset
  2362. * specified in the event, either the QD Font of the active
  2363. * input area if one exists, or of the text at the specified
  2364. * offset and specified leading/ trailing edge value. At a
  2365. * font run boundary, such as where a Japanese text run ends,
  2366. * and a Roman begins, a leading edge value of 'true' should
  2367. * return the font of the Roman text run while a leading edge
  2368. * value of 'false' should return the Japanese font. This
  2369. * parameter is optional and may not be returned to the caller.
  2370. *
  2371. * <-- kEventParamTextInputReplyFont (out, typeLongInteger)
  2372. * The FMFont associated with the text at the offset specified
  2373. * in the event, either the FMFont of the active input area if
  2374. * one exists, or of the text at the specified offset and
  2375. * specified leading/ trailing edge value. At a font run
  2376. * boundary, such as where a Japanese text run ends, and a
  2377. * Roman begins, a leading edge value of 'true' should return
  2378. * the font of the Roman text run while a leading edge value
  2379. * of 'false' should return the Japanese font. This parameter
  2380. * allows the handler to return an FMFont when a FMFontFamily
  2381. * or FOND would be inconvenient to compute. This parameter is
  2382. * optional and may not be returned to the caller.
  2383. *
  2384. * <-- kEventParamTextInputReplyFMFont (out, typeUInt32)
  2385. * The point size associated with the text at the offset
  2386. * specified in the event, either the point size of the active
  2387. * input area if one exists, or of the text at the specified
  2388. * offset. At a style run boundary where point size changes,
  2389. * the leadingEdge parameter determines which point size
  2390. * should be returned. This parameter is optional and may not
  2391. * be returned to the caller.
  2392. *
  2393. * <-- kEventParamTextInputReplyPointSize (out, typeFixed)
  2394. * The line height associated with the text at the offset
  2395. * specified in the event, either the line height of the
  2396. * active input area if one exists, or of the text at the
  2397. * specified offset. At a style run boundary where point size
  2398. * changes, the leadingEdge parameter determines which line
  2399. * height should be returned. This parameter is optional and
  2400. * may not be returned to the caller.
  2401. *
  2402. * <-- kEventParamTextInputReplyLineHeight (out, typeShortInteger)
  2403. * The line ascent associated with the text at the offset
  2404. * specified in the event, either the line ascent of the
  2405. * active input area if one exists, or of the text at the
  2406. * specified offset. At a style run boundary where point size
  2407. * changes, the leadingEdge parameter determines which line
  2408. * ascent should be returned. This parameter is optional and
  2409. * may not be returned to the caller.
  2410. *
  2411. * <-- kEventParamTextInputReplyLineAscent (out, typeShortInteger)
  2412. * The orientation associated with the text at the offset
  2413. * specified in the event, either the orientation of the
  2414. * active input area if one exists, or of the text at the
  2415. * specified offset. At a style run boundary where
  2416. * orientation changes, the leadingEdge parameter determines
  2417. * which orientation should be returned. The value 90
  2418. * specifies a horizontal line direction and 180 specifies a
  2419. * vertical line direction. This parameter is optional and may
  2420. * not be returned to the caller.
  2421. *
  2422. * Availability:
  2423. * Mac OS X: in version 10.0 and later in Carbon.framework
  2424. * CarbonLib: in CarbonLib 1.1 and later
  2425. }
  2426. const
  2427. kEventTextInputOffsetToPos = 3;
  2428. {
  2429. * kEventClassTextInput / kEventTextInputPosToOffset
  2430. *
  2431. * Summary:
  2432. * Requests conversion from global QD coordinate to a byte offset in
  2433. * text.
  2434. *
  2435. * Discussion:
  2436. * This event is used for mouse tracking. An input method typically
  2437. * produces this event to perform proper cursor management as the
  2438. * cursor moves over various subranges, or clauses of text (or the
  2439. * boundaries between these) in an inline input session, or moves
  2440. * between an inline input session to the main text body, or even
  2441. * outside of the main text body.
  2442. *
  2443. * Mac OS X threading:
  2444. * Not thread safe
  2445. *
  2446. * Parameters:
  2447. *
  2448. * --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
  2449. * This parameter is provided by the input method originating
  2450. * the event. (Required parameter)
  2451. *
  2452. * --> kEventParamTextInputSendRefCon (in, typeLongInteger)
  2453. * TSM's SendTextInputEvent, called by an input method,
  2454. * inserts this parameter before dispatching the event to the
  2455. * user focus. (Required Parameter)
  2456. *
  2457. * --> kEventParamTextInputSendCurrentPoint (in, typeQDPoint)
  2458. * The point whose text offset (and classification) the input
  2459. * method is requesting. This point is usually the current
  2460. * mouse position in global QD coordinates. Text offset
  2461. * classifications are defined by
  2462. * kEventParamTextInputReplyRegionClass. (Required Parameter)
  2463. *
  2464. * --> kEventParamTextInputSendDraggingMode (in, typeBoolean)
  2465. * A Boolean value that indicates whether the input method is
  2466. * currently tracking the mouse -- that is, whether the user
  2467. * is dragging the current selection. If it is TRUE, the
  2468. * application should pin the cursor to the limits of the
  2469. * active input area (to avoid highlighting beyond the limits
  2470. * of the active input area). This parameter is optional and
  2471. * may not be present in all instances of this event.
  2472. *
  2473. * <-- kEventParamTextInputReplyRegionClass (out, typeLongInteger)
  2474. * The text offset corresponding to the supplied QD point. If
  2475. * the click is within the limits of the active input area,
  2476. * the offset is relative to the start of the active input
  2477. * area. Otherwise, the offset is relative to the start of the
  2478. * application's text body. (Required reply parameter)
  2479. *
  2480. * <-- kEventParamTextInputReplyTextOffset (out, typeLongInteger)
  2481. * The classification of the offset parameter. The values
  2482. * kTSMOutsideOfBody and kTSMInsideOfBody means that the
  2483. * position is outside or inside of the text body,
  2484. * respectively. A value of kTSMInsideOfActiveInputArea means
  2485. * that the position is inside of the active input area.
  2486. * (Required reply parameter)
  2487. *
  2488. * <-- kEventParamTextInputReplyLeadingEdge (out, typeBoolean)
  2489. * Specifies whether the QD point supplied corresponds to the
  2490. * leading edge (true) or trailing edge (false) of a glyph.
  2491. * This value is similar to the leadingEdge parameter of the
  2492. * QuickDraw PixelToChar function. If the supplied point is on
  2493. * the leading edge of a glyph, this parameter contains the
  2494. * text offset of the character whose glyph is at the pixel
  2495. * location. (If the glyph represents multiple characters, it
  2496. * returns the text offset of the first of these characters in
  2497. * memory.) If the supplied point is on the trailing edge of
  2498. * a glyph, this parameter returns the text offset of the
  2499. * first character in memory following the character or
  2500. * characters represented by the glyph. This parameter is
  2501. * optional and may not be returned to the caller.
  2502. *
  2503. * <-- kEventParamTextInputReplySLRec (out, typeIntlWritingCode)
  2504. * The ScriptLanguageRecord of the script run containing the
  2505. * character at the returned text offset and leading/trailing
  2506. * edge value. This parameter is optional and may not be
  2507. * returned to the caller.
  2508. *
  2509. * Availability:
  2510. * Mac OS X: in version 10.0 and later in Carbon.framework
  2511. * CarbonLib: in CarbonLib 1.1 and later
  2512. }
  2513. const
  2514. kEventTextInputPosToOffset = 4;
  2515. {
  2516. * kEventClassTextInput / kEventTextInputShowHideBottomWindow
  2517. *
  2518. * Summary:
  2519. * Show or hide the bottom-line input window.
  2520. *
  2521. * Discussion:
  2522. * This event is produced by input methods to control the Text
  2523. * Services Manager bottom-line input window, and is not normally
  2524. * handled by an application.
  2525. *
  2526. * Mac OS X threading:
  2527. * Not thread safe
  2528. *
  2529. * Parameters:
  2530. *
  2531. * --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
  2532. * This parameter is provided by the input method originating
  2533. * the event. (Required parameter)
  2534. *
  2535. * --> kEventParamTextInputSendRefCon (in, typeLongInteger)
  2536. * TSM's SendTextInputEvent, called by an input method,
  2537. * inserts this parameter before dispatching the event to the
  2538. * user focus. (Required Parameter)
  2539. *
  2540. * --> kEventParamTextInputSendShowHide (in, typeBoolean)
  2541. * If true, the bottomline input window should be shown; if
  2542. * false, it should be hidden. This parameter is not needed if
  2543. * the input method is simply inquiring about the state of the
  2544. * input window. This parameter is optional and may not be
  2545. * present in all instances of this event.
  2546. *
  2547. * <-- kEventParamTextInputReplyShowHide (out, typeBoolean)
  2548. * The current state of the input window: true if the window
  2549. * is shown; false if it is hidden. If the optional parameter
  2550. * kEventParamTextInputSendShowHide is included, this return
  2551. * parameter should show the state of the window before it was
  2552. * set to the state requested in the optional parameter. This
  2553. * parameter is optional and may not be returned to the caller.
  2554. *
  2555. * Availability:
  2556. * Mac OS X: in version 10.0 and later in Carbon.framework
  2557. * CarbonLib: in CarbonLib 1.1 and later
  2558. }
  2559. const
  2560. kEventTextInputShowHideBottomWindow = 5;
  2561. {
  2562. * kEventClassTextInput / kEventTextInputGetSelectedText
  2563. *
  2564. * Summary:
  2565. * Get the selected text (or the character before or after the
  2566. * insertion point, based on the leadingEdge parameter) from the
  2567. * applicationÕs text engine.
  2568. *
  2569. * Mac OS X threading:
  2570. * Not thread safe
  2571. *
  2572. * Parameters:
  2573. *
  2574. * --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
  2575. * This parameter is provided by the input method originating
  2576. * the event. (Required parameter)
  2577. *
  2578. * --> kEventParamTextInputSendRefCon (in, typeLongInteger)
  2579. * TSM's SendTextInputEvent, called by an input method,
  2580. * inserts this parameter before dispatching the event to the
  2581. * user focus. (Required Parameter)
  2582. *
  2583. * --> kEventParamTextInputSendLeadingEdge (in, typeBoolean)
  2584. * If there is a non-empty selection, this parameter should be
  2585. * ignored. When the current selection is empty, i.e. an
  2586. * insertion point, and this parameter is NOT supplied, no
  2587. * text should be returned. If the current selection is empty
  2588. * and this parameter is supplied, return the character (or
  2589. * characters) representing the glyph on the side of the
  2590. * insertion point indicated by this leadingEdge parameter.
  2591. * This value is similar to the leadingEdge parameter of the
  2592. * QuickDraw PixelToChar function. If this parameter is true,
  2593. * the character (or characters) at the insertion point is
  2594. * returned. If this parameter is false, the character (or
  2595. * characters) immediately preceding (in memory order) the
  2596. * insertion point should be returned. This parameter is
  2597. * optional and may not be present in all instances of this
  2598. * event. This parameter has no default value and no text
  2599. * should be returned when this parameter is ommited and there
  2600. * is no selected text.
  2601. *
  2602. * --> kEventParamTextInputSendTextServiceEncoding (in, typeUInt32)
  2603. * The encoding associated with the text sent by an input
  2604. * method. On MacOS X, this parameter is not commonly used
  2605. * because all TSM input methods produce (and request)
  2606. * Unicode, but if specified, this may be a Unicode variant
  2607. * encoding. In CarbonLib on MacOS, this parameter identifies
  2608. * the Mac encoding (usually an encoding variant) of the text
  2609. * produced by the input method on MacOS, where it is not a
  2610. * requirement that input methods be Unicode-savvy. On this
  2611. * platform, TSM needs the information to convert text to
  2612. * Unicode from a Mac encoding variant which cannot be derived
  2613. * from the ScriptLanguage record associated with the input
  2614. * method component. This parameter is optional and may not be
  2615. * present in all instances of this event.
  2616. *
  2617. * <-- kEventParamTextInputReplyText (out, typeUnicodeText)
  2618. * The data type of this parameter actually depends on the
  2619. * TSMDocument type created via NewTSMDocument: it should be
  2620. * typeChar for kTextService documents, or typeUnicodeText for
  2621. * kUnicodeDocument documents. This parameter is optional and
  2622. * may not be returned to the caller.
  2623. *
  2624. * <-- kEventParamTextInputReplySLRec (out, typeIntlWritingCode)
  2625. * The ScriptLanguageRecord of the script run containing the
  2626. * text being returned to an input method. This parameter is
  2627. * optional and may not be returned to the caller.
  2628. *
  2629. * <-- kEventParamTextInputReplyMacEncoding (out, typeUInt32)
  2630. * The Mac encoding (variant) associated with the text
  2631. * returned to the input method. On Mac OS X, this parameter
  2632. * may needed by TSM to convert application produced text from
  2633. * a Mac encoding to Unicodes returned to the input method.
  2634. * This parameter is optional and may not be returned to the
  2635. * caller.
  2636. *
  2637. * <-- kEventParamTextInputGlyphInfoArray (out, typeGlyphInfoArray)
  2638. * A TSMGlyphInfoArray structure in which the event handler
  2639. * can associate unencoded glyphs IDs and/or fonts with
  2640. * (sub)ranges of text it returns. The array elements
  2641. * identify non-overlapping ranges of text and the glyph ID
  2642. * (character collection is 0) such as in an OpenType font, or
  2643. * the CID (collection is non-zero) such as in TrueType fonts.
  2644. * If the glyphID itself is 0, only the font specified is to
  2645. * be applied to the text range. This is useful for
  2646. * characters in Unicode private use area. For more
  2647. * information, see the Glyph Access protocol described in
  2648. * Technote TN2079. This parameter is optional and may not be
  2649. * returned to the caller. NOTE: This parameter should really
  2650. * have been kEventParamTextInputReplyGlyphInfoArray, which
  2651. * was introduced after glyphInfo support was added to this
  2652. * event, but we can't change it now without breaking binary
  2653. * compatibility.
  2654. *
  2655. * Availability:
  2656. * Mac OS X: in version 10.0 and later in Carbon.framework
  2657. * CarbonLib: in CarbonLib 1.1 and later
  2658. }
  2659. const
  2660. kEventTextInputGetSelectedText = 6;
  2661. {
  2662. * kEventClassTextInput / kEventTextInputUnicodeText
  2663. *
  2664. * Summary:
  2665. * Used by input methods to provide original input text to the Text
  2666. * Services Manager.
  2667. *
  2668. * Discussion:
  2669. * This Unicode text event is produced only by input methods or
  2670. * other text services, and is delivered to TSM via
  2671. * SendTextInputEvent(). TSM never dispatches this event to the user
  2672. * focus, so application handlers should NOT install handlers for
  2673. * this event. Instead, TSM chains this event into any active
  2674. * keyboard input method in order to prevent interference with
  2675. * existing inline input sessions. The keyboard input method can
  2676. * either insert the text into the inline session, or it may confirm
  2677. * its session and return the UnicodeText event to TSM unhandled, in
  2678. * which case TSM will convert the event into a UnicodeForKey event
  2679. * (converting the Unicodes to Mac charCodes and synthesizing
  2680. * information where needed) and finally dispatch the resulting
  2681. * event to the user focus as usual.
  2682. *
  2683. * Mac OS X threading:
  2684. * Not thread safe
  2685. *
  2686. * Parameters:
  2687. *
  2688. * --> kEventParamTextInputSendComponentInstance (in, typeComponentInstance)
  2689. * This parameter is provided by the input method originating
  2690. * the event. (Required parameter)
  2691. *
  2692. * --> kEventParamTextInputSendSLRec (in, typeIntlWritingCode)
  2693. * The ScriptLanguageRecord associated with the text contained
  2694. * in the event. This parameter is provided by the input
  2695. * method originating the event. This parameter is optional
  2696. * and may not be present in all instances of this event.
  2697. *
  2698. * --> kEventParamTextInputSendText (in, typeUnicodeText)
  2699. * The Unicode characters produced by an input method.
  2700. * (Required Parameter)
  2701. *
  2702. * --> kEventParamTextInputSendTextServiceEncoding (in, typeUInt32)
  2703. * The encoding associated with the text sent by an input
  2704. * method. On MacOS X, this parameter is not commonly used
  2705. * because all TSM input methods produce (and request)
  2706. * Unicode, but if specified, this may be a Unicode variant
  2707. * encoding. This parameter is optional and may not be present
  2708. * in all instances of this event.
  2709. *
  2710. * --> kEventParamTextInputSendTextServiceMacEncoding (in, typeUInt32)
  2711. * The Mac encoding (variant) associated with the text sent by
  2712. * an input method, should TSM or an event handler need to
  2713. * convert the Unicodes. This parameter is optional and may
  2714. * not be present in all instances of this event.
  2715. *
  2716. * --> kEventParamTextInputSendGlyphInfoArray (in, typeGlyphInfoArray)
  2717. * A TSMGlyphInfoArray structure in which an input method can
  2718. * associate unencoded glyphs IDs and/or fonts with
  2719. * (sub)ranges of text it produces. The array elements
  2720. * identify non-overlapping ranges of text and the glyph ID
  2721. * (character collection is 0) such as in an OpenType font, or
  2722. * the CID (collection is non-zero) such as in TrueType fonts.
  2723. * If the glyphID itself is 0, only the font specified is to
  2724. * be applied to the text range. This is useful for
  2725. * characters in Unicode private use area, such as Windings,
  2726. * but note that this capability should be used with care
  2727. * because changing the font of an input text stream can lead
  2728. * to a confusing user interface. For more information, see
  2729. * the Glyph Access protocol described in Technote TN2079.
  2730. * This parameter is optional and may not be present in all
  2731. * instances of this event.
  2732. *
  2733. * Availability:
  2734. * Mac OS X: in version 10.2 and later in Carbon.framework
  2735. * CarbonLib: not available
  2736. }
  2737. const
  2738. kEventTextInputUnicodeText = 7;
  2739. {
  2740. * kEventClassTextInput / kEventTextInputFilterText
  2741. *
  2742. * Summary:
  2743. * Send text about to be inserted into the user focus to be filtered
  2744. * first.
  2745. *
  2746. * Discussion:
  2747. * Sent before any final-form text is sent to the user focus. Final
  2748. * form text includes text produced by a keyboard layout, Ink input
  2749. * method, Character palette or any other TSM text service, and any
  2750. * text being "confirmed" (or commited) from an inline input
  2751. * session. In the case of text confirmed from an inline input
  2752. * session, TSM will take the resulting text buffer filtered by the
  2753. * event handler and adjust all parameters in the
  2754. * UpdateActiveInputArea event produced by the input method. The
  2755. * text filtering action will thus be transparent to both the app's
  2756. * UpdateActiveInputArea handler and the input method confirming the
  2757. * text.
  2758. *
  2759. * Mac OS X threading:
  2760. * Not thread safe
  2761. *
  2762. * Parameters:
  2763. *
  2764. * --> kEventParamTextInputSendRefCon (in, typeLongInteger)
  2765. * TSM's SendTextInputEvent, called by an input method,
  2766. * inserts this parameter before dispatching the event to the
  2767. * user focus. (Required Parameter)
  2768. *
  2769. * --> kEventParamTextInputSendText (in, typeUnicodeText)
  2770. * The Unicode characters that are about to be sent to the
  2771. * user focus, and need to be filtered. (Required Parameter)
  2772. *
  2773. * <-- kEventParamTextInputReplyText (out, typeUnicodeText)
  2774. * The filtered Unicode characters... may be a zero-size
  2775. * parameter. (Required Parameter)
  2776. *
  2777. * Result:
  2778. * Return noErr to indicate that the text needing filtering has been
  2779. * changed, otherwise return eventNotHandledErr.
  2780. *
  2781. * Availability:
  2782. * Mac OS X: in version 10.4 and later in Carbon.framework
  2783. * CarbonLib: not available
  2784. }
  2785. const
  2786. kEventTextInputFilterText = 14;
  2787. {--------------------------------------------------------------------------------------}
  2788. { Raw Keyboard Events }
  2789. {--------------------------------------------------------------------------------------}
  2790. {
  2791. kEventClassKeyboard quick reference:
  2792. kEventRawKeyDown = 1,
  2793. kEventRawKeyRepeat = 2,
  2794. kEventRawKeyUp = 3,
  2795. kEventRawKeyModifiersChanged = 4,
  2796. kEventHotKeyPressed = 5,
  2797. kEventHotKeyReleased = 6
  2798. );
  2799. |*!
  2800. @event kEventRawKeyDown
  2801. @abstract A key was pressed.
  2802. @discussion This is the lowest-level keyboard input event. When this event is sent, the keyboard
  2803. input has not yet been processed by the Text Services Manager or passed to input methods.
  2804. Usually, you should not handle this event, because doing so may interfere with input
  2805. methods; instead, you should handle the kEventTextInputUnicodeForKeyEvent event, which
  2806. is sent after input methods have handled the raw key event, and contains both Unicode
  2807. and the original keyboard event.
  2808. This event has a default handler on the application event target. The default handler
  2809. calls the Text Services Manager to pass the event through to input methods. The default
  2810. handler also implements certain standard keyboard equivalents, such as cmd-` for intra-
  2811. process window rotation and the universal keyboard access equivalents for interprocess
  2812. window rotation and document, floating, toolbar, and menubar keyboard focus.
  2813. @param kEventParamKeyMacCharCodes
  2814. The character generated by the key that was pressed. The characterÕs encoding
  2815. is determined by the current keyboard script.
  2816. @param kEventParamKeyCode
  2817. The virtual keycode of the key that was pressed.
  2818. @param kEventParamKeyModifiers
  2819. The keyboard modifiers that were down when the key was pressed.
  2820. @param kEventParamKeyboardType
  2821. The type of keyboard on which the key was pressed.
  2822. }
  2823. {
  2824. * kEventClassKeyboard / kEventRawKeyDown
  2825. *
  2826. * Mac OS X threading:
  2827. * Not thread safe
  2828. *
  2829. * Availability:
  2830. * Mac OS X: in version 10.0 and later in Carbon.framework
  2831. * CarbonLib: in CarbonLib 1.1 and later
  2832. }
  2833. const
  2834. kEventRawKeyDown = 1;
  2835. {
  2836. * kEventClassKeyboard / kEventRawKeyRepeat
  2837. *
  2838. * Summary:
  2839. * Sent periodically as a key is held down by the user.
  2840. *
  2841. * Discussion:
  2842. * Usually, you should not handle this event, because doing so may
  2843. * interfere with input methods; instead, you should handle the
  2844. * kEventTextInputUnicodeForKeyEvent event, which is sent after
  2845. * input methods have handled the raw key event, and contains both
  2846. * Unicode and the original keyboard event.
  2847. *
  2848. * Mac OS X threading:
  2849. * Not thread safe
  2850. *
  2851. * Parameters:
  2852. *
  2853. * --> kEventParamKeyMacCharCodes (in, typeChar)
  2854. * The character generated by the key that was pressed. The
  2855. * characterÕs encoding is determined by the current keyboard
  2856. * script.
  2857. *
  2858. * --> kEventParamKeyCode (in, typeUInt32)
  2859. * The virtual keycode of the key that was pressed.
  2860. *
  2861. * --> kEventParamKeyModifiers (in, typeUInt32)
  2862. * The keyboard modifiers that were down when the key was
  2863. * pressed.
  2864. *
  2865. * --> kEventParamKeyboardType (in, typeUInt32)
  2866. * The type of keyboard on which the key was pressed.
  2867. *
  2868. * Availability:
  2869. * Mac OS X: in version 10.0 and later in Carbon.framework
  2870. * CarbonLib: in CarbonLib 1.1 and later
  2871. }
  2872. const
  2873. kEventRawKeyRepeat = 2;
  2874. {
  2875. * kEventClassKeyboard / kEventRawKeyUp
  2876. *
  2877. * Summary:
  2878. * A key was released.
  2879. *
  2880. * Mac OS X threading:
  2881. * Not thread safe
  2882. *
  2883. * Parameters:
  2884. *
  2885. * --> kEventParamKeyMacCharCodes (in, typeChar)
  2886. * The character generated by the key that was released. The
  2887. * characterÕs encoding is determined by the current keyboard
  2888. * script.
  2889. *
  2890. * --> kEventParamKeyCode (in, typeUInt32)
  2891. * The virtual keycode of the key that was released.
  2892. *
  2893. * --> kEventParamKeyModifiers (in, typeUInt32)
  2894. * The keyboard modifiers that were down when the key was
  2895. * released.
  2896. *
  2897. * --> kEventParamKeyboardType (in, typeUInt32)
  2898. * The type of keyboard on which the key was released.
  2899. *
  2900. * Availability:
  2901. * Mac OS X: in version 10.0 and later in Carbon.framework
  2902. * CarbonLib: in CarbonLib 1.1 and later
  2903. }
  2904. const
  2905. kEventRawKeyUp = 3;
  2906. {
  2907. * kEventClassKeyboard / kEventRawKeyModifiersChanged
  2908. *
  2909. * Summary:
  2910. * The keyboard modifiers have changed.
  2911. *
  2912. * Discussion:
  2913. * This event is sent to all handlers registered for it.
  2914. *
  2915. * Mac OS X threading:
  2916. * Not thread safe
  2917. *
  2918. * Parameters:
  2919. *
  2920. * --> kEventParamKeyModifiers (in, typeUInt32)
  2921. * The keyboard modifiers that are now pressed. This is the
  2922. * current state of the modifiers, not a delta state; it
  2923. * includes modifiers that were pressed before the latest
  2924. * change to modifier state.
  2925. *
  2926. * Availability:
  2927. * Mac OS X: in version 10.0 and later in Carbon.framework
  2928. * CarbonLib: in CarbonLib 1.1 and later
  2929. }
  2930. const
  2931. kEventRawKeyModifiersChanged = 4;
  2932. {
  2933. * kEventClassKeyboard / kEventHotKeyPressed
  2934. *
  2935. * Summary:
  2936. * A registered hot key was pressed.
  2937. *
  2938. * Mac OS X threading:
  2939. * Not thread safe
  2940. *
  2941. * Parameters:
  2942. *
  2943. * --> kEventParamDirectObject (in, typeEventHotKeyID)
  2944. * The ID of the hot key that was pressed.
  2945. *
  2946. * Availability:
  2947. * Mac OS X: in version 10.0 and later in Carbon.framework
  2948. * CarbonLib: in CarbonLib 1.3 and later
  2949. }
  2950. const
  2951. kEventHotKeyPressed = 5;
  2952. {
  2953. * kEventClassKeyboard / kEventHotKeyReleased
  2954. *
  2955. * Summary:
  2956. * A registered hot key was released.
  2957. *
  2958. * Mac OS X threading:
  2959. * Not thread safe
  2960. *
  2961. * Parameters:
  2962. *
  2963. * --> kEventParamDirectObject (in, typeEventHotKeyID)
  2964. * The ID of the hot key that was released.
  2965. *
  2966. * Availability:
  2967. * Mac OS X: in version 10.0 and later in Carbon.framework
  2968. * CarbonLib: in CarbonLib 1.3 and later
  2969. }
  2970. const
  2971. kEventHotKeyReleased = 6;
  2972. {
  2973. * Summary:
  2974. * Key modifier change event bits and masks
  2975. *
  2976. * Discussion:
  2977. * From bit 8, cmdKeyBit, to bit 15, rightControlKeyBit, are
  2978. * compatible with Event Manager modifiers.
  2979. }
  2980. const
  2981. {
  2982. * The Num Lock state bit (Mac OS X only).
  2983. }
  2984. kEventKeyModifierNumLockBit = 16; { Num Lock is on? (Mac OS X only)}
  2985. {
  2986. * The Fn key state bit (Mac OS X only).
  2987. }
  2988. kEventKeyModifierFnBit = 17; { Fn key is down? (Mac OS X only)}
  2989. const
  2990. kEventKeyModifierNumLockMask = 1 shl kEventKeyModifierNumLockBit;
  2991. kEventKeyModifierFnMask = 1 shl kEventKeyModifierFnBit;
  2992. {--------------------------------------------------------------------------------------}
  2993. { Application Events }
  2994. {--------------------------------------------------------------------------------------}
  2995. {
  2996. kEventClassApplication quick reference:
  2997. kEventAppActivated = 1,
  2998. kEventAppDeactivated = 2,
  2999. kEventAppQuit = 3,
  3000. kEventAppLaunchNotification = 4,
  3001. kEventAppLaunched = 5,
  3002. kEventAppTerminated = 6,
  3003. kEventAppFrontSwitched = 7,
  3004. kEventAppFocusMenuBar = 8,
  3005. kEventAppFocusNextDocumentWindow = 9,
  3006. kEventAppFocusNextFloatingWindow = 10,
  3007. kEventAppFocusToolbar = 11,
  3008. kEventAppFocusDrawer = 12,
  3009. kEventAppGetDockTileMenu = 20,
  3010. kEventAppIsEventInInstantMouser = 104,
  3011. kEventAppHidden = 107,
  3012. kEventAppShown = 108,
  3013. kEventAppSystemUIModeChanged = 109,
  3014. kEventAppAvailableWindowBoundsChanged = 110,
  3015. kEventAppActiveWindowChanged = 111
  3016. }
  3017. {
  3018. * kEventClassApplication / kEventAppActivated
  3019. *
  3020. * Summary:
  3021. * This application has been activated.
  3022. *
  3023. * Discussion:
  3024. * This event is sent to all handlers registered for it.
  3025. *
  3026. * Mac OS X threading:
  3027. * Not thread safe
  3028. *
  3029. * Parameters:
  3030. *
  3031. * --> kEventParamWindowRef (in, typeWindowRef)
  3032. * This parameter is present if a click on an application
  3033. * window was the cause of the app activation; it contains the
  3034. * window that was clicked. This parameter is not provided if
  3035. * the application was activated for some other reason.
  3036. *
  3037. * Availability:
  3038. * Mac OS X: in version 10.0 and later in Carbon.framework
  3039. * CarbonLib: in CarbonLib 1.1 and later
  3040. }
  3041. const
  3042. kEventAppActivated = 1;
  3043. {
  3044. * kEventClassApplication / kEventAppDeactivated
  3045. *
  3046. * Summary:
  3047. * This application has been deactivated.
  3048. *
  3049. * Discussion:
  3050. * This event is sent to all handlers registered for it.
  3051. *
  3052. * Mac OS X threading:
  3053. * Not thread safe
  3054. *
  3055. * Availability:
  3056. * Mac OS X: in version 10.0 and later in Carbon.framework
  3057. * CarbonLib: in CarbonLib 1.1 and later
  3058. }
  3059. const
  3060. kEventAppDeactivated = 2;
  3061. {
  3062. * kEventClassApplication / kEventAppQuit
  3063. *
  3064. * Summary:
  3065. * A request to quit. Sent by QuitApplicationEventLoop to the
  3066. * application target.
  3067. *
  3068. * Discussion:
  3069. * The RunApplicationEventLoop API installs a default handler on the
  3070. * application target for this event while the event loop is
  3071. * running. The handler is removed before RunApplicationEventLoop
  3072. * returns.
  3073. *
  3074. * The event handler installed by RunApplicationEventLoop will cause
  3075. * RunApplicationEventLoop to exit. Most applications will not need
  3076. * to handle this event; instead, an application should install an
  3077. * AppleEvent handler for the kAEQuitApplication event handler if it
  3078. * needs to check for unsaved documents or do other cleanup before
  3079. * quitting.
  3080. *
  3081. * Mac OS X threading:
  3082. * Not thread safe
  3083. *
  3084. * Availability:
  3085. * Mac OS X: in version 10.0 and later in Carbon.framework
  3086. * CarbonLib: in CarbonLib 1.1 and later
  3087. }
  3088. const
  3089. kEventAppQuit = 3;
  3090. {
  3091. * kEventClassApplication / kEventAppLaunchNotification
  3092. *
  3093. * Summary:
  3094. * Notification that an asynchronous process launch has completed.
  3095. *
  3096. * Discussion:
  3097. * This event is received when you use LaunchServices to launch a
  3098. * process asynchronously. Your application only receives this event
  3099. * for processes that you launch; it is not sent for process
  3100. * launches from other applications (such as the Finder).
  3101. *
  3102. * Mac OS X threading:
  3103. * Not thread safe
  3104. *
  3105. * Parameters:
  3106. *
  3107. * --> kEventParamProcessID (in, typeProcessSerialNumber)
  3108. * The ProcessSerialNumber of the process that was launched.
  3109. *
  3110. * --> kEventParamLaunchRefCon (in, typeUInt32)
  3111. * Contains the value in the asyncRefCon field of the LSLaunch
  3112. * structure that was used to launch the process.
  3113. *
  3114. * --> kEventParamLaunchErr (in, typeOSStatus)
  3115. * A result code indicating success or failure of the launch.
  3116. *
  3117. * Availability:
  3118. * Mac OS X: in version 10.0 and later in Carbon.framework
  3119. * CarbonLib: not available
  3120. }
  3121. const
  3122. kEventAppLaunchNotification = 4;
  3123. {
  3124. * kEventClassApplication / kEventAppLaunched
  3125. *
  3126. * Summary:
  3127. * Another app was launched.
  3128. *
  3129. * Discussion:
  3130. * This event is sent to all handlers registered for it.
  3131. *
  3132. * Mac OS X threading:
  3133. * Not thread safe
  3134. *
  3135. * Parameters:
  3136. *
  3137. * --> kEventParamProcessID (in, typeProcessSerialNumber)
  3138. * The ProcessSerialNumber of the process that was launched.
  3139. *
  3140. * Availability:
  3141. * Mac OS X: in version 10.0 and later in Carbon.framework
  3142. * CarbonLib: in CarbonLib 1.3.1 and later
  3143. }
  3144. const
  3145. kEventAppLaunched = 5;
  3146. {
  3147. * kEventClassApplication / kEventAppTerminated
  3148. *
  3149. * Summary:
  3150. * Another app terminated.
  3151. *
  3152. * Discussion:
  3153. * This event is sent to all handlers registered for it.
  3154. *
  3155. * Mac OS X threading:
  3156. * Not thread safe
  3157. *
  3158. * Parameters:
  3159. *
  3160. * --> kEventParamProcessID (in, typeProcessSerialNumber)
  3161. * The ProcessSerialNumber of the process that terminated.
  3162. *
  3163. * Availability:
  3164. * Mac OS X: in version 10.0 and later in Carbon.framework
  3165. * CarbonLib: in CarbonLib 1.3.1 and later
  3166. }
  3167. const
  3168. kEventAppTerminated = 6;
  3169. {
  3170. * kEventClassApplication / kEventAppFrontSwitched
  3171. *
  3172. * Summary:
  3173. * The front (active) application has changed.
  3174. *
  3175. * Discussion:
  3176. * This event is sent to all handlers registered for it.
  3177. *
  3178. * Mac OS X threading:
  3179. * Not thread safe
  3180. *
  3181. * Parameters:
  3182. *
  3183. * --> kEventParamProcessID (in, typeProcessSerialNumber)
  3184. * The ProcessSerialNumber of the process that became
  3185. * frontmost.
  3186. *
  3187. * Availability:
  3188. * Mac OS X: in version 10.0 and later in Carbon.framework
  3189. * CarbonLib: in CarbonLib 1.3.1 and later
  3190. }
  3191. const
  3192. kEventAppFrontSwitched = 7;
  3193. {
  3194. * kEventClassApplication / kEventAppHidden
  3195. *
  3196. * Summary:
  3197. * The current application has been hidden.
  3198. *
  3199. * Discussion:
  3200. * This event is sent to all handlers registered for it.
  3201. *
  3202. * Mac OS X threading:
  3203. * Not thread safe
  3204. *
  3205. * Availability:
  3206. * Mac OS X: in version 10.2 and later in Carbon.framework
  3207. * CarbonLib: not available
  3208. }
  3209. const
  3210. kEventAppHidden = 107;
  3211. {
  3212. * kEventClassApplication / kEventAppShown
  3213. *
  3214. * Summary:
  3215. * The current application has been shown.
  3216. *
  3217. * Discussion:
  3218. * This event is sent to all handlers registered for it.
  3219. *
  3220. * Mac OS X threading:
  3221. * Not thread safe
  3222. *
  3223. * Availability:
  3224. * Mac OS X: in version 10.2 and later in Carbon.framework
  3225. * CarbonLib: not available
  3226. }
  3227. const
  3228. kEventAppShown = 108;
  3229. {
  3230. * kEventClassApplication / kEventAppSystemUIModeChanged
  3231. *
  3232. * Summary:
  3233. * The system UI mode of the frontmost application has changed.
  3234. *
  3235. * Discussion:
  3236. * This event is sent to all handlers registered for it.
  3237. *
  3238. * Mac OS X threading:
  3239. * Not thread safe
  3240. *
  3241. * Parameters:
  3242. *
  3243. * --> kEventParamSystemUIMode (in, typeUInt32)
  3244. * The new system UI mode. Contains a kUIMode constant from
  3245. * MacApplication.h.
  3246. *
  3247. * Availability:
  3248. * Mac OS X: in version 10.2 and later in Carbon.framework
  3249. * CarbonLib: not available
  3250. }
  3251. const
  3252. kEventAppSystemUIModeChanged = 109;
  3253. const
  3254. {
  3255. * Indicates that a deviceÕs available window positioning bounds have
  3256. * changed because of a change in Dock position or size.
  3257. }
  3258. kAvailBoundsChangedForDock = 1 shl 0;
  3259. {
  3260. * Indicates that a deviceÕs available window positioning bounds have
  3261. * changed because of a change in display configuration.
  3262. }
  3263. kAvailBoundsChangedForDisplay = 1 shl 1;
  3264. {
  3265. * kEventClassApplication / kEventAppAvailableWindowBoundsChanged
  3266. *
  3267. * Summary:
  3268. * The available window positioning bounds have changed.
  3269. *
  3270. * Discussion:
  3271. * This event is sent to all handlers registered for it.
  3272. *
  3273. * This event is currently sent in two circumstances: when the Dock
  3274. * has changed position or size, and when the display configuration
  3275. * has changed. A separate copy of this event is sent to each
  3276. * affected GDevice.
  3277. *
  3278. * All applications have a default handler installed on the
  3279. * application target that responds to this event by sending
  3280. * kEventWindowConstrain events to each window on the specified
  3281. * device. It is not possible to prevent this handler from running,
  3282. * since this event is sent to all registered handlers. However,
  3283. * applications that would like to do their own window layout may
  3284. * install a handler for this event, and also set the
  3285. * kWindowNoConstrainAttribute on their windows, which will cause
  3286. * the basic window handler to ignore kEventWindowConstrain. An
  3287. * application may also install its own kEventWindowConstrain
  3288. * handler and selectively return a value other than
  3289. * eventNotHandledErr, which will prevent the event from being sent
  3290. * to the basic window handler.
  3291. *
  3292. * Mac OS X threading:
  3293. * Not thread safe
  3294. *
  3295. * Parameters:
  3296. *
  3297. * --> kEventParamGDevice (in, typeGDHandle)
  3298. * The device whose available positioning bounds have changed.
  3299. *
  3300. * --> kEventParamReason (in, typeUInt32)
  3301. * The reasons why the available positioning bounds have
  3302. * changed. This parameter contains one or more of the
  3303. * kAvailBoundsChangedFor constants.
  3304. *
  3305. * --> kEventParamTransactionID (in, typeUInt32)
  3306. * An integer which is the same for all instances of this
  3307. * event that are produced by the same configuration change.
  3308. * For example, if multiple displays are attached, then this
  3309. * event is sent once for each display after a display
  3310. * configuration change; however, the transaction ID parameter
  3311. * will the same for each event, so a handler for this event
  3312. * can choose to ignore all but the first event by correlating
  3313. * the the transaction IDs.
  3314. *
  3315. * --> kEventParamPreviousDockRect (in, typeHIRect)
  3316. * The DockÕs previous bounds, in global coordinates. This
  3317. * parameter is optional and may not be present in all
  3318. * instances of this event. It is present in events with a
  3319. * kEventParamReason parameter containing
  3320. * kAvailBoundsChangedForDock.
  3321. *
  3322. * --> kEventParamPreviousDockDevice (in, typeGDHandle)
  3323. * The GDevice on which the Dock was previously positioned.
  3324. * This parameter is optional and may not be present in all
  3325. * instances of this event. It is present in events with a
  3326. * kEventParamReason parameter containing
  3327. * kAvailBoundsChangedForDock.
  3328. *
  3329. * --> kEventParamCurrentDockRect (in, typeHIRect)
  3330. * The DockÕs current bounds, in global coordinates. This
  3331. * parameter is optional and may not be present in all
  3332. * instances of this event. It is present in events with a
  3333. * kEventParamReason parameter containing
  3334. * kAvailBoundsChangedForDock.
  3335. *
  3336. * --> kEventParamCurrentDockDevice (in, typeGDHandle)
  3337. * The GDevice on which the Dock is currently positioned. This
  3338. * parameter is optional and may not be present in all
  3339. * instances of this event. It is present in events with a
  3340. * kEventParamReason parameter containing
  3341. * kAvailBoundsChangedForDock.
  3342. *
  3343. * --> kEventParamRgnHandle (in, typeQDRgnHandle)
  3344. * The GrayRgn before the configuration change. This parameter
  3345. * is optional and may not be present in all instances of this
  3346. * event. It is present in events with a kEventParamReason
  3347. * parameter containing kAvailBoundsChangedForDisplay. To get
  3348. * the GrayRgn after the configuration change, just call the
  3349. * GetGrayRgn API.
  3350. *
  3351. * Availability:
  3352. * Mac OS X: in version 10.3 and later in Carbon.framework
  3353. * CarbonLib: not available
  3354. }
  3355. const
  3356. kEventAppAvailableWindowBoundsChanged = 110;
  3357. {
  3358. * kEventClassApplication / kEventAppActiveWindowChanged
  3359. *
  3360. * Summary:
  3361. * Notification that the active window in the current process has
  3362. * changed.
  3363. *
  3364. * Discussion:
  3365. * The Window Manager internally tracks the active window, which is
  3366. * the window that is returned by ActiveNonFloatingWindow. When
  3367. * SelectWindow is called on a window, that window is made the new
  3368. * active window. At that time, the Window Manager also posts a
  3369. * kEventAppActiveWindowChanged event to the main event
  3370. * queue.
  3371. *
  3372. * The ActivateWindow API also causes this event to be
  3373. * posted.
  3374. *
  3375. * If more than one window is activated sequentially before the
  3376. * event loop is run, only a single kEventAppActiveWindowChanged
  3377. * event will be left in the event queue, its PreviousActiveWindow
  3378. * parameter will be the window that was originally active, and its
  3379. * CurrentActiveWindow parameter will be the window that was finally
  3380. * active.
  3381. *
  3382. * This event only reports changes to the current process. It does
  3383. * not report activation changes in other processes.
  3384. * <BR> This event is sent to all handlers registered for it.
  3385. *
  3386. * Mac OS X threading:
  3387. * Not thread safe
  3388. *
  3389. * Parameters:
  3390. *
  3391. * --> kEventParamPreviousWindow (in, typeWindowRef)
  3392. * The window that was previously active.
  3393. *
  3394. * --> kEventParamCurrentWindow (in, typeWindowRef)
  3395. * The window that is now active.
  3396. *
  3397. * Availability:
  3398. * Mac OS X: in version 10.3 and later in Carbon.framework
  3399. * CarbonLib: not available
  3400. }
  3401. const
  3402. kEventAppActiveWindowChanged = 111;
  3403. {
  3404. * kEventClassApplication / kEventAppGetDockTileMenu
  3405. *
  3406. * Summary:
  3407. * A request for a menu to be displayed by the applicationÕs dock
  3408. * tile.
  3409. *
  3410. * Discussion:
  3411. * This event has a default handler on the application target. The
  3412. * default handler will return the menu, if any, that was provided
  3413. * by the SetApplicationDockTileMenu API. The sender of this event
  3414. * will release the menu after the Dock has displayed it, so if you
  3415. * return a permanently allocated MenuRef, you should call
  3416. * RetainMenu on it before returning from your event handler. For
  3417. * most applications, it will be easier to use the
  3418. * SetApplicationDockTileMenu API directly rather than installing a
  3419. * handler for this event.
  3420. *
  3421. * Mac OS X threading:
  3422. * Not thread safe
  3423. *
  3424. * Parameters:
  3425. *
  3426. * <-- kEventParamMenuRef (out, typeMenuRef)
  3427. * A MenuRef to be displayed in the Dock is returned by the
  3428. * handler in this parameter.
  3429. *
  3430. * Availability:
  3431. * Mac OS X: in version 10.1 and later in Carbon.framework
  3432. * CarbonLib: not available
  3433. }
  3434. const
  3435. kEventAppGetDockTileMenu = 20;
  3436. {
  3437. * kEventClassApplication / kEventAppFocusMenuBar
  3438. *
  3439. * Summary:
  3440. * The user has requested keyboard focus on the menubar.
  3441. *
  3442. * Discussion:
  3443. * This event is handled automatically by the default application
  3444. * event handler. A handler for this event should switch the
  3445. * keyboard focus to the menubar. Applications may install handlers
  3446. * for this event to track keyboard focus, but should not prevent
  3447. * the event from being handled by the default application handler.
  3448. *
  3449. * Mac OS X threading:
  3450. * Not thread safe
  3451. *
  3452. * Parameters:
  3453. *
  3454. * --> kEventParamKeyModifiers (in, typeUInt32)
  3455. * The keyboard modifiers that were pressed when the user
  3456. * requested a focus switch.
  3457. *
  3458. * Availability:
  3459. * Mac OS X: in version 10.2 and later in Carbon.framework
  3460. * CarbonLib: not available
  3461. }
  3462. const
  3463. kEventAppFocusMenuBar = 8;
  3464. {
  3465. * kEventClassApplication / kEventAppFocusNextDocumentWindow
  3466. *
  3467. * Summary:
  3468. * The user has requested keyboard focus on a document window.
  3469. *
  3470. * Discussion:
  3471. * This event is handled automatically by the default application
  3472. * event handler. A handler for this event should cycle to the next
  3473. * (or previous, if the shift key is down) document window, or if
  3474. * there are no more windows to activate in the applicationÕs window
  3475. * list, to the next or previous document window in the next or
  3476. * previous process. User focus (see SetUserFocusWindow) should be
  3477. * applied to the new front document window. If something other than
  3478. * a document window has the focus at the time you receive this
  3479. * event, the frontmost document window should be given the user
  3480. * focus instead, and no z-order change should be made.
  3481. * Additionally, the keyboard focus should be moved to the main
  3482. * control in the newly focused window if no keyboard focus exists
  3483. * within the window.
  3484. *
  3485. * A handler for this event should never override it entirely; if
  3486. * necessary, it should only check if the user focus is somewhere
  3487. * other than a document window, and if so, set the focus on the
  3488. * active document window. If the focus is already on a document
  3489. * window, a handler for this event should always return
  3490. * eventNotHandledErr so that the default handler can rotate to the
  3491. * next window across all processes.
  3492. *
  3493. * Mac OS X threading:
  3494. * Not thread safe
  3495. *
  3496. * Parameters:
  3497. *
  3498. * --> kEventParamKeyModifiers (in, typeUInt32)
  3499. * The keyboard modifiers that were pressed when the user
  3500. * requested a focus switch.
  3501. *
  3502. * Availability:
  3503. * Mac OS X: in version 10.2 and later in Carbon.framework
  3504. * CarbonLib: not available
  3505. }
  3506. const
  3507. kEventAppFocusNextDocumentWindow = 9;
  3508. {
  3509. * kEventClassApplication / kEventAppFocusNextFloatingWindow
  3510. *
  3511. * Summary:
  3512. * The user has requested keyboard focus on a floating window.
  3513. *
  3514. * Discussion:
  3515. * This event is handled automatically by the default application
  3516. * event handler. A handler for this event should cycle to the next
  3517. * (or previous, if the shift key is down) floating window in the
  3518. * application. User focus (see SetUserFocusWindow) should be
  3519. * applied to the new front floating window. If something other than
  3520. * a floating window has the focus at the time you receive this
  3521. * event, the frontmost floating window should be given the user
  3522. * focus instead, and no z-order change should be made.
  3523. * Additionally, the keyboard focus should be moved to the main
  3524. * control in the newly focused window if no keyboard focus exists
  3525. * within the window. The default handler sends a
  3526. * kEventCommandProcess event containing
  3527. * kHICommandRotateFloatingWindowsForward/Backward when it detects
  3528. * that floating windows should be cycled.
  3529. *
  3530. * Mac OS X threading:
  3531. * Not thread safe
  3532. *
  3533. * Parameters:
  3534. *
  3535. * --> kEventParamKeyModifiers (in, typeUInt32)
  3536. * The keyboard modifiers that were pressed when the user
  3537. * requested a focus switch.
  3538. *
  3539. * Availability:
  3540. * Mac OS X: in version 10.2 and later in Carbon.framework
  3541. * CarbonLib: not available
  3542. }
  3543. const
  3544. kEventAppFocusNextFloatingWindow = 10;
  3545. {
  3546. * kEventClassApplication / kEventAppFocusToolbar
  3547. *
  3548. * Summary:
  3549. * The user has requested keyboard focus on the toolbar in the
  3550. * focused window.
  3551. *
  3552. * Discussion:
  3553. * For windows that use the standard HIToolbar control, this event
  3554. * is handled automatically by the default application event
  3555. * handler. A handler for this event should put focus on the first
  3556. * control in the toolbar in the focused window, if a toolbar is
  3557. * present.
  3558. *
  3559. * Mac OS X threading:
  3560. * Not thread safe
  3561. *
  3562. * Parameters:
  3563. *
  3564. * --> kEventParamKeyModifiers (in, typeUInt32)
  3565. * The keyboard modifiers that were pressed when the user
  3566. * requested a focus switch.
  3567. *
  3568. * Availability:
  3569. * Mac OS X: in version 10.2 and later in Carbon.framework
  3570. * CarbonLib: not available
  3571. }
  3572. const
  3573. kEventAppFocusToolbar = 11;
  3574. {
  3575. * kEventClassApplication / kEventAppFocusDrawer
  3576. *
  3577. * Summary:
  3578. * The user has requested keyboard focus on the drawer in the
  3579. * focused window.
  3580. *
  3581. * Discussion:
  3582. * This event is handled automatically by the default application
  3583. * event handler. A handler for this event should put focus on the
  3584. * first control in the drawer in the focused window, if a drawer is
  3585. * present. If multiple drawers are present, focus is moved in
  3586. * clockwise order from one drawer to the next, starting with the
  3587. * top drawer, if any. If the modifiers parameter contains the shift
  3588. * key, then focus should be moved in reverse (counterclockwise)
  3589. * order.
  3590. *
  3591. * Mac OS X threading:
  3592. * Not thread safe
  3593. *
  3594. * Parameters:
  3595. *
  3596. * --> kEventParamKeyModifiers (in, typeUInt32)
  3597. * The keyboard modifiers that were pressed when the user
  3598. * requested a focus switch.
  3599. *
  3600. * Availability:
  3601. * Mac OS X: in version 10.4 and later in Carbon.framework
  3602. * CarbonLib: not available
  3603. }
  3604. const
  3605. kEventAppFocusDrawer = 12;
  3606. {
  3607. * kEventClassApplication / kEventAppIsEventInInstantMouser
  3608. *
  3609. * Summary:
  3610. * Sent when the system needs to determine if the given event's
  3611. * global mouse location is over an "instant mousing" area. An
  3612. * instant mousing area is an area where a mouse down should not
  3613. * generate ink, but should only be interpreted as a click.
  3614. *
  3615. * Mac OS X threading:
  3616. * Not thread safe
  3617. *
  3618. * Parameters:
  3619. *
  3620. * --> kEventParamEventRef (in, typeEventRef)
  3621. * The Event to check.
  3622. *
  3623. * <-- kEventParamIsInInstantMouser (out, typeBoolean)
  3624. * True if event was in an "instant mousing" area, false
  3625. * otherwise.
  3626. *
  3627. * Availability:
  3628. * Mac OS X: in version 10.2 and later in Carbon.framework
  3629. * CarbonLib: not available
  3630. }
  3631. const
  3632. kEventAppIsEventInInstantMouser = 104;
  3633. {--------------------------------------------------------------------------------------}
  3634. { Apple Events }
  3635. {--------------------------------------------------------------------------------------}
  3636. {
  3637. kEventClassAppleEvent quick reference:
  3638. kEventAppleEvent = 1
  3639. }
  3640. {
  3641. * kEventClassAppleEvent / kEventAppleEvent
  3642. *
  3643. * Summary:
  3644. * Sent when a high-level event is received.
  3645. *
  3646. * Discussion:
  3647. * The RunApplicationEventLoop API installs a default handler on the
  3648. * application target for this event while the event loop is
  3649. * running. The handler is removed before RunApplicationEventLoop
  3650. * returns.
  3651. *
  3652. * The handler installed by RunApplicationEventLoop will call
  3653. * AEProcessAppleEvent.
  3654. *
  3655. * It is not possible to get the AppleEvent itself from this Carbon
  3656. * event; only its event class and kind are available. To inspect
  3657. * the AppleEvent parameters, the event must actually be dispatched
  3658. * using AEProcessAppleEvent.
  3659. *
  3660. * If you need to handle this Carbon event yourself, the necessary
  3661. * steps are: (1) remove the Carbon event from the queue. The
  3662. * AppleEvent requires some special preparation before it can be
  3663. * processed, and this preparation only occurs when the event is
  3664. * dequeued. (2) Use ConvertEventRefToEventRecord to get an
  3665. * EventRecord from the Carbon event. (3) Call AEProcessAppleEvent
  3666. * on the EventRecord.
  3667. *
  3668. * Mac OS X threading:
  3669. * Not thread safe
  3670. *
  3671. * Parameters:
  3672. *
  3673. * --> kEventParamAEEventClass (in, typeType)
  3674. * The event class of the Apple event.
  3675. *
  3676. * --> kEventParamAEEventID (in, typeType)
  3677. * The event ID of the Apple event.
  3678. *
  3679. * Availability:
  3680. * Mac OS X: in version 10.0 and later in Carbon.framework
  3681. * CarbonLib: in CarbonLib 1.1 and later
  3682. }
  3683. const
  3684. kEventAppleEvent = 1;
  3685. {--------------------------------------------------------------------------------------}
  3686. { Window Events }
  3687. {--------------------------------------------------------------------------------------}
  3688. {
  3689. kEventClassWindow quick reference:
  3690. -- window refresh events --
  3691. kEventWindowUpdate = 1,
  3692. kEventWindowDrawContent = 2,
  3693. -- window activation events --
  3694. kEventWindowActivated = 5,
  3695. kEventWindowDeactivated = 6,
  3696. kEventWindowHandleActivate = 91,
  3697. kEventWindowHandleDeactivate = 92,
  3698. kEventWindowGetClickActivation = 7,
  3699. kEventWindowGetClickModality = 8,
  3700. -- window state change events --
  3701. kEventWindowShowing = 22,
  3702. kEventWindowHiding = 23,
  3703. kEventWindowShown = 24,
  3704. kEventWindowHidden = 25,
  3705. kEventWindowCollapsing = 86,
  3706. kEventWindowCollapsed = 67,
  3707. kEventWindowExpanding = 87,
  3708. kEventWindowExpanded = 70,
  3709. kEventWindowZoomed = 76,
  3710. kEventWindowBoundsChanging = 26,
  3711. kEventWindowBoundsChanged = 27,
  3712. kEventWindowResizeStarted = 28,
  3713. kEventWindowResizeCompleted = 29,
  3714. kEventWindowDragStarted = 30,
  3715. kEventWindowDragCompleted = 31,
  3716. kEventWindowClosed = 73,
  3717. kEventWindowTransitionStarted = 88,
  3718. kEventWindowTransitionCompleted = 89,
  3719. -- window click events --
  3720. kEventWindowClickDragRgn = 32,
  3721. kEventWindowClickResizeRgn = 33,
  3722. kEventWindowClickCollapseRgn = 34,
  3723. kEventWindowClickCloseRgn = 35,
  3724. kEventWindowClickZoomRgn = 36,
  3725. kEventWindowClickContentRgn = 37,
  3726. kEventWindowClickProxyIconRgn = 38,
  3727. kEventWindowClickToolbarButtonRgn = 41,
  3728. kEventWindowClickStructureRgn = 42,
  3729. -- window cursor change events --
  3730. kEventWindowCursorChange = 40,
  3731. -- window action events --
  3732. kEventWindowCollapse = 66,
  3733. %% kEventWindowCollapsed = 67,
  3734. kEventWindowCollapseAll = 68,
  3735. kEventWindowExpand = 69,
  3736. %% kEventWindowExpanded = 70,
  3737. kEventWindowExpandAll = 71,
  3738. kEventWindowClose = 72,
  3739. %% kEventWindowClosed = 73,
  3740. kEventWindowCloseAll = 74,
  3741. kEventWindowZoom = 75,
  3742. %% kEventWindowZoomed = 76,
  3743. kEventWindowZoomAll = 77,
  3744. kEventWindowContextualMenuSelect = 78,
  3745. kEventWindowPathSelect = 79,
  3746. kEventWindowGetIdealSize = 80,
  3747. kEventWindowGetMinimumSize = 81,
  3748. kEventWindowGetMaximumSize = 82,
  3749. kEventWindowConstrain = 83,
  3750. kEventWindowHandleContentClick = 85,
  3751. %% kEventWindowCollapsing = 86,
  3752. %% kEventWindowExpanding = 87,
  3753. %% kEventWindowTransitionStarted = 88,
  3754. %% kEventWindowTransitionCompleted = 89,
  3755. kEventWindowGetDockTileMenu = 90,
  3756. %% kEventWindowHandleActivate = 91,
  3757. %% kEventWindowHandleDeactivate = 92,
  3758. kEventWindowProxyBeginDrag = 128,
  3759. kEventWindowProxyEndDrag = 129,
  3760. kEventWindowToolbarSwitchMode = 150,
  3761. -- window focus events --
  3762. kEventWindowFocusAcquired = 200,
  3763. kEventWindowFocusRelinquish = 201,
  3764. kEventWindowFocusContent = 202,
  3765. kEventWindowFocusToolbar = 203,
  3766. kEventWindowFocusDrawer = 204,
  3767. -- sheet events --
  3768. kEventWindowSheetOpening, = 210,
  3769. kEventWindowSheetOpened = 211,
  3770. kEventWindowSheetClosing = 212,
  3771. kEventWindowSheetClosed = 213,
  3772. -- drawer events --
  3773. kEventWindowDrawerOpening = 220,
  3774. kEventWindowDrawerOpened = 221,
  3775. kEventWindowDrawerClosing = 222,
  3776. kEventWindowDrawerClosed = 223,
  3777. -- window definition events --
  3778. kEventWindowDrawFrame = 1000,
  3779. kEventWindowDrawPart = 1001,
  3780. kEventWindowGetRegion = 1002,
  3781. kEventWindowHitTest = 1003,
  3782. kEventWindowInit = 1004,
  3783. kEventWindowDispose = 1005,
  3784. kEventWindowDragHilite = 1006,
  3785. kEventWindowModified = 1007,
  3786. kEventWindowSetupProxyDragImage = 1008,
  3787. kEventWindowStateChanged = 1009,
  3788. kEventWindowMeasureTitle = 1010,
  3789. kEventWindowDrawGrowBox = 1011,
  3790. kEventWindowGetGrowImageRegion = 1012,
  3791. kEventWindowPaint = 1013
  3792. On window handlers:
  3793. All windows have a handler installed called the Òbasic window handler.Ó This handler provides certain
  3794. basic services for all windows; for example, it handles clicks in the collapse and toolbar buttons,
  3795. since these buttons were handled automatically for WaitNextEvent-based applications in the classic
  3796. Mac OS toolbox, and so are still be handled automatically in Carbon by the basic window handler. The
  3797. basic window handler also implements the HICommands that are sent by the standard window menu to minimize,
  3798. maximize, or zoom a window (kHICommandMinimize/Maximize/ZoomWindow), and the window-class events that are
  3799. generated by those commands (kEventWindowCollapse/Expand/Zoom).
  3800. When the window is created with, or has added, the kWindowStandardHandlerAttribute, the window also has
  3801. installed the Òstandard window handler.Ó The standard handler provides much more advanced behavior than
  3802. the basic window handler; a window using the standard handler generally requires no other extra handlers
  3803. to move, resize, redraw, or track user clicks in controls. Applications will generally add extra handlers
  3804. to respond to command events generated by controls in the window.
  3805. }
  3806. {
  3807. * kEventClassWindow / kEventWindowUpdate
  3808. *
  3809. * Summary:
  3810. * The lowest-level window update event.
  3811. *
  3812. * Discussion:
  3813. * Posted to the event queue for any window that needs updating
  3814. * regardless of whether the window has the standard handler
  3815. * installed. The standard window handler responds to this event by
  3816. * calling BeginUpdate and SetPort, sending a
  3817. * kEventWindowDrawContent event, and calling EndUpdate. An
  3818. * application handler for this event that does not call through to
  3819. * the standard handler must itself call BeginUpdate and
  3820. * EndUpdate.
  3821. *
  3822. * If all handlers for this event return eventNotHandledErr, and the
  3823. * application is calling WaitNextEvent or GetNextEvent, then a
  3824. * kEventWindowUpdate event will be returned as a classic updateEvt.
  3825. *
  3826. * Mac OS X threading:
  3827. * Not thread safe
  3828. *
  3829. * Parameters:
  3830. *
  3831. * --> kEventParamDirectObject (in, typeWindowRef)
  3832. * The window that requires updating.
  3833. *
  3834. * Availability:
  3835. * Mac OS X: in version 10.0 and later in Carbon.framework
  3836. * CarbonLib: in CarbonLib 1.1 and later
  3837. }
  3838. const
  3839. kEventWindowUpdate = 1;
  3840. {
  3841. * kEventClassWindow / kEventWindowDrawContent
  3842. *
  3843. * Summary:
  3844. * A request to update a windowÕs content.
  3845. *
  3846. * Discussion:
  3847. * This event is sent by the standard window handler when it
  3848. * receives a kEventWindowUpdate event. BeginUpdate, SetPort, and
  3849. * EndUpdate are called by the standard handler inside its
  3850. * kEventWindowUpdate handler; your handler for the
  3851. * kEventWindowDrawContent event only needs to draw into the current
  3852. * port.
  3853. *
  3854. * The standard window handler responds to this event by calling
  3855. * UpdateControls.
  3856. *
  3857. * Regardless of whether the window uses the standard window event
  3858. * handler, you will also receive this event right before a window
  3859. * is made visible, to allow you to draw the windowÕs initial
  3860. * contents; you can implement this event to avoid flicker when the
  3861. * window is first shown.
  3862. *
  3863. * Mac OS X threading:
  3864. * Not thread safe
  3865. *
  3866. * Parameters:
  3867. *
  3868. * --> kEventParamDirectObject (in, typeWindowRef)
  3869. * The window that requires updating.
  3870. *
  3871. * Availability:
  3872. * Mac OS X: in version 10.0 and later in Carbon.framework
  3873. * CarbonLib: in CarbonLib 1.1 and later
  3874. }
  3875. const
  3876. kEventWindowDrawContent = 2;
  3877. {
  3878. * kEventClassWindow / kEventWindowActivated
  3879. *
  3880. * Summary:
  3881. * Notification that a window has been activated.
  3882. *
  3883. * Discussion:
  3884. * This event is sent to all handlers registered for it. It is sent
  3885. * to any window that is activated, regardless of whether the window
  3886. * has the standard handler installed. On Mac OS X 10.3 and later,
  3887. * the standard window event handler responds to this event by
  3888. * sending a kEventWindowHandleActivate event to the window; on
  3889. * CarbonLib and earlier releases of Mac OS X, the standard window
  3890. * handler calls ActivateControl on the windowÕs root
  3891. * control.
  3892. *
  3893. * If all handlers for this event return eventNotHandledErr, then
  3894. * the Window Manager posts the event to the event queue, where it
  3895. * will later be returned from WaitNextEvent as a classic
  3896. * activateEvt. If any handler returns an error code other than
  3897. * eventNotHandledErr, then the event will not be posted to the
  3898. * event queue.
  3899. *
  3900. * Mac OS X threading:
  3901. * Not thread safe
  3902. *
  3903. * Parameters:
  3904. *
  3905. * --> kEventParamDirectObject (in, typeWindowRef)
  3906. * The window that is now active.
  3907. *
  3908. * Availability:
  3909. * Mac OS X: in version 10.0 and later in Carbon.framework
  3910. * CarbonLib: in CarbonLib 1.1 and later
  3911. }
  3912. const
  3913. kEventWindowActivated = 5;
  3914. {
  3915. * kEventClassWindow / kEventWindowDeactivated
  3916. *
  3917. * Summary:
  3918. * Notification that a window has been deactivated.
  3919. *
  3920. * Discussion:
  3921. * This event is sent to all handlers registered for it. It is sent
  3922. * to any window that is deactivated, regardless of whether the
  3923. * window has the standard handler installed. On Mac OS X 10.3 and
  3924. * later, the standard window event handler responds to this event
  3925. * by sending a kEventWindowHandleDeactivate event to the window; on
  3926. * CarbonLib and earlier releases of Mac OS X, the standard window
  3927. * handler calls DeactivateControl on the windowÕs root
  3928. * control.
  3929. *
  3930. * If all handlers for this event return eventNotHandledErr, then
  3931. * the Window Manager posts the event to the event queue, where it
  3932. * will later be returned from WaitNextEvent as a classic
  3933. * activateEvt. If any handler returns an error code other than
  3934. * eventNotHandledErr, then the event will not be posted to the
  3935. * event queue.
  3936. *
  3937. * Mac OS X threading:
  3938. * Not thread safe
  3939. *
  3940. * Parameters:
  3941. *
  3942. * --> kEventParamDirectObject (in, typeWindowRef)
  3943. * The window that is now inactive.
  3944. *
  3945. * Availability:
  3946. * Mac OS X: in version 10.0 and later in Carbon.framework
  3947. * CarbonLib: in CarbonLib 1.1 and later
  3948. }
  3949. const
  3950. kEventWindowDeactivated = 6;
  3951. {
  3952. * kEventClassWindow / kEventWindowHandleActivate
  3953. *
  3954. * Summary:
  3955. * The window has received a kEventWindowActivated event, and its
  3956. * contents should become active.
  3957. *
  3958. * Discussion:
  3959. * This event is generated by the standard window handler in
  3960. * response to a kEventWindowActivated event. An application may
  3961. * handle this event by activating its content appropriately. The
  3962. * standard window handler responds to this event by calling
  3963. * ActivateControl on the window's root control.
  3964. *
  3965. * Mac OS X threading:
  3966. * Not thread safe
  3967. *
  3968. * Parameters:
  3969. *
  3970. * --> kEventParamDirectObject (in, typeWindowRef)
  3971. * The window that was activated.
  3972. *
  3973. * Availability:
  3974. * Mac OS X: in version 10.3 and later in Carbon.framework
  3975. * CarbonLib: not available
  3976. }
  3977. const
  3978. kEventWindowHandleActivate = 91;
  3979. {
  3980. * kEventClassWindow / kEventWindowHandleDeactivate
  3981. *
  3982. * Summary:
  3983. * The window has received a kEventWindowDeactivated event, and its
  3984. * contents should become inactive.
  3985. *
  3986. * Discussion:
  3987. * This event is generated by the standard window handler in
  3988. * response to a kEventWindowDeactivated event. An application may
  3989. * handle this event by deactivating its content appropriately. The
  3990. * standard window handler responds to this event by calling
  3991. * DeactivateControl on the window's root control.
  3992. *
  3993. * Mac OS X threading:
  3994. * Not thread safe
  3995. *
  3996. * Parameters:
  3997. *
  3998. * --> kEventParamDirectObject (in, typeWindowRef)
  3999. * The window that was deactivated.
  4000. *
  4001. * Availability:
  4002. * Mac OS X: in version 10.3 and later in Carbon.framework
  4003. * CarbonLib: not available
  4004. }
  4005. const
  4006. kEventWindowHandleDeactivate = 92;
  4007. {
  4008. * kEventClassWindow / kEventWindowGetClickActivation
  4009. *
  4010. * Summary:
  4011. * Sent when a click occurs in a window. Allows the window to
  4012. * determine whether the window should be activated and whether the
  4013. * click should be handled.
  4014. *
  4015. * Discussion:
  4016. * This event is sent in two situations:
  4017. * - for all windows, it is sent to a clicked window when the
  4018. * window's process is inactive
  4019. * - for windows that use the standard window event handler, this
  4020. * event is also sent to clicked windows when the window's process
  4021. * is active. Prior to Mac OS X 10.4, this event is only sent when
  4022. * the clicked window is not the frontmost window in its window
  4023. * group. In Mac OS X 10.4 and later, this event is sent in response
  4024. * to all clicks in a window, regardless of whether the window is
  4025. * frontmost, so that command-clicks may properly avoid z-ordering
  4026. * the window in front of other windows from other processes.
  4027. *
  4028. *
  4029. * A handler for this event can determine whether the window is
  4030. * activated and whether the click is handled or ignored by setting
  4031. * the kEventParamClickActivation parameter to one of the
  4032. * ClickActivationResult constants in Controls.h.
  4033. *
  4034. * The default behavior varies according to the window state and the
  4035. * click location:
  4036. * - if the window's process is active, and the window is frontmost
  4037. * in its group, then the standard window event handler returns
  4038. * kActivateAndHandleClick.
  4039. * - if the window's process is inactive, or the window is not
  4040. * frontmost in its group, then the standard window event handler
  4041. * returns kActivateAndIgnoreClick.
  4042. * - if the click falls on the window widgets in the window
  4043. * structure, then the default window event handler usually returns
  4044. * kDoNotActivateAndHandleClick.
  4045. * You have the option of overriding the behavior to support
  4046. * click-through or select-and-click.
  4047. *
  4048. * Mac OS X threading:
  4049. * Not thread safe
  4050. *
  4051. * Parameters:
  4052. *
  4053. * --> kEventParamDirectObject (in, typeWindowRef)
  4054. * The window that was clicked.
  4055. *
  4056. * --> kEventParamMouseLocation (in, typeQDPoint)
  4057. * The location of the click, in global coordinates.
  4058. *
  4059. * --> kEventParamKeyModifiers (in, typeUInt32)
  4060. * The keyboard modifiers that were pressed when the mouse was
  4061. * clicked.
  4062. *
  4063. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  4064. * The window part that was clicked. Available in Mac OS X
  4065. * 10.3 and later.
  4066. *
  4067. * --> kEventParamWindowDefPart (in, typeWindowDefPartCode)
  4068. * The window part that was clicked. This is really a window
  4069. * part code, not a window def part code, despite the
  4070. * parameter name; this parameter is available in all versions
  4071. * of Mac OS X and CarbonLib 1.1 and later, but use
  4072. * kEventParamWindowPartCode when available instead for
  4073. * clarity.
  4074. *
  4075. * --> kEventParamControlRef (in, typeControlRef)
  4076. * The control that was clicked. Only present if the click was
  4077. * on a control.
  4078. *
  4079. * <-- kEventParamClickActivation (out, typeClickActivationResult)
  4080. * On exit, indicates how the click should be handled. Should
  4081. * be set a ClickActivationResult constant from Controls.h.
  4082. *
  4083. * Availability:
  4084. * Mac OS X: in version 10.0 and later in Carbon.framework
  4085. * CarbonLib: in CarbonLib 1.1 and later
  4086. }
  4087. const
  4088. kEventWindowGetClickActivation = 7;
  4089. {
  4090. * Summary:
  4091. * Responses to the kEventWindowGetClickModality event.
  4092. }
  4093. const
  4094. {
  4095. * Indicates whether a modal window prevents the mouse event from
  4096. * being passed to the clicked window. If this bit is set, the
  4097. * kEventParamModalWindow and kEventParamWindowModality parameters
  4098. * should be set before the event handler returns. If this bit is
  4099. * clear, normal event handling will occur; the clicked window will
  4100. * typically be z-ordered to the top of its window group, activated,
  4101. * become the user focus window, and receive the mouse event for
  4102. * further processing.
  4103. }
  4104. kHIModalClickIsModal = 1 shl 0;
  4105. {
  4106. * If kHIModalClickIsModal is set, this flag indicates whether the
  4107. * click event should be allowed to pass to the clicked window. If
  4108. * kHIModalClickIsModal is not set, this flag is ignored.
  4109. }
  4110. kHIModalClickAllowEvent = 1 shl 1;
  4111. {
  4112. * If kHIModalClickIsModal is set and kHIModalClickAllowEvent is not
  4113. * set, this flag indicates whether the caller should announce that
  4114. * the click has been blocked by a modal window using appropriate UI
  4115. * (typically, by calling SysBeep). If kHIModalClickIsModal is not
  4116. * set, or if kHIModalClickAllowEvent is set, this flag is ignored.
  4117. }
  4118. kHIModalClickAnnounce = 1 shl 2;
  4119. {
  4120. * If both kHIModalClickIsModal and kHIModalClickAllowEvent are set,
  4121. * this flag indicates whether the clicked window should be z-ordered
  4122. * to the top of its window group. The window will not, however, be
  4123. * activated or become the user focus window. If either of
  4124. * kHIModalClickIsModal or kHIModalClickAllowEvent is not set, this
  4125. * flag is ignored.
  4126. }
  4127. kHIModalClickRaiseWindow = 1 shl 3;
  4128. type
  4129. HIModalClickResult = UInt32;
  4130. const
  4131. typeModalClickResult = $776D6372 (* 'wmcr' *); { HIModalClickResult}
  4132. typeWindowModality = $776D6F64 (* 'wmod' *); { WindowModality}
  4133. kEventParamModalClickResult = typeModalClickResult; { typeModalClickResult}
  4134. kEventParamModalWindow = $6D77696E (* 'mwin' *); { typeWindowRef}
  4135. kEventParamWindowModality = typeWindowModality; { typeWindowModality}
  4136. {
  4137. * kEventClassWindow / kEventWindowGetClickModality
  4138. *
  4139. * Summary:
  4140. * Determines whether a mouse-down or mouse-up event is blocked by a
  4141. * modal window.
  4142. *
  4143. * Discussion:
  4144. * This event is sent to a window by the event dispatcher target
  4145. * prior to dispatching a mouse-down or mouse-up event to the
  4146. * clicked window. A handler for this event may examine application
  4147. * state to determine whether this click should be allowed.
  4148. *
  4149. * This event may also be sent in other circumstances besides a
  4150. * mouse event. The toolbox currently sends this event in the
  4151. * following other cases:
  4152. *
  4153. * - in SelectWindow
  4154. * - when handling the cmd-~ key sequence
  4155. * - when restoring a collapsed window from the Dock
  4156. * - when handling the kHICommandSelectWindow command
  4157. * - during application activation, when activating a clicked
  4158. * window
  4159. *
  4160. * In each case, the result of this event is used to determine
  4161. * whether z-ordering, activation, and hiliting of the window should
  4162. * be allowed.
  4163. *
  4164. * This event contains an optional EventRef parameter that is the
  4165. * original mouse event. This parameter is not always present; if
  4166. * not present, the handler should generally assume that the click
  4167. * was a single click.
  4168. *
  4169. * There is a default handler for this event installed on the
  4170. * application target. The default behavior is to determine whether
  4171. * this is a modal click by examining the modality of the visible,
  4172. * uncollapsed windows in front of the clicked window, the location
  4173. * of the click, and the keyboard modifiers. A custom handler may,
  4174. * of course, entirely ignore window z-order or modality, and
  4175. * determine modality in any way it deems necessary.
  4176. *
  4177. * Mac OS X threading:
  4178. * Not thread safe
  4179. *
  4180. * Parameters:
  4181. *
  4182. * --> kEventParamDirectObject (in, typeWindowRef)
  4183. * The window that was clicked.
  4184. *
  4185. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  4186. * The window part that was clicked.
  4187. *
  4188. * --> kEventParamKeyModifiers (in, typeUInt32)
  4189. * The keyboard modifiers that were pressed when the mouse
  4190. * button was pressed.
  4191. *
  4192. * --> kEventParamEventRef (in, typeEventRef)
  4193. * The original mouse event. This parameter is optional and
  4194. * may not be present in all instances of this event. If this
  4195. * parameter is not present, the handler should assume that
  4196. * the click was a single click, with the window part and
  4197. * keyboard modifiers specified by the other parameters in the
  4198. * kEventWindowGetClickModality event.
  4199. *
  4200. * <-- kEventParamModalClickResult (out, typeModalClickResult)
  4201. * On exit, this parameter should contain an
  4202. * HIModalClickResult value indicating how the click should be
  4203. * handled.
  4204. *
  4205. * <-- kEventParamModalWindow (out, typeWindowRef)
  4206. * On exit, this parameter should contain the modal window
  4207. * that caused the click to be blocked, if any. The sender of
  4208. * this event uses this information to determine which window
  4209. * should be activated if the application is inactive.
  4210. *
  4211. *
  4212. * This parameter is only required if the
  4213. * kEventParamModalClickResult parameter contains
  4214. * kHIModalClickIsModal. If an event handler wants to report
  4215. * that a click has been blocked by modality, but cannot
  4216. * determine which window blocked the click, it is acceptable
  4217. * to either not add this parameter to the event, or to set
  4218. * the parameter to a NULL WindowRef.
  4219. *
  4220. * <-- kEventParamWindowModality (out, typeWindowModality)
  4221. * On exit, this parameter should contain the modality of the
  4222. * modal window that is in front of the clicked window, if
  4223. * any. This parameter is only required if the
  4224. * kEventParamModalClickResult parameter contains
  4225. * kHIModalClickIsModal.
  4226. *
  4227. * Availability:
  4228. * Mac OS X: in version 10.4 and later in Carbon.framework
  4229. * CarbonLib: not available
  4230. }
  4231. const
  4232. kEventWindowGetClickModality = 8;
  4233. {
  4234. * Summary:
  4235. * Window bounds change event attributes
  4236. *
  4237. * Discussion:
  4238. * When the toolbox sends out a kEventWindowBoundsChanging or
  4239. * kEventWindowBoundsChanged event, it also sends along a parameter
  4240. * containing attributes of the event. These attributes can be used
  4241. * to determine what aspect of the window changed (origin, size, or
  4242. * both), and whether or not some user action is driving the change
  4243. * (drag or resize).
  4244. }
  4245. const
  4246. {
  4247. * The bounds is changing because the user is dragging the window
  4248. * around.
  4249. }
  4250. kWindowBoundsChangeUserDrag = 1 shl 0;
  4251. {
  4252. * The bounds is changing because the user is resizing the window.
  4253. }
  4254. kWindowBoundsChangeUserResize = 1 shl 1;
  4255. {
  4256. * The dimensions (width and height) of the window content area are
  4257. * changing.
  4258. }
  4259. kWindowBoundsChangeSizeChanged = 1 shl 2;
  4260. {
  4261. * The top left corner (origin) of the window content is changing.
  4262. }
  4263. kWindowBoundsChangeOriginChanged = 1 shl 3;
  4264. {
  4265. * The bounds is changing because ZoomWindow or ZoomWindowIdeal was
  4266. * called. Note that this flag does not imply any user interaction;
  4267. * if the application calls ZoomWindow itself without user request,
  4268. * this flag will still be set. Available in Mac OS X 10.2 and
  4269. * CarbonLib 1.6, and later.
  4270. }
  4271. kWindowBoundsChangeZoom = 1 shl 4;
  4272. {
  4273. * kEventClassWindow / kEventWindowShowing
  4274. *
  4275. * Summary:
  4276. * Notification that a window is being shown.
  4277. *
  4278. * Discussion:
  4279. * This event is sent to all handlers registered for it.
  4280. *
  4281. * Mac OS X threading:
  4282. * Not thread safe
  4283. *
  4284. * Parameters:
  4285. *
  4286. * --> kEventParamDirectObject (in, typeWindowRef)
  4287. * The window being shown.
  4288. *
  4289. * Availability:
  4290. * Mac OS X: in version 10.0 and later in Carbon.framework
  4291. * CarbonLib: in CarbonLib 1.1 and later
  4292. }
  4293. const
  4294. kEventWindowShowing = 22;
  4295. {
  4296. * kEventClassWindow / kEventWindowHiding
  4297. *
  4298. * Summary:
  4299. * Notification that a window is being hidden.
  4300. *
  4301. * Discussion:
  4302. * This event is sent to all handlers registered for it.
  4303. *
  4304. * Mac OS X threading:
  4305. * Not thread safe
  4306. *
  4307. * Parameters:
  4308. *
  4309. * --> kEventParamDirectObject (in, typeWindowRef)
  4310. * The window being hidden.
  4311. *
  4312. * Availability:
  4313. * Mac OS X: in version 10.0 and later in Carbon.framework
  4314. * CarbonLib: in CarbonLib 1.1 and later
  4315. }
  4316. const
  4317. kEventWindowHiding = 23;
  4318. {
  4319. * kEventClassWindow / kEventWindowShown
  4320. *
  4321. * Summary:
  4322. * Notification that a window has been shown.
  4323. *
  4324. * Discussion:
  4325. * This event is sent to all handlers registered for it.
  4326. *
  4327. * Mac OS X threading:
  4328. * Not thread safe
  4329. *
  4330. * Parameters:
  4331. *
  4332. * --> kEventParamDirectObject (in, typeWindowRef)
  4333. * The window that was shown.
  4334. *
  4335. * Availability:
  4336. * Mac OS X: in version 10.0 and later in Carbon.framework
  4337. * CarbonLib: in CarbonLib 1.1 and later
  4338. }
  4339. const
  4340. kEventWindowShown = 24;
  4341. {
  4342. * kEventClassWindow / kEventWindowHidden
  4343. *
  4344. * Summary:
  4345. * Notification that a window has been hidden.
  4346. *
  4347. * Discussion:
  4348. * This event is sent to all handlers registered for it. Prior to
  4349. * Mac OS X 10.2 and CarbonLib 1.6, kEventWindowClosed and
  4350. * kEventWindowHidden were sent in that order by the Window Manager
  4351. * to a window being destroyed. This was problematic if you had a
  4352. * Hidden handler which used data that was destroyed by the Closed
  4353. * handler. The Window Manager in Mac OS X 10.2 and CarbonLib 1.6
  4354. * and later now sends these events in the reverse order:
  4355. * kEventWindowHidden first, followed by kEventWindowClosed. The
  4356. * last event sent to a window remains kEventWindowDispose.
  4357. *
  4358. * Mac OS X threading:
  4359. * Not thread safe
  4360. *
  4361. * Parameters:
  4362. *
  4363. * --> kEventParamDirectObject (in, typeWindowRef)
  4364. * The window that was hidden.
  4365. *
  4366. * Availability:
  4367. * Mac OS X: in version 10.0 and later in Carbon.framework
  4368. * CarbonLib: in CarbonLib 1.1 and later
  4369. }
  4370. const
  4371. kEventWindowHidden = 25;
  4372. {
  4373. * kEventClassWindow / kEventWindowCollapsing
  4374. *
  4375. * Summary:
  4376. * Notification that a window is about to collapse.
  4377. *
  4378. * Discussion:
  4379. * This event is sent to all handlers registered for it.
  4380. *
  4381. * Mac OS X threading:
  4382. * Not thread safe
  4383. *
  4384. * Parameters:
  4385. *
  4386. * --> kEventParamDirectObject (in, typeWindowRef)
  4387. * The window being collapsed.
  4388. *
  4389. * Availability:
  4390. * Mac OS X: in version 10.1 and later in Carbon.framework
  4391. * CarbonLib: in CarbonLib 1.6 and later
  4392. }
  4393. const
  4394. kEventWindowCollapsing = 86;
  4395. {
  4396. * kEventClassWindow / kEventWindowCollapsed
  4397. *
  4398. * Summary:
  4399. * Notification that a window has successfully collapsed.
  4400. *
  4401. * Discussion:
  4402. * This event is sent to all handlers registered for it.
  4403. *
  4404. * Mac OS X threading:
  4405. * Not thread safe
  4406. *
  4407. * Parameters:
  4408. *
  4409. * --> kEventParamDirectObject (in, typeWindowRef)
  4410. * The window that was collapsed.
  4411. *
  4412. * Availability:
  4413. * Mac OS X: in version 10.0 and later in Carbon.framework
  4414. * CarbonLib: in CarbonLib 1.1 and later
  4415. }
  4416. const
  4417. kEventWindowCollapsed = 67;
  4418. {
  4419. * kEventClassWindow / kEventWindowExpanding
  4420. *
  4421. * Summary:
  4422. * Notification that a window is about to expand.
  4423. *
  4424. * Discussion:
  4425. * This event is sent to all handlers registered for it.
  4426. *
  4427. * Mac OS X threading:
  4428. * Not thread safe
  4429. *
  4430. * Parameters:
  4431. *
  4432. * --> kEventParamDirectObject (in, typeWindowRef)
  4433. * The window being expanded.
  4434. *
  4435. * Availability:
  4436. * Mac OS X: in version 10.1 and later in Carbon.framework
  4437. * CarbonLib: in CarbonLib 1.6 and later
  4438. }
  4439. const
  4440. kEventWindowExpanding = 87;
  4441. {
  4442. * kEventClassWindow / kEventWindowExpanded
  4443. *
  4444. * Summary:
  4445. * Notification that a window has successfully expanded.
  4446. *
  4447. * Discussion:
  4448. * This event is sent to all handlers registered for it.
  4449. *
  4450. * Mac OS X threading:
  4451. * Not thread safe
  4452. *
  4453. * Parameters:
  4454. *
  4455. * --> kEventParamDirectObject (in, typeWindowRef)
  4456. * The window that was expanded.
  4457. *
  4458. * Availability:
  4459. * Mac OS X: in version 10.0 and later in Carbon.framework
  4460. * CarbonLib: in CarbonLib 1.1 and later
  4461. }
  4462. const
  4463. kEventWindowExpanded = 70;
  4464. {
  4465. * kEventClassWindow / kEventWindowZoomed
  4466. *
  4467. * Summary:
  4468. * Notification that a window has been successfully zoomed.
  4469. *
  4470. * Discussion:
  4471. * This event is sent to all handlers registered for it. In
  4472. * CarbonLib 1.1 through CarbonLib 1.4, and Mac OS X 10.0 and 10.1,
  4473. * this event is only sent by the standard window event handler
  4474. * after handling kEventWindowZoom; starting with CarbonLib 1.5 and
  4475. * Mac OS X 10.2, this event is sent by ZoomWindow and
  4476. * ZoomWindowIdeal.
  4477. *
  4478. * Mac OS X threading:
  4479. * Not thread safe
  4480. *
  4481. * Parameters:
  4482. *
  4483. * --> kEventParamDirectObject (in, typeWindowRef)
  4484. * The window that was zoomed.
  4485. *
  4486. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  4487. * The part code (inZoomIn or inZoomOut) that was passed to
  4488. * ZoomWindow or ZoomWindowIdeal. This parameter is available
  4489. * in Mac OS X 10.4 and later.
  4490. *
  4491. * Availability:
  4492. * Mac OS X: in version 10.0 and later in Carbon.framework
  4493. * CarbonLib: in CarbonLib 1.1 and later
  4494. }
  4495. const
  4496. kEventWindowZoomed = 76;
  4497. {
  4498. * kEventClassWindow / kEventWindowBoundsChanging
  4499. *
  4500. * Summary:
  4501. * Notification that a windowÕs bounds are about to be changed.
  4502. *
  4503. * Discussion:
  4504. * Sent during DragWindow or ResizeWindow, before the window is
  4505. * actually moved or resized, and also during programmatic
  4506. * bounds-changing APIs such as SetWindowBounds and ZoomWindow. An
  4507. * event handler may alter the kEventParamCurrentBounds parameter in
  4508. * the event to change the eventual location of the window. You may
  4509. * change the size, origin, or both of the windowÕs bounds. Do not,
  4510. * however, call SizeWindow or SetWindowBounds yourself from inside
  4511. * a handler for this event.
  4512. *
  4513. * In Mac OS X 10.1 and later, kEventWindowBoundsChanging is sent
  4514. * before all changes to a windowÕs bounds, regardless of whether
  4515. * the change is initiated by the user or by a direct call to a
  4516. * Window Manager API. Applications may intercept the event and
  4517. * modify the bounds. When the event is sent because of a direct
  4518. * call to the Window Manager, the
  4519. * kWindowBoundsChangeUserDrag/Resize attribute bits will not be set.
  4520. *
  4521. * Mac OS X threading:
  4522. * Not thread safe
  4523. *
  4524. * Parameters:
  4525. *
  4526. * --> kEventParamDirectObject (in, typeWindowRef)
  4527. * The window being shown.
  4528. *
  4529. * --> kEventParamAttributes (in, typeUInt32)
  4530. * The bounds-changing attributes indicating whether the
  4531. * window is being resized, moved, or both.
  4532. *
  4533. * --> kEventParamOriginalBounds (in, typeQDRectangle)
  4534. * The windowÕs original content bounds before the window
  4535. * resize or drag began.
  4536. *
  4537. * --> kEventParamPreviousBounds (in, typeQDRectangle)
  4538. * The windowÕs content bounds before the current bounds
  4539. * change.
  4540. *
  4541. * <-> kEventParamCurrentBounds (in/out, typeQDRectangle)
  4542. * On entry, the windowÕs proposed new content bounds; on
  4543. * exit, the content bounds that are desired by the event
  4544. * handler.
  4545. *
  4546. * Result:
  4547. * Return noErr to indicate that the Window Manager should use the
  4548. * kEventParamCurrentBounds parameter as the windowÕs new content
  4549. * bounds.
  4550. *
  4551. * Availability:
  4552. * Mac OS X: in version 10.0 and later in Carbon.framework
  4553. * CarbonLib: in CarbonLib 1.1 and later
  4554. }
  4555. const
  4556. kEventWindowBoundsChanging = 26;
  4557. {
  4558. * kEventClassWindow / kEventWindowBoundsChanged
  4559. *
  4560. * Summary:
  4561. * Notification that a windowÕs bounds have been changed.
  4562. *
  4563. * Discussion:
  4564. * This event is sent to all handlers registered for it. Do not call
  4565. * SizeWindow or SetWindowBounds from inside a handler for this
  4566. * event; if you need to enforce a certain window bounds, install a
  4567. * kEventWindowBoundsChanging handler instead.
  4568. *
  4569. * Mac OS X threading:
  4570. * Not thread safe
  4571. *
  4572. * Parameters:
  4573. *
  4574. * --> kEventParamDirectObject (in, typeWindowRef)
  4575. * The window whose bounds were changed.
  4576. *
  4577. * --> kEventParamAttributes (in, typeUInt32)
  4578. * The bounds-changing attributes indicating whether the
  4579. * window was resized, moved, or both.
  4580. *
  4581. * --> kEventParamOriginalBounds (in, typeQDRectangle)
  4582. * The windowÕs original content bounds before the window
  4583. * resize or drag began.
  4584. *
  4585. * --> kEventParamPreviousBounds (in, typeQDRectangle)
  4586. * The windowÕs content bounds before the current bounds
  4587. * change.
  4588. *
  4589. * --> kEventParamCurrentBounds (in, typeQDRectangle)
  4590. * The windowÕs new content bounds.
  4591. *
  4592. * Availability:
  4593. * Mac OS X: in version 10.0 and later in Carbon.framework
  4594. * CarbonLib: in CarbonLib 1.1 and later
  4595. }
  4596. const
  4597. kEventWindowBoundsChanged = 27;
  4598. {
  4599. * kEventClassWindow / kEventWindowResizeStarted
  4600. *
  4601. * Summary:
  4602. * Notification that the user has just started to resize a window.
  4603. *
  4604. * Discussion:
  4605. * This event is sent to all handlers registered for it.
  4606. *
  4607. * Mac OS X threading:
  4608. * Not thread safe
  4609. *
  4610. * Parameters:
  4611. *
  4612. * --> kEventParamDirectObject (in, typeWindowRef)
  4613. * The window being resized.
  4614. *
  4615. * Availability:
  4616. * Mac OS X: in version 10.0 and later in Carbon.framework
  4617. * CarbonLib: in CarbonLib 1.1 and later
  4618. }
  4619. const
  4620. kEventWindowResizeStarted = 28;
  4621. {
  4622. * kEventClassWindow / kEventWindowResizeCompleted
  4623. *
  4624. * Summary:
  4625. * Notification that the user has just finished resizing a window.
  4626. *
  4627. * Discussion:
  4628. * This event is sent to all handlers registered for it.
  4629. *
  4630. * Mac OS X threading:
  4631. * Not thread safe
  4632. *
  4633. * Parameters:
  4634. *
  4635. * --> kEventParamDirectObject (in, typeWindowRef)
  4636. * The window that was resized.
  4637. *
  4638. * Availability:
  4639. * Mac OS X: in version 10.0 and later in Carbon.framework
  4640. * CarbonLib: in CarbonLib 1.1 and later
  4641. }
  4642. const
  4643. kEventWindowResizeCompleted = 29;
  4644. {
  4645. * kEventClassWindow / kEventWindowDragStarted
  4646. *
  4647. * Summary:
  4648. * Notification that the user has just started to drag a window.
  4649. *
  4650. * Discussion:
  4651. * This event is sent to all handlers registered for it.
  4652. *
  4653. * Mac OS X threading:
  4654. * Not thread safe
  4655. *
  4656. * Parameters:
  4657. *
  4658. * --> kEventParamDirectObject (in, typeWindowRef)
  4659. * The window being dragged.
  4660. *
  4661. * Availability:
  4662. * Mac OS X: in version 10.0 and later in Carbon.framework
  4663. * CarbonLib: in CarbonLib 1.1 and later
  4664. }
  4665. const
  4666. kEventWindowDragStarted = 30;
  4667. {
  4668. * kEventClassWindow / kEventWindowDragCompleted
  4669. *
  4670. * Summary:
  4671. * Notification that the user has just finished dragging a window.
  4672. *
  4673. * Discussion:
  4674. * This event is sent to all handlers registered for it.
  4675. *
  4676. * Mac OS X threading:
  4677. * Not thread safe
  4678. *
  4679. * Parameters:
  4680. *
  4681. * --> kEventParamDirectObject (in, typeWindowRef)
  4682. * The window that was dragged.
  4683. *
  4684. * Availability:
  4685. * Mac OS X: in version 10.0 and later in Carbon.framework
  4686. * CarbonLib: in CarbonLib 1.1 and later
  4687. }
  4688. const
  4689. kEventWindowDragCompleted = 31;
  4690. {
  4691. * kEventClassWindow / kEventWindowClosed
  4692. *
  4693. * Summary:
  4694. * Notification that a window is being destroyed.
  4695. *
  4696. * Discussion:
  4697. * This event is sent to all handlers registered for it. Prior to
  4698. * Mac OS X 10.2 and CarbonLib 1.6, kEventWindowClosed and
  4699. * kEventWindowHidden were sent in that order by the Window Manager
  4700. * to a window being destroyed. This was problematic if you had a
  4701. * Hidden handler which used data that was destroyed by the Closed
  4702. * handler. The Window Manager in Mac OS X 10.2 and CarbonLib 1.6
  4703. * and later now sends these events in the reverse order:
  4704. * kEventWindowHidden first, followed by kEventWindowClosed. The
  4705. * last event sent to a window remains kEventWindowDispose.
  4706. *
  4707. * Mac OS X threading:
  4708. * Not thread safe
  4709. *
  4710. * Parameters:
  4711. *
  4712. * --> kEventParamDirectObject (in, typeWindowRef)
  4713. * The window being destroyed.
  4714. *
  4715. * Availability:
  4716. * Mac OS X: in version 10.0 and later in Carbon.framework
  4717. * CarbonLib: in CarbonLib 1.1 and later
  4718. }
  4719. const
  4720. kEventWindowClosed = 73;
  4721. {
  4722. * kEventClassWindow / kEventWindowTransitionStarted
  4723. *
  4724. * Summary:
  4725. * Notification that a window transition has started.
  4726. *
  4727. * Discussion:
  4728. * This event is sent to all handlers registered for it. It is sent
  4729. * by the TransitionWindow, TransitionWindowAndParent, and
  4730. * TransitionWindowWithOptions APIs just before the first frame of
  4731. * the transition animation.
  4732. *
  4733. * Mac OS X threading:
  4734. * Not thread safe
  4735. *
  4736. * Parameters:
  4737. *
  4738. * --> kEventParamDirectObject (in, typeWindowRef)
  4739. * The window that will be transitioning.
  4740. *
  4741. * --> kEventParamUserData (in, typeVoidPtr)
  4742. * The user data that was specified in the
  4743. * TransitionWindowOptions.userData field. If no user data was
  4744. * specified, this parameter will still be present, but its
  4745. * value will be NULL.
  4746. *
  4747. * --> kEventParamWindowTransitionAction (in, typeWindowTransitionAction)
  4748. * The transition action that is starting.
  4749. *
  4750. * --> kEventParamWindowTransitionEffect (in, typeWindowTransitionEffect)
  4751. * The transition effect that is starting.
  4752. *
  4753. * Availability:
  4754. * Mac OS X: in version 10.3 and later in Carbon.framework
  4755. * CarbonLib: not available
  4756. }
  4757. const
  4758. kEventWindowTransitionStarted = 88;
  4759. {
  4760. * kEventClassWindow / kEventWindowTransitionCompleted
  4761. *
  4762. * Summary:
  4763. * Notification that a window transition has completed.
  4764. *
  4765. * Discussion:
  4766. * This event is sent to all handlers registered for it. It is sent
  4767. * by the TransitionWindow, TransitionWindowAndParent, and
  4768. * TransitionWindowWithOptions APIs just after the last frame of the
  4769. * transition animation.
  4770. *
  4771. * Mac OS X threading:
  4772. * Not thread safe
  4773. *
  4774. * Parameters:
  4775. *
  4776. * --> kEventParamDirectObject (in, typeWindowRef)
  4777. * The window that was transitioning.
  4778. *
  4779. * --> kEventParamUserData (in, typeVoidPtr)
  4780. * The user data that was specified in the
  4781. * TransitionWindowOptions.userData field. If no user data was
  4782. * specified, this parameter will still be present, but its
  4783. * value will be NULL.
  4784. *
  4785. * --> kEventParamWindowTransitionAction (in, typeWindowTransitionAction)
  4786. * The transition action that has completed.
  4787. *
  4788. * --> kEventParamWindowTransitionEffect (in, typeWindowTransitionEffect)
  4789. * The transition effect that has completed.
  4790. *
  4791. * Availability:
  4792. * Mac OS X: in version 10.3 and later in Carbon.framework
  4793. * CarbonLib: not available
  4794. }
  4795. const
  4796. kEventWindowTransitionCompleted = 89;
  4797. {
  4798. * kEventClassWindow / kEventWindowClickDragRgn
  4799. *
  4800. * Summary:
  4801. * Sent when the mouse is clicked in the drag region.
  4802. *
  4803. * Discussion:
  4804. * The standard window handler responds to this event by checking if
  4805. * the click is a window path-select click; if so, it sends
  4806. * kEventWindowPathSelect to allow customization of the path-select
  4807. * menu, and then calls WindowPathSelect. If the click is not a
  4808. * path-select click, the standard window handler calls DragWindow.
  4809. * Note that this event is not sent for composited windows; the
  4810. * window frame view handles the mouse-down event directly. To
  4811. * intercept a drag region click in a composited window, install a
  4812. * kEventControlClick handler on the windowÕs root view.
  4813. *
  4814. * Mac OS X threading:
  4815. * Not thread safe
  4816. *
  4817. * Parameters:
  4818. *
  4819. * --> kEventParamDirectObject (in, typeWindowRef)
  4820. * The window that was clicked.
  4821. *
  4822. * --> kEventParamMouseLocation (in, typeHIPoint)
  4823. * The mouse location, in global coordinates.
  4824. *
  4825. * --> kEventParamWindowRef (in, typeWindowRef)
  4826. * The window under the mouse. Available in Mac OS X 10.1 and
  4827. * later.
  4828. *
  4829. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  4830. * The window-relative position of the mouse in the window
  4831. * given in the kEventParamWindowRef parameter. 0,0 is at the
  4832. * top left of the structure of the window. Available in Mac
  4833. * OS X 10.1 and later.
  4834. *
  4835. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  4836. * The part code that the mouse location hit in the window.
  4837. * This parameter only exists if the WindowRef parameter
  4838. * exists. This saves you the trouble of calling FindWindow,
  4839. * which is expensive on Mac OS X as it needs to call the
  4840. * Window Server. Available in Mac OS X 10.3 and later.
  4841. *
  4842. * --> kEventParamKeyModifiers (in, typeUInt32)
  4843. * The keyboard modifiers that were pressed when the event was
  4844. * generated.
  4845. *
  4846. * --> kEventParamMouseButton (in, typeMouseButton)
  4847. * Which mouse button was pressed.
  4848. *
  4849. * --> kEventParamClickCount (in, typeUInt32)
  4850. * Whether this is a single click, double click, etc.
  4851. *
  4852. * --> kEventParamMouseChord (in, typeUInt32)
  4853. * Which other mouse buttons were pressed when the event was
  4854. * generated. Available on Mac OS X only.
  4855. *
  4856. * --> kEventParamTabletEventType (in, typeUInt32)
  4857. * The type of tablet event which generated this mouse event;
  4858. * contains either kEventTabletPoint or kEventTabletProximity.
  4859. * Only present if the event was generated from a tablet.
  4860. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  4861. *
  4862. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  4863. * Further information about the tablet event which generated
  4864. * this mouse event. Present if the the
  4865. * kEventParamTabletEventType parameter contains
  4866. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  4867. * 1.5, and later.
  4868. *
  4869. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  4870. * Further information about the tablet event which generated
  4871. * this mouse event. Present if the the
  4872. * kEventParamTabletEventType parameter contains
  4873. * kEventTabletProximity. Available on Mac OS X 10.1 and
  4874. * CarbonLib 1.5, and later.
  4875. *
  4876. * Availability:
  4877. * Mac OS X: in version 10.0 and later in Carbon.framework
  4878. * CarbonLib: in CarbonLib 1.1 and later
  4879. }
  4880. const
  4881. kEventWindowClickDragRgn = 32;
  4882. {
  4883. * kEventClassWindow / kEventWindowClickResizeRgn
  4884. *
  4885. * Summary:
  4886. * Sent when the mouse is clicked in the resize area.
  4887. *
  4888. * Discussion:
  4889. * The standard window handler responds to this event by calling
  4890. * ResizeWindow. Note that this event is not sent for composited
  4891. * windows; the window resize view handles the mouse-down event
  4892. * directly. To intercept a resize region click in a composited
  4893. * window, install a kEventControlClick handler on the windowÕs
  4894. * resize view.
  4895. *
  4896. * Mac OS X threading:
  4897. * Not thread safe
  4898. *
  4899. * Parameters:
  4900. *
  4901. * --> kEventParamDirectObject (in, typeWindowRef)
  4902. * The window that was clicked.
  4903. *
  4904. * --> kEventParamMouseLocation (in, typeHIPoint)
  4905. * The mouse location, in global coordinates.
  4906. *
  4907. * --> kEventParamWindowRef (in, typeWindowRef)
  4908. * The window under the mouse. Available in Mac OS X 10.1 and
  4909. * later.
  4910. *
  4911. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  4912. * The window-relative position of the mouse in the window
  4913. * given in the kEventParamWindowRef parameter. 0,0 is at the
  4914. * top left of the structure of the window. Available in Mac
  4915. * OS X 10.1 and later.
  4916. *
  4917. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  4918. * The part code that the mouse location hit in the window.
  4919. * This parameter only exists if the WindowRef parameter
  4920. * exists. This saves you the trouble of calling FindWindow,
  4921. * which is expensive on Mac OS X as it needs to call the
  4922. * Window Server. Available in Mac OS X 10.3 and later.
  4923. *
  4924. * --> kEventParamKeyModifiers (in, typeUInt32)
  4925. * The keyboard modifiers that were pressed when the event was
  4926. * generated.
  4927. *
  4928. * --> kEventParamMouseButton (in, typeMouseButton)
  4929. * Which mouse button was pressed.
  4930. *
  4931. * --> kEventParamClickCount (in, typeUInt32)
  4932. * Whether this is a single click, double click, etc.
  4933. *
  4934. * --> kEventParamMouseChord (in, typeUInt32)
  4935. * Which other mouse buttons were pressed when the event was
  4936. * generated. Available on Mac OS X only.
  4937. *
  4938. * --> kEventParamTabletEventType (in, typeUInt32)
  4939. * The type of tablet event which generated this mouse event;
  4940. * contains either kEventTabletPoint or kEventTabletProximity.
  4941. * Only present if the event was generated from a tablet.
  4942. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  4943. *
  4944. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  4945. * Further information about the tablet event which generated
  4946. * this mouse event. Present if the the
  4947. * kEventParamTabletEventType parameter contains
  4948. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  4949. * 1.5, and later.
  4950. *
  4951. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  4952. * Further information about the tablet event which generated
  4953. * this mouse event. Present if the the
  4954. * kEventParamTabletEventType parameter contains
  4955. * kEventTabletProximity. Available on Mac OS X 10.1 and
  4956. * CarbonLib 1.5, and later.
  4957. *
  4958. * Availability:
  4959. * Mac OS X: in version 10.0 and later in Carbon.framework
  4960. * CarbonLib: in CarbonLib 1.1 and later
  4961. }
  4962. const
  4963. kEventWindowClickResizeRgn = 33;
  4964. {
  4965. * kEventClassWindow / kEventWindowClickCollapseRgn
  4966. *
  4967. * Summary:
  4968. * Sent when the mouse is clicked in the collapse button.
  4969. *
  4970. * Discussion:
  4971. * For all windows, the basic window handler responds to this event
  4972. * by tracking the click in the collapse button. If the mouse is
  4973. * released while still in the button, the basic window handler
  4974. * generates one of the kEventWindowCollapse,
  4975. * kEventWindowCollapseAll, kEventWindowExpand, or
  4976. * kEventWindowExpandAll events, depending on the windowÕs original
  4977. * collapse state and whether the option key was pressed. Note that
  4978. * this event is not sent for composited windows; the window
  4979. * collapse button view handles the mouse-down event directly. To
  4980. * intercept a collapse region click in a composited window, install
  4981. * a kEventControlClick handler on the windowÕs collapse button view.
  4982. *
  4983. * Mac OS X threading:
  4984. * Not thread safe
  4985. *
  4986. * Parameters:
  4987. *
  4988. * --> kEventParamDirectObject (in, typeWindowRef)
  4989. * The window that was clicked.
  4990. *
  4991. * --> kEventParamMouseLocation (in, typeHIPoint)
  4992. * The mouse location, in global coordinates.
  4993. *
  4994. * --> kEventParamWindowRef (in, typeWindowRef)
  4995. * The window under the mouse. Available in Mac OS X 10.1 and
  4996. * later.
  4997. *
  4998. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  4999. * The window-relative position of the mouse in the window
  5000. * given in the kEventParamWindowRef parameter. 0,0 is at the
  5001. * top left of the structure of the window. Available in Mac
  5002. * OS X 10.1 and later.
  5003. *
  5004. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  5005. * The part code that the mouse location hit in the window.
  5006. * This parameter only exists if the WindowRef parameter
  5007. * exists. This saves you the trouble of calling FindWindow,
  5008. * which is expensive on Mac OS X as it needs to call the
  5009. * Window Server. Available in Mac OS X 10.3 and later.
  5010. *
  5011. * --> kEventParamKeyModifiers (in, typeUInt32)
  5012. * The keyboard modifiers that were pressed when the event was
  5013. * generated.
  5014. *
  5015. * --> kEventParamMouseButton (in, typeMouseButton)
  5016. * Which mouse button was pressed.
  5017. *
  5018. * --> kEventParamClickCount (in, typeUInt32)
  5019. * Whether this is a single click, double click, etc.
  5020. *
  5021. * --> kEventParamMouseChord (in, typeUInt32)
  5022. * Which other mouse buttons were pressed when the event was
  5023. * generated. Available on Mac OS X only.
  5024. *
  5025. * --> kEventParamTabletEventType (in, typeUInt32)
  5026. * The type of tablet event which generated this mouse event;
  5027. * contains either kEventTabletPoint or kEventTabletProximity.
  5028. * Only present if the event was generated from a tablet.
  5029. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  5030. *
  5031. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  5032. * Further information about the tablet event which generated
  5033. * this mouse event. Present if the the
  5034. * kEventParamTabletEventType parameter contains
  5035. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  5036. * 1.5, and later.
  5037. *
  5038. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  5039. * Further information about the tablet event which generated
  5040. * this mouse event. Present if the the
  5041. * kEventParamTabletEventType parameter contains
  5042. * kEventTabletProximity. Available on Mac OS X 10.1 and
  5043. * CarbonLib 1.5, and later.
  5044. *
  5045. * Availability:
  5046. * Mac OS X: in version 10.0 and later in Carbon.framework
  5047. * CarbonLib: in CarbonLib 1.1 and later
  5048. }
  5049. const
  5050. kEventWindowClickCollapseRgn = 34;
  5051. {
  5052. * kEventClassWindow / kEventWindowClickCloseRgn
  5053. *
  5054. * Summary:
  5055. * Sent when the mouse is clicked in the close button.
  5056. *
  5057. * Discussion:
  5058. * The standard window handler responds to this event by tracking
  5059. * the click in the close button. If the mouse is released while
  5060. * still in the button, the standard window handler generates one of
  5061. * the kEventWindowClose or kEventWindowCloseAll events, depending
  5062. * on whether the option key was pressed. Note that this event is
  5063. * not sent for composited windows; the window close button view
  5064. * handles the mouse-down event directly. To intercept a close
  5065. * region click in a composited window, install a kEventControlClick
  5066. * handler on the windowÕs close button view.
  5067. *
  5068. * Mac OS X threading:
  5069. * Not thread safe
  5070. *
  5071. * Parameters:
  5072. *
  5073. * --> kEventParamDirectObject (in, typeWindowRef)
  5074. * The window that was clicked.
  5075. *
  5076. * --> kEventParamMouseLocation (in, typeHIPoint)
  5077. * The mouse location, in global coordinates.
  5078. *
  5079. * --> kEventParamWindowRef (in, typeWindowRef)
  5080. * The window under the mouse. Available in Mac OS X 10.1 and
  5081. * later.
  5082. *
  5083. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  5084. * The window-relative position of the mouse in the window
  5085. * given in the kEventParamWindowRef parameter. 0,0 is at the
  5086. * top left of the structure of the window. Available in Mac
  5087. * OS X 10.1 and later.
  5088. *
  5089. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  5090. * The part code that the mouse location hit in the window.
  5091. * This parameter only exists if the WindowRef parameter
  5092. * exists. This saves you the trouble of calling FindWindow,
  5093. * which is expensive on Mac OS X as it needs to call the
  5094. * Window Server. Available in Mac OS X 10.3 and later.
  5095. *
  5096. * --> kEventParamKeyModifiers (in, typeUInt32)
  5097. * The keyboard modifiers that were pressed when the event was
  5098. * generated.
  5099. *
  5100. * --> kEventParamMouseButton (in, typeMouseButton)
  5101. * Which mouse button was pressed.
  5102. *
  5103. * --> kEventParamClickCount (in, typeUInt32)
  5104. * Whether this is a single click, double click, etc.
  5105. *
  5106. * --> kEventParamMouseChord (in, typeUInt32)
  5107. * Which other mouse buttons were pressed when the event was
  5108. * generated. Available on Mac OS X only.
  5109. *
  5110. * --> kEventParamTabletEventType (in, typeUInt32)
  5111. * The type of tablet event which generated this mouse event;
  5112. * contains either kEventTabletPoint or kEventTabletProximity.
  5113. * Only present if the event was generated from a tablet.
  5114. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  5115. *
  5116. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  5117. * Further information about the tablet event which generated
  5118. * this mouse event. Present if the the
  5119. * kEventParamTabletEventType parameter contains
  5120. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  5121. * 1.5, and later.
  5122. *
  5123. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  5124. * Further information about the tablet event which generated
  5125. * this mouse event. Present if the the
  5126. * kEventParamTabletEventType parameter contains
  5127. * kEventTabletProximity. Available on Mac OS X 10.1 and
  5128. * CarbonLib 1.5, and later.
  5129. *
  5130. * Availability:
  5131. * Mac OS X: in version 10.0 and later in Carbon.framework
  5132. * CarbonLib: in CarbonLib 1.1 and later
  5133. }
  5134. const
  5135. kEventWindowClickCloseRgn = 35;
  5136. {
  5137. * kEventClassWindow / kEventWindowClickZoomRgn
  5138. *
  5139. * Summary:
  5140. * Sent when the mouse is clicked in the zoom button.
  5141. *
  5142. * Discussion:
  5143. * The standard window handler responds to this event by tracking
  5144. * the click in the zoom button. If the mouse is released while
  5145. * still in the button, the standard window handler generates one of
  5146. * the kEventWindowZoom or kEventWindowZoomAll events, depending on
  5147. * whether the option key was pressed. Note that this event is not
  5148. * sent for composited windows; the window zoom button view handles
  5149. * the mouse-down event directly. To intercept a zoom region click
  5150. * in a composited window, install a kEventControlClick handler on
  5151. * the windowÕs zoom region view.
  5152. *
  5153. * Mac OS X threading:
  5154. * Not thread safe
  5155. *
  5156. * Parameters:
  5157. *
  5158. * --> kEventParamDirectObject (in, typeWindowRef)
  5159. * The window that was clicked.
  5160. *
  5161. * --> kEventParamMouseLocation (in, typeHIPoint)
  5162. * The mouse location, in global coordinates.
  5163. *
  5164. * --> kEventParamWindowRef (in, typeWindowRef)
  5165. * The window under the mouse. Available in Mac OS X 10.1 and
  5166. * later.
  5167. *
  5168. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  5169. * The window-relative position of the mouse in the window
  5170. * given in the kEventParamWindowRef parameter. 0,0 is at the
  5171. * top left of the structure of the window. Available in Mac
  5172. * OS X 10.1 and later.
  5173. *
  5174. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  5175. * The part code that the mouse location hit in the window.
  5176. * This parameter only exists if the WindowRef parameter
  5177. * exists. This saves you the trouble of calling FindWindow,
  5178. * which is expensive on Mac OS X as it needs to call the
  5179. * Window Server. Available in Mac OS X 10.3 and later.
  5180. *
  5181. * --> kEventParamKeyModifiers (in, typeUInt32)
  5182. * The keyboard modifiers that were pressed when the event was
  5183. * generated.
  5184. *
  5185. * --> kEventParamMouseButton (in, typeMouseButton)
  5186. * Which mouse button was pressed.
  5187. *
  5188. * --> kEventParamClickCount (in, typeUInt32)
  5189. * Whether this is a single click, double click, etc.
  5190. *
  5191. * --> kEventParamMouseChord (in, typeUInt32)
  5192. * Which other mouse buttons were pressed when the event was
  5193. * generated. Available on Mac OS X only.
  5194. *
  5195. * --> kEventParamTabletEventType (in, typeUInt32)
  5196. * The type of tablet event which generated this mouse event;
  5197. * contains either kEventTabletPoint or kEventTabletProximity.
  5198. * Only present if the event was generated from a tablet.
  5199. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  5200. *
  5201. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  5202. * Further information about the tablet event which generated
  5203. * this mouse event. Present if the the
  5204. * kEventParamTabletEventType parameter contains
  5205. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  5206. * 1.5, and later.
  5207. *
  5208. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  5209. * Further information about the tablet event which generated
  5210. * this mouse event. Present if the the
  5211. * kEventParamTabletEventType parameter contains
  5212. * kEventTabletProximity. Available on Mac OS X 10.1 and
  5213. * CarbonLib 1.5, and later.
  5214. *
  5215. * Availability:
  5216. * Mac OS X: in version 10.0 and later in Carbon.framework
  5217. * CarbonLib: in CarbonLib 1.1 and later
  5218. }
  5219. const
  5220. kEventWindowClickZoomRgn = 36;
  5221. {
  5222. * kEventClassWindow / kEventWindowClickContentRgn
  5223. *
  5224. * Summary:
  5225. * Sent when the mouse is clicked in the content region.
  5226. *
  5227. * Discussion:
  5228. * The standard window handler responds to this event by checking if
  5229. * the click should display a contextual menu; if so, and if the
  5230. * click was in an enabled control, it calls
  5231. * HandleControlContextualMenuSelect. If the click was not in a
  5232. * control, or if the control does not display a contextual menu,
  5233. * the standard window handler sends a
  5234. * kEventWindowContextualMenuSelect event to the window.
  5235. *
  5236. * If the click was not a contextual menu click, then the standard
  5237. * window handler uses HIViewGetViewForMouseEvent to determine the
  5238. * HIView containing the click. If a view is found, the standard
  5239. * window handler calls HIViewClick, which will generate a
  5240. * kEventControlClick event.
  5241. *
  5242. * If no view is found that contains the click, or if the containing
  5243. * view does not handle the click, then the standard window handler
  5244. * sends a kEventWindowHandleContentClick event.
  5245. *
  5246. * Note that this event is not sent for composited windows; all
  5247. * mouse-downs in a composited window are handled by a view, and
  5248. * there is no Ócontent regionÓ in a composited window. To intercept
  5249. * a content region click in a composited window, install a
  5250. * kEventControlClick handler on the windowÕs content view, or
  5251. * provide your own HIView subclass.
  5252. *
  5253. * Mac OS X threading:
  5254. * Not thread safe
  5255. *
  5256. * Parameters:
  5257. *
  5258. * --> kEventParamDirectObject (in, typeWindowRef)
  5259. * The window that was clicked.
  5260. *
  5261. * --> kEventParamMouseLocation (in, typeHIPoint)
  5262. * The mouse location, in global coordinates.
  5263. *
  5264. * --> kEventParamWindowRef (in, typeWindowRef)
  5265. * The window under the mouse. Available in Mac OS X 10.1 and
  5266. * later.
  5267. *
  5268. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  5269. * The window-relative position of the mouse in the window
  5270. * given in the kEventParamWindowRef parameter. 0,0 is at the
  5271. * top left of the structure of the window. Available in Mac
  5272. * OS X 10.1 and later.
  5273. *
  5274. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  5275. * The part code that the mouse location hit in the window.
  5276. * This parameter only exists if the WindowRef parameter
  5277. * exists. This saves you the trouble of calling FindWindow,
  5278. * which is expensive on Mac OS X as it needs to call the
  5279. * Window Server. Available in Mac OS X 10.3 and later.
  5280. *
  5281. * --> kEventParamKeyModifiers (in, typeUInt32)
  5282. * The keyboard modifiers that were pressed when the event was
  5283. * generated.
  5284. *
  5285. * --> kEventParamMouseButton (in, typeMouseButton)
  5286. * Which mouse button was pressed.
  5287. *
  5288. * --> kEventParamClickCount (in, typeUInt32)
  5289. * Whether this is a single click, double click, etc.
  5290. *
  5291. * --> kEventParamMouseChord (in, typeUInt32)
  5292. * Which other mouse buttons were pressed when the event was
  5293. * generated. Available on Mac OS X only.
  5294. *
  5295. * --> kEventParamTabletEventType (in, typeUInt32)
  5296. * The type of tablet event which generated this mouse event;
  5297. * contains either kEventTabletPoint or kEventTabletProximity.
  5298. * Only present if the event was generated from a tablet.
  5299. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  5300. *
  5301. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  5302. * Further information about the tablet event which generated
  5303. * this mouse event. Present if the the
  5304. * kEventParamTabletEventType parameter contains
  5305. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  5306. * 1.5, and later.
  5307. *
  5308. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  5309. * Further information about the tablet event which generated
  5310. * this mouse event. Present if the the
  5311. * kEventParamTabletEventType parameter contains
  5312. * kEventTabletProximity. Available on Mac OS X 10.1 and
  5313. * CarbonLib 1.5, and later.
  5314. *
  5315. * Availability:
  5316. * Mac OS X: in version 10.0 and later in Carbon.framework
  5317. * CarbonLib: in CarbonLib 1.1 and later
  5318. }
  5319. const
  5320. kEventWindowClickContentRgn = 37;
  5321. {
  5322. * kEventClassWindow / kEventWindowClickProxyIconRgn
  5323. *
  5324. * Summary:
  5325. * Sent when the mouse is clicked in the proxy icon.
  5326. *
  5327. * Discussion:
  5328. * The standard window handler responds to this event by handling
  5329. * proxy icon dragging. It first sends a kEventWindowProxyBeginDrag
  5330. * event to allow customization of the DragRef, and then calls
  5331. * TrackWindowProxyFromExistingDrag. Finally, the standard window
  5332. * handler sends a kEventWindowProxyEndDrag event. Note that this
  5333. * event is not sent for composited windows; the window title view
  5334. * handles the mouse-down event directly. To intercept a proxy icon
  5335. * region click in a composited window, install a kEventControlClick
  5336. * handler on the windowÕs title view.
  5337. *
  5338. * Mac OS X threading:
  5339. * Not thread safe
  5340. *
  5341. * Parameters:
  5342. *
  5343. * --> kEventParamDirectObject (in, typeWindowRef)
  5344. * The window that was clicked.
  5345. *
  5346. * --> kEventParamMouseLocation (in, typeHIPoint)
  5347. * The mouse location, in global coordinates.
  5348. *
  5349. * --> kEventParamWindowRef (in, typeWindowRef)
  5350. * The window under the mouse. Available in Mac OS X 10.1 and
  5351. * later.
  5352. *
  5353. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  5354. * The window-relative position of the mouse in the window
  5355. * given in the kEventParamWindowRef parameter. 0,0 is at the
  5356. * top left of the structure of the window. Available in Mac
  5357. * OS X 10.1 and later.
  5358. *
  5359. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  5360. * The part code that the mouse location hit in the window.
  5361. * This parameter only exists if the WindowRef parameter
  5362. * exists. This saves you the trouble of calling FindWindow,
  5363. * which is expensive on Mac OS X as it needs to call the
  5364. * Window Server. Available in Mac OS X 10.3 and later.
  5365. *
  5366. * --> kEventParamKeyModifiers (in, typeUInt32)
  5367. * The keyboard modifiers that were pressed when the event was
  5368. * generated.
  5369. *
  5370. * --> kEventParamMouseButton (in, typeMouseButton)
  5371. * Which mouse button was pressed.
  5372. *
  5373. * --> kEventParamClickCount (in, typeUInt32)
  5374. * Whether this is a single click, double click, etc.
  5375. *
  5376. * --> kEventParamMouseChord (in, typeUInt32)
  5377. * Which other mouse buttons were pressed when the event was
  5378. * generated. Available on Mac OS X only.
  5379. *
  5380. * --> kEventParamTabletEventType (in, typeUInt32)
  5381. * The type of tablet event which generated this mouse event;
  5382. * contains either kEventTabletPoint or kEventTabletProximity.
  5383. * Only present if the event was generated from a tablet.
  5384. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  5385. *
  5386. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  5387. * Further information about the tablet event which generated
  5388. * this mouse event. Present if the the
  5389. * kEventParamTabletEventType parameter contains
  5390. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  5391. * 1.5, and later.
  5392. *
  5393. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  5394. * Further information about the tablet event which generated
  5395. * this mouse event. Present if the the
  5396. * kEventParamTabletEventType parameter contains
  5397. * kEventTabletProximity. Available on Mac OS X 10.1 and
  5398. * CarbonLib 1.5, and later.
  5399. *
  5400. * Availability:
  5401. * Mac OS X: in version 10.0 and later in Carbon.framework
  5402. * CarbonLib: in CarbonLib 1.1 and later
  5403. }
  5404. const
  5405. kEventWindowClickProxyIconRgn = 38;
  5406. {
  5407. * kEventClassWindow / kEventWindowClickToolbarButtonRgn
  5408. *
  5409. * Summary:
  5410. * Sent when the mouse is clicked in the toolbar button.
  5411. *
  5412. * Discussion:
  5413. * For all windows, the basic window handler responds to this event
  5414. * by tracking the click in the toolbar button. If the mouse is
  5415. * released while still in the button, the basic window handler
  5416. * sends a kEventWindowToolbarSwitchMode event. Note that this event
  5417. * is not sent for composited windows; the window toolbar button
  5418. * view handles the mouse-down event directly. To intercept a
  5419. * toolbar button region click in a composited window, install a
  5420. * kEventControlClick handler on the windowÕs toolbar button view.
  5421. *
  5422. * Mac OS X threading:
  5423. * Not thread safe
  5424. *
  5425. * Parameters:
  5426. *
  5427. * --> kEventParamDirectObject (in, typeWindowRef)
  5428. * The window that was clicked.
  5429. *
  5430. * --> kEventParamMouseLocation (in, typeHIPoint)
  5431. * The mouse location, in global coordinates.
  5432. *
  5433. * --> kEventParamWindowRef (in, typeWindowRef)
  5434. * The window under the mouse. Available in Mac OS X 10.1 and
  5435. * later.
  5436. *
  5437. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  5438. * The window-relative position of the mouse in the window
  5439. * given in the kEventParamWindowRef parameter. 0,0 is at the
  5440. * top left of the structure of the window. Available in Mac
  5441. * OS X 10.1 and later.
  5442. *
  5443. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  5444. * The part code that the mouse location hit in the window.
  5445. * This parameter only exists if the WindowRef parameter
  5446. * exists. This saves you the trouble of calling FindWindow,
  5447. * which is expensive on Mac OS X as it needs to call the
  5448. * Window Server. Available in Mac OS X 10.3 and later.
  5449. *
  5450. * --> kEventParamKeyModifiers (in, typeUInt32)
  5451. * The keyboard modifiers that were pressed when the event was
  5452. * generated.
  5453. *
  5454. * --> kEventParamMouseButton (in, typeMouseButton)
  5455. * Which mouse button was pressed.
  5456. *
  5457. * --> kEventParamClickCount (in, typeUInt32)
  5458. * Whether this is a single click, double click, etc.
  5459. *
  5460. * --> kEventParamMouseChord (in, typeUInt32)
  5461. * Which other mouse buttons were pressed when the event was
  5462. * generated. Available on Mac OS X only.
  5463. *
  5464. * --> kEventParamTabletEventType (in, typeUInt32)
  5465. * The type of tablet event which generated this mouse event;
  5466. * contains either kEventTabletPoint or kEventTabletProximity.
  5467. * Only present if the event was generated from a tablet.
  5468. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  5469. *
  5470. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  5471. * Further information about the tablet event which generated
  5472. * this mouse event. Present if the the
  5473. * kEventParamTabletEventType parameter contains
  5474. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  5475. * 1.5, and later.
  5476. *
  5477. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  5478. * Further information about the tablet event which generated
  5479. * this mouse event. Present if the the
  5480. * kEventParamTabletEventType parameter contains
  5481. * kEventTabletProximity. Available on Mac OS X 10.1 and
  5482. * CarbonLib 1.5, and later.
  5483. *
  5484. * Availability:
  5485. * Mac OS X: in version 10.0 and later in Carbon.framework
  5486. * CarbonLib: not available
  5487. }
  5488. const
  5489. kEventWindowClickToolbarButtonRgn = 41;
  5490. {
  5491. * kEventClassWindow / kEventWindowClickStructureRgn
  5492. *
  5493. * Summary:
  5494. * Sent when the mouse is clicked in some part of the window
  5495. * structure other than the window widgets, drag region, or resize
  5496. * region.
  5497. *
  5498. * Discussion:
  5499. * The standard window handler responds to this event by calling
  5500. * HIViewGetViewForMouseEvent to determine the HIView containing the
  5501. * click. If a view is found, the standard window handler calls
  5502. * HIViewClick, which will generate a kEventControlClick event. Note
  5503. * that this event is not sent for composited windows; all parts of
  5504. * the window frame are built from views, and the mouse will never
  5505. * land outside of a view.
  5506. *
  5507. * Mac OS X threading:
  5508. * Not thread safe
  5509. *
  5510. * Parameters:
  5511. *
  5512. * --> kEventParamDirectObject (in, typeWindowRef)
  5513. * The window that was clicked.
  5514. *
  5515. * --> kEventParamMouseLocation (in, typeHIPoint)
  5516. * The mouse location, in global coordinates.
  5517. *
  5518. * --> kEventParamWindowRef (in, typeWindowRef)
  5519. * The window under the mouse. Available in Mac OS X 10.1 and
  5520. * later.
  5521. *
  5522. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  5523. * The window-relative position of the mouse in the window
  5524. * given in the kEventParamWindowRef parameter. 0,0 is at the
  5525. * top left of the structure of the window. Available in Mac
  5526. * OS X 10.1 and later.
  5527. *
  5528. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  5529. * The part code that the mouse location hit in the window.
  5530. * This parameter only exists if the WindowRef parameter
  5531. * exists. This saves you the trouble of calling FindWindow,
  5532. * which is expensive on Mac OS X as it needs to call the
  5533. * Window Server. Available in Mac OS X 10.3 and later.
  5534. *
  5535. * --> kEventParamKeyModifiers (in, typeUInt32)
  5536. * The keyboard modifiers that were pressed when the event was
  5537. * generated.
  5538. *
  5539. * --> kEventParamMouseButton (in, typeMouseButton)
  5540. * Which mouse button was pressed.
  5541. *
  5542. * --> kEventParamClickCount (in, typeUInt32)
  5543. * Whether this is a single click, double click, etc.
  5544. *
  5545. * --> kEventParamMouseChord (in, typeUInt32)
  5546. * Which other mouse buttons were pressed when the event was
  5547. * generated. Available on Mac OS X only.
  5548. *
  5549. * --> kEventParamTabletEventType (in, typeUInt32)
  5550. * The type of tablet event which generated this mouse event;
  5551. * contains either kEventTabletPoint or kEventTabletProximity.
  5552. * Only present if the event was generated from a tablet.
  5553. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  5554. *
  5555. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  5556. * Further information about the tablet event which generated
  5557. * this mouse event. Present if the the
  5558. * kEventParamTabletEventType parameter contains
  5559. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  5560. * 1.5, and later.
  5561. *
  5562. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  5563. * Further information about the tablet event which generated
  5564. * this mouse event. Present if the the
  5565. * kEventParamTabletEventType parameter contains
  5566. * kEventTabletProximity. Available on Mac OS X 10.1 and
  5567. * CarbonLib 1.5, and later.
  5568. *
  5569. * Availability:
  5570. * Mac OS X: in version 10.1 and later in Carbon.framework
  5571. * CarbonLib: not available
  5572. }
  5573. const
  5574. kEventWindowClickStructureRgn = 42;
  5575. {
  5576. * kEventClassWindow / kEventWindowCursorChange
  5577. *
  5578. * Summary:
  5579. * Sent when the mouse is moving over the content region of a window.
  5580. *
  5581. * Discussion:
  5582. * This event is used to manage ownership of the cursor. You should
  5583. * only change the cursor if you receive this event; otherwise,
  5584. * someone else needed to adjust the cursor and handled the event
  5585. * (e.g., a TSM Input Method when the mouse is over an inline input
  5586. * region). This event is only sent to the window itself; it is not
  5587. * propagated to controls in the window.
  5588. *
  5589. * Mac OS X threading:
  5590. * Not thread safe
  5591. *
  5592. * Parameters:
  5593. *
  5594. * --> kEventParamDirectObject (in, typeWindowRef)
  5595. * The window under the mouse.
  5596. *
  5597. * --> kEventParamMouseLocation (in, typeQDPoint)
  5598. * The mouse location in global coordinates.
  5599. *
  5600. * --> kEventParamKeyModifiers (in, typeUInt32)
  5601. * The current keyboard modifiers.
  5602. *
  5603. * Availability:
  5604. * Mac OS X: in version 10.0 and later in Carbon.framework
  5605. * CarbonLib: in CarbonLib 1.5 and later
  5606. }
  5607. const
  5608. kEventWindowCursorChange = 40;
  5609. {
  5610. * kEventClassWindow / kEventWindowCollapse
  5611. *
  5612. * Summary:
  5613. * A request to collapse a window.
  5614. *
  5615. * Discussion:
  5616. * For all windows, the basic window handler responds to this event
  5617. * by calling CollapseWindow, passing true for the collapse
  5618. * parameter, which sends kEventWindowCollapsing and
  5619. * kEventWindowCollapsed events. This event is generated by the
  5620. * standard window handler in response to a click in a windowÕs
  5621. * collapse button. It is also generated by the basic window handler
  5622. * when Minimize or Collapse is selected from the standard window
  5623. * menu.
  5624. *
  5625. * Mac OS X threading:
  5626. * Not thread safe
  5627. *
  5628. * Parameters:
  5629. *
  5630. * --> kEventParamDirectObject (in, typeWindowRef)
  5631. * The window that should collapse.
  5632. *
  5633. * Availability:
  5634. * Mac OS X: in version 10.0 and later in Carbon.framework
  5635. * CarbonLib: in CarbonLib 1.1 and later
  5636. }
  5637. const
  5638. kEventWindowCollapse = 66;
  5639. {
  5640. * kEventClassWindow / kEventWindowCollapseAll
  5641. *
  5642. * Summary:
  5643. * A request to collapse all windows.
  5644. *
  5645. * Discussion:
  5646. * For all windows, the basic window handler responds to this event
  5647. * by calling CollapseAllWindows, passing true for the collapse
  5648. * parameter. CollapseAllWindows simply calls CollapseWindow on each
  5649. * window; it does not send a kEventWindowCollapse to each window.
  5650. * This event is generated by the standard window handler in
  5651. * response to an option-click in a windowÕs collapse button. It is
  5652. * also generated by the basic window handler when Minimize All or
  5653. * Collapse All is selected from the standard window menu.
  5654. *
  5655. * Mac OS X threading:
  5656. * Not thread safe
  5657. *
  5658. * Parameters:
  5659. *
  5660. * --> kEventParamDirectObject (in, typeWindowRef)
  5661. * The window whose collapse button was clicked.
  5662. *
  5663. * Availability:
  5664. * Mac OS X: in version 10.0 and later in Carbon.framework
  5665. * CarbonLib: in CarbonLib 1.1 and later
  5666. }
  5667. const
  5668. kEventWindowCollapseAll = 68;
  5669. {
  5670. * kEventClassWindow / kEventWindowExpand
  5671. *
  5672. * Summary:
  5673. * A request to expand a window.
  5674. *
  5675. * Discussion:
  5676. * For all windows, the basic window handler responds to this event
  5677. * by calling CollapseWindow, passing false for the collapse
  5678. * parameter, which sends kEventWindowExpanding and
  5679. * kEventWindowExpanded events. This event is generated by the
  5680. * standard window handler in responds to a click in a collapsed
  5681. * windowÕs collapse button. It is also generated by the basic
  5682. * window handler when Uncollapse is selected from from the standard
  5683. * window menu provided by CarbonLib.
  5684. *
  5685. * Note that you will not receive this event on Mac OS X before a
  5686. * window is expanded from the Dock, since minimized windows in the
  5687. * dock donÕt uses collapse buttons to unminimize. However, you will
  5688. * still receive kEventWindowExpanding and kEventWindowExpanded in
  5689. * that case. You will receive this event on Mac OS 8 and 9 using
  5690. * CarbonLib since collapsed windows do have a collapse button there.
  5691. *
  5692. * Mac OS X threading:
  5693. * Not thread safe
  5694. *
  5695. * Parameters:
  5696. *
  5697. * --> kEventParamDirectObject (in, typeWindowRef)
  5698. * The window that should expand.
  5699. *
  5700. * Availability:
  5701. * Mac OS X: in version 10.0 and later in Carbon.framework
  5702. * CarbonLib: in CarbonLib 1.1 and later
  5703. }
  5704. const
  5705. kEventWindowExpand = 69;
  5706. {
  5707. * kEventClassWindow / kEventWindowExpandAll
  5708. *
  5709. * Summary:
  5710. * A request to expand all windows.
  5711. *
  5712. * Discussion:
  5713. * For all windows, the basic window handler responds to this event
  5714. * by calling CollapseAllWindows, passing false for the collapse
  5715. * parameter. On Mac OS X 10.3 and later, CollapseAllWindows sends a
  5716. * kEventWindowExpand event to each window; on earlier version of
  5717. * Mac OS X, and in CarbonLib, it simply calls CollapseWindow on
  5718. * each window. This event is generated by the standard window
  5719. * handler in response to an option-click in a windowÕs collapse
  5720. * button. It is also generated by the basic window handler when
  5721. * Uncollapse All is selected from the standard window menu provided
  5722. * by CarbonLib.
  5723. *
  5724. * Mac OS X threading:
  5725. * Not thread safe
  5726. *
  5727. * Parameters:
  5728. *
  5729. * --> kEventParamDirectObject (in, typeWindowRef)
  5730. * The window whose collapse button was clicked.
  5731. *
  5732. * Availability:
  5733. * Mac OS X: in version 10.0 and later in Carbon.framework
  5734. * CarbonLib: in CarbonLib 1.1 and later
  5735. }
  5736. const
  5737. kEventWindowExpandAll = 71;
  5738. {
  5739. * kEventClassWindow / kEventWindowClose
  5740. *
  5741. * Summary:
  5742. * A request to close a window.
  5743. *
  5744. * Discussion:
  5745. * The standard window handler responds to this event by calling
  5746. * DisposeWindow. This event is generated by the standard window
  5747. * handler in response to a click in a windowÕs close button. On Mac
  5748. * OS X 10.3 and later, it is also generated when the Close menu
  5749. * item is selected from the Dock menu of a minimized window.
  5750. *
  5751. *
  5752. * Your application would typically intercept this event to check if
  5753. * the windowÕs document is dirty, and display a Save Changes alert
  5754. * if so.
  5755. *
  5756. * In order to support closing minimized windows from the Dock, your
  5757. * application must provide an event hander for this event,
  5758. * installed on the windowÕs event target, even if your application
  5759. * does not use the standard window handler or otherwise use Carbon
  5760. * events.
  5761. *
  5762. * Mac OS X threading:
  5763. * Not thread safe
  5764. *
  5765. * Parameters:
  5766. *
  5767. * --> kEventParamDirectObject (in, typeWindowRef)
  5768. * The window that should close.
  5769. *
  5770. * Availability:
  5771. * Mac OS X: in version 10.0 and later in Carbon.framework
  5772. * CarbonLib: in CarbonLib 1.1 and later
  5773. }
  5774. const
  5775. kEventWindowClose = 72;
  5776. {
  5777. * kEventClassWindow / kEventWindowCloseAll
  5778. *
  5779. * Summary:
  5780. * A request to close all windows.
  5781. *
  5782. * Discussion:
  5783. * The standard window handler responds to this event by sending a
  5784. * kEventWindowClose event to all visible windows of the same window
  5785. * class as the target window. This event is generated by the
  5786. * standard window handler in response to an option-click in a
  5787. * windowÕs close button.
  5788. *
  5789. * Mac OS X threading:
  5790. * Not thread safe
  5791. *
  5792. * Parameters:
  5793. *
  5794. * --> kEventParamDirectObject (in, typeWindowRef)
  5795. * The window whose close button was clicked.
  5796. *
  5797. * Availability:
  5798. * Mac OS X: in version 10.0 and later in Carbon.framework
  5799. * CarbonLib: in CarbonLib 1.1 and later
  5800. }
  5801. const
  5802. kEventWindowCloseAll = 74;
  5803. {
  5804. * kEventClassWindow / kEventWindowZoom
  5805. *
  5806. * Summary:
  5807. * A request to zoom a window.
  5808. *
  5809. * Discussion:
  5810. * For all windows, the basic window handler responds to this event
  5811. * by sending a kEventWindowIdealSize event to get the windowÕs
  5812. * ideal size, and then calling ZoomWindowIdeal. This event is
  5813. * generated by the standard window handler in response to a click
  5814. * in the windowÕs zoom button. It is also generated by the basic
  5815. * window handler when Zoom is selected from the standard window
  5816. * menu.
  5817. *
  5818. * Mac OS X threading:
  5819. * Not thread safe
  5820. *
  5821. * Parameters:
  5822. *
  5823. * --> kEventParamDirectObject (in, typeWindowRef)
  5824. * The window that should zoom.
  5825. *
  5826. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  5827. * The part code (inZoomIn or inZoomOut) that should be passed
  5828. * to ZoomWindow or ZoomWindowIdeal. This parameter is
  5829. * optional and may not be present in all instances of this
  5830. * event. If present, the event handler should determine if
  5831. * the window is already in the requested state (i.e., if the
  5832. * part code is inZoomOut and the window is already in the
  5833. * standard state), and if so, the event handler should not
  5834. * zoom the window at all. If this parameter is not present,
  5835. * the event handler should zoom the window based on its
  5836. * current state. This parameter is available in Mac OS X 10.3
  5837. * and later.
  5838. *
  5839. * Availability:
  5840. * Mac OS X: in version 10.0 and later in Carbon.framework
  5841. * CarbonLib: in CarbonLib 1.1 and later
  5842. }
  5843. const
  5844. kEventWindowZoom = 75;
  5845. {
  5846. * kEventClassWindow / kEventWindowZoomAll
  5847. *
  5848. * Summary:
  5849. * A request to zoom all windows.
  5850. *
  5851. * Discussion:
  5852. * The standard window handler responds to this event by zooming all
  5853. * visible windows of the same window class as the target window. On
  5854. * Mac OS X 10.3 and later, it causes each window to zoom by sending
  5855. * a kEventWindowZoom event to the window; on earlier versions of
  5856. * Mac OS X, and in CarbonLib, it simply calls ZoomWindowIdeal on
  5857. * each window. This event is generated by the standard window
  5858. * handler in response to an option-click on a windowÕs zoom button.
  5859. *
  5860. *
  5861. * After zooming all of the windows, if the windows are being zoomed
  5862. * out and the window class of the target window is
  5863. * kDocumentWindowClass, the windows are cascaded by sending a
  5864. * kEventCommandProcess event with the kHICommandArrangeInFront
  5865. * command to the target window.
  5866. *
  5867. * Mac OS X threading:
  5868. * Not thread safe
  5869. *
  5870. * Parameters:
  5871. *
  5872. * --> kEventParamDirectObject (in, typeWindowRef)
  5873. * The window whose zoom button was clicked.
  5874. *
  5875. * Availability:
  5876. * Mac OS X: in version 10.0 and later in Carbon.framework
  5877. * CarbonLib: in CarbonLib 1.1 and later
  5878. }
  5879. const
  5880. kEventWindowZoomAll = 77;
  5881. {
  5882. * kEventClassWindow / kEventWindowContextualMenuSelect
  5883. *
  5884. * Summary:
  5885. * A request to display a contextual menu.
  5886. *
  5887. * Discussion:
  5888. * This event is generated by the standard window handler in
  5889. * response to a contextual menu click in the content area of a
  5890. * window. In response to such an event, the standard window handler
  5891. * first checks if the click is on a control, and if so, calls
  5892. * HandleControlContextualMenuClick. If the click was not on a
  5893. * control, or if HandleControlContextualMenuClick returned that it
  5894. * did not handle the click, then the standard window handler sends
  5895. * kEventWindowContextualMenuSelect to allow the application to
  5896. * provide its own customized contextual menu. The standard window
  5897. * handler does not respond to this event itself.
  5898. *
  5899. * Mac OS X threading:
  5900. * Not thread safe
  5901. *
  5902. * Parameters:
  5903. *
  5904. * --> kEventParamDirectObject (in, typeWindowRef)
  5905. * The window that should collapse.
  5906. *
  5907. * --> kEventParamMouseLocation (in, typeHIPoint)
  5908. * The mouse location, in global coordinates.
  5909. *
  5910. * --> kEventParamWindowRef (in, typeWindowRef)
  5911. * The window under the mouse. Available in Mac OS X 10.1 and
  5912. * later.
  5913. *
  5914. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  5915. * The window-relative position of the mouse in the window
  5916. * given in the kEventParamWindowRef parameter. 0,0 is at the
  5917. * top left of the structure of the window. Available in Mac
  5918. * OS X 10.1 and later.
  5919. *
  5920. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  5921. * The part code that the mouse location hit in the window.
  5922. * This parameter only exists if the WindowRef parameter
  5923. * exists. This saves you the trouble of calling FindWindow,
  5924. * which is expensive on Mac OS X as it needs to call the
  5925. * Window Server. Available in Mac OS X 10.3 and later.
  5926. *
  5927. * --> kEventParamKeyModifiers (in, typeUInt32)
  5928. * The keyboard modifiers that were pressed when the event was
  5929. * generated.
  5930. *
  5931. * --> kEventParamMouseButton (in, typeMouseButton)
  5932. * Which mouse button was pressed.
  5933. *
  5934. * --> kEventParamClickCount (in, typeUInt32)
  5935. * Whether this is a single click, double click, etc.
  5936. *
  5937. * --> kEventParamMouseChord (in, typeUInt32)
  5938. * Which other mouse buttons were pressed when the event was
  5939. * generated. Available on Mac OS X only.
  5940. *
  5941. * --> kEventParamTabletEventType (in, typeUInt32)
  5942. * The type of tablet event which generated this mouse event;
  5943. * contains either kEventTabletPoint or kEventTabletProximity.
  5944. * Only present if the event was generated from a tablet.
  5945. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  5946. *
  5947. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  5948. * Further information about the tablet event which generated
  5949. * this mouse event. Present if the the
  5950. * kEventParamTabletEventType parameter contains
  5951. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  5952. * 1.5, and later.
  5953. *
  5954. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  5955. * Further information about the tablet event which generated
  5956. * this mouse event. Present if the the
  5957. * kEventParamTabletEventType parameter contains
  5958. * kEventTabletProximity. Available on Mac OS X 10.1 and
  5959. * CarbonLib 1.5, and later.
  5960. *
  5961. * Availability:
  5962. * Mac OS X: in version 10.0 and later in Carbon.framework
  5963. * CarbonLib: in CarbonLib 1.1 and later
  5964. }
  5965. const
  5966. kEventWindowContextualMenuSelect = 78;
  5967. {
  5968. * kEventClassWindow / kEventWindowPathSelect
  5969. *
  5970. * Summary:
  5971. * Allows customization of the path-selection popup menu displayed
  5972. * over a windowÕs title.
  5973. *
  5974. * Discussion:
  5975. * This event is generated by the standard window handler in
  5976. * response to a click in a windowÕs drag region. In response to
  5977. * such an event, the standard window handler first calls
  5978. * IsWindowPathSelectEvent to determine if the click should cause a
  5979. * path-selection popup menu to be displayed. If so, and if the
  5980. * window is also hilited and has a proxy icon, the standard window
  5981. * handler sends a kEventWindowPathSelect event to the window.
  5982. *
  5983. *
  5984. * A handler for this event should put a MenuRef into the event and
  5985. * return noErr to cause the menu to be displayed as the path
  5986. * selection popup menu. The menu will not be released by the
  5987. * standard window handler; however, in Mac OS X 10.4 and later, it
  5988. * will be retained by the EventRef when added to the event, and
  5989. * released when the event is destroyed, so a handler for this event
  5990. * may, on Mac OS X 10.4 and later, release the menu after adding it
  5991. * to the menu.
  5992. *
  5993. * Note! The standard window handler's use of this event was broken
  5994. * in all releases of CarbonLib and Mac OS X before Mac OS X 10.4;
  5995. * the MenuRef added to this event was not used to display the path
  5996. * selection menu. Therefore, this event is effectively useless
  5997. * before Mac OS X 10.4.
  5998. *
  5999. * Mac OS X threading:
  6000. * Not thread safe
  6001. *
  6002. * Parameters:
  6003. *
  6004. * --> kEventParamDirectObject (in, typeWindowRef)
  6005. * The window that will display the path-selection popup menu.
  6006. *
  6007. * <-- kEventParamMenuRef (out, typeMenuRef)
  6008. * On exit, contains the menu that should be displayed.
  6009. *
  6010. * Availability:
  6011. * Mac OS X: in version 10.0 and later in Carbon.framework
  6012. * CarbonLib: in CarbonLib 1.1 and later
  6013. }
  6014. const
  6015. kEventWindowPathSelect = 79;
  6016. {
  6017. * kEventClassWindow / kEventWindowGetIdealSize
  6018. *
  6019. * Summary:
  6020. * A request for the ideal size of a windowÕs content region, for
  6021. * use during window zooming.
  6022. *
  6023. * Discussion:
  6024. * This event is generated by the basic window handler in response
  6025. * to kEventWindowZoom. The basic window handler sends this event to
  6026. * the window to get the windowÕs ideal size, and passes the
  6027. * resulting size to ZoomWindowIdeal.
  6028. *
  6029. * This event is not handled by either the basic or standard window
  6030. * handlers. If no handler responds to this event, the basic window
  6031. * handler uses an ideal size based on the size of the monitor on
  6032. * which the window is located.
  6033. *
  6034. * Prior to Mac OS X Mac OS X 10.4, the ZoomWindowIdeal API
  6035. * malfunctioned if passed an idealSize that was large enough to
  6036. * cause 16-bit integer overflow when added to the window's current
  6037. * position. Therefore, when providing an ideal size in response to
  6038. * this event, you should generally not return values that are close
  6039. * to 32767. It is better to limit your ideal size to, say, 16K.
  6040. *
  6041. * Mac OS X threading:
  6042. * Not thread safe
  6043. *
  6044. * Parameters:
  6045. *
  6046. * --> kEventParamDirectObject (in, typeWindowRef)
  6047. * The window being zoomed.
  6048. *
  6049. * <-- kEventParamDimensions (out, typeQDPoint)
  6050. * On exit, contains the windowÕs ideal size.
  6051. *
  6052. * Availability:
  6053. * Mac OS X: in version 10.0 and later in Carbon.framework
  6054. * CarbonLib: in CarbonLib 1.1 and later
  6055. }
  6056. const
  6057. kEventWindowGetIdealSize = 80;
  6058. {
  6059. * kEventClassWindow / kEventWindowGetMinimumSize
  6060. *
  6061. * Summary:
  6062. * A request for the minimum size of a windowÕs content region, for
  6063. * use during window resizing.
  6064. *
  6065. * Discussion:
  6066. * This event is generated by the standard window handler before
  6067. * resizing a window. On Mac OS X 10.2 and later, the basic window
  6068. * handler responds to this event by calling GetWindowResizeLimits
  6069. * and returning the minimum size in the event; on earlier versions
  6070. * of Mac OS X and CarbonLib, this event is not handled by the basic
  6071. * or standard window handlers.
  6072. *
  6073. * On Mac OS X 10.2 and CarbonLib 1.6 and later, this event is also
  6074. * generated by ResizeWindow and GrowWindow if the sizeConstraints
  6075. * parameter is NULL.
  6076. *
  6077. * Mac OS X threading:
  6078. * Not thread safe
  6079. *
  6080. * Parameters:
  6081. *
  6082. * --> kEventParamDirectObject (in, typeWindowRef)
  6083. * The window being resized.
  6084. *
  6085. * <-- kEventParamDimensions (out, typeQDPoint)
  6086. * On exit, contains the windowÕs minimum size.
  6087. *
  6088. * Availability:
  6089. * Mac OS X: in version 10.0 and later in Carbon.framework
  6090. * CarbonLib: in CarbonLib 1.1 and later
  6091. }
  6092. const
  6093. kEventWindowGetMinimumSize = 81;
  6094. {
  6095. * kEventClassWindow / kEventWindowGetMaximumSize
  6096. *
  6097. * Summary:
  6098. * A request for the maximum size of a windowÕs content region, for
  6099. * use during window resizing.
  6100. *
  6101. * Discussion:
  6102. * This event is generated by the standard window handler before
  6103. * resizing a window. On Mac OS X 10.2 and later, the basic window
  6104. * handler responds to this event by calling GetWindowResizeLimits
  6105. * and returning the maximum size in the event; on earlier versions
  6106. * of Mac OS X and CarbonLib, this event is not handled by the basic
  6107. * or standard window handlers.
  6108. *
  6109. * On Mac OS X 10.2 and CarbonLib 1.6 and later, this event is also
  6110. * generated by ResizeWindow and GrowWindow if the sizeConstraints
  6111. * parameter is NULL.
  6112. *
  6113. * Mac OS X threading:
  6114. * Not thread safe
  6115. *
  6116. * Parameters:
  6117. *
  6118. * --> kEventParamDirectObject (in, typeWindowRef)
  6119. * The window being resized.
  6120. *
  6121. * <-- kEventParamDimensions (out, typeQDPoint)
  6122. * On exit, contains the windowÕs minimum size.
  6123. *
  6124. * Availability:
  6125. * Mac OS X: in version 10.0 and later in Carbon.framework
  6126. * CarbonLib: in CarbonLib 1.1 and later
  6127. }
  6128. const
  6129. kEventWindowGetMaximumSize = 82;
  6130. {
  6131. * kEventClassWindow / kEventWindowConstrain
  6132. *
  6133. * Summary:
  6134. * Requests that a windowÕs position be constrained to the available
  6135. * window positioning bounds.
  6136. *
  6137. * Discussion:
  6138. * The basic window handler responds to this event by calling
  6139. * ConstrainWindowToScreen. This event is generated in two
  6140. * situations: changes in graphics device configuration, and changes
  6141. * to Dock size. In either case, a window which was previously
  6142. * visible onscreen may become obscured or be totally offscreen, and
  6143. * should be repositioned back inside the available window
  6144. * positioning bounds.
  6145. *
  6146. * The behavior of the basic window handler may be customized by
  6147. * modifying the parameters to the event and then allowing the event
  6148. * to pass through to the basic handler, or an application may
  6149. * choose to override the event entirely and perform its own window
  6150. * constraining.
  6151. *
  6152. * Applications may also use the
  6153. * kEventAppAvailableWindowBoundsChanged event to be notified of
  6154. * changes to a deviceÕs available bounds.
  6155. *
  6156. * Mac OS X threading:
  6157. * Not thread safe
  6158. *
  6159. * Parameters:
  6160. *
  6161. * --> kEventParamDirectObject (in, typeWindowRef)
  6162. * The window being constrained.
  6163. *
  6164. * --> kEventParamAvailableBounds (in, typeQDRectangle)
  6165. * The reasons why the window is being constrained. This
  6166. * parameter contains one or more of the
  6167. * kAvailBoundsChangedFor constants. This parameter is
  6168. * available only on Mac OS X 10.3 and later.
  6169. *
  6170. * --> kEventParamAttributes (in, typeUInt32)
  6171. * An integer which is the same for all instances of this
  6172. * event that are produced by the same configuration change.
  6173. * For example, if multiple displays are attached, then this
  6174. * event is sent once for each window on each affected display
  6175. * after a display configuration change; however, the
  6176. * transaction ID parameter will the same for each event, so a
  6177. * handler for this event can correlate events by observing
  6178. * the transaction ID. This parameter is available only on Mac
  6179. * OS X 10.3 and later.
  6180. *
  6181. * --> kEventParamWindowRegionCode (in, typeWindowRegionCode)
  6182. * The available window positioning bounds in which the window
  6183. * should be positioned. Event handlers may change the value
  6184. * in this parameter and then return eventNotHandledErr to
  6185. * allow the basic window handler to constrain the window to
  6186. * the new bounding rect.
  6187. *
  6188. * This parameter is used by the basic window handler on Mac
  6189. * OS X 10.1 and later; on earlier versions of Mac OS X, the
  6190. * basic window handler always constrains the window to the
  6191. * rect returned by GetAvailableWindowPositioningBounds for
  6192. * the windowÕs device.
  6193. *
  6194. * --> kEventParamRgnHandle (in, typeQDRgnHandle)
  6195. * Window constraint options that should be passed to
  6196. * ConstrainWindowToScreen. This parameter is optional and may
  6197. * not be present in all instances of this event. If present,
  6198. * this parameter should be formed from constants in the
  6199. * WindowConstrainOptions enumeration.
  6200. *
  6201. * This parameter is used by the basic window handler on Mac
  6202. * OS X 10.2 and later; on earlier versions of Mac OS X, or if
  6203. * this parameter is missing, the basic window handler passes
  6204. * kWindowConstrainMoveRegardlessOfFit to
  6205. * ConstrainWindowToScreen in Mac OS X 10.0, and
  6206. * kWindowConstrainMoveRegardlessOfFit |
  6207. * kWindowConstrainAllowPartial in Mac OS 10.1 and later.
  6208. *
  6209. * --> kEventParamPreviousDockRect (in, typeHIRect)
  6210. * A WindowRegionCode that should be passed to
  6211. * ConstrainWindowToScreen. This parameter is optional and may
  6212. * not be present in all instances of this event.
  6213. *
  6214. * This parameter is used by the basic window handler on Mac
  6215. * OS X 10.2 and later. On earlier versions of Mac OS X, or if
  6216. * this parameter is missing, the basic window handler passes
  6217. * kWindowDragRgn to ConstrainWindowToScreen.
  6218. *
  6219. * --> kEventParamPreviousDockDevice (in, typeGDHandle)
  6220. * The GrayRgn before a graphics device configuration change.
  6221. * This parameter is optional and may not be present in all
  6222. * instances of this event. It is present in events generated
  6223. * on Mac OS X 10.2 and later.
  6224. *
  6225. * An event handler may compare this region with the current
  6226. * GrayRgn to more intelligently determine whether the window
  6227. * should be constrained to the current GrayRgn. The basic
  6228. * window handler in Mac OS X 10.2 will not constrain windows
  6229. * that were not onscreen before the device configuration
  6230. * change.
  6231. *
  6232. * --> kEventParamCurrentDockRect (in, typeHIRect)
  6233. * The Dock bounding rect before a Dock size change. This
  6234. * parameter is optional and may not be present in all
  6235. * instances of this event. It is present in events in events
  6236. * generated on Mac OS X 10.2 and later.
  6237. *
  6238. * --> kEventParamCurrentDockDevice (in, typeGDHandle)
  6239. * The GDevice on which the Dock was previously positioned.
  6240. * This parameter is optional and may not be present in all
  6241. * instances of this event. It is present in events generated
  6242. * on Mac OS X 10.3 and later.
  6243. *
  6244. * --> kEventParamTabletEventType (in, typeUInt32)
  6245. * The Dock bounding rect after a Dock size change. This
  6246. * parameter is optional and may not be present in all
  6247. * instances of this event. It is present in events in events
  6248. * generated on Mac OS X 10.2 and later.
  6249. *
  6250. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  6251. * The GDevice on which the Dock is currently positioned. This
  6252. * parameter is optional and may not be present in all
  6253. * instances of this event. It is present in events generated
  6254. * on Mac OS X 10.3 and later.
  6255. *
  6256. * Availability:
  6257. * Mac OS X: in version 10.0 and later in Carbon.framework
  6258. * CarbonLib: in CarbonLib 1.5 and later
  6259. }
  6260. const
  6261. kEventWindowConstrain = 83;
  6262. {
  6263. * kEventClassWindow / kEventWindowProxyBeginDrag
  6264. *
  6265. * Summary:
  6266. * Notification that a proxy icon drag is beginning.
  6267. *
  6268. * Discussion:
  6269. * This event includes the DragRef that will be used for the proxy
  6270. * icon drag. An application handler may attach its own data to the
  6271. * DragRef as appropriate for the document content.
  6272. *
  6273. * Mac OS X threading:
  6274. * Not thread safe
  6275. *
  6276. * Parameters:
  6277. *
  6278. * --> kEventParamDirectObject (in, typeWindowRef)
  6279. * The window whose proxy icon is being dragged.
  6280. *
  6281. * --> kEventParamDragRef (in, typeDragRef)
  6282. * The DragRef that will be used for the proxy icon drag.
  6283. *
  6284. * Availability:
  6285. * Mac OS X: in version 10.0 and later in Carbon.framework
  6286. * CarbonLib: in CarbonLib 1.1 and later
  6287. }
  6288. const
  6289. kEventWindowProxyBeginDrag = 128;
  6290. {
  6291. * kEventClassWindow / kEventWindowProxyEndDrag
  6292. *
  6293. * Summary:
  6294. * Notification that a proxy icon drag has ended.
  6295. *
  6296. * Discussion:
  6297. * This event is sent regardless of whether the drag completed
  6298. * successfully, or was canceled by the user.
  6299. *
  6300. * Mac OS X threading:
  6301. * Not thread safe
  6302. *
  6303. * Parameters:
  6304. *
  6305. * --> kEventParamDirectObject (in, typeWindowRef)
  6306. * The window whose proxy icon is being dragged.
  6307. *
  6308. * --> kEventParamDragRef (in, typeDragRef)
  6309. * The DragRef that was used for the proxy icon drag.
  6310. *
  6311. * Availability:
  6312. * Mac OS X: in version 10.0 and later in Carbon.framework
  6313. * CarbonLib: in CarbonLib 1.1 and later
  6314. }
  6315. const
  6316. kEventWindowProxyEndDrag = 129;
  6317. {
  6318. * kEventClassWindow / kEventWindowHandleContentClick
  6319. *
  6320. * Summary:
  6321. * The mouse has been clicked in the content region of a window, but
  6322. * the click is not a contextual menu invocation or a click on a
  6323. * control.
  6324. *
  6325. * Discussion:
  6326. * This event is generated by the standard window handler in
  6327. * response to a kEventWindowClickContentRgn event. An application
  6328. * may handle this event by checking if the mouse click was on a
  6329. * portion of its own user interface, and responding appropriately
  6330. * if so.
  6331. *
  6332. * Mac OS X threading:
  6333. * Not thread safe
  6334. *
  6335. * Parameters:
  6336. *
  6337. * --> kEventParamDirectObject (in, typeWindowRef)
  6338. * The window that was clicked.
  6339. *
  6340. * --> kEventParamMouseLocation (in, typeHIPoint)
  6341. * The mouse location, in global coordinates.
  6342. *
  6343. * --> kEventParamWindowRef (in, typeWindowRef)
  6344. * The window under the mouse. Available in Mac OS X 10.1 and
  6345. * later.
  6346. *
  6347. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  6348. * The window-relative position of the mouse in the window
  6349. * given in the kEventParamWindowRef parameter. 0,0 is at the
  6350. * top left of the structure of the window. Available in Mac
  6351. * OS X 10.1 and later.
  6352. *
  6353. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  6354. * The part code that the mouse location hit in the window.
  6355. * This parameter only exists if the WindowRef parameter
  6356. * exists. This saves you the trouble of calling FindWindow,
  6357. * which is expensive on Mac OS X as it needs to call the
  6358. * Window Server. Available in Mac OS X 10.3 and later.
  6359. *
  6360. * --> kEventParamKeyModifiers (in, typeUInt32)
  6361. * The keyboard modifiers that were pressed when the event was
  6362. * generated.
  6363. *
  6364. * --> kEventParamMouseButton (in, typeMouseButton)
  6365. * Which mouse button was pressed.
  6366. *
  6367. * --> kEventParamClickCount (in, typeUInt32)
  6368. * Whether this is a single click, double click, etc.
  6369. *
  6370. * --> kEventParamMouseChord (in, typeUInt32)
  6371. * Which other mouse buttons were pressed when the event was
  6372. * generated. Available on Mac OS X only.
  6373. *
  6374. * --> kEventParamTabletEventType (in, typeUInt32)
  6375. * The type of tablet event which generated this mouse event;
  6376. * contains either kEventTabletPoint or kEventTabletProximity.
  6377. * Only present if the event was generated from a tablet.
  6378. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  6379. *
  6380. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  6381. * Further information about the tablet event which generated
  6382. * this mouse event. Present if the the
  6383. * kEventParamTabletEventType parameter contains
  6384. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  6385. * 1.5, and later.
  6386. *
  6387. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  6388. * Further information about the tablet event which generated
  6389. * this mouse event. Present if the the
  6390. * kEventParamTabletEventType parameter contains
  6391. * kEventTabletProximity. Available on Mac OS X 10.1 and
  6392. * CarbonLib 1.5, and later.
  6393. *
  6394. * Availability:
  6395. * Mac OS X: in version 10.0 and later in Carbon.framework
  6396. * CarbonLib: in CarbonLib 1.3.1 and later
  6397. }
  6398. const
  6399. kEventWindowHandleContentClick = 85;
  6400. {
  6401. * kEventClassWindow / kEventWindowGetDockTileMenu
  6402. *
  6403. * Summary:
  6404. * A request for a menu to be displayed by a windowÕs dock tile.
  6405. *
  6406. * Discussion:
  6407. * The basic window handler responds to this event by returning the
  6408. * menu, if any, that was provided by the SetWindowDockTileMenu API.
  6409. * For most applications, it will be easier to use the
  6410. * SetWindowDockTileMenu API directly rather than installing a
  6411. * handler for this event.
  6412. *
  6413. * Mac OS X threading:
  6414. * Not thread safe
  6415. *
  6416. * Parameters:
  6417. *
  6418. * --> kEventParamDirectObject (in, typeWindowRef)
  6419. * The window that should collapse.
  6420. *
  6421. * <-- kEventParamMenuRef (out, typeMenuRef)
  6422. * On exit, contains the menu that should be displayed for the
  6423. * windowÕs Dock tile. The sender of this event will release
  6424. * the menu after the Dock has displayed it, so if you return
  6425. * a permanently allocated MenuRef, you should call RetainMenu
  6426. * on it before returning from your event handler.
  6427. *
  6428. * Availability:
  6429. * Mac OS X: in version 10.2 and later in Carbon.framework
  6430. * CarbonLib: not available
  6431. }
  6432. const
  6433. kEventWindowGetDockTileMenu = 90;
  6434. {
  6435. * kEventClassWindow / kEventWindowToolbarSwitchMode
  6436. *
  6437. * Summary:
  6438. * A request that the windowÕs toolbar change its display mode.
  6439. *
  6440. * Discussion:
  6441. * For all windows, the basic window handler responds to this event
  6442. * by changing the display mode of the windowÕs HIToolbar, if any.
  6443. * If the application uses its own custom toolbar implementation, it
  6444. * should handle this event itself and respond appropriately. This
  6445. * event is generated by the basic window handler in response to a
  6446. * click in the windowÕs toolbar button.
  6447. *
  6448. * Mac OS X threading:
  6449. * Not thread safe
  6450. *
  6451. * Parameters:
  6452. *
  6453. * --> kEventParamDirectObject (in, typeWindowRef)
  6454. * The window whose toolbar button was clicked.
  6455. *
  6456. * --> kEventParamMouseLocation (in, typeHIPoint)
  6457. * The mouse location, in global coordinates.
  6458. *
  6459. * --> kEventParamWindowRef (in, typeWindowRef)
  6460. * The window under the mouse. Available in Mac OS X 10.1 and
  6461. * later.
  6462. *
  6463. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  6464. * The window-relative position of the mouse in the window
  6465. * given in the kEventParamWindowRef parameter. 0,0 is at the
  6466. * top left of the structure of the window. Available in Mac
  6467. * OS X 10.1 and later.
  6468. *
  6469. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  6470. * The part code that the mouse location hit in the window.
  6471. * This parameter only exists if the WindowRef parameter
  6472. * exists. This saves you the trouble of calling FindWindow,
  6473. * which is expensive on Mac OS X as it needs to call the
  6474. * Window Server. Available in Mac OS X 10.3 and later.
  6475. *
  6476. * --> kEventParamKeyModifiers (in, typeUInt32)
  6477. * The keyboard modifiers that were pressed when the event was
  6478. * generated.
  6479. *
  6480. * --> kEventParamMouseButton (in, typeMouseButton)
  6481. * Which mouse button was pressed.
  6482. *
  6483. * --> kEventParamClickCount (in, typeUInt32)
  6484. * Whether this is a single click, double click, etc.
  6485. *
  6486. * --> kEventParamMouseChord (in, typeUInt32)
  6487. * Which other mouse buttons were pressed when the event was
  6488. * generated. Available on Mac OS X only.
  6489. *
  6490. * --> kEventParamTabletEventType (in, typeUInt32)
  6491. * The type of tablet event which generated this mouse event;
  6492. * contains either kEventTabletPoint or kEventTabletProximity.
  6493. * Only present if the event was generated from a tablet.
  6494. * Available in Mac OS X 10.1 and CarbonLib 1.5, and later.
  6495. *
  6496. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  6497. * Further information about the tablet event which generated
  6498. * this mouse event. Present if the the
  6499. * kEventParamTabletEventType parameter contains
  6500. * kEventTabletPoint. Available on Mac OS X 10.1 and CarbonLib
  6501. * 1.5, and later.
  6502. *
  6503. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  6504. * Further information about the tablet event which generated
  6505. * this mouse event. Present if the the
  6506. * kEventParamTabletEventType parameter contains
  6507. * kEventTabletProximity. Available on Mac OS X 10.1 and
  6508. * CarbonLib 1.5, and later.
  6509. *
  6510. * Availability:
  6511. * Mac OS X: in version 10.0 and later in Carbon.framework
  6512. * CarbonLib: not available
  6513. }
  6514. const
  6515. kEventWindowToolbarSwitchMode = 150;
  6516. {
  6517. * kEventClassWindow / kEventWindowFocusAcquired
  6518. *
  6519. * Summary:
  6520. * Notification that the user (or some other action) has caused the
  6521. * focus to shift to your window.
  6522. *
  6523. * Discussion:
  6524. * This event is sent to all handlers registered for it.
  6525. *
  6526. * The basic window handler responds to this event by forwarding the
  6527. * event to the focused control in the specified window. This allows
  6528. * the focused control to invalidate or redraw itself as necessary;
  6529. * for example, the standard edit-text control responds to this
  6530. * event by enabling its blinking insertion point. An application
  6531. * handler may choose to set the focus to custom application content
  6532. * instead.
  6533. *
  6534. * Mac OS X threading:
  6535. * Not thread safe
  6536. *
  6537. * Parameters:
  6538. *
  6539. * --> kEventParamDirectObject (in, typeWindowRef)
  6540. * The window that is gaining focus.
  6541. *
  6542. * Availability:
  6543. * Mac OS X: in version 10.0 and later in Carbon.framework
  6544. * CarbonLib: in CarbonLib 1.1 and later
  6545. }
  6546. const
  6547. kEventWindowFocusAcquired = 200;
  6548. {
  6549. * kEventClassWindow / kEventWindowFocusRelinquish
  6550. *
  6551. * Summary:
  6552. * Notification that a window has lost user focus.
  6553. *
  6554. * Discussion:
  6555. * This event is sent to all handlers registered for it.
  6556. *
  6557. * The basic window handler responds to this event by forwarding the
  6558. * event to the focused control in the specified window. This allows
  6559. * the focused control to invalidate or redraw itself as necessary;
  6560. * for example, the standard edit-text control responds to this
  6561. * event by disabling its blinking insertion point. An application
  6562. * handler should remove the focus from custom application content
  6563. * and ensure that the content is redrawn without the focus
  6564. * highlight.
  6565. *
  6566. * Mac OS X threading:
  6567. * Not thread safe
  6568. *
  6569. * Parameters:
  6570. *
  6571. * --> kEventParamDirectObject (in, typeWindowRef)
  6572. * The window that is losing focus.
  6573. *
  6574. * Availability:
  6575. * Mac OS X: in version 10.0 and later in Carbon.framework
  6576. * CarbonLib: in CarbonLib 1.1 and later
  6577. }
  6578. const
  6579. kEventWindowFocusRelinquish = 201;
  6580. {
  6581. * kEventClassWindow / kEventWindowFocusContent
  6582. *
  6583. * Summary:
  6584. * A request to set the focus to the content area of a window.
  6585. *
  6586. * Discussion:
  6587. * If the content area of your window is not already focused, you
  6588. * should set the focus to the main part/control/view of the window.
  6589. * If the content area of your window is already focused, do
  6590. * nothing. The standard window handler responds to this event by
  6591. * calling HIViewAdvanceFocus on the windowÕs root control, if the
  6592. * focus is not already contained within the content root.
  6593. *
  6594. * Mac OS X threading:
  6595. * Not thread safe
  6596. *
  6597. * Parameters:
  6598. *
  6599. * --> kEventParamDirectObject (in, typeWindowRef)
  6600. * The window whose content should be focused.
  6601. *
  6602. * Availability:
  6603. * Mac OS X: in version 10.2 and later in Carbon.framework
  6604. * CarbonLib: not available
  6605. }
  6606. const
  6607. kEventWindowFocusContent = 202;
  6608. {
  6609. * kEventClassWindow / kEventWindowFocusToolbar
  6610. *
  6611. * Summary:
  6612. * A request to set the focus to the toolbar of a window.
  6613. *
  6614. * Discussion:
  6615. * If your windowÕs toolbar is not already focused, you should set
  6616. * the focus to the first item in the toolbar. If your windowÕs
  6617. * toolbar is already focused, do nothing. The basic window handler
  6618. * responds to this event by calling HIViewAdvanceFocus on the
  6619. * toolbar control, if the focus is not already contained within the
  6620. * toolbar.
  6621. *
  6622. * Mac OS X threading:
  6623. * Not thread safe
  6624. *
  6625. * Parameters:
  6626. *
  6627. * --> kEventParamDirectObject (in, typeWindowRef)
  6628. * The window whose toolbar should be focused.
  6629. *
  6630. * Availability:
  6631. * Mac OS X: in version 10.2 and later in Carbon.framework
  6632. * CarbonLib: not available
  6633. }
  6634. const
  6635. kEventWindowFocusToolbar = 203;
  6636. {
  6637. * kEventClassWindow / kEventWindowFocusDrawer
  6638. *
  6639. * Summary:
  6640. * A request to set the focus to the drawer of a window.
  6641. *
  6642. * Discussion:
  6643. * If your windowÕs drawer is not already focused, you should set
  6644. * the focus to the first item in the drawer. If your windowÕs
  6645. * drawer is already focused, you should move the focus to the next
  6646. * or previous drawer, if any, depending on whether the modifiers
  6647. * parameter contains the shift key modifier. The basic window
  6648. * handler responds to this event by calling SetUserFocusWindow on,
  6649. * and sending a kEventWindowFocusContent event to, the appropriate
  6650. * drawer, if the focus is not already contained within the drawer.
  6651. *
  6652. * Mac OS X threading:
  6653. * Not thread safe
  6654. *
  6655. * Parameters:
  6656. *
  6657. * --> kEventParamDirectObject (in, typeWindowRef)
  6658. * The window whose drawer should be focused.
  6659. *
  6660. * --> kEventParamKeyModifiers (in, typeUInt32)
  6661. * The keyboard modifiers that were pressed when the user
  6662. * requested a focus switch.
  6663. *
  6664. * Availability:
  6665. * Mac OS X: in version 10.4 and later in Carbon.framework
  6666. * CarbonLib: not available
  6667. }
  6668. const
  6669. kEventWindowFocusDrawer = 204;
  6670. {
  6671. * kEventClassWindow / kEventWindowSheetOpening
  6672. *
  6673. * Summary:
  6674. * Notification that a sheet is opening.
  6675. *
  6676. * Discussion:
  6677. * This event is sent to all handlers registered for it. This event
  6678. * is sent to the sheet, its parent window, and the application
  6679. * target before the sheet begins opening.
  6680. *
  6681. * Mac OS X threading:
  6682. * Not thread safe
  6683. *
  6684. * Parameters:
  6685. *
  6686. * --> kEventParamDirectObject (in, typeWindowRef)
  6687. * The sheet that is opening.
  6688. *
  6689. * Result:
  6690. * An event handler for this event may return userCanceledErr if the
  6691. * sheet should not open. Any other return value is ignored and will
  6692. * still allow the sheet to open.
  6693. *
  6694. * Availability:
  6695. * Mac OS X: in version 10.4 and later in Carbon.framework
  6696. * CarbonLib: not available
  6697. }
  6698. const
  6699. kEventWindowSheetOpening = 210;
  6700. {
  6701. * kEventClassWindow / kEventWindowSheetOpened
  6702. *
  6703. * Summary:
  6704. * Notification that a sheet is open.
  6705. *
  6706. * Discussion:
  6707. * This event is sent to all handlers registered for it. This event
  6708. * is sent to the sheet, its parent window, and the application
  6709. * target after the sheet is fully open.
  6710. *
  6711. * Mac OS X threading:
  6712. * Not thread safe
  6713. *
  6714. * Parameters:
  6715. *
  6716. * --> kEventParamDirectObject (in, typeWindowRef)
  6717. * The sheet that opened.
  6718. *
  6719. * Availability:
  6720. * Mac OS X: in version 10.4 and later in Carbon.framework
  6721. * CarbonLib: not available
  6722. }
  6723. const
  6724. kEventWindowSheetOpened = 211;
  6725. {
  6726. * kEventClassWindow / kEventWindowSheetClosing
  6727. *
  6728. * Summary:
  6729. * Notification that a sheet is closing.
  6730. *
  6731. * Discussion:
  6732. * This event is sent to all handlers registered for it. This event
  6733. * is sent to the sheet, its parent window, and the application
  6734. * target before the sheet begins closing.
  6735. *
  6736. * Mac OS X threading:
  6737. * Not thread safe
  6738. *
  6739. * Parameters:
  6740. *
  6741. * --> kEventParamDirectObject (in, typeWindowRef)
  6742. * The sheet that is opening.
  6743. *
  6744. * Result:
  6745. * An event handler for this event may return userCanceledErr if the
  6746. * sheet should not close. Any other return value is ignored and
  6747. * will still allow the sheet to close.
  6748. *
  6749. * Availability:
  6750. * Mac OS X: in version 10.4 and later in Carbon.framework
  6751. * CarbonLib: not available
  6752. }
  6753. const
  6754. kEventWindowSheetClosing = 212;
  6755. {
  6756. * kEventClassWindow / kEventWindowSheetClosed
  6757. *
  6758. * Summary:
  6759. * Notification that a sheet is closed.
  6760. *
  6761. * Discussion:
  6762. * This event is sent to all handlers registered for it. This event
  6763. * is sent to the sheet, its parent window, and the application
  6764. * target after the sheet is fully closed.
  6765. *
  6766. * Mac OS X threading:
  6767. * Not thread safe
  6768. *
  6769. * Parameters:
  6770. *
  6771. * --> kEventParamDirectObject (in, typeWindowRef)
  6772. * The sheet that closed.
  6773. *
  6774. * Availability:
  6775. * Mac OS X: in version 10.4 and later in Carbon.framework
  6776. * CarbonLib: not available
  6777. }
  6778. const
  6779. kEventWindowSheetClosed = 213;
  6780. {
  6781. * kEventClassWindow / kEventWindowDrawerOpening
  6782. *
  6783. * Summary:
  6784. * Notification that a drawer is opening.
  6785. *
  6786. * Discussion:
  6787. * This event is sent to all handlers registered for it. This event
  6788. * is sent to the drawer, its parent window, and the application
  6789. * target before the drawer begins opening.
  6790. *
  6791. * Mac OS X threading:
  6792. * Not thread safe
  6793. *
  6794. * Parameters:
  6795. *
  6796. * --> kEventParamDirectObject (in, typeWindowRef)
  6797. * The drawer that is opening.
  6798. *
  6799. * Result:
  6800. * An event handler for this event may return userCanceledErr if the
  6801. * drawer should not open. Any other return value is ignored and
  6802. * will still allow the drawer to open.
  6803. *
  6804. * Availability:
  6805. * Mac OS X: in version 10.2 and later in Carbon.framework
  6806. * CarbonLib: not available
  6807. }
  6808. const
  6809. kEventWindowDrawerOpening = 220;
  6810. {
  6811. * kEventClassWindow / kEventWindowDrawerOpened
  6812. *
  6813. * Summary:
  6814. * Notification that a drawer is open.
  6815. *
  6816. * Discussion:
  6817. * This event is sent to all handlers registered for it. This event
  6818. * is sent to the drawer, its parent window, and the application
  6819. * target after the drawer is fully open.
  6820. *
  6821. * Mac OS X threading:
  6822. * Not thread safe
  6823. *
  6824. * Parameters:
  6825. *
  6826. * --> kEventParamDirectObject (in, typeWindowRef)
  6827. * The drawer that opened.
  6828. *
  6829. * Availability:
  6830. * Mac OS X: in version 10.2 and later in Carbon.framework
  6831. * CarbonLib: not available
  6832. }
  6833. const
  6834. kEventWindowDrawerOpened = 221;
  6835. {
  6836. * kEventClassWindow / kEventWindowDrawerClosing
  6837. *
  6838. * Summary:
  6839. * Notification that a drawer is closing.
  6840. *
  6841. * Discussion:
  6842. * This event is sent to all handlers registered for it. This event
  6843. * is sent to the drawer, its parent window, and the application
  6844. * target before the drawer begins closing.
  6845. *
  6846. * Mac OS X threading:
  6847. * Not thread safe
  6848. *
  6849. * Parameters:
  6850. *
  6851. * --> kEventParamDirectObject (in, typeWindowRef)
  6852. * The drawer that is opening.
  6853. *
  6854. * Result:
  6855. * An event handler for this event may return userCanceledErr if the
  6856. * drawer should not close. Any other return value is ignored and
  6857. * will still allow the drawer to close.
  6858. *
  6859. * Availability:
  6860. * Mac OS X: in version 10.2 and later in Carbon.framework
  6861. * CarbonLib: not available
  6862. }
  6863. const
  6864. kEventWindowDrawerClosing = 222;
  6865. {
  6866. * kEventClassWindow / kEventWindowDrawerClosed
  6867. *
  6868. * Summary:
  6869. * Notification that a drawer is closed.
  6870. *
  6871. * Discussion:
  6872. * This event is sent to all handlers registered for it. This event
  6873. * is sent to the drawer, its parent window, and the application
  6874. * target after the drawer is fully closed.
  6875. *
  6876. * Mac OS X threading:
  6877. * Not thread safe
  6878. *
  6879. * Parameters:
  6880. *
  6881. * --> kEventParamDirectObject (in, typeWindowRef)
  6882. * The drawer that closed.
  6883. *
  6884. * Availability:
  6885. * Mac OS X: in version 10.2 and later in Carbon.framework
  6886. * CarbonLib: not available
  6887. }
  6888. const
  6889. kEventWindowDrawerClosed = 223;
  6890. {
  6891. * kEventClassWindow / kEventWindowDrawFrame
  6892. *
  6893. * Summary:
  6894. * Sent by the Window Manager when itÕs time to draw a windowÕs
  6895. * structure.
  6896. *
  6897. * Discussion:
  6898. * This is the replacement to the old wDraw defProc message (though
  6899. * it is a special case of the 0 part code indicating to draw the
  6900. * entire window frame).
  6901. *
  6902. * Mac OS X threading:
  6903. * Not thread safe
  6904. *
  6905. * Parameters:
  6906. *
  6907. * --> kEventParamDirectObject (in, typeWindowRef)
  6908. * The window to draw.
  6909. *
  6910. * Availability:
  6911. * Mac OS X: in version 10.0 and later in Carbon.framework
  6912. * CarbonLib: in CarbonLib 1.1 and later
  6913. }
  6914. const
  6915. kEventWindowDrawFrame = 1000;
  6916. {
  6917. * kEventClassWindow / kEventWindowDrawPart
  6918. *
  6919. * Summary:
  6920. * Sent by the Window Manager when itÕs time to draw a specific part
  6921. * of a windowÕs structure, such as the close button.
  6922. *
  6923. * Discussion:
  6924. * This is typically sent during window widget tracking.
  6925. *
  6926. * Mac OS X threading:
  6927. * Not thread safe
  6928. *
  6929. * Parameters:
  6930. *
  6931. * --> kEventParamDirectObject (in, typeWindowRef)
  6932. * The window to draw.
  6933. *
  6934. * --> kEventParamWindowDefPart (in, typeWindowDefPartCode)
  6935. * The part to draw.
  6936. *
  6937. * Availability:
  6938. * Mac OS X: in version 10.0 and later in Carbon.framework
  6939. * CarbonLib: in CarbonLib 1.1 and later
  6940. }
  6941. const
  6942. kEventWindowDrawPart = 1001;
  6943. {
  6944. * kEventClassWindow / kEventWindowGetRegion
  6945. *
  6946. * Summary:
  6947. * Sent by the Window Manager when it needs to get a specific region
  6948. * from a window, or when the GetWindowRegion API is called.
  6949. *
  6950. * Mac OS X threading:
  6951. * Not thread safe
  6952. *
  6953. * Parameters:
  6954. *
  6955. * --> kEventParamDirectObject (in, typeWindowRef)
  6956. * The window whose region to return.
  6957. *
  6958. * --> kEventParamWindowRegionCode (in, typeWindowRegionCode)
  6959. * The region to return.
  6960. *
  6961. * --> kEventParamRgnHandle (in, typeQDRgnHandle)
  6962. * On entry, contains a valid but empty RgnHandle; you should
  6963. * place the window region in this RgnHandle.
  6964. *
  6965. * Availability:
  6966. * Mac OS X: in version 10.0 and later in Carbon.framework
  6967. * CarbonLib: in CarbonLib 1.1 and later
  6968. }
  6969. const
  6970. kEventWindowGetRegion = 1002;
  6971. {
  6972. * kEventClassWindow / kEventWindowHitTest
  6973. *
  6974. * Summary:
  6975. * Sent when the Window Manager needs to determine what part of a
  6976. * window would be 'hit' with a given mouse location in global
  6977. * coordinates.
  6978. *
  6979. * Mac OS X threading:
  6980. * Not thread safe
  6981. *
  6982. * Parameters:
  6983. *
  6984. * --> kEventParamDirectObject (in, typeWindowRef)
  6985. * The window to hit-test.
  6986. *
  6987. * --> kEventParamMouseLocation (in, typeQDPoint)
  6988. * The mouse location.
  6989. *
  6990. * <-- kEventParamWindowDefPart (out, typeWindowDefPartCode)
  6991. * On exit, contains the window part that was hit.
  6992. *
  6993. * Availability:
  6994. * Mac OS X: in version 10.0 and later in Carbon.framework
  6995. * CarbonLib: in CarbonLib 1.1 and later
  6996. }
  6997. const
  6998. kEventWindowHitTest = 1003;
  6999. {
  7000. * kEventClassWindow / kEventWindowInit
  7001. *
  7002. * Summary:
  7003. * Sent by the Window Manager when the window is being created. This
  7004. * is a hook to allow your window definition to do any
  7005. * initialization you might need to do.
  7006. *
  7007. * Discussion:
  7008. * This event can be sent more than once to a window if the window
  7009. * definition function for the window is changed; see the note under
  7010. * kEventWindowDispose.
  7011. *
  7012. * Mac OS X threading:
  7013. * Not thread safe
  7014. *
  7015. * Parameters:
  7016. *
  7017. * --> kEventParamDirectObject (in, typeWindowRef)
  7018. * The window being created.
  7019. *
  7020. * <-- kEventParamWindowFeatures (out, typeUInt32)
  7021. * On exit, your event handler should store the window
  7022. * features in this parameter.
  7023. *
  7024. * Availability:
  7025. * Mac OS X: in version 10.0 and later in Carbon.framework
  7026. * CarbonLib: in CarbonLib 1.1 and later
  7027. }
  7028. const
  7029. kEventWindowInit = 1004;
  7030. {
  7031. * kEventClassWindow / kEventWindowDispose
  7032. *
  7033. * Summary:
  7034. * Sent by the Window Manager to notify the window definition that
  7035. * it should dispose of any private data structures attached to the
  7036. * window.
  7037. *
  7038. * Discussion:
  7039. * Note that this event does not directly correspond with
  7040. * destruction of the window; the Window Manager occasionally needs
  7041. * to change the window definition of a window (for example, when
  7042. * ChangeWindowAttributes is used to change the visual appearance of
  7043. * a window), and in that case, the window will receive a
  7044. * kEventWindowDispose followed by a kEventWindowInit so that the
  7045. * old and new window definitions can disconnect and connect to the
  7046. * window. If you need to know when a window is really being
  7047. * destroyed, install a handler for kEventWindowClosed.
  7048. *
  7049. * Mac OS X threading:
  7050. * Not thread safe
  7051. *
  7052. * Parameters:
  7053. *
  7054. * --> kEventParamDirectObject (in, typeWindowRef)
  7055. * The window being destroyed.
  7056. *
  7057. * Availability:
  7058. * Mac OS X: in version 10.0 and later in Carbon.framework
  7059. * CarbonLib: in CarbonLib 1.1 and later
  7060. }
  7061. const
  7062. kEventWindowDispose = 1005;
  7063. {
  7064. * kEventClassWindow / kEventWindowDragHilite
  7065. *
  7066. * Summary:
  7067. * Sent by the Window Manager when it is time to draw/erase any drag
  7068. * hilite in the window structure.
  7069. *
  7070. * Discussion:
  7071. * This is typically sent from within HiliteWindowFrameForDrag.
  7072. *
  7073. * Mac OS X threading:
  7074. * Not thread safe
  7075. *
  7076. * Parameters:
  7077. *
  7078. * --> kEventParamDirectObject (in, typeWindowRef)
  7079. * The window being hilited.
  7080. *
  7081. * --> kEventParamWindowDragHiliteFlag (in, typeBoolean)
  7082. * Whether to draw (true) or erase (false) the hilite.
  7083. *
  7084. * Availability:
  7085. * Mac OS X: in version 10.0 and later in Carbon.framework
  7086. * CarbonLib: in CarbonLib 1.1 and later
  7087. }
  7088. const
  7089. kEventWindowDragHilite = 1006;
  7090. {
  7091. * kEventClassWindow / kEventWindowModified
  7092. *
  7093. * Summary:
  7094. * Sent by the Window Manager when it is time to redraw window
  7095. * structure to account for a change in the document modified state.
  7096. *
  7097. * Discussion:
  7098. * This is typically sent from within SetWindowModified.
  7099. *
  7100. * Mac OS X threading:
  7101. * Not thread safe
  7102. *
  7103. * Parameters:
  7104. *
  7105. * --> kEventParamDirectObject (in, typeWindowRef)
  7106. * The window that was modified.
  7107. *
  7108. * --> kEventParamWindowModifiedFlag (in, typeBoolean)
  7109. * The new modified state.
  7110. *
  7111. * Availability:
  7112. * Mac OS X: in version 10.0 and later in Carbon.framework
  7113. * CarbonLib: in CarbonLib 1.1 and later
  7114. }
  7115. const
  7116. kEventWindowModified = 1007;
  7117. {
  7118. * kEventClassWindow / kEventWindowSetupProxyDragImage
  7119. *
  7120. * Summary:
  7121. * Sent by the Window Manager when it is time to generate a drag
  7122. * image for the window proxy.
  7123. *
  7124. * Discussion:
  7125. * This is typically sent from within BeginWindowProxyDrag.
  7126. *
  7127. * Mac OS X threading:
  7128. * Not thread safe
  7129. *
  7130. * Parameters:
  7131. *
  7132. * --> kEventParamDirectObject (in, typeWindowRef)
  7133. * The window whose proxy is being dragged.
  7134. *
  7135. * <-- kEventParamWindowProxyGWorldPtr (out, typeGWorldPtr)
  7136. * On exit, contains a GWorld you allocate which contains the
  7137. * drag image.
  7138. *
  7139. * --> kEventParamWindowProxyImageRgn (in, typeQDRgnHandle)
  7140. * The region you modify to contain the clip region for the
  7141. * GWorld.
  7142. *
  7143. * --> kEventParamWindowProxyOutlineRgn (in, typeQDRgnHandle)
  7144. * The region you modify to contain the drag outline used when
  7145. * the GWorld cannot be used.
  7146. *
  7147. * Availability:
  7148. * Mac OS X: in version 10.0 and later in Carbon.framework
  7149. * CarbonLib: in CarbonLib 1.1 and later
  7150. }
  7151. const
  7152. kEventWindowSetupProxyDragImage = 1008;
  7153. {
  7154. * kEventClassWindow / kEventWindowStateChanged
  7155. *
  7156. * Summary:
  7157. * Sent by the Window Manager when a particular window state changes.
  7158. *
  7159. * Discussion:
  7160. * See the state-change flags in MacWindows.h.
  7161. *
  7162. * Mac OS X threading:
  7163. * Not thread safe
  7164. *
  7165. * Parameters:
  7166. *
  7167. * --> kEventParamDirectObject (in, typeWindowRef)
  7168. * The window whose state was changed.
  7169. *
  7170. * --> kEventParamWindowStateChangedFlags (in, typeUInt32)
  7171. * The state change flags
  7172. *
  7173. * Availability:
  7174. * Mac OS X: in version 10.0 and later in Carbon.framework
  7175. * CarbonLib: in CarbonLib 1.1 and later
  7176. }
  7177. const
  7178. kEventWindowStateChanged = 1009;
  7179. {
  7180. * kEventClassWindow / kEventWindowMeasureTitle
  7181. *
  7182. * Summary:
  7183. * Sent when the Window Manager needs to know how much space the
  7184. * windowÕs title area takes up.
  7185. *
  7186. * Mac OS X threading:
  7187. * Not thread safe
  7188. *
  7189. * Parameters:
  7190. *
  7191. * --> kEventParamDirectObject (in, typeWindowRef)
  7192. * The window whose title to measure.
  7193. *
  7194. * <-- kEventParamWindowTitleFullWidth (out, typeSInt16)
  7195. * On exit, contains the length of the whole title area.
  7196. *
  7197. * <-- kEventParamWindowTitleTextWidth (out, typeSInt16)
  7198. * On exit, contains the length just the title text.
  7199. *
  7200. * Availability:
  7201. * Mac OS X: in version 10.0 and later in Carbon.framework
  7202. * CarbonLib: in CarbonLib 1.1 and later
  7203. }
  7204. const
  7205. kEventWindowMeasureTitle = 1010;
  7206. {
  7207. * kEventClassWindow / kEventWindowDrawGrowBox
  7208. *
  7209. * Summary:
  7210. * When the DrawGrowIcon API is called, this event is sent to the
  7211. * window to tell it to draw the grow box.
  7212. *
  7213. * Discussion:
  7214. * This is a compatibility event harkening back to the old days
  7215. * before Mac OS 8. Not very useful these days. This is only really
  7216. * needed for windows that do not have the grow box integrated into
  7217. * the window frame. Scroll bar delimiter lines are also drawn.
  7218. *
  7219. * Mac OS X threading:
  7220. * Not thread safe
  7221. *
  7222. * Parameters:
  7223. *
  7224. * --> kEventParamDirectObject (in, typeWindowRef)
  7225. * The window whose grow box to draw.
  7226. *
  7227. * Availability:
  7228. * Mac OS X: in version 10.0 and later in Carbon.framework
  7229. * CarbonLib: in CarbonLib 1.1 and later
  7230. }
  7231. const
  7232. kEventWindowDrawGrowBox = 1011;
  7233. {
  7234. * kEventClassWindow / kEventWindowGetGrowImageRegion
  7235. *
  7236. * Summary:
  7237. * This is a special way for a window to override the standard
  7238. * resize outline for windows that do not do live resizing.
  7239. *
  7240. * Discussion:
  7241. * As the user resizes the window, this event is sent with the
  7242. * current size the user has chosen expressed as a rectangle. You
  7243. * should calculate your window outline and modify the
  7244. * kEventParamRgnHandle parameter to reflect your desired outline.
  7245. *
  7246. * Mac OS X threading:
  7247. * Not thread safe
  7248. *
  7249. * Parameters:
  7250. *
  7251. * --> kEventParamDirectObject (in, typeWindowRef)
  7252. * The window whose grow image to return.
  7253. *
  7254. * --> kEventParamWindowGrowRect (in, typeQDRectangle)
  7255. * The windowÕs global port bounds.
  7256. *
  7257. * --> kEventParamRgnHandle (in, typeQDRgnHandle)
  7258. * The region to modify.
  7259. *
  7260. * Availability:
  7261. * Mac OS X: in version 10.0 and later in Carbon.framework
  7262. * CarbonLib: in CarbonLib 1.1 and later
  7263. }
  7264. const
  7265. kEventWindowGetGrowImageRegion = 1012;
  7266. {
  7267. * kEventClassWindow / kEventWindowPaint
  7268. *
  7269. * Summary:
  7270. * When the Window Manager needs to paint a window (e.g, when a
  7271. * window is first displayed), the kEventWindowPaint event is sent
  7272. * to allow the window to control all aspect of painting, including
  7273. * the window frame.
  7274. *
  7275. * Discussion:
  7276. * If a window does not respond to this event, the Window Manager
  7277. * ends up sending kEventWindowDrawFrame and then erasing the window
  7278. * to the window content color as usual. This is mostly used for
  7279. * specialty windows, such as help tags or appliance apps might have.
  7280. *
  7281. * Mac OS X threading:
  7282. * Not thread safe
  7283. *
  7284. * Parameters:
  7285. *
  7286. * --> kEventParamDirectObject (in, typeWindowRef)
  7287. * The window to paint.
  7288. *
  7289. * Availability:
  7290. * Mac OS X: in version 10.0 and later in Carbon.framework
  7291. * CarbonLib: not available
  7292. }
  7293. const
  7294. kEventWindowPaint = 1013;
  7295. {--------------------------------------------------------------------------------------}
  7296. { Menu Events }
  7297. {--------------------------------------------------------------------------------------}
  7298. {
  7299. kEventClassMenu quick reference:
  7300. kEventMenuBeginTracking = 1,
  7301. kEventMenuEndTracking = 2,
  7302. kEventMenuChangeTrackingMode = 3,
  7303. kEventMenuOpening = 4,
  7304. kEventMenuClosed = 5,
  7305. kEventMenuTargetItem = 6,
  7306. kEventMenuMatchKey = 7,
  7307. kEventMenuEnableItems = 8,
  7308. kEventMenuPopulate = 9,
  7309. kEventMenuMeasureItemWidth = 100,
  7310. kEventMenuMeasureItemHeight = 101,
  7311. kEventMenuDrawItem = 102,
  7312. kEventMenuDrawItemContent = 103,
  7313. kEventMenuDispose = 1001,
  7314. kEventMenuCalculateSize = 1004,
  7315. -- menu content view events --
  7316. kEventMenuCreateFrameView = 1005,
  7317. kEventMenuGetFrameBounds = 1006,
  7318. kEventMenuBecomeScrollable = 1007,
  7319. kEventMenuCeaseToBeScrollable = 1008,
  7320. -- menu bar visibility events --
  7321. kEventMenuBarShown = 2000,
  7322. kEventMenuBarHidden = 2001
  7323. }
  7324. {
  7325. * Discussion:
  7326. * Menu context flags indicate the context or usage of a
  7327. * menu-related Carbon event.
  7328. }
  7329. const
  7330. { menu location}
  7331. {
  7332. * Indicates that this menu is inserted in the menubar, or is a
  7333. * (directly or indirectly) a submenu of a menu that is inserted in
  7334. * the menubar.
  7335. }
  7336. kMenuContextMenuBar = 1 shl 0; { menu type}
  7337. {
  7338. * Indicates that this menu is a pull-down menu inserted in the
  7339. * menubar.
  7340. }
  7341. kMenuContextPullDown = 1 shl 8;
  7342. {
  7343. * Indicates that this menu is a popup menu being displayed by
  7344. * PopUpMenuSelect.
  7345. }
  7346. kMenuContextPopUp = 1 shl 9;
  7347. {
  7348. * Indicates that this menu is a submenu of some other pull-down or
  7349. * popup menu.
  7350. }
  7351. kMenuContextSubmenu = 1 shl 10; { menu usage}
  7352. {
  7353. * Indicates that this Carbon event has been sent during a menubar
  7354. * tracking session.
  7355. }
  7356. kMenuContextMenuBarTracking = 1 shl 16;
  7357. {
  7358. * Indicates that this Carbon event has been sent during a popup menu
  7359. * tracking session.
  7360. }
  7361. kMenuContextPopUpTracking = 1 shl 17;
  7362. {
  7363. * Indicates that this Carbon event has been sent during command key
  7364. * matching.
  7365. }
  7366. kMenuContextKeyMatching = 1 shl 18;
  7367. {
  7368. * Indicates that this Carbon event has been sent at idle time to
  7369. * update the enabled state of the menus. Available on Mac OS X 10.1
  7370. * and later, and in CarbonLib 1.5 and later; on earlier releases,
  7371. * the kMenuContextKeyMatching flag is set when an event is sent
  7372. * during menu enabling.
  7373. }
  7374. kMenuContextMenuEnabling = 1 shl 19;
  7375. {
  7376. * Indicates that this Carbon event has been sent during during a
  7377. * search for a menu item command ID by the
  7378. * CountMenuItemsWithCommandID or GetIndMenuItemWithCommandID APIs.
  7379. * Available on Mac OS X 10.2 and CarbonLib 1.6.
  7380. }
  7381. kMenuContextCommandIDSearch = 1 shl 20;
  7382. {
  7383. * Summary:
  7384. * Menu direction
  7385. }
  7386. const
  7387. {
  7388. * Indicates that the menu should be placed to the right of its
  7389. * parent.
  7390. }
  7391. kHIMenuRightDirection = 0;
  7392. {
  7393. * Indicates that the menu should be placed to the left of its parent.
  7394. }
  7395. kHIMenuLeftDirection = 1;
  7396. {
  7397. * Indicates that the menu should be centered on its parent.
  7398. }
  7399. kHIMenuCenterDirection = 2;
  7400. {
  7401. * kEventClassMenu / kEventMenuBeginTracking
  7402. *
  7403. * Summary:
  7404. * The user has begun tracking the menubar or a pop-up menu.
  7405. *
  7406. * Discussion:
  7407. * This event is sent to all handlers registered for it. It is sent
  7408. * first to the menu specified in the direct object parameter, if
  7409. * any, and then to the user focus target.
  7410. *
  7411. * Mac OS X threading:
  7412. * Not thread safe
  7413. *
  7414. * Parameters:
  7415. *
  7416. * --> kEventParamDirectObject (in, typeMenuRef)
  7417. * The root of the menu hierarchy being tracked. If tracking a
  7418. * popup menu, this parameter is the popup; if tracking the
  7419. * menubar, this parameter is the root menu on Mac OS X, but
  7420. * is NULL in CarbonLib.
  7421. *
  7422. * --> kEventParamCurrentMenuTrackingMode (in, typeMenuTrackingMode)
  7423. * Indicates whether the user is tracking the menus using the
  7424. * mouse or the keyboard. Contains either
  7425. * kMenuTrackingModeMouse or kMenuTrackingModeKeyboard.
  7426. *
  7427. * --> kEventParamMenuContext (in, typeUInt32)
  7428. * Menu context flags indicating what type of menu is being
  7429. * tracked. This parameter is available on Mac OS X 10.1 and
  7430. * later, and CarbonLib 1.5 and later.
  7431. *
  7432. * Result:
  7433. * The handler may return userCanceledErr to stop menu tracking.
  7434. *
  7435. * Availability:
  7436. * Mac OS X: in version 10.0 and later in Carbon.framework
  7437. * CarbonLib: in CarbonLib 1.1 and later
  7438. }
  7439. const
  7440. kEventMenuBeginTracking = 1;
  7441. {
  7442. * kEventClassMenu / kEventMenuEndTracking
  7443. *
  7444. * Summary:
  7445. * The user has finished tracking the menubar or a popup menu
  7446. *
  7447. * Discussion:
  7448. * This event is sent to all handlers registered for it. It is sent
  7449. * first to the menu specified in the direct object parameter, if
  7450. * any, and then to the user focus target.
  7451. *
  7452. * In Mac OS X 10.3 and later, when a menu tracking session ends,
  7453. * the Menu Manager now sends kEventMenuEndTracking to every menu
  7454. * that was opened during the session, in addition to the root menu.
  7455. * This is done to allow menus with dynamic content to remove that
  7456. * content at the end of menu tracking; for example, a menu
  7457. * containing many IconRefs might wish to load the IconRefs
  7458. * dynamically in response to a kEventMenuPopulate, and remove them
  7459. * in response to kEventMenuEndTracking, to avoid the memory
  7460. * overhead of keeping the IconRef data in memory while the menu is
  7461. * not being displayed.
  7462. *
  7463. * Mac OS X threading:
  7464. * Not thread safe
  7465. *
  7466. * Parameters:
  7467. *
  7468. * --> kEventParamDirectObject (in, typeMenuRef)
  7469. * The root of the menu hierarchy being tracked. If tracking a
  7470. * popup menu, this parameter is the popup; if tracking the
  7471. * menubar, this parameter is the root menu on Mac OS X, but
  7472. * is NULL in CarbonLib.
  7473. *
  7474. * --> kEventParamMenuContext (in, typeUInt32)
  7475. * Menu context flags indicating what type of menu was being
  7476. * tracked. This parameter is available on Mac OS X 10.1 and
  7477. * later, and CarbonLib 1.5 and later.
  7478. *
  7479. * --> kEventParamMenuDismissed (in, typeUInt32)
  7480. * Contains an indication of why menu tracking ended; this
  7481. * will be one of the kHIMenuDismissedBy constants in Menus.h.
  7482. * This parameter is available on Mac OS X 10.3 and later.
  7483. *
  7484. * Availability:
  7485. * Mac OS X: in version 10.0 and later in Carbon.framework
  7486. * CarbonLib: in CarbonLib 1.1 and later
  7487. }
  7488. const
  7489. kEventMenuEndTracking = 2;
  7490. {
  7491. * kEventClassMenu / kEventMenuChangeTrackingMode
  7492. *
  7493. * Summary:
  7494. * The user has switched from selecting a menu with the mouse to
  7495. * selecting with the keyboard, or from selecting with the keyboard
  7496. * to selecting with the mouse.
  7497. *
  7498. * Discussion:
  7499. * This event is sent to all handlers registered for it. It is sent
  7500. * first to the menu specified in the direct object parameter, and
  7501. * then to the user focus target.
  7502. *
  7503. * Mac OS X threading:
  7504. * Not thread safe
  7505. *
  7506. * Parameters:
  7507. *
  7508. * --> kEventParamDirectObject (in, typeMenuRef)
  7509. * The root of the menu hierarchy being tracked. If tracking a
  7510. * popup menu, this parameter is the popup; if tracking the
  7511. * menubar, this parameter is the root menu.
  7512. *
  7513. * --> kEventParamCurrentMenuTrackingMode (in, typeMenuTrackingMode)
  7514. * Indicates whether the user was previously tracking the
  7515. * menus using the mouse or the keyboard. Contains either
  7516. * kMenuTrackingModeMouse or kMenuTrackingModeKeyboard.
  7517. *
  7518. * --> kEventParamNewMenuTrackingMode (in, typeMenuTrackingMode)
  7519. * Indicates whether the user is now tracking the menus using
  7520. * the mouse or the keyboard. Contains either
  7521. * kMenuTrackingModeMouse or kMenuTrackingModeKeyboard.
  7522. *
  7523. * --> kEventParamMenuContext (in, typeUInt32)
  7524. * Menu context flags indicating what type of menu is being
  7525. * tracked.
  7526. *
  7527. * Availability:
  7528. * Mac OS X: in version 10.1 and later in Carbon.framework
  7529. * CarbonLib: not available
  7530. }
  7531. const
  7532. kEventMenuChangeTrackingMode = 3;
  7533. {
  7534. * kEventClassMenu / kEventMenuOpening
  7535. *
  7536. * Summary:
  7537. * A menu is opening.
  7538. *
  7539. * Discussion:
  7540. * This event is sent to all handlers registered for it. It is sent
  7541. * each time that the menu is opened (i.e., more than once during a
  7542. * given tracking session if the user opens the menu multiple
  7543. * times). It is sent before the menu is actually drawn, so you can
  7544. * update the menu contents (including making changes that will
  7545. * alter the menu size) and the new contents will be drawn correctly.
  7546. *
  7547. * Mac OS X threading:
  7548. * Not thread safe
  7549. *
  7550. * Parameters:
  7551. *
  7552. * --> kEventParamDirectObject (in, typeMenuRef)
  7553. * The menu being opened.
  7554. *
  7555. * --> kEventParamMenuFirstOpen (in, typeBoolean)
  7556. * Whether this is the first time this menu has been opened
  7557. * during this menu tracking session.
  7558. *
  7559. * --> kEventParamMenuContext (in, typeUInt32)
  7560. * The context in which this menu is opening. Available on Mac
  7561. * OS X and CarbonLib 1.5 and later.
  7562. *
  7563. * Result:
  7564. * On Mac OS X, the handler may return userCanceledErr to prevent
  7565. * this menu from opening
  7566. *
  7567. * Availability:
  7568. * Mac OS X: in version 10.0 and later in Carbon.framework
  7569. * CarbonLib: in CarbonLib 1.1 and later
  7570. }
  7571. const
  7572. kEventMenuOpening = 4;
  7573. {
  7574. * kEventClassMenu / kEventMenuClosed
  7575. *
  7576. * Summary:
  7577. * A menu has been closed.
  7578. *
  7579. * Discussion:
  7580. * This event is sent to all handlers registered for it. It is sent
  7581. * after the menu is hidden.
  7582. *
  7583. * Mac OS X threading:
  7584. * Not thread safe
  7585. *
  7586. * Parameters:
  7587. *
  7588. * --> kEventParamDirectObject (in, typeMenuRef)
  7589. * The menu being closed.
  7590. *
  7591. * --> kEventParamMenuContext (in, typeUInt32)
  7592. * The context in which this menu is closing. Available on Mac
  7593. * OS X 10.1 and later, and CarbonLib 1.5 and later.
  7594. *
  7595. * Availability:
  7596. * Mac OS X: in version 10.0 and later in Carbon.framework
  7597. * CarbonLib: in CarbonLib 1.1 and later
  7598. }
  7599. const
  7600. kEventMenuClosed = 5;
  7601. {
  7602. * kEventClassMenu / kEventMenuTargetItem
  7603. *
  7604. * Summary:
  7605. * The mouse is moving over a particular menu item.
  7606. *
  7607. * Discussion:
  7608. * This event is sent to all handlers registered for it. It is sent
  7609. * for both enabled and disabled items.
  7610. *
  7611. * Mac OS X threading:
  7612. * Not thread safe
  7613. *
  7614. * Parameters:
  7615. *
  7616. * --> kEventParamDirectObject (in, typeMenuRef)
  7617. * The menu being tracked.
  7618. *
  7619. * --> kEventParamMenuItemIndex (in, typeMenuItemIndex)
  7620. * The menu item under the mouse.
  7621. *
  7622. * --> kEventParamMenuCommand (in, typeMenuCommand)
  7623. * The command ID associated with this menu item.
  7624. *
  7625. * --> kEventParamMenuContext (in, typeUInt32)
  7626. * The context in which this menu being tracked. Available on
  7627. * Mac OS X 10.1 and later, and CarbonLib 1.5 and later.
  7628. *
  7629. * Availability:
  7630. * Mac OS X: in version 10.0 and later in Carbon.framework
  7631. * CarbonLib: in CarbonLib 1.1 and later
  7632. }
  7633. const
  7634. kEventMenuTargetItem = 6;
  7635. {
  7636. * kEventClassMenu / kEventMenuMatchKey
  7637. *
  7638. * Summary:
  7639. * A menu is about to be examined for items that match a command key
  7640. * event.
  7641. *
  7642. * Discussion:
  7643. * A handler for this event may perform its own command key matching
  7644. * and override the Menu ManagerÕs default matching algorithms.
  7645. * Returning noErr from your handler indicates that you have found a
  7646. * match. The handler for this event should not examine submenus of
  7647. * this menu for a match; a separate event will be sent for each
  7648. * submenu.
  7649. *
  7650. * Handlers for this event must be installed directly on the menu
  7651. * containing the item to be matched. To improve performance of
  7652. * command key matching, the Menu Manager only sends this event if
  7653. * the menu itself has a handler; if a handler for this event is
  7654. * installed on any other event target, it will not receive the
  7655. * event.
  7656. *
  7657. * In CarbonLib and Mac OS X through version 10.3, the Menu Manager
  7658. * sends a kEventMenuEnableItems event to the menu before sending
  7659. * kEventMenuMatchKey. In Mac OS X 10.4 and later, the Menu Manager
  7660. * no longer sends kEventMenuEnableItems (or the resulting
  7661. * kEventCommandUpdateStatus events) to the menu; a handler for
  7662. * kEventMenuMatchKey is expected to determine on its own whether a
  7663. * matching menu item is enabled.
  7664. *
  7665. * Mac OS X threading:
  7666. * Not thread safe
  7667. *
  7668. * Parameters:
  7669. *
  7670. * --> kEventParamDirectObject (in, typeMenuRef)
  7671. * The menu being searched for a command key match.
  7672. *
  7673. * --> kEventParamEventRef (in, typeEventRef)
  7674. * The keyboard input event that should be checked for a
  7675. * match. Currently this event is always kEventRawKeyDown, but
  7676. * in the future it may be kEventTextInputUnicodeForKeyEvent.
  7677. * When called from IsMenuKeyEvent, this parameter contains
  7678. * the EventRef that was passed to IsMenuKeyEvent; when called
  7679. * from MenuKey or MenuEvent, this parameter contains an event
  7680. * created from the information passed to MenuKey or
  7681. * MenuEvent. Note that in the MenuKey case, no virtual
  7682. * keycode (kEventParamKeyCode) or key modifiers
  7683. * (kEventParamKeyModifiers) will be available.
  7684. *
  7685. * --> kEventParamMenuEventOptions (in, typeMenuEventOptions)
  7686. * Options from the MenuEventOptions enum that control how the
  7687. * menu should be searched for a command key. This parameter
  7688. * contains the options that were passed to IsMenuKeyEvent, or
  7689. * 0 if called from MenuKey or MenuEvent. The only option that
  7690. * your handler will need to obey is
  7691. * kMenuEventIncludeDisabledItems; other options are
  7692. * irrelevant for an event handler.
  7693. *
  7694. * --> kEventParamMenuContext (in, typeUInt32)
  7695. * The context in which this menu is being searched for a
  7696. * command key. Available on Mac OS X 10.1 and later, and
  7697. * CarbonLib 1.5 and later.
  7698. *
  7699. * <-- kEventParamMenuItemIndex (out, typeMenuItemIndex)
  7700. * On exit, contains the menu item index that matched the
  7701. * event.
  7702. *
  7703. * Result:
  7704. * If your handler finds a match, it should set the
  7705. * kEventParamMenuItemIndex parameter to contain the item index of
  7706. * the matching item, and return noErr. If it does not find a match,
  7707. * it should return menuItemNotFoundErr. Any other return value will
  7708. * cause the Menu Manager to use its default command key matching
  7709. * algorithm for this menu.
  7710. *
  7711. * Availability:
  7712. * Mac OS X: in version 10.0 and later in Carbon.framework
  7713. * CarbonLib: in CarbonLib 1.1 and later
  7714. }
  7715. const
  7716. kEventMenuMatchKey = 7;
  7717. {
  7718. * kEventClassMenu / kEventMenuEnableItems
  7719. *
  7720. * Summary:
  7721. * A request that the items in the menu be properly enabled or
  7722. * disabled according to the current state of the application.
  7723. *
  7724. * Discussion:
  7725. * This event is sent from inside MenuKey, MenuEvent, and
  7726. * IsMenuKeyEvent before those APIs examine the menu for an item
  7727. * that matches a keyboard event. It is also sent during menu
  7728. * tracking before a menu is first made visible; it is sent
  7729. * immediately after kEventMenuOpening, once per menu per menu
  7730. * tracking session. It is also sent to the top-level menus in the
  7731. * menubar when the application is idle after user input has
  7732. * occurred, to allow the menu titles to be enabled or disabled
  7733. * appropriately according to the current user focus. You can
  7734. * distinquish between all these cases by examining the contents of
  7735. * the kEventParamMenuContext parameter.
  7736. *
  7737. * If you install an event handler for kEventCommandProcess, you
  7738. * should also install a handler for either kEventMenuEnableItems or
  7739. * kEventCommandUpdateStatus. This is necessary because the Carbon
  7740. * event system will attempt to match command keys against the
  7741. * available menus before returning the keyboard event to your
  7742. * application via WaitNextEvent. If you have menu command event
  7743. * handlers installed for your menu items, your handlers will be
  7744. * called without your ever receiving the keyboard event or calling
  7745. * MenuKey/MenuEvent/IsMenuKeyEvent yourself. Therefore, you have no
  7746. * opportunity to enable your menu items properly other than from a
  7747. * kEventMenuEnableItems or kEventCommandUpdateStatus handler.
  7748. *
  7749. *
  7750. * It is not necessary to handle this event if you do not install
  7751. * kEventCommandProcess handlers for your menu items; in that case,
  7752. * the command key event will be returned from WaitNextEvent or
  7753. * ReceiveNextEvent as normal, and you can set up your menus before
  7754. * calling MenuKey/MenuEvent/ IsMenuKeyEvent.
  7755. *
  7756. * This event is sent first to the target menu, and then to the user
  7757. * focus target.
  7758. *
  7759. * Mac OS X threading:
  7760. * Not thread safe
  7761. *
  7762. * Parameters:
  7763. *
  7764. * --> kEventParamDirectObject (in, typeMenuRef)
  7765. * The menu being enabled.
  7766. *
  7767. * --> kEventParamEnableMenuForKeyEvent (in, typeBoolean)
  7768. * Indicates whether this menu should be enabled for key event
  7769. * matching (true) or because the menu itself is about to
  7770. * become visible (false). If true, only the item enable
  7771. * state, command key, command key modifiers, and (optionally)
  7772. * the command key glyph need to be correct. If false, the
  7773. * entire menu item contents must be correct. This may be
  7774. * useful if you have custom menu content that is expensive to
  7775. * prepare.
  7776. *
  7777. * --> kEventParamMenuContext (in, typeUInt32)
  7778. * The context in which this menu is being enabled. Available
  7779. * on Mac OS X and CarbonLib 1.3.1 and later.
  7780. *
  7781. * Availability:
  7782. * Mac OS X: in version 10.0 and later in Carbon.framework
  7783. * CarbonLib: in CarbonLib 1.1 and later
  7784. }
  7785. const
  7786. kEventMenuEnableItems = 8;
  7787. {
  7788. * kEventClassMenu / kEventMenuPopulate
  7789. *
  7790. * Summary:
  7791. * kEventMenuPopulate is intended to be handled by applications that
  7792. * dynamically create their menu contents just-in-time before the
  7793. * menu is displayed. A handler for this event can add items to tbe
  7794. * menu that will be displayed or searched for a command key.
  7795. *
  7796. * Discussion:
  7797. * This event is sent to all handlers registered for it. Previously,
  7798. * kEventMenuOpening was recommended for the purpose of dynamically
  7799. * updating menu content. kEventMenuPopulate is now recommended
  7800. * because it will be sent by the Menu Manager before it searches a
  7801. * menu for a matching command key, to allow a handler to
  7802. * dynamically add menu items that may have command key equivalents
  7803. * to the menu; kEventMenuOpening is only sent before the menu is
  7804. * displayed. kEventMenuPopulate is also sent just before
  7805. * kEventMenuOpening as a menu is being displayed. Finally,
  7806. * kEventMenuPopulate is only sent once per menu tracking session
  7807. * for a given menu, even if that menu is closed and opened multiple
  7808. * times by the user; kEventMenuOpening is sent each time that the
  7809. * menu is displayed.
  7810. *
  7811. * You can distinguish the command-key case from the
  7812. * menu-being-displayed case by examining the contents of the
  7813. * kEventParamMenuContext parameter; the kMenuContextKeyMatching
  7814. * flag will be set if the event is sent during command key
  7815. * matching, and either the kMenuContextMenuBarTracking or
  7816. * kMenuContextPopUpTracking flags will be sent if the event is sent
  7817. * before actual display of the menu.
  7818. *
  7819. * In Mac OS X 10.2 and CarbonLib 1.6, kEventMenuPopulate is also
  7820. * sent to menus before the menu is searched for a command ID by the
  7821. * CountMenuItemsWithCommandID and GetIndMenuItemWithCommandID APIs.
  7822. * You can distinguish this case by checking for the
  7823. * kMenuContextCommandIDSearch flag in the kEventParamMenuContext
  7824. * parameter. In this case, the event also includes a
  7825. * kEventParamMenuCommand parameter with the command ID being
  7826. * searched for as the event parameter data.
  7827. *
  7828. * Mac OS X threading:
  7829. * Not thread safe
  7830. *
  7831. * Parameters:
  7832. *
  7833. * --> kEventParamDirectObject (in, typeMenuRef)
  7834. * The menu to be populated.
  7835. *
  7836. * --> kEventParamMenuContext (in, typeUInt32)
  7837. * The context in which this menu is being populated.
  7838. *
  7839. * --> kEventParamMenuCommand (in, typeMenuCommand)
  7840. * If this event is sent by CountMenuItemsWithCommandID or
  7841. * GetIndMenuItemWithCommandID, this parameter contains the
  7842. * command ID for which the API is searching. Available on Mac
  7843. * OS X 10.2 and CarbonLib 1.6.
  7844. *
  7845. * Availability:
  7846. * Mac OS X: in version 10.1 and later in Carbon.framework
  7847. * CarbonLib: in CarbonLib 1.5 and later
  7848. }
  7849. const
  7850. kEventMenuPopulate = 9;
  7851. {
  7852. * kEventClassMenu / kEventMenuDispose
  7853. *
  7854. * Summary:
  7855. * Sent when a menu definition should disconnect itself from a menu.
  7856. *
  7857. * Discussion:
  7858. * This event is sent to all handlers registered for it.
  7859. *
  7860. * Mac OS X threading:
  7861. * Not thread safe
  7862. *
  7863. * Parameters:
  7864. *
  7865. * --> kEventParamDirectObject (in, typeMenuRef)
  7866. * The menu being destroyed.
  7867. *
  7868. * Availability:
  7869. * Mac OS X: in version 10.0 and later in Carbon.framework
  7870. * CarbonLib: in CarbonLib 1.1 and later
  7871. }
  7872. const
  7873. kEventMenuDispose = 1001;
  7874. {
  7875. * kEventClassMenu / kEventMenuMeasureItemWidth
  7876. *
  7877. * Summary:
  7878. * Requests measurement of the width of a menu item.
  7879. *
  7880. * Discussion:
  7881. * Sent by the standard menu definition when a menu item has the
  7882. * kMenuItemAttrCustomDraw attribute. Handlers for this event should
  7883. * be installed directly on the menu. A handler for this event may
  7884. * respond by providing a customized width for the menu item. If no
  7885. * handler is installed, the standard menu definition provides a
  7886. * default handler that will return the standard width for the item.
  7887. *
  7888. * Mac OS X threading:
  7889. * Not thread safe
  7890. *
  7891. * Parameters:
  7892. *
  7893. * --> kEventParamDirectObject (in, typeMenuRef)
  7894. * The menu that is being measured.
  7895. *
  7896. * --> kEventParamMenuItemIndex (in, typeMenuItemIndex)
  7897. * The menu item that is being measured.
  7898. *
  7899. * <-- kEventParamMenuItemWidth (out, typeShortInteger)
  7900. * On exit, contains the menu item width.
  7901. *
  7902. * Availability:
  7903. * Mac OS X: in version 10.1 and later in Carbon.framework
  7904. * CarbonLib: in CarbonLib 1.5 and later
  7905. }
  7906. const
  7907. kEventMenuMeasureItemWidth = 100;
  7908. {
  7909. * kEventClassMenu / kEventMenuMeasureItemHeight
  7910. *
  7911. * Summary:
  7912. * Requests measurement of the height of a menu item.
  7913. *
  7914. * Discussion:
  7915. * Sent by the standard menu definition when a menu item has the
  7916. * kMenuItemAttrCustomDraw attribute. Handlers for this event should
  7917. * be installed directly on the menu. A handler for this event may
  7918. * respond by providing a customized height for the menu item. If no
  7919. * handler is installed, the standard menu definition provides a
  7920. * default handler that will return the standard height for the item.
  7921. *
  7922. * Mac OS X threading:
  7923. * Not thread safe
  7924. *
  7925. * Parameters:
  7926. *
  7927. * --> kEventParamDirectObject (in, typeMenuRef)
  7928. * The menu that is being measured.
  7929. *
  7930. * --> kEventParamMenuItemIndex (in, typeMenuItemIndex)
  7931. * The menu item that is being measured.
  7932. *
  7933. * <-- kEventParamMenuItemHeight (out, typeShortInteger)
  7934. * On exit, contains the menu item height.
  7935. *
  7936. * Availability:
  7937. * Mac OS X: in version 10.1 and later in Carbon.framework
  7938. * CarbonLib: in CarbonLib 1.5 and later
  7939. }
  7940. const
  7941. kEventMenuMeasureItemHeight = 101;
  7942. {
  7943. * kEventClassMenu / kEventMenuDrawItem
  7944. *
  7945. * Summary:
  7946. * Requests drawing of an entire menu item, including its background.
  7947. *
  7948. * Discussion:
  7949. * Sent by the standard menu definition when a menu item has the
  7950. * kMenuItemAttrCustomDraw attribute. Handlers for this event should
  7951. * be installed directly on the menu. A handler for this event may
  7952. * respond by completely overriding the drawing of the menu item.
  7953. * The item should be drawn into the current port if using
  7954. * QuickDraw, or into the provided CGContextRef if using
  7955. * CoreGraphics. If no handler is installed, the standard menu
  7956. * definition provides a default handler that calls
  7957. * DrawThemeMenuItem to draw the menu item background and content.
  7958. *
  7959. * Mac OS X threading:
  7960. * Not thread safe
  7961. *
  7962. * Parameters:
  7963. *
  7964. * --> kEventParamDirectObject (in, typeMenuRef)
  7965. * The menu being drawn.
  7966. *
  7967. * --> kEventParamCurrentBounds (in, typeQDRectangle)
  7968. * The bounds of the menu, in global coordinates
  7969. *
  7970. * --> kEventParamMenuItemIndex (in, typeMenuItemIndex)
  7971. * The menu item being drawn.
  7972. *
  7973. * --> kEventParamMenuItemBounds (in, typeQDRectangle)
  7974. * The bounds of the menu item, in local coordinates of the
  7975. * current port.
  7976. *
  7977. * --> kEventParamMenuVirtualTop (in, typeLongInteger)
  7978. * The virtual top coordinate of the menu, in global
  7979. * coordinates.
  7980. *
  7981. * --> kEventParamMenuVirtualBottom (in, typeLongInteger)
  7982. * The virtual bottom coordinate of the menu, in global
  7983. * coordinates.
  7984. *
  7985. * --> kEventParamMenuDrawState (in, typeThemeMenuState)
  7986. * The ThemeMenuState of the menu.
  7987. *
  7988. * --> kEventParamMenuItemType (in, typeThemeMenuItemType)
  7989. * The type of menu item.
  7990. *
  7991. * --> kEventParamCGContextRef (in, typeCGContextRef)
  7992. * The CG context in which the menu item should be drawn. Note
  7993. * that this context has Cartesian coordinates, with (0,0) at
  7994. * the bottom left, while the item bounds passed in the event
  7995. * has QuickDraw coordinates, with (0,0) at the top left. To
  7996. * align the context coordinates with the item bounds, use the
  7997. * height of the current port to flip the context with
  7998. * CGContextTranslateCTM( context, 0, height ) and
  7999. * CGContextScaleCTM( context, 1, -1 ).
  8000. *
  8001. * <-- kEventParamMenuMarkBounds (out, typeQDRectangle)
  8002. * On exit, contains the bounds of the menu item mark
  8003. * character. Not present if the item has no mark. Added to
  8004. * the event by the standard menu definitionÕs handler, if the
  8005. * event is allowed to pass through.
  8006. *
  8007. * <-- kEventParamMenuIconBounds (out, typeQDRectangle)
  8008. * On exit, contains the bounds of the menu item icon. Not
  8009. * present if the item has no icon. Added to the event by the
  8010. * standard menu definitionÕs handler, if the event is allowed
  8011. * to pass through.
  8012. *
  8013. * <-- kEventParamMenuTextBounds (out, typeQDRectangle)
  8014. * On exit, contains the bounds of the menu itemÕs text. Added
  8015. * to the event by the standard menu definitionÕs handler, if
  8016. * the event is allowed to pass through.
  8017. *
  8018. * <-- kEventParamMenuTextBaseline (out, typeShortInteger)
  8019. * On exit, contains the baseline of the menu itemÕs text.
  8020. * Added to the event by the standard menu definitionÕs
  8021. * handler, if the event is allowed to pass through.
  8022. *
  8023. * <-- kEventParamMenuCommandKeyBounds (out, typeQDRectangle)
  8024. * On exit, contains the bounds of the menu item command key.
  8025. * Not present if the item has no command key. Added to the
  8026. * event by the standard menu definitionÕs handler, if the
  8027. * event is allowed to pass through.
  8028. *
  8029. * Availability:
  8030. * Mac OS X: in version 10.1 and later in Carbon.framework
  8031. * CarbonLib: in CarbonLib 1.5 and later
  8032. }
  8033. const
  8034. kEventMenuDrawItem = 102;
  8035. {
  8036. * kEventClassMenu / kEventMenuDrawItemContent
  8037. *
  8038. * Summary:
  8039. * Requests drawing of a menu itemÕs content: its text, command key,
  8040. * icon, etc.
  8041. *
  8042. * Discussion:
  8043. * Sent by the standard menu definition when a menu item has the
  8044. * kMenuItemAttrCustomDraw attribute. Handlers for this event should
  8045. * be installed directly on the menu. A handler for this event may
  8046. * respond by overriding the drawing of the menu item content: the
  8047. * mark character, icon, text, and command key information. At the
  8048. * time when this event is sent, the background of the menu item has
  8049. * already been drawn using the standard system appearance, and if
  8050. * the item is selected, the background is drawn with a hilite. The
  8051. * item should be drawn into the current port if using QuickDraw, or
  8052. * into the provided CGContextRef if using CoreGraphics. If no
  8053. * handler is installed, the standard menu definition provides a
  8054. * default handler that draws the standard menu item content. The
  8055. * standard handler also adds event parameters to the event
  8056. * indicating the bounding boxes of the different portions of the
  8057. * menu item content (mark, icon, text, and command keys), and an
  8058. * event parameter with the baseline of the menu item text; this
  8059. * allows handlers to use CallNextEventHandler to call through to
  8060. * the standard system handler, and then modify the system
  8061. * appearance by drawing on top of the standard content.
  8062. *
  8063. * Mac OS X threading:
  8064. * Not thread safe
  8065. *
  8066. * Parameters:
  8067. *
  8068. * --> kEventParamDirectObject (in, typeMenuRef)
  8069. * The menu being drawn.
  8070. *
  8071. * --> kEventParamMenuItemIndex (in, typeMenuItemIndex)
  8072. * The menu item being drawn.
  8073. *
  8074. * --> kEventParamMenuItemBounds (in, typeQDRectangle)
  8075. * The bounds of the menu item, in local coordinates of the
  8076. * current port.
  8077. *
  8078. * --> kEventParamDeviceDepth (in, typeShortInteger)
  8079. * The bit depth of the GDevice on which the menu is being
  8080. * drawn.
  8081. *
  8082. * --> kEventParamDeviceColor (in, typeBoolean)
  8083. * Whether the GDevice on which the menu is being drawn is in
  8084. * black&white or color mode.
  8085. *
  8086. * --> kEventParamCGContextRef (in, typeCGContextRef)
  8087. * The CG context in which the menu item should be drawn. Note
  8088. * that this context has Cartesian coordinates, with (0,0) at
  8089. * the bottom left, while the item bounds passed in the event
  8090. * has QuickDraw coordinates, with (0,0) at the top left. To
  8091. * align the context coordinates with the item bounds, use the
  8092. * height of the current port to flip the context with
  8093. * CGContextTranslateCTM( context, 0, height ) and
  8094. * CGContextScaleCTM( context, 1, -1 ).
  8095. *
  8096. * <-- kEventParamMenuMarkBounds (out, typeQDRectangle)
  8097. * On exit, contains the bounds of the menu item mark
  8098. * character. Not present if the item has no mark. Added to
  8099. * the event by the standard menu definitionÕs handler, if the
  8100. * event is allowed to pass through.
  8101. *
  8102. * <-- kEventParamMenuIconBounds (out, typeQDRectangle)
  8103. * On exit, contains the bounds of the menu item icon. Not
  8104. * present if the item has no icon. Added to the event by the
  8105. * standard menu definitionÕs handler, if the event is allowed
  8106. * to pass through.
  8107. *
  8108. * <-- kEventParamMenuTextBounds (out, typeQDRectangle)
  8109. * On exit, contains the bounds of the menu itemÕs text. Added
  8110. * to the event by the standard menu definitionÕs handler, if
  8111. * the event is allowed to pass through.
  8112. *
  8113. * <-- kEventParamMenuTextBaseline (out, typeShortInteger)
  8114. * On exit, contains the baseline of the menu itemÕs text.
  8115. * Added to the event by the standard menu definitionÕs
  8116. * handler, if the event is allowed to pass through.
  8117. *
  8118. * <-- kEventParamMenuCommandKeyBounds (out, typeQDRectangle)
  8119. * On exit, contains the bounds of the menu item command key.
  8120. * Not present if the item has no command key. Added to the
  8121. * event by the standard menu definitionÕs handler, if the
  8122. * event is allowed to pass through.
  8123. *
  8124. * Availability:
  8125. * Mac OS X: in version 10.1 and later in Carbon.framework
  8126. * CarbonLib: in CarbonLib 1.5 and later
  8127. }
  8128. const
  8129. kEventMenuDrawItemContent = 103;
  8130. {
  8131. * kEventClassMenu / kEventMenuCalculateSize
  8132. *
  8133. * Summary:
  8134. * Requests that a menu calculate its total size.
  8135. *
  8136. * Discussion:
  8137. * Sent by CalcMenuSize to request that the menu calculate its size.
  8138. * The Menu Manager provides a default handler for all menus that
  8139. * calls the menu's MDEF or menu content view to determine the menu
  8140. * size. Applications will typically not need to handle this event;
  8141. * a custom menu definition or menu content view should use
  8142. * kMenuSizeMsg or kEventControlGetOptimalBounds to calculate its
  8143. * size.
  8144. *
  8145. * Note that if the menu uses an MDEF, the MDEF will set the menu's
  8146. * width and height in response to kMenuSizeMsg. The default handler
  8147. * for this event saves the old width and height before calling the
  8148. * MDEF and restores them afterwards. CalcMenuSize will set the
  8149. * final menu width and height based on the dimensions returned from
  8150. * this event; applications may override this event to customize the
  8151. * width or height of a menu by modifying the kEventParamDimensions
  8152. * parameter.
  8153. *
  8154. * This event is sent only to the menu, and is not propagated past
  8155. * it.
  8156. *
  8157. * Mac OS X threading:
  8158. * Not thread safe
  8159. *
  8160. * Parameters:
  8161. *
  8162. * --> kEventParamDirectObject (in, typeMenuRef)
  8163. * The menu being measured.
  8164. *
  8165. * --> kEventParamControlRef (in, typeControlRef)
  8166. * If the menu uses a content view, this parameter contains
  8167. * the HIViewRef that should calculate the menu's size. This
  8168. * parameter will not be present if the menu uses an MDEF.
  8169. *
  8170. * --> kEventParamGDevice (in, typeGDHandle)
  8171. * If the menu uses an MDEF, this parameter contains the
  8172. * GDevice on which the menu will be displayed. This parameter
  8173. * will not be present if the menu uses a content view.
  8174. *
  8175. * --> kEventParamAvailableBounds (in, typeQDRectangle)
  8176. * If the menu uses an MDEF, this parameter contains a
  8177. * bounding rect in global coordinates inside of which the
  8178. * menu should be displayed. This parameter is optional and
  8179. * may not be present in all instances of this event; if not
  8180. * present, the GDevice's bounds should be used instead. This
  8181. * parameter will not be present if the menu uses a content
  8182. * view.
  8183. *
  8184. * <-- kEventParamDimensions (out, typeHISize)
  8185. * On exit, contains the menu's size.
  8186. *
  8187. * Availability:
  8188. * Mac OS X: in version 10.3 and later in Carbon.framework
  8189. * CarbonLib: not available
  8190. }
  8191. const
  8192. kEventMenuCalculateSize = 1004;
  8193. {
  8194. * kEventClassMenu / kEventMenuCreateFrameView
  8195. *
  8196. * Summary:
  8197. * Requests that a menu content view create the HIView that will
  8198. * used to draw the menu window frame.
  8199. *
  8200. * Discussion:
  8201. * The HIMenuView class provides a default handler for this event
  8202. * that creates an instance of the standard menu window frame view.
  8203. *
  8204. *
  8205. * This event is sent only to the menu content view, and is not
  8206. * propagated past the view.
  8207. *
  8208. * Mac OS X threading:
  8209. * Not thread safe
  8210. *
  8211. * Parameters:
  8212. *
  8213. * --> kEventParamEventRef (in, typeEventRef)
  8214. * The initialization event that should be used to create the
  8215. * view. A handler for this event may add its own parameters
  8216. * to this event.
  8217. *
  8218. * --> kEventParamMenuType (in, typeThemeMenuType)
  8219. * The type of menu frame (pull-down, popup, or hierarchical)
  8220. * that is needed.
  8221. *
  8222. * <-- kEventParamMenuFrameView (out, typeControlRef)
  8223. * On exit, contains the newly created menu frame view.
  8224. *
  8225. * Availability:
  8226. * Mac OS X: in version 10.3 and later in Carbon.framework
  8227. * CarbonLib: not available
  8228. }
  8229. const
  8230. kEventMenuCreateFrameView = 1005;
  8231. {
  8232. * kEventClassMenu / kEventMenuGetFrameBounds
  8233. *
  8234. * Summary:
  8235. * Requests that a menu content view calculate the bounding rect, in
  8236. * global coordinates, of the menu window frame that should contain
  8237. * the menu.
  8238. *
  8239. * Discussion:
  8240. * This event is sent by the Menu Manager before displaying
  8241. * pull-down, popup, and hierarchical menus. It provides an
  8242. * opportunity for the menu content view to determine the position
  8243. * of the menu frame based on the position of the menu title, parent
  8244. * menu item, or popup menu location.
  8245. *
  8246. * The HIMenuView class provides a default handler for this event
  8247. * that calculates an appropriate location based on the bounds of
  8248. * the menu, the available screen space, and the frame metrics of
  8249. * the menu window content view.
  8250. *
  8251. * This event is sent only to the menu content view, and is not
  8252. * propagated past the view.
  8253. *
  8254. * Mac OS X threading:
  8255. * Not thread safe
  8256. *
  8257. * Parameters:
  8258. *
  8259. * --> kEventParamMenuType (in, typeThemeMenuType)
  8260. * The type of menu (pull-down, popup, or hierarchical) that
  8261. * is being displayed.
  8262. *
  8263. * --> kEventParamMenuIsPopup (in, typeBoolean)
  8264. * Whether this menu originated from a popup menu. Primarily
  8265. * useful to distinguish between hierarchical menus that are
  8266. * submenus of pull-down menus, and hierarchical menus that
  8267. * are submenus of popup menus.
  8268. *
  8269. * --> kEventParamMenuFrameView (in, typeControlRef)
  8270. * The menu window frame view.
  8271. *
  8272. * --> kEventParamMenuDirection (in, typeMenuDirection)
  8273. * The suggested direction (left or right) which the view
  8274. * should attempt to use when positioning the menu window. For
  8275. * pull-down menus, this will typically be
  8276. * kHIMenuRightDirection; for hierarchical menus, it will be
  8277. * the same direction as the parent menu.
  8278. *
  8279. * --> kEventParamMenuItemBounds (in, typeHIRect)
  8280. * The bounds, in global coordinates, of the parent menu title
  8281. * (for pull-down menus), the parent menu item (for
  8282. * hierarchical menus), or the popup location (for popup
  8283. * menus).
  8284. *
  8285. * --> kEventParamGDevice (in, typeGDHandle)
  8286. * The GDevice on which the menu should be displayed.
  8287. *
  8288. * --> kEventParamAvailableBounds (in, typeHIRect)
  8289. * The available bounds, in global coordinates, inside which
  8290. * the menu should be displayed. The menu should not extend
  8291. * outside of these bounds.
  8292. *
  8293. * --> kEventParamParentMenu (in, typeMenuRef)
  8294. * Only available when kEventParamMenuType is
  8295. * kThemeMenuTypeHierarchical. The parent menu of this menu.
  8296. *
  8297. * --> kEventParamParentMenuItem (in, typeMenuItemIndex)
  8298. * Only available when kEventParamMenuType is
  8299. * kThemeMenuTypeHierarchical. The parent menu item of this
  8300. * menu.
  8301. *
  8302. * --> kEventParamMenuPopupItem (in, typeMenuItemIndex)
  8303. * Only available when kEventParamMenuType is
  8304. * kThemeMenuTypePopUp. The item in the menu that should be
  8305. * positioned at the popup location, or zero if no item should
  8306. * be positioned there.
  8307. *
  8308. * <-- kEventParamBounds (out, typeHIRect)
  8309. * On exit, contains the bounding rect, in global coordinates,
  8310. * of the menu window. The handler should add this parameter
  8311. * to the event.
  8312. *
  8313. * <-- kEventParamOrigin (out, typeHIPoint)
  8314. * On exit, contains the origin to which the menu content view
  8315. * should be scrolled before the menu is displayed.
  8316. *
  8317. * Availability:
  8318. * Mac OS X: in version 10.3 and later in Carbon.framework
  8319. * CarbonLib: not available
  8320. }
  8321. const
  8322. kEventMenuGetFrameBounds = 1006;
  8323. {
  8324. * kEventClassMenu / kEventMenuBecomeScrollable
  8325. *
  8326. * Summary:
  8327. * Requests that a menu content view prepare to be scrollable, by
  8328. * installing the appropriate event handlers, timers, etc.
  8329. *
  8330. * Discussion:
  8331. * This event is sent by the Menu Manager when a menu becomes the
  8332. * most recently opened menu in the menu hierarchy. It is an
  8333. * indication that this menu content view is now a candidate for
  8334. * scrolling.
  8335. *
  8336. * The Menu Manager provides a default handler for this event that
  8337. * installs event handlers to provide automatic scrolling behavior
  8338. * for HIView-based menus.
  8339. *
  8340. * If a menu content view does not wish to use the Menu Manager's
  8341. * default scrolling support, it can override this event and return
  8342. * noErr to prevent the event from being propagated to the Menu
  8343. * Manager's default handler.
  8344. *
  8345. * This event is sent only to the menu content view, and is not
  8346. * propagated past the view.
  8347. *
  8348. * Mac OS X threading:
  8349. * Not thread safe
  8350. *
  8351. * Availability:
  8352. * Mac OS X: in version 10.3 and later in Carbon.framework
  8353. * CarbonLib: not available
  8354. }
  8355. const
  8356. kEventMenuBecomeScrollable = 1007;
  8357. {
  8358. * kEventClassMenu / kEventMenuCeaseToBeScrollable
  8359. *
  8360. * Summary:
  8361. * Requests that a menu content view cease to be scrollable.
  8362. *
  8363. * Discussion:
  8364. * This event is sent by the Menu Manager when a menu ceases to be
  8365. * the most recently opened menu. This occurs when the menu is
  8366. * closed, or when a submenu of the most recently opened menu is
  8367. * opened. It is an indication that this menu content view is no
  8368. * longer a candidate for scrolling.
  8369. *
  8370. * The Menu Manager provides a default handler for this event that
  8371. * removes event handlers installed in response to
  8372. * kEventMenuBecomeScrollable.
  8373. *
  8374. * This event is sent only to the menu content view, and is not
  8375. * propagated past the view.
  8376. *
  8377. * Mac OS X threading:
  8378. * Not thread safe
  8379. *
  8380. * Availability:
  8381. * Mac OS X: in version 10.3 and later in Carbon.framework
  8382. * CarbonLib: not available
  8383. }
  8384. const
  8385. kEventMenuCeaseToBeScrollable = 1008;
  8386. {
  8387. * kEventClassMenu / kEventMenuBarShown
  8388. *
  8389. * Summary:
  8390. * Notification that the menubar in the frontmost process has been
  8391. * shown.
  8392. *
  8393. * Discussion:
  8394. * This event is sent to all handlers registered for it. This event
  8395. * will be sent to registered handlers in all processes when the
  8396. * front process shows its menubar. This event is sent only to the
  8397. * application target.
  8398. *
  8399. * Mac OS X threading:
  8400. * Not thread safe
  8401. *
  8402. * Availability:
  8403. * Mac OS X: in version 10.3 and later in Carbon.framework
  8404. * CarbonLib: not available
  8405. }
  8406. const
  8407. kEventMenuBarShown = 2000;
  8408. {
  8409. * kEventClassMenu / kEventMenuBarHidden
  8410. *
  8411. * Summary:
  8412. * Notification that the menubar in the frontmost process has been
  8413. * hidden.
  8414. *
  8415. * Discussion:
  8416. * This event is sent to all handlers registered for it. This event
  8417. * will be sent to registered handlers in all processes when the
  8418. * front process hides its menubar. This event is sent only to the
  8419. * application target.
  8420. *
  8421. * Mac OS X threading:
  8422. * Not thread safe
  8423. *
  8424. * Availability:
  8425. * Mac OS X: in version 10.3 and later in Carbon.framework
  8426. * CarbonLib: not available
  8427. }
  8428. const
  8429. kEventMenuBarHidden = 2001;
  8430. {--------------------------------------------------------------------------------------}
  8431. { Command Events }
  8432. {--------------------------------------------------------------------------------------}
  8433. {
  8434. kEventClassCommand quick reference:
  8435. kEventCommandProcess = 1,
  8436. kEventCommandUpdateStatus = 2
  8437. }
  8438. {
  8439. * kEventClassCommand / kEventCommandProcess
  8440. *
  8441. * Summary:
  8442. * A command has been invoked and the application should handle it.
  8443. *
  8444. * Discussion:
  8445. * This event is sent when the user chooses a menu item or clicks a
  8446. * control. Any menu item selection, from either the menubar, a
  8447. * popup or contextual menu, or a popup or bevel button control,
  8448. * will cause this event to be sent; if the menu item does not have
  8449. * a command ID, the commandID field of the HICommand parameter will
  8450. * be zero, but the event will still contain a valid MenuRef and
  8451. * MenuItemIndex. Controls will send this event only if the control
  8452. * has a non-zero command ID set with SetControlCommandID.
  8453. *
  8454. * Some senders of this event will also include the modifier keys
  8455. * that were pressed by the user when the command was invoked, but
  8456. * this parameter is optional and may not be present in all
  8457. * instances of this event.
  8458. *
  8459. * When a command event is sent from a menu, a MenuContext parameter
  8460. * will be included on Mac OS X 10.2 and CarbonLib 1.6, indicating
  8461. * whether the command was sent from a menu in the menubar
  8462. * (kMenuContextMenuBar will be set) or from a popup menu
  8463. * (kMenuContextMenuBar will not be set). The MenuContext parameter
  8464. * also indicates whether the event was sent by a selection of a
  8465. * menu item with the mouse (kMenuContextMenuBarTracking or
  8466. * kMenuContextPopUpTracking will be set), or by a command key press
  8467. * (kMenuContextKeyMatching will be set). If you need to determine
  8468. * the source of a command event on a Carbon release prior to Mac OS
  8469. * X 10.2 or CarbonLib 1.6, we recommend installing a
  8470. * kEventMenuEnableItems handler on each menu and caching the
  8471. * MenuContext parameter in the EnableItems event in a menu
  8472. * property; when you receive the CommandProcess event, look up the
  8473. * cached MenuContext.
  8474. *
  8475. * It is essential that your event handler for this event return
  8476. * eventNotHandledErr for any command events that you do not handle,
  8477. * especially for commands that are sent from menus attached to
  8478. * popup or bevel button controls; if, for example, you return noErr
  8479. * for command events sent in response to a menu selection from a
  8480. * popup button, the Menu Manager will return zero from
  8481. * PopUpMenuSelect, and the popup button control will not know that
  8482. * an item was selected from the popup menu and will not redraw with
  8483. * the new selection.
  8484. *
  8485. * Mac OS X threading:
  8486. * Not thread safe
  8487. *
  8488. * Parameters:
  8489. *
  8490. * --> kEventParamDirectObject (in, typeHICommand)
  8491. * The command to be handled.
  8492. *
  8493. * --> kEventParamKeyModifiers (in, typeUInt32)
  8494. * The keyboard modifiers that were pressed when the command
  8495. * was invoked by the user. This parameter is optional and may
  8496. * not be present in all instances of this event.
  8497. *
  8498. * --> kEventParamMenuContext (in, typeUInt32)
  8499. * If the command was contained in a menu, information about
  8500. * the menu. This parameter is optional and may not be present
  8501. * in all instances of this event. Available in Mac OS X 10.2
  8502. * and CarbonLib 1.6, and later.
  8503. *
  8504. * Availability:
  8505. * Mac OS X: in version 10.0 and later in Carbon.framework
  8506. * CarbonLib: in CarbonLib 1.1 and later
  8507. }
  8508. const
  8509. kEventCommandProcess = 1;
  8510. {
  8511. * kEventClassCommand / kEventCommandUpdateStatus
  8512. *
  8513. * Summary:
  8514. * A command-generating user interface element requires updating.
  8515. *
  8516. * Discussion:
  8517. * When you receive this event, you should update the necessary UI
  8518. * elements in your application to reflect the current status of the
  8519. * command. For example, if the command has the kHICommandFromMenu
  8520. * bit set, you should update the menu item state, menu item text,
  8521. * and so on, to reflect the current reality in your application. If
  8522. * the menu item is the "Undo" item, and the last editing change to
  8523. * the document was a Cut operation, then you might set the text to
  8524. * "Undo Cut" and enable the menu item.
  8525. *
  8526. * Currently, this event is only sent for menu items; it is not used
  8527. * to update the status of controls.
  8528. *
  8529. * Note that when responding to this event, you should only update
  8530. * the status of the single user interface element (a menu item, for
  8531. * example) described by the HICommand structure; you should not
  8532. * update the status of the entire menu or of all menus in the
  8533. * menubar. You will receive a separate UpdateStatus event for each
  8534. * menu item in a menu, and each item should be updated
  8535. * individually. When updating a menu item, you should generally not
  8536. * use Enable/DisableMenuCommand; these APIs search the entire menu
  8537. * hierarchy for the command ID. Instead, just call
  8538. * Enable/DisableMenuItem directly, passing the menu and menu item
  8539. * index that are provided to you in the HICommand structure.
  8540. *
  8541. *
  8542. * You may wish to optimize your handling of the UpdateStatus event
  8543. * by examining the MenuContext parameter to the event. This
  8544. * parameter indicates the context in which the command requires
  8545. * updating. For example, if the menu context parameter has the
  8546. * kMenuContextKeyMatching bit set, you know that the update request
  8547. * is being sent in while search for a menu item that matches a
  8548. * command key. This knowledge can help you avoid unnecessary work;
  8549. * if your menu item for this command has no command key, for
  8550. * example, you can ignore this event when the KeyMatching bit is
  8551. * set because your menu item will never match a command key
  8552. * anyways, regardless of whether it is enabled or disabled.
  8553. *
  8554. * Mac OS X threading:
  8555. * Not thread safe
  8556. *
  8557. * Parameters:
  8558. *
  8559. * --> kEventParamDirectObject (in, typeHICommand)
  8560. * The command to be updated.
  8561. *
  8562. * --> kEventParamMenuContext (in, typeUInt32)
  8563. * If the command was contained in a menu, information about
  8564. * the menu and the context of the command updating request.
  8565. * This parameter is optional and may not be present in all
  8566. * instances of this event.
  8567. *
  8568. * Availability:
  8569. * Mac OS X: in version 10.0 and later in Carbon.framework
  8570. * CarbonLib: in CarbonLib 1.1 and later
  8571. }
  8572. const
  8573. kEventCommandUpdateStatus = 2;
  8574. { HI Commands }
  8575. {
  8576. * Summary:
  8577. * Common command IDs
  8578. }
  8579. const
  8580. {
  8581. * The OK button in a dialog or alert.
  8582. }
  8583. kHICommandOK = $6F6B2020 (* 'ok ' *);
  8584. {
  8585. * The Cancel button in a dialog or alert.
  8586. }
  8587. kHICommandCancel = $6E6F7421 (* 'not!' *);
  8588. {
  8589. * The application should quit.
  8590. }
  8591. kHICommandQuit = $71756974 (* 'quit' *);
  8592. {
  8593. * The last editing operation should be undone.
  8594. }
  8595. kHICommandUndo = $756E646F (* 'undo' *);
  8596. {
  8597. * The last editing operation should be redone.
  8598. }
  8599. kHICommandRedo = $7265646F (* 'redo' *);
  8600. {
  8601. * The selected items should be cut.
  8602. }
  8603. kHICommandCut = $63757420 (* 'cut ' *);
  8604. {
  8605. * The selected items should be copied.
  8606. }
  8607. kHICommandCopy = $636F7079 (* 'copy' *);
  8608. {
  8609. * The contents of the clipboard should be pasted.
  8610. }
  8611. kHICommandPaste = $70617374 (* 'past' *);
  8612. {
  8613. * The selected items should be deleted.
  8614. }
  8615. kHICommandClear = $636C6561 (* 'clea' *);
  8616. {
  8617. * All items in the active window should be selected.
  8618. }
  8619. kHICommandSelectAll = $73616C6C (* 'sall' *);
  8620. {
  8621. * The application should be hidden. The Menu Manager will respond to
  8622. * this command automatically; your application does not need to
  8623. * handle it.
  8624. }
  8625. kHICommandHide = $68696465 (* 'hide' *);
  8626. {
  8627. * Other applications should be hidden. The Menu Manager will respond
  8628. * to this command automatically; your application does not need to
  8629. * handle it.
  8630. }
  8631. kHICommandHideOthers = $6869646F (* 'hido' *);
  8632. {
  8633. * All applications should become visible. The Menu Manager will
  8634. * respond to this command automatically; your application does not
  8635. * need to handle it.
  8636. }
  8637. kHICommandShowAll = $7368616C (* 'shal' *);
  8638. {
  8639. * The Preferences menu item has been selected.
  8640. }
  8641. kHICommandPreferences = $70726566 (* 'pref' *);
  8642. {
  8643. * The active window should be zoomed in or out. The default
  8644. * application handler will respond to this event automatically; your
  8645. * application does not need to handle it, but you may want to
  8646. * install a Carbon event handler for kEventWindowGetIdealSize to
  8647. * return the ideal size for your document windows.
  8648. }
  8649. kHICommandZoomWindow = $7A6F6F6D (* 'zoom' *);
  8650. {
  8651. * The active window should be minimized. The default application
  8652. * handler will respond to this event automatically; your application
  8653. * does not need to handle it.
  8654. }
  8655. kHICommandMinimizeWindow = $6D696E69 (* 'mini' *);
  8656. {
  8657. * All collapsable windows should be minimized. The default
  8658. * application handler will respond to this event automatically; your
  8659. * application does not need to handle it.
  8660. }
  8661. kHICommandMinimizeAll = $6D696E61 (* 'mina' *);
  8662. {
  8663. * The active window should be maximized. Only sent on Mac OS 9. The
  8664. * default application handler will respond to this event
  8665. * automatically; your application does not need to handle it.
  8666. }
  8667. kHICommandMaximizeWindow = $6D617869 (* 'maxi' *);
  8668. {
  8669. * All collapsable windows should be maximized. This command is not
  8670. * sent or handled on Mac OS X.
  8671. }
  8672. kHICommandMaximizeAll = $6D617861 (* 'maxa' *);
  8673. {
  8674. * All document-class windows should be arranged in a stack. The
  8675. * default application handler will respond to this event
  8676. * automatically; your application does not need to handle it.
  8677. }
  8678. kHICommandArrangeInFront = $66726E74 (* 'frnt' *);
  8679. {
  8680. * All windows of this application should be brought in front of
  8681. * windows from other applications. Only sent on Mac OS X. The
  8682. * default application handler will respond to this event
  8683. * automatically; your application does not need to handle it.
  8684. }
  8685. kHICommandBringAllToFront = $62667274 (* 'bfrt' *);
  8686. {
  8687. * This command ID is used as a placeholder to mark the separator
  8688. * item dividing the Zoom/Minimize/Maximize/Arrange menu items in the
  8689. * standard Window menu from the menu items listing the visible
  8690. * windows. If you need to add your own menu items to the standard
  8691. * Window menu before the window list section, you can look for the
  8692. * menu item with this command ID using GetIndMenuItemWithCommandID,
  8693. * and insert your menu items before the item with this ID.
  8694. }
  8695. kHICommandWindowListSeparator = $776C6476 (* 'wldv' *);
  8696. {
  8697. * This command ID is used as a placeholder to mark the end of the
  8698. * window list section of the standard Window menu. If you need to
  8699. * add your own menu items to the standard Window menu after the
  8700. * window list section, you can look for the menu item with this
  8701. * command ID using GetIndMenuItemWithCommandID, and insert your
  8702. * items after the item with this ID.
  8703. }
  8704. kHICommandWindowListTerminator = $776C7374 (* 'wlst' *);
  8705. {
  8706. * A window in the standard Window menu has been selected and should
  8707. * be activated. In Mac OS X 10.3, this command is also sent by the
  8708. * toolbox whenever it needs to activate a window in your
  8709. * application; for example, it is used when a window is selected
  8710. * from the application's Dock menu, and when a window that uses the
  8711. * standard window event handler is clicked. The default application
  8712. * handler will respond to this event automatically; your application
  8713. * does not need to handle it.
  8714. }
  8715. kHICommandSelectWindow = $7377696E (* 'swin' *);
  8716. {
  8717. * The Rotate Windows hotkey (cmd-~ by default) has been pressed, and
  8718. * non-floating windows should be rotated so that the window after
  8719. * the active window is activated. The default application handler
  8720. * will respond to this event automatically; your application does
  8721. * not need to handle it.
  8722. }
  8723. kHICommandRotateWindowsForward = $726F7477 (* 'rotw' *);
  8724. {
  8725. * The Rotate Windows hotkey (cmd-~ by default) has been pressed, and
  8726. * non-floating windows should be rotated so that the window before
  8727. * the active window is activated. The default application handler
  8728. * will respond to this event automatically; your application does
  8729. * not need to handle it.
  8730. }
  8731. kHICommandRotateWindowsBackward = $726F7462 (* 'rotb' *);
  8732. {
  8733. * The floating window focus hotkey (ctl-F6 by default) has been
  8734. * pressed, and floating windows should be rotated so that the window
  8735. * after the focused window is activated. The default application
  8736. * handler will respond to this event automatically; your application
  8737. * does not need to handle it.
  8738. }
  8739. kHICommandRotateFloatingWindowsForward = $72746677 (* 'rtfw' *);
  8740. {
  8741. * The floating window focus hotkey (ctl-F6 by default) has been
  8742. * pressed, and floating windows should be rotated so that the window
  8743. * before the focused window is activated. The default application
  8744. * handler will respond to this event automatically; your application
  8745. * does not need to handle it.
  8746. }
  8747. kHICommandRotateFloatingWindowsBackward = $72746662 (* 'rtfb' *);
  8748. {
  8749. * The About menu item has been selected. In Mac OS X 10.3 and later,
  8750. * RunApplicationEventLoop installs a handler for this command ID on
  8751. * the application target, and will handle this event automatically
  8752. * by calling HIAboutBox. Your application may install its own
  8753. * handler if it wishes to display a customized about box.
  8754. }
  8755. kHICommandAbout = $61626F75 (* 'abou' *);
  8756. {
  8757. * A new document or item should be created.
  8758. }
  8759. kHICommandNew = $6E657720 (* 'new ' *);
  8760. {
  8761. * The user wants to open an existing document.
  8762. }
  8763. kHICommandOpen = $6F70656E (* 'open' *);
  8764. {
  8765. * The active window should be closed. This command would typically
  8766. * be generated by a Close menu item. On Mac OS X 10.3 and later, the
  8767. * default application handler responds to this command by sending a
  8768. * kEventWindowClose event; on earlier systems, only the standard
  8769. * window event handler responded to this event.
  8770. }
  8771. kHICommandClose = $636C6F73 (* 'clos' *);
  8772. {
  8773. * The active document should be saved.
  8774. }
  8775. kHICommandSave = $73617665 (* 'save' *);
  8776. {
  8777. * The user wants to save the active document under a new name.
  8778. }
  8779. kHICommandSaveAs = $73766173 (* 'svas' *);
  8780. {
  8781. * The contents of the active document should be reverted to the last
  8782. * saved version.
  8783. }
  8784. kHICommandRevert = $72767274 (* 'rvrt' *);
  8785. {
  8786. * The active window should be printed.
  8787. }
  8788. kHICommandPrint = $70726E74 (* 'prnt' *);
  8789. {
  8790. * The user wants to configure the current page margins, formatting,
  8791. * and print options.
  8792. }
  8793. kHICommandPageSetup = $70616765 (* 'page' *);
  8794. {
  8795. * The applicationÕs help book should be displayed. Used by the Help
  8796. * Manager when it adds the "<AppName> Help" menu item to the Help
  8797. * menu. The Help Manager installs a handler for this command ID on
  8798. * the Help menu returned by HMGetHelpMenu, and will respond to this
  8799. * event automatically; your application does not need to handle it.
  8800. }
  8801. kHICommandAppHelp = $61686C70 (* 'ahlp' *);
  8802. {
  8803. * The character palette needs to be shown. Events with this command
  8804. * ID are only generated in Mac OS X 10.3 and later. The toolbox will
  8805. * respond to this event automatically; your application does not
  8806. * need to handle it.
  8807. }
  8808. kHICommandShowCharacterPalette = $63687270 (* 'chrp' *);
  8809. {
  8810. * Display the spelling panel if it is not already visible. Events
  8811. * with this command ID are only generated in Mac OS X 10.4 and
  8812. * later. If spell checking has been enabled in MLTE or an
  8813. * HITextView then this command is handled automatically.
  8814. }
  8815. kHICommandShowSpellingPanel = $73687370 (* 'shsp' *);
  8816. {
  8817. * Spell check the document now. Events with this command ID are
  8818. * only generated in Mac OS X 10.4 and later. If spell checking has
  8819. * been enabled in MLTE or an HITextView then this command is handled
  8820. * automatically.
  8821. }
  8822. kHICommandCheckSpelling = $636B7370 (* 'cksp' *);
  8823. kHICommandChangeSpelling = $63687370 (* 'chsp' *);
  8824. {
  8825. * Begin interactive spell checking. Events with this command ID are
  8826. * only generated in Mac OS X 10.4 and later. If spell checking has
  8827. * been enabled in MLTE or an HITextView then this command is handled
  8828. * automatically.
  8829. }
  8830. kHICommandCheckSpellingAsYouType = $61737063 (* 'aspc' *);
  8831. {
  8832. * Ignore this word while spell checking this text view. Events with
  8833. * this command ID are only generated in Mac OS X 10.4 and later. If
  8834. * spell checking has been enabled in MLTE or an HITextView then this
  8835. * command is handled automatically.
  8836. }
  8837. kHICommandIgnoreSpelling = $69677370 (* 'igsp' *);
  8838. {
  8839. * Learn this spelling for all documents. Events with this command
  8840. * ID are only generated in Mac OS X 10.4 and later. If spell
  8841. * checking has been enabled in MLTE or an HITextView then this
  8842. * command is handled automatically.
  8843. }
  8844. kHICommandLearnWord = $6C727764 (* 'lrwd' *);
  8845. {
  8846. * Summary:
  8847. * Values for the attributes field of the HICommand and
  8848. * HICommandExtended structures.
  8849. *
  8850. * Discussion:
  8851. * These bit masks are mutually exclusive; only one should be set at
  8852. * any given time. Some HICommand and HICommandExtended structures
  8853. * will have an attributes value of zero; in this case, there is no
  8854. * information available about the source of the command.
  8855. }
  8856. const
  8857. {
  8858. * Indicates that the command originates from a menu item. The
  8859. * HICommand.menu and HICommandExtended.source.menu fields are valid.
  8860. }
  8861. kHICommandFromMenu = 1 shl 0;
  8862. {
  8863. * Indicates that the command originates from a control. The
  8864. * HICommandExtended.source.control field is valid.
  8865. }
  8866. kHICommandFromControl = 1 shl 1;
  8867. {
  8868. * Indicates that the command originates from a window. The
  8869. * HICommandExtended.source.window field is valid.
  8870. }
  8871. kHICommandFromWindow = 1 shl 2;
  8872. type
  8873. HICommand = record
  8874. attributes: UInt32;
  8875. commandID: UInt32;
  8876. menuRef: MenuRef;
  8877. menuItemIndex: MenuItemIndex;
  8878. end;
  8879. HICommandPtr = ^HICommand;
  8880. type
  8881. HICommandExtended = record
  8882. attributes: UInt32;
  8883. commandID: UInt32;
  8884. case SInt16 of
  8885. 0: (
  8886. control: ControlRef;
  8887. );
  8888. 1: (
  8889. window: WindowRef;
  8890. );
  8891. 2: (
  8892. menuRef: MenuRef;
  8893. menuItemIndex: MenuItemIndex;
  8894. );
  8895. end;
  8896. HICommandExtendedPtr = ^HICommandExtended;
  8897. {--------------------------------------------------------------------------------------}
  8898. { Control Events }
  8899. {--------------------------------------------------------------------------------------}
  8900. {
  8901. kEventClassControl quick reference:
  8902. // lifespan
  8903. kEventControlInitialize = 1000,
  8904. kEventControlDispose = 1001,
  8905. kEventControlGetOptimalBounds = 1003,
  8906. kEventControlDefInitialize = kEventControlInitialize,
  8907. kEventControlDefDispose = kEventControlDispose,
  8908. // event handling
  8909. kEventControlHit = 1,
  8910. kEventControlSimulateHit = 2,
  8911. kEventControlHitTest = 3,
  8912. kEventControlDraw = 4,
  8913. kEventControlApplyBackground = 5,
  8914. kEventControlApplyTextColor = 6,
  8915. kEventControlSetFocusPart = 7,
  8916. kEventControlGetFocusPart = 8,
  8917. kEventControlActivate = 9,
  8918. kEventControlDeactivate = 10,
  8919. kEventControlSetCursor = 11,
  8920. kEventControlContextualMenuClick = 12,
  8921. kEventControlClick = 13,
  8922. kEventControlGetNextFocusCandidate = 14,
  8923. kEventControlGetAutoToggleValue = 15,
  8924. kEventControlInterceptSubviewClick = 16,
  8925. kEventControlGetClickActivation = 17,
  8926. kEventControlDragEnter = 18,
  8927. kEventControlDragWithin = 19,
  8928. kEventControlDragLeave = 20,
  8929. kEventControlDragReceive = 21,
  8930. kEventControlInvalidateForSizeChange = 22,
  8931. kEventControlTrackingAreaEntered = 23, // in HIView.h
  8932. kEventControlTrackingAreaExited = 24, // in HIView.h
  8933. // tracking
  8934. kEventControlTrack = 51,
  8935. kEventControlGetScrollToHereStartPoint = 52,
  8936. kEventControlGetIndicatorDragConstraint = 53,
  8937. kEventControlIndicatorMoved = 54,
  8938. kEventControlGhostingFinished = 55,
  8939. kEventControlGetActionProcPart = 56,
  8940. // accessors
  8941. kEventControlGetPartRegion = 101,
  8942. kEventControlGetPartBounds = 102,
  8943. kEventControlSetData = 103,
  8944. kEventControlGetData = 104,
  8945. kEventControlGetSizeConstraints = 105,
  8946. kEventControlGetFrameMetrics = 106,
  8947. // notification
  8948. kEventControlValueFieldChanged = 151,
  8949. kEventControlAddedSubControl = 152,
  8950. kEventControlRemovingSubControl = 153,
  8951. kEventControlBoundsChanged = 154,
  8952. kEventControlVisibilityChanged = 157,
  8953. kEventControlTitleChanged = 158,
  8954. kEventControlOwningWindowChanged = 159,
  8955. kEventControlHiliteChanged = 160,
  8956. kEventControlEnabledStateChanged = 161,
  8957. kEventControlLayoutInfoChanged = 162,
  8958. // miscellaneous
  8959. kEventControlArbitraryMessage = 201
  8960. }
  8961. {
  8962. * kEventClassControl / kEventControlClick
  8963. *
  8964. * Summary:
  8965. * A mouse down event occurred over a control.
  8966. *
  8967. * Discussion:
  8968. * This event is sent when a non-contextual-menu click occurs over a
  8969. * control; a contextual menu click generates
  8970. * kEventControlContextualMenuClick instead.
  8971. *
  8972. * The handler of this event is responsible for two things: first,
  8973. * the handler must set the keyboard focus to the control if the
  8974. * control takes focus on clicks; look for the
  8975. * kControlGetsFocusOnClick feature bit and call an API such as
  8976. * SetKeyboardFocus. Second, the handler must call one of the
  8977. * control tracking APIs: HIViewClick, HandleControlClick, or
  8978. * TrackControl. The standard window handler does both of these
  8979. * things.
  8980. *
  8981. * Warning: Beware of handling kEventControlClick events! This is
  8982. * usually NOT the event you really want to handle.
  8983. * kEventControlClick is a request to "please click this control,"
  8984. * not "allow a control definition to track the mouse." If you are
  8985. * implementing or overriding a control definitionÕs or HIViewÕs
  8986. * support for tracking the mouse, you should handle
  8987. * kEventControlTrack instead.
  8988. *
  8989. * Mac OS X threading:
  8990. * Not thread safe
  8991. *
  8992. * Parameters:
  8993. *
  8994. * --> kEventParamDirectObject (in, typeControlRef)
  8995. * The control that was clicked.
  8996. *
  8997. * --> kEventParamMouseLocation (in, typeHIPoint)
  8998. * The mouse location, in global coordinates.
  8999. *
  9000. * --> kEventParamWindowRef (in, typeWindowRef)
  9001. * The window under the mouse.
  9002. *
  9003. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  9004. * The window-relative position of the mouse in the window
  9005. * given in the kEventParamWindowRef parameter. 0,0 is at the
  9006. * top left of the structure of the window.
  9007. *
  9008. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  9009. * The part code that the mouse location hit in the window.
  9010. * This parameter only exists if the WindowRef parameter
  9011. * exists. This saves you the trouble of calling FindWindow,
  9012. * which is expensive on Mac OS X as it needs to call the
  9013. * Window Server. Available in Mac OS X 10.3 and later.
  9014. *
  9015. * --> kEventParamKeyModifiers (in, typeUInt32)
  9016. * The keyboard modifiers that were pressed when the event was
  9017. * generated.
  9018. *
  9019. * --> kEventParamMouseButton (in, typeMouseButton)
  9020. * Which mouse button was pressed.
  9021. *
  9022. * --> kEventParamClickCount (in, typeUInt32)
  9023. * Whether this is a single click, double click, etc.
  9024. *
  9025. * --> kEventParamMouseChord (in, typeUInt32)
  9026. * Which other mouse buttons were pressed when the event was
  9027. * generated. Available on Mac OS X only.
  9028. *
  9029. * --> kEventParamTabletEventType (in, typeUInt32)
  9030. * The type of tablet event which generated this mouse event;
  9031. * contains either kEventTabletPoint or kEventTabletProximity.
  9032. * Only present if the event was generated from a tablet.
  9033. *
  9034. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  9035. * Further information about the tablet event which generated
  9036. * this mouse event. Present if the the
  9037. * kEventParamTabletEventType parameter contains
  9038. * kEventTabletPoint.
  9039. *
  9040. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  9041. * Further information about the tablet event which generated
  9042. * this mouse event. Present if the the
  9043. * kEventParamTabletEventType parameter contains
  9044. * kEventTabletProximity.
  9045. *
  9046. * Availability:
  9047. * Mac OS X: in version 10.0 and later in Carbon.framework
  9048. * CarbonLib: in CarbonLib 1.3.1 and later
  9049. }
  9050. const
  9051. kEventControlClick = 13;
  9052. {
  9053. * kEventClassControl / kEventControlHit
  9054. *
  9055. * Summary:
  9056. * Sent by TrackControl and HandleControlClick after handling a
  9057. * click in a control.
  9058. *
  9059. * Discussion:
  9060. * This event indicates that a control has been manipulated by the
  9061. * user and that the user released the mouse button over some part
  9062. * of the control. It is sent automatically by the Control Manager
  9063. * when the control tracking code returns a non-zero part
  9064. * code.
  9065. *
  9066. * You might want to handle this event in a custom control
  9067. * definition if your control definition has special behavior after
  9068. * the control has been tracked. You can also handle this event in
  9069. * application code, to be notified after a control has been
  9070. * tracked; however, from the application level, it is generally
  9071. * preferred to provide a command ID for the control and handle
  9072. * kEventCommandProcess instead of kEventControlHit. Handling
  9073. * kEventCommandProcess is more generic and allows the same code to
  9074. * handle events from both controls and menu items.
  9075. *
  9076. * Mac OS X threading:
  9077. * Not thread safe
  9078. *
  9079. * Parameters:
  9080. *
  9081. * --> kEventParamDirectObject (in, typeControlRef)
  9082. * The control that was tracked.
  9083. *
  9084. * --> kEventParamControlPart (in, typeControlPartCode)
  9085. * The control part that the mouse was over when it was
  9086. * released.
  9087. *
  9088. * --> kEventParamKeyModifiers (in, typeUInt32)
  9089. * The keyboard modifiers that were pressed when the mouse was
  9090. * released.
  9091. *
  9092. * Availability:
  9093. * Mac OS X: in version 10.0 and later in Carbon.framework
  9094. * CarbonLib: in CarbonLib 1.1 and later
  9095. }
  9096. const
  9097. kEventControlHit = 1;
  9098. {
  9099. * kEventClassControl / kEventControlInitialize
  9100. *
  9101. * Summary:
  9102. * Allows the control to initialize private data.
  9103. *
  9104. * Mac OS X threading:
  9105. * Not thread safe
  9106. *
  9107. * Parameters:
  9108. *
  9109. * --> kEventParamDirectObject (in, typeControlRef)
  9110. * The control that is being created.
  9111. *
  9112. * --> kEventParamInitCollection (in, typeCollection)
  9113. * Initialization data supplied to CreateCustomControl.
  9114. *
  9115. * <-- kEventParamControlFeatures (out, typeUInt32)
  9116. * On exit, your event handler should supply the control
  9117. * features flags. NOTE: On Mac OS X 10.3 and later, this is
  9118. * deprecated in favor of using the HIViewChangeFeatures API.
  9119. * Instead of supplying this parameter, just call
  9120. * HIViewChangeFeatures. Also, this parameter can only be used
  9121. * to supply features for the original kControlFoo features,
  9122. * not the new kHIViewFoo features.
  9123. *
  9124. * Availability:
  9125. * Mac OS X: in version 10.0 and later in Carbon.framework
  9126. * CarbonLib: not available
  9127. }
  9128. const
  9129. kEventControlInitialize = 1000;
  9130. {
  9131. * kEventClassControl / kEventControlDispose
  9132. *
  9133. * Summary:
  9134. * Allows the control to dispose of private data.
  9135. *
  9136. * Mac OS X threading:
  9137. * Not thread safe
  9138. *
  9139. * Parameters:
  9140. *
  9141. * --> kEventParamDirectObject (in, typeControlRef)
  9142. * The control that is being destroyed.
  9143. *
  9144. * Availability:
  9145. * Mac OS X: in version 10.0 and later in Carbon.framework
  9146. * CarbonLib: not available
  9147. }
  9148. const
  9149. kEventControlDispose = 1001;
  9150. {
  9151. * kEventClassControl / kEventControlGetOptimalBounds
  9152. *
  9153. * Summary:
  9154. * Allows the control to report its best size and its text baseline
  9155. * based on its current settings.
  9156. *
  9157. * Mac OS X threading:
  9158. * Not thread safe
  9159. *
  9160. * Parameters:
  9161. *
  9162. * --> kEventParamDirectObject (in, typeControlRef)
  9163. * The control whose optimal bounds to return.
  9164. *
  9165. * <-- kEventParamControlOptimalBounds (out, typeHIRect)
  9166. * On exit, contains the controlÕs optimal bounds.
  9167. *
  9168. * <-- kEventParamControlOptimalBaselineOffset (out, typeShortInteger)
  9169. * On exit, contains the controlÕs optimal baseline offset:
  9170. * the distance from the top of the controlÕs optimal bounds
  9171. * to the baseline of the control text, if any. This parameter
  9172. * is optional and does not need to be provided if it doesnÕt
  9173. * apply for your control.
  9174. *
  9175. * Availability:
  9176. * Mac OS X: in version 10.0 and later in Carbon.framework
  9177. * CarbonLib: not available
  9178. }
  9179. const
  9180. kEventControlGetOptimalBounds = 1003;
  9181. {
  9182. * kEventClassControl / kEventControlSimulateHit
  9183. *
  9184. * Summary:
  9185. * Sent when your control should simulate a click in response to
  9186. * some other action, such as a return key for a default button.
  9187. *
  9188. * Discussion:
  9189. * Note that this event is solely meant to provide visual feedback
  9190. * that a control was clicked. For example, the push button control
  9191. * hilites itself briefly in response to this event. This event does
  9192. * not cause other events (such as kEventControlHit or
  9193. * kEventCommandProcess) to be sent. To fully simulate the results
  9194. * of clicking on a control, you can use the HIViewSimulateClick
  9195. * API, which sends a kEventControlSimulateHit event and also sends
  9196. * the kEventControlHit and kEventCommandProcess events that would
  9197. * normally result from a click on a control.
  9198. *
  9199. * Mac OS X threading:
  9200. * Not thread safe
  9201. *
  9202. * Parameters:
  9203. *
  9204. * --> kEventParamDirectObject (in, typeControlRef)
  9205. * The control for which a hit should be simulated.
  9206. *
  9207. * --> kEventParamKeyModifiers (in, typeUInt32)
  9208. * The keyboard modifiers that should be used for the
  9209. * simulated hit.
  9210. *
  9211. * <-> kEventParamControlPart (in/out, typeControlPartCode)
  9212. * On entry, contains the part code for which the control
  9213. * should simulate a hit. On exit, the control may modify this
  9214. * parameter to reflect the same sort of part code that it
  9215. * would pass back while handling kEventControlTrack.
  9216. *
  9217. * Availability:
  9218. * Mac OS X: in version 10.0 and later in Carbon.framework
  9219. * CarbonLib: not available
  9220. }
  9221. const
  9222. kEventControlSimulateHit = 2;
  9223. {
  9224. * kEventClassControl / kEventControlHitTest
  9225. *
  9226. * Summary:
  9227. * Sent when someone wants to find out what part of your control is
  9228. * at a given point in local coordinates.
  9229. *
  9230. * Mac OS X threading:
  9231. * Not thread safe
  9232. *
  9233. * Parameters:
  9234. *
  9235. * --> kEventParamDirectObject (in, typeControlRef)
  9236. * The control to hit-test.
  9237. *
  9238. * --> kEventParamMouseLocation (in, typeQDPoint)
  9239. * The point to hit-test. For controls in non-compositing
  9240. * windows, this coordinate is in local coordinates of the
  9241. * owning window; for controls in compositing windows, this
  9242. * coordinate is in view-local coordinates.
  9243. *
  9244. * <-- kEventParamControlPart (out, typeControlPartCode)
  9245. * On exit, contains the part code of the control part that
  9246. * was hit, or kControlNoPart if no part was hit.
  9247. *
  9248. * Availability:
  9249. * Mac OS X: in version 10.0 and later in Carbon.framework
  9250. * CarbonLib: not available
  9251. }
  9252. const
  9253. kEventControlHitTest = 3;
  9254. {
  9255. * kEventClassControl / kEventControlDraw
  9256. *
  9257. * Summary:
  9258. * Sent when your control should draw itself. The event can
  9259. * optionally contain a port in which to draw and a part to
  9260. * constrain drawing to.
  9261. *
  9262. * Mac OS X threading:
  9263. * Not thread safe
  9264. *
  9265. * Parameters:
  9266. *
  9267. * --> kEventParamDirectObject (in, typeControlRef)
  9268. * The control to be drawn.
  9269. *
  9270. * --> kEventParamControlPart (in, typeControlPartCode)
  9271. * The control part code to draw. This parameter is optional
  9272. * and may not be present in all instances of this event. Draw
  9273. * the entire control if the parameter is not present.
  9274. *
  9275. * --> kEventParamGrafPort (in, typeGrafPtr)
  9276. * The GrafPort into which to draw the control. This parameter
  9277. * is optional and may not be present in all instances of this
  9278. * event. Draw into the current port if the parameter is not
  9279. * present.
  9280. *
  9281. * --> kEventParamRgnHandle (in, typeQDRgnHandle)
  9282. * A region describing the area that needs to be redrawn; you
  9283. * may constrain your drawing to this region. This parameter
  9284. * is only provided on Mac OS X 10.2 and later, and only in
  9285. * certain situations in compositing mode (when the view is
  9286. * visible, etc). Draw the entire control if the parameter is
  9287. * not present.
  9288. *
  9289. * --> kEventParamShape (in, typeHIShapeRef)
  9290. * An HIShapeRef describing the area that needs to be redrawn;
  9291. * you may constrain your drawing to this area. This parameter
  9292. * is only provided on Mac OS X 10.4 and later, and only in
  9293. * certain situations in compositing mode (when the view is
  9294. * visible, etc). Draw the entire control if the parameter is
  9295. * not present.
  9296. *
  9297. * --> kEventParamCGContextRef (in, typeCGContextRef)
  9298. * The CGContext into which to draw the control. This
  9299. * parameter is only provided on Mac OS X 10.2 and later, and
  9300. * only when the owning window uses compositing mode. The
  9301. * context is already transformed and clipped appropriately
  9302. * for view-local drawing. If this parameter is present, you
  9303. * should always use it; this will be extremely important to
  9304. * allow printing of controls. If this parameter is not
  9305. * present (prior to Mac OS X 10.2, or in a non-compositing
  9306. * window), and you want to draw with CoreGraphics, you can
  9307. * create your own CGContext with QDBeginCGContext.
  9308. *
  9309. * Availability:
  9310. * Mac OS X: in version 10.0 and later in Carbon.framework
  9311. * CarbonLib: not available
  9312. }
  9313. const
  9314. kEventControlDraw = 4;
  9315. {
  9316. * kEventClassControl / kEventControlApplyBackground
  9317. *
  9318. * Summary:
  9319. * Sent when your control should apply its background color or
  9320. * pattern to the specified port so that subcontrols of this control
  9321. * can properly erase.
  9322. *
  9323. * Discussion:
  9324. * This event is used for non-composited control drawing. When an
  9325. * embedded control in a non-composited window draws, it first
  9326. * erases its bounding rect. Before calling EraseRect or EraseRgn,
  9327. * the control calls SetUpControlBackground, which sends this event
  9328. * to parent controls of the embedded control that have the
  9329. * kControlHasSpecialBackground feature flag. An embedding control
  9330. * may respond to this event by setting the background color or
  9331. * pattern of the specified GrafPort; this color or pattern will
  9332. * then be used by the embedded control when it erases its
  9333. * bounds.
  9334. *
  9335. * Note that an embedding control should not actually draw its
  9336. * background in response to this event; doing so would not have any
  9337. * effect, because the embedded control will erase any drawing
  9338. * shortly anyways.
  9339. *
  9340. * Mac OS X threading:
  9341. * Not thread safe
  9342. *
  9343. * Parameters:
  9344. *
  9345. * --> kEventParamDirectObject (in, typeControlRef)
  9346. * The control which should apply a background color or
  9347. * pattern.
  9348. *
  9349. * --> kEventParamControlSubControl (in, typeControlRef)
  9350. * The subcontrol that is about to draw.
  9351. *
  9352. * --> kEventParamControlDrawDepth (in, typeShortInteger)
  9353. * The bit depth of the GDevice on which the subcontrol will
  9354. * be drawn.
  9355. *
  9356. * --> kEventParamControlDrawInColor (in, typeBoolean)
  9357. * Whether the GDevice on which the subcontrol will be drawn
  9358. * is in color or black & white.
  9359. *
  9360. * --> kEventParamGrafPort (in, typeGrafPtr)
  9361. * The port to which the background color or pattern should be
  9362. * applied. This parameter is optional and may not be present
  9363. * in all instances of this event. Apply the background to the
  9364. * current port if this parameter is not present.
  9365. *
  9366. * Availability:
  9367. * Mac OS X: in version 10.0 and later in Carbon.framework
  9368. * CarbonLib: not available
  9369. }
  9370. const
  9371. kEventControlApplyBackground = 5;
  9372. {
  9373. * kEventClassControl / kEventControlApplyTextColor
  9374. *
  9375. * Summary:
  9376. * Sent when your control should apply a color or pattern to the
  9377. * specified port and context so a subcontrol can draw text which
  9378. * looks appropriate for your controlÕs background.
  9379. *
  9380. * Mac OS X threading:
  9381. * Not thread safe
  9382. *
  9383. * Parameters:
  9384. *
  9385. * --> kEventParamDirectObject (in, typeControlRef)
  9386. * The control which should apply a text color.
  9387. *
  9388. * --> kEventParamControlSubControl (in, typeControlRef)
  9389. * The subcontrol that is about to draw.
  9390. *
  9391. * --> kEventParamControlDrawDepth (in, typeShortInteger)
  9392. * The bit depth of the GDevice on which the subcontrol will
  9393. * be drawn.
  9394. *
  9395. * --> kEventParamControlDrawInColor (in, typeBoolean)
  9396. * Whether the GDevice on which the subcontrol will be drawn
  9397. * is in color or black & white.
  9398. *
  9399. * --> kEventParamCGContextRef (in, typeCGContextRef)
  9400. * The CGContext to which the text color should be applied.
  9401. * This parameter is optional and may not be present in all
  9402. * instances of this event.
  9403. *
  9404. * --> kEventParamGrafPort (in, typeGrafPtr)
  9405. * The GrafPort to which the text color should be applied.
  9406. * This parameter is optional and may not be present in all
  9407. * instances of this event. Apply to the current port if this
  9408. * parameter is not present.
  9409. *
  9410. * Availability:
  9411. * Mac OS X: in version 10.0 and later in Carbon.framework
  9412. * CarbonLib: not available
  9413. }
  9414. const
  9415. kEventControlApplyTextColor = 6;
  9416. {
  9417. * kEventClassControl / kEventControlGetNextFocusCandidate
  9418. *
  9419. * Summary:
  9420. * Sent so that a given control can customize the focus order of its
  9421. * subcontrols.
  9422. *
  9423. * Discussion:
  9424. * The recipient will receive a start subcontrol in the
  9425. * kEventParamStartControl parameter and a focusing direction in the
  9426. * kEventParamControlPart parameter. You must only pass back
  9427. * subcontrols of yourself (or NULL) when receiving this event; if
  9428. * you do otherwise, the Control ManagerÕs behavior is undefined.
  9429. *
  9430. * Mac OS X threading:
  9431. * Not thread safe
  9432. *
  9433. * Parameters:
  9434. *
  9435. * --> kEventParamDirectObject (in, typeControlRef)
  9436. * The control which should customize the focus order.
  9437. *
  9438. * --> kEventParamControlPart (in, typeControlPartCode)
  9439. * A focusing meta-part code, either kControlFocusNextPart or
  9440. * kControlFocusPrevPart.
  9441. *
  9442. * --> kEventParamStartControl (in, typeControlRef)
  9443. * On exit, should contain the next or previous subcontrol; if
  9444. * there is no next subcontrol in the given focusing
  9445. * direction, the recipient must either exclude the
  9446. * kEventParamNextControl parameter or set it to NULL
  9447. *
  9448. * <-- kEventParamNextControl (out, typeControlRef)
  9449. * The starting point from which to search for the next or
  9450. * previous control. This parameter is optional and may not be
  9451. * present in all instances of this event. Find the first
  9452. * subcontrol in the appropriate focusing direction if this
  9453. * parameter is not present or if it contains NULL.
  9454. *
  9455. * Availability:
  9456. * Mac OS X: in version 10.2 and later in Carbon.framework
  9457. * CarbonLib: not available
  9458. }
  9459. const
  9460. kEventControlGetNextFocusCandidate = 14;
  9461. {
  9462. * kEventClassControl / kEventControlGetAutoToggleValue
  9463. *
  9464. * Summary:
  9465. * This event is sent when the Control Manager is about to
  9466. * autotoggle a control. You can specify the toggled value to use
  9467. * based on the current value of your control.
  9468. *
  9469. * Discussion:
  9470. * The Control Manager provides default behavior for this event. If
  9471. * the event is not handled by a control, the default handler
  9472. * automatically provides this mapping: if the controlÕs value is 1,
  9473. * the toggled value is 0. If the controlÕs value is any other
  9474. * value, the toggled value is 1.
  9475. *
  9476. * Mac OS X threading:
  9477. * Not thread safe
  9478. *
  9479. * Parameters:
  9480. *
  9481. * --> kEventParamDirectObject (in, typeControlRef)
  9482. * The control that is being toggled.
  9483. *
  9484. * --> kEventParamControlPart (in, typeControlPartCode)
  9485. * The control part that is being toggled.
  9486. *
  9487. * <-- kEventParamControlValue (out, typeLongInteger)
  9488. * On exit, contains the new control value.
  9489. *
  9490. * Availability:
  9491. * Mac OS X: in version 10.2 and later in Carbon.framework
  9492. * CarbonLib: not available
  9493. }
  9494. const
  9495. kEventControlGetAutoToggleValue = 15;
  9496. {
  9497. * kEventClassControl / kEventControlInterceptSubviewClick
  9498. *
  9499. * Summary:
  9500. * This is sent when the HIViewGetViewForMouseEvent API is called,
  9501. * to allow embedding controls to intercept clicks in the their
  9502. * embedded controls.
  9503. *
  9504. * Discussion:
  9505. * The Control Manager sends this event before descending into any
  9506. * subviews. Controls can override this to intercept clicks which
  9507. * would normally be destined for their children. For example, the
  9508. * HIToolbar control intercepts cmd-clicks to handle dragging its
  9509. * children. To accomplish this, it overrides this event, looking
  9510. * for the command key modifier. When the command key is pressed,
  9511. * the view just returns noErr as the result from its event handler.
  9512. * This tells the Control Manager to stop descending and return the
  9513. * view that it called as the mouse event destination.
  9514. *
  9515. * Mac OS X threading:
  9516. * Not thread safe
  9517. *
  9518. * Parameters:
  9519. *
  9520. * --> kEventParamDirectObject (in, typeControlRef)
  9521. * The mouse-down event to intercept.
  9522. *
  9523. * Result:
  9524. * An operating system result code. Return noErr to indicate that
  9525. * this view intercepted the click, or eventNotHandledErr to allow
  9526. * subviews of this view to take the click.
  9527. *
  9528. * Availability:
  9529. * Mac OS X: in version 10.2 and later in Carbon.framework
  9530. * CarbonLib: not available
  9531. }
  9532. const
  9533. kEventControlInterceptSubviewClick = 16;
  9534. {
  9535. * kEventClassControl / kEventControlGetClickActivation
  9536. *
  9537. * Summary:
  9538. * Sent when a click occurs in a window. Allows the control to
  9539. * determine whether the window should be activated and whether the
  9540. * click should be handled.
  9541. *
  9542. * Discussion:
  9543. * This is very much like the window class version of this event.
  9544. * The difference is that the mouse location is view- or
  9545. * port-relative. This event is actually a copy of the mouse down
  9546. * event, and so it has all the parameters that such an event would
  9547. * have (modifiers, button number, etc.).
  9548. *
  9549. * When handling a click, this event is sent first, and is sent only
  9550. * to the control that was clicked; it is not propagated to the
  9551. * embedder of the clicked control. If the event is not handled,
  9552. * then a kEventWindowGetClickActivation event is sent to the window
  9553. * that was clicked.
  9554. *
  9555. * Mac OS X threading:
  9556. * Not thread safe
  9557. *
  9558. * Parameters:
  9559. *
  9560. * --> kEventParamDirectObject (in, typeControlRef)
  9561. * The control that was clicked.
  9562. *
  9563. * <-- kEventParamClickActivation (out, typeClickActivationResult)
  9564. * On exit, indicates how the click should be handled. Should
  9565. * be set a ClickActivationResult constant from Controls.h.
  9566. *
  9567. * --> kEventParamMouseLocation (in, typeHIPoint)
  9568. * The mouse location, in view-local coordinates if the
  9569. * controlÕs owning window is composited, or port-local
  9570. * coordinates if not.
  9571. *
  9572. * --> kEventParamWindowRef (in, typeWindowRef)
  9573. * The window under the mouse.
  9574. *
  9575. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  9576. * The window-relative position of the mouse in the window
  9577. * given in the kEventParamWindowRef parameter. 0,0 is at the
  9578. * top left of the structure of the window.
  9579. *
  9580. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  9581. * The part code that the mouse location hit in the window.
  9582. * This parameter only exists if the WindowRef parameter
  9583. * exists. This saves you the trouble of calling FindWindow,
  9584. * which is expensive on Mac OS X as it needs to call the
  9585. * Window Server. Available in Mac OS X 10.3 and later.
  9586. *
  9587. * --> kEventParamKeyModifiers (in, typeUInt32)
  9588. * The keyboard modifiers that were pressed when the event was
  9589. * generated.
  9590. *
  9591. * --> kEventParamMouseButton (in, typeMouseButton)
  9592. * Which mouse button was pressed.
  9593. *
  9594. * --> kEventParamClickCount (in, typeUInt32)
  9595. * Whether this is a single click, double click, etc.
  9596. *
  9597. * --> kEventParamMouseChord (in, typeUInt32)
  9598. * Which other mouse buttons were pressed when the event was
  9599. * generated. Available on Mac OS X only.
  9600. *
  9601. * --> kEventParamTabletEventType (in, typeUInt32)
  9602. * The type of tablet event which generated this mouse event;
  9603. * contains either kEventTabletPoint or kEventTabletProximity.
  9604. * Only present if the event was generated from a tablet.
  9605. *
  9606. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  9607. * Further information about the tablet event which generated
  9608. * this mouse event. Present if the the
  9609. * kEventParamTabletEventType parameter contains
  9610. * kEventTabletPoint.
  9611. *
  9612. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  9613. * Further information about the tablet event which generated
  9614. * this mouse event. Present if the the
  9615. * kEventParamTabletEventType parameter contains
  9616. * kEventTabletProximity.
  9617. *
  9618. * Availability:
  9619. * Mac OS X: in version 10.2 and later in Carbon.framework
  9620. * CarbonLib: not available
  9621. }
  9622. const
  9623. kEventControlGetClickActivation = 17;
  9624. {
  9625. * kEventClassControl / kEventControlDragEnter
  9626. *
  9627. * Summary:
  9628. * A drag has entered your control.
  9629. *
  9630. * Discussion:
  9631. * If you at all wish to handle the drag, you must return true in
  9632. * the kEventParamControlWouldAcceptDrop parameter from your event
  9633. * handler in response to this event. If you return
  9634. * eventNotHandledErr, do not supply a
  9635. * kEventParamControlWouldAcceptDrop parameter, or set its value to
  9636. * false, you will not receive 'within' or 'leave' messages, nor
  9637. * will you be eligible to receive the drop. This is done to try to
  9638. * be as efficient as possible when sending events during the drag
  9639. * operation.
  9640. *
  9641. * Mac OS X threading:
  9642. * Not thread safe
  9643. *
  9644. * Parameters:
  9645. *
  9646. * --> kEventParamDirectObject (in, typeControlRef)
  9647. * The control that is the drag target.
  9648. *
  9649. * --> kEventParamDragRef (in, typeDragRef)
  9650. * The DragRef for the drag.
  9651. *
  9652. * <-- kEventParamControlWouldAcceptDrop (out, typeBoolean)
  9653. * The control would accept the drop. Return true in this
  9654. * parameter if your view wants to track and possibly receive
  9655. * this drag.
  9656. *
  9657. * Availability:
  9658. * Mac OS X: in version 10.2 and later in Carbon.framework
  9659. * CarbonLib: not available
  9660. }
  9661. const
  9662. kEventControlDragEnter = 18;
  9663. {
  9664. * kEventClassControl / kEventControlDragWithin
  9665. *
  9666. * Summary:
  9667. * A drag has moved with your airspace (but not on any subcontrol).
  9668. *
  9669. * Discussion:
  9670. * Your control will typically respond to this event by drawing its
  9671. * drag highlight. If the user moves into a subcontrol, it becomes
  9672. * the target of the drag and your control will not receive 'within'
  9673. * messages any longer.
  9674. *
  9675. * Mac OS X threading:
  9676. * Not thread safe
  9677. *
  9678. * Parameters:
  9679. *
  9680. * --> kEventParamDirectObject (in, typeControlRef)
  9681. * The control that is the drag target.
  9682. *
  9683. * --> kEventParamDragRef (in, typeDragRef)
  9684. * The DragRef for the drag.
  9685. *
  9686. * Availability:
  9687. * Mac OS X: in version 10.2 and later in Carbon.framework
  9688. * CarbonLib: not available
  9689. }
  9690. const
  9691. kEventControlDragWithin = 19;
  9692. {
  9693. * kEventClassControl / kEventControlDragLeave
  9694. *
  9695. * Summary:
  9696. * A drag is leaving your view.
  9697. *
  9698. * Discussion:
  9699. * Your control will typically respond to this event by removing its
  9700. * drag highlight.
  9701. *
  9702. * Mac OS X threading:
  9703. * Not thread safe
  9704. *
  9705. * Parameters:
  9706. *
  9707. * --> kEventParamDirectObject (in, typeControlRef)
  9708. * The control that is the drag target.
  9709. *
  9710. * --> kEventParamDragRef (in, typeDragRef)
  9711. * The DragRef for the drag.
  9712. *
  9713. * Availability:
  9714. * Mac OS X: in version 10.2 and later in Carbon.framework
  9715. * CarbonLib: not available
  9716. }
  9717. const
  9718. kEventControlDragLeave = 20;
  9719. {
  9720. * kEventClassControl / kEventControlDragReceive
  9721. *
  9722. * Summary:
  9723. * Congratulations, you are the lucky recipient of a drag. Enjoy it.
  9724. *
  9725. * Mac OS X threading:
  9726. * Not thread safe
  9727. *
  9728. * Parameters:
  9729. *
  9730. * --> kEventParamDirectObject (in, typeControlRef)
  9731. * The control that is the drag target.
  9732. *
  9733. * --> kEventParamDragRef (in, typeDragRef)
  9734. * The DragRef for the drag.
  9735. *
  9736. * Availability:
  9737. * Mac OS X: in version 10.2 and later in Carbon.framework
  9738. * CarbonLib: not available
  9739. }
  9740. const
  9741. kEventControlDragReceive = 21;
  9742. {
  9743. * kEventClassControl / kEventControlSetFocusPart
  9744. *
  9745. * Summary:
  9746. * Sent when your control is gaining, losing, or changing the focus.
  9747. *
  9748. * Mac OS X threading:
  9749. * Not thread safe
  9750. *
  9751. * Parameters:
  9752. *
  9753. * --> kEventParamDirectObject (in, typeControlRef)
  9754. * The control that is gaining, losing, or changing focus.
  9755. *
  9756. * --> kEventParamControlFocusEverything (in, typeBoolean)
  9757. * Indicates whether to allowing focusing on a part that
  9758. * doesnÕt accept general keyboard input, such as a push
  9759. * button, or if only traditionally focusable parts such as
  9760. * edit fields and list boxes should be allowed to gain focus.
  9761. * This parameter is optional and may not be present in all
  9762. * instances of this event. Restrict focus to traditionally
  9763. * focusable parts if this parameter is not present.
  9764. *
  9765. * <-> kEventParamControlPart (in/out, typeControlPartCode)
  9766. * On entry, a part code that may be either an actual control
  9767. * part or a control focus meta-part. This parameter may be
  9768. * one of kControlFocusNoPart (if the control is losing
  9769. * focus), kControlFocusNextPart (if the next part in the
  9770. * control should be focused), kControlFocusPrevPart (if the
  9771. * previous part in the control should be focused), or an
  9772. * actual control part (if that specific part should be
  9773. * focused). On exit, your event handler should store the
  9774. * actual part code that was focused into this parameter. Your
  9775. * control must always allow the focus to be removed (when
  9776. * this parameter is kControlFocusNoPart on entry).
  9777. *
  9778. * Availability:
  9779. * Mac OS X: in version 10.0 and later in Carbon.framework
  9780. * CarbonLib: not available
  9781. }
  9782. const
  9783. kEventControlSetFocusPart = 7;
  9784. {
  9785. * kEventClassControl / kEventControlGetFocusPart
  9786. *
  9787. * Summary:
  9788. * Sent when your the Control Manager wants to know what part of
  9789. * your control is currently focused. Set the kEventParamControlPart
  9790. * param to your currently focused part.
  9791. *
  9792. * Discussion:
  9793. * The Control Manager provides default behavior for this event. If
  9794. * the event is not handled by a control, the default handler
  9795. * returns the part of the control that was most recently focused.
  9796. *
  9797. * Mac OS X threading:
  9798. * Not thread safe
  9799. *
  9800. * Parameters:
  9801. *
  9802. * --> kEventParamDirectObject (in, typeControlRef)
  9803. * The control for which to get the current focus.
  9804. *
  9805. * <-- kEventParamControlPart (out, typeControlPartCode)
  9806. * On exit, contains the current focus for this control.
  9807. *
  9808. * Availability:
  9809. * Mac OS X: in version 10.0 and later in Carbon.framework
  9810. * CarbonLib: not available
  9811. }
  9812. const
  9813. kEventControlGetFocusPart = 8;
  9814. {
  9815. * kEventClassControl / kEventControlActivate
  9816. *
  9817. * Summary:
  9818. * Sent when your control becomes active as a result of a call to
  9819. * ActivateControl.
  9820. *
  9821. * Mac OS X threading:
  9822. * Not thread safe
  9823. *
  9824. * Parameters:
  9825. *
  9826. * --> kEventParamDirectObject (in, typeControlRef)
  9827. * The control that was activated.
  9828. *
  9829. * Availability:
  9830. * Mac OS X: in version 10.0 and later in Carbon.framework
  9831. * CarbonLib: not available
  9832. }
  9833. const
  9834. kEventControlActivate = 9;
  9835. {
  9836. * kEventClassControl / kEventControlDeactivate
  9837. *
  9838. * Summary:
  9839. * Sent when your control becomes inactive as a result of a call to
  9840. * DeactivateControl.
  9841. *
  9842. * Mac OS X threading:
  9843. * Not thread safe
  9844. *
  9845. * Parameters:
  9846. *
  9847. * --> kEventParamDirectObject (in, typeControlRef)
  9848. * The control that was deactivated.
  9849. *
  9850. * Availability:
  9851. * Mac OS X: in version 10.0 and later in Carbon.framework
  9852. * CarbonLib: not available
  9853. }
  9854. const
  9855. kEventControlDeactivate = 10;
  9856. {
  9857. * kEventClassControl / kEventControlSetCursor
  9858. *
  9859. * Summary:
  9860. * Sent when your control is asked to change the cursor as a result
  9861. * of a call to HandleControlSetCursor.
  9862. *
  9863. * Discussion:
  9864. * Note that the standard window event handler does not call
  9865. * HandleControlSetCursor, and therefore, your control will not
  9866. * ordinarily receive this event. Your host application must call
  9867. * HandleControlSetCursor itself in order for your control to
  9868. * receive this event. On Mac OS X 10.2 and later, we recommend
  9869. * using mouse tracking regions in your control to be notified when
  9870. * to change the cursor, rather than using this event.
  9871. *
  9872. * Mac OS X threading:
  9873. * Not thread safe
  9874. *
  9875. * Parameters:
  9876. *
  9877. * --> kEventParamDirectObject (in, typeControlRef)
  9878. * The control that should set the cursor.
  9879. *
  9880. * --> kEventParamMouseLocation (in, typeQDPoint)
  9881. * The mouse location, in view-local coordinates if the
  9882. * controlÕs owning window is composited, or port-local
  9883. * coordinates if not.
  9884. *
  9885. * --> kEventParamKeyModifiers (in, typeUInt32)
  9886. * The current keyboard modifiers.
  9887. *
  9888. * Availability:
  9889. * Mac OS X: in version 10.0 and later in Carbon.framework
  9890. * CarbonLib: not available
  9891. }
  9892. const
  9893. kEventControlSetCursor = 11;
  9894. {
  9895. * kEventClassControl / kEventControlContextualMenuClick
  9896. *
  9897. * Summary:
  9898. * Sent when your control is asked to display a contextual menu as a
  9899. * result of a call to HandleControlContextualMenuClick.
  9900. *
  9901. * Mac OS X threading:
  9902. * Not thread safe
  9903. *
  9904. * Parameters:
  9905. *
  9906. * --> kEventParamDirectObject (in, typeControlRef)
  9907. * The control that was clicked.
  9908. *
  9909. * --> kEventParamMouseLocation (in, typeQDPoint)
  9910. * The mouse location, in view-local coordinates if the
  9911. * controlÕs owning window is composited, or port-local
  9912. * coordinates if not. In Mac OS X 10.2 and earlier, however,
  9913. * this parameter was incorrectly in global coordinates.
  9914. *
  9915. * --> kEventParamWindowRef (in, typeWindowRef)
  9916. * The window under the mouse. Available in Mac OS X 10.3 and
  9917. * later.
  9918. *
  9919. * --> kEventParamWindowMouseLocation (in, typeHIPoint)
  9920. * The window-relative position of the mouse in the window
  9921. * given in the kEventParamWindowRef parameter. 0,0 is at the
  9922. * top left of the structure of the window. Available in Mac
  9923. * OS X 10.3 and later.
  9924. *
  9925. * --> kEventParamWindowPartCode (in, typeWindowPartCode)
  9926. * The part code that the mouse location hit in the window.
  9927. * This parameter only exists if the WindowRef parameter
  9928. * exists. This saves you the trouble of calling FindWindow,
  9929. * which is expensive on Mac OS X as it needs to call the
  9930. * Window Server. Available in Mac OS X 10.3 and later.
  9931. *
  9932. * --> kEventParamKeyModifiers (in, typeUInt32)
  9933. * The keyboard modifiers that were pressed when the event was
  9934. * generated. Available in Mac OS X 10.3 and later.
  9935. *
  9936. * --> kEventParamMouseButton (in, typeMouseButton)
  9937. * Which mouse button was pressed. Available in Mac OS X 10.3
  9938. * and later.
  9939. *
  9940. * --> kEventParamClickCount (in, typeUInt32)
  9941. * Whether this is a single click, double click, etc.
  9942. * Available in Mac OS X 10.3 and later.
  9943. *
  9944. * --> kEventParamMouseChord (in, typeUInt32)
  9945. * Which other mouse buttons were pressed when the event was
  9946. * generated. Available in Mac OS X 10.3 and later.
  9947. *
  9948. * --> kEventParamTabletEventType (in, typeUInt32)
  9949. * The type of tablet event which generated this mouse event;
  9950. * contains either kEventTabletPoint or kEventTabletProximity.
  9951. * Only present if the event was generated from a tablet.
  9952. * Available in Mac OS X 10.3 and later.
  9953. *
  9954. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  9955. * Further information about the tablet event which generated
  9956. * this mouse event. Present if the the
  9957. * kEventParamTabletEventType parameter contains
  9958. * kEventTabletPoint. Available in Mac OS X 10.3 and later.
  9959. *
  9960. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  9961. * Further information about the tablet event which generated
  9962. * this mouse event. Present if the the
  9963. * kEventParamTabletEventType parameter contains
  9964. * kEventTabletProximity. Available in Mac OS X 10.3 and later.
  9965. *
  9966. * Availability:
  9967. * Mac OS X: in version 10.0 and later in Carbon.framework
  9968. * CarbonLib: not available
  9969. }
  9970. const
  9971. kEventControlContextualMenuClick = 12;
  9972. {
  9973. * kEventClassControl / kEventControlTrack
  9974. *
  9975. * Summary:
  9976. * Sent to allow a control definition to track the mouse in response
  9977. * to a call to HIViewClick, HandleControlClick, etc.
  9978. *
  9979. * Discussion:
  9980. * In fact, this event is actually sent from within HIViewClick and
  9981. * HandleControlClick. The default handling of this event is the
  9982. * Control ManagerÕs normal tracking logic; this is good enough for
  9983. * simple controls (such as push buttons) and controls with simple
  9984. * indicators (such as scroll bars and sliders). You should only
  9985. * need to handle or override this event if you are trying to do
  9986. * more complex tracking, such as displaying a menu in the middle of
  9987. * tracking.
  9988. *
  9989. * Mac OS X threading:
  9990. * Not thread safe
  9991. *
  9992. * Parameters:
  9993. *
  9994. * --> kEventParamDirectObject (in, typeControlRef)
  9995. * The control to track.
  9996. *
  9997. * --> kEventParamMouseLocation (in, typeQDPoint)
  9998. * The mouse location, in view-local coordinates if the
  9999. * controlÕs owning window is composited, or port-local
  10000. * coordinates if not.
  10001. *
  10002. * <-> kEventParamKeyModifiers (in/out, typeUInt32)
  10003. * The current keyboard modifiers. On exit, the event handler
  10004. * may update this parameter with the modifiers that were
  10005. * pressed when tracking ended; these modifiers will be
  10006. * included in the kEventCommandProcess event that is sent by
  10007. * the Control Manager.
  10008. *
  10009. * --> kEventParamControlAction (in, typeControlActionUPP)
  10010. * The control action proc that should be called by the
  10011. * control during tracking.
  10012. *
  10013. * <-- kEventParamControlPart (out, typeControlPartCode)
  10014. * On exit, contains the part code of the control part that
  10015. * was selected when tracking ended, or kControlNoPart if no
  10016. * part was selected. If the part code is non-zero, the
  10017. * Control Manager will automatically send kEventControlHit
  10018. * and kEventCommandProcess events.
  10019. *
  10020. * Availability:
  10021. * Mac OS X: in version 10.0 and later in Carbon.framework
  10022. * CarbonLib: not available
  10023. }
  10024. const
  10025. kEventControlTrack = 51;
  10026. {
  10027. * kEventClassControl / kEventControlGetScrollToHereStartPoint
  10028. *
  10029. * Summary:
  10030. * Sent so your control can support Scroll To Here behavior during
  10031. * tracking.
  10032. *
  10033. * Mac OS X threading:
  10034. * Not thread safe
  10035. *
  10036. * Parameters:
  10037. *
  10038. * --> kEventParamDirectObject (in, typeControlRef)
  10039. * The control for which to retrieve the Scroll To Here point.
  10040. *
  10041. * <-> kEventParamMouseLocation (in/out, typeQDPoint)
  10042. * On entry, a point in view-local coordinates if the
  10043. * controlÕs owning window is composited, or port-local
  10044. * coordinates if not, which provides the location at which
  10045. * the user clicked to request Scroll To Here behavior. On
  10046. * exit, this parameter should contain the mouse location in
  10047. * view-local or port-local coordinates where a click would
  10048. * have needed to be to cause your indicator to be dragged to
  10049. * the incoming mouse location.
  10050. *
  10051. * --> kEventParamKeyModifiers (in, typeUInt32)
  10052. * The current keyboard modifiers.
  10053. *
  10054. * Availability:
  10055. * Mac OS X: in version 10.0 and later in Carbon.framework
  10056. * CarbonLib: not available
  10057. }
  10058. const
  10059. kEventControlGetScrollToHereStartPoint = 52;
  10060. {
  10061. * kEventClassControl / kEventControlGetIndicatorDragConstraint
  10062. *
  10063. * Summary:
  10064. * Sent so your control can constrain the movement of its indicator
  10065. * during tracking.
  10066. *
  10067. * Mac OS X threading:
  10068. * Not thread safe
  10069. *
  10070. * Parameters:
  10071. *
  10072. * --> kEventParamDirectObject (in, typeControlRef)
  10073. * The control that is being tracked.
  10074. *
  10075. * --> kEventParamMouseLocation (in, typeQDPoint)
  10076. * The mouse location, in view-local coordinates if the
  10077. * controlÕs owning window is composited, or port-local
  10078. * coordinates if not.
  10079. *
  10080. * --> kEventParamKeyModifiers (in, typeUInt32)
  10081. * The current keyboard modifiers.
  10082. *
  10083. * <-- kEventParamControlIndicatorDragConstraint (out, typeIndicatorDragConstraint)
  10084. * On exit, contains an IndicatorDragConstraint structure.
  10085. *
  10086. * Availability:
  10087. * Mac OS X: in version 10.0 and later in Carbon.framework
  10088. * CarbonLib: not available
  10089. }
  10090. const
  10091. kEventControlGetIndicatorDragConstraint = 53;
  10092. {
  10093. * kEventClassControl / kEventControlIndicatorMoved
  10094. *
  10095. * Summary:
  10096. * Sent during live-tracking of the indicator so your control can
  10097. * update its value based on the new indicator position. During
  10098. * non-live tracking, this event lets you redraw the indicator ghost
  10099. * at the appropriate place.
  10100. *
  10101. * Mac OS X threading:
  10102. * Not thread safe
  10103. *
  10104. * Parameters:
  10105. *
  10106. * --> kEventParamDirectObject (in, typeControlRef)
  10107. * The control that is being tracked.
  10108. *
  10109. * --> kEventParamDirectObject (in, typeControlRef)
  10110. * The new indicator region.
  10111. *
  10112. * --> kEventParamControlIndicatorRegion (in, typeQDRgnHandle)
  10113. * Indicates whether the control is using non-live-tracking
  10114. * (true) or live tracking (false).
  10115. *
  10116. * Availability:
  10117. * Mac OS X: in version 10.0 and later in Carbon.framework
  10118. * CarbonLib: not available
  10119. }
  10120. const
  10121. kEventControlIndicatorMoved = 54;
  10122. {
  10123. * kEventClassControl / kEventControlGhostingFinished
  10124. *
  10125. * Summary:
  10126. * Sent at the end of non-live indicator tracking so your control
  10127. * can update its value based on the final ghost location.
  10128. *
  10129. * Mac OS X threading:
  10130. * Not thread safe
  10131. *
  10132. * Parameters:
  10133. *
  10134. * --> kEventParamDirectObject (in, typeControlRef)
  10135. * The control that was being tracked.
  10136. *
  10137. * --> kEventParamControlIndicatorOffset (in, typeQDPoint)
  10138. * The final offset of the indicator.
  10139. *
  10140. * Availability:
  10141. * Mac OS X: in version 10.0 and later in Carbon.framework
  10142. * CarbonLib: not available
  10143. }
  10144. const
  10145. kEventControlGhostingFinished = 55;
  10146. {
  10147. * kEventClassControl / kEventControlGetActionProcPart
  10148. *
  10149. * Summary:
  10150. * Sent during tracking so your control can alter the part that is
  10151. * passed to its action proc based on modifier keys, etc.
  10152. *
  10153. * Mac OS X threading:
  10154. * Not thread safe
  10155. *
  10156. * Parameters:
  10157. *
  10158. * --> kEventParamDirectObject (in, typeControlRef)
  10159. * The control being tracked.
  10160. *
  10161. * --> kEventParamKeyModifiers (in, typeUInt32)
  10162. * The current keyboard modifiers.
  10163. *
  10164. * <-> kEventParamControlPart (in/out, typeControlPartCode)
  10165. * On entry, the proposed control part that will be sent to
  10166. * the action proc. Your handler may modify this parameter
  10167. * based on its own criteria (which modifier keys are pressed,
  10168. * for example).
  10169. *
  10170. * <-- kEventParamControlPartAutoRepeats (out, typeBoolean)
  10171. * On output, a flag to the standard control tracking loop in
  10172. * the Control Manager indicating whether to autorepeat when
  10173. * the user presses and holds on certain parts of your custom
  10174. * control. The autorepeat timing curve is the same as that
  10175. * used for the buttons/page areas of scroll bars. This
  10176. * parameter is observed by the Control Manager in Mac OS X
  10177. * 10.2 and later.
  10178. *
  10179. * Availability:
  10180. * Mac OS X: in version 10.0 and later in Carbon.framework
  10181. * CarbonLib: not available
  10182. }
  10183. const
  10184. kEventControlGetActionProcPart = 56;
  10185. {
  10186. * kEventClassControl / kEventControlGetPartRegion
  10187. *
  10188. * Summary:
  10189. * Sent by the GetControlRegion, HIViewCopyPartShape, and similar
  10190. * APIs when a client wants to get a particular region or shape of
  10191. * your control.
  10192. *
  10193. * Discussion:
  10194. * This event is sent to your handler in order to fetch both regions
  10195. * and shapes from your view. Shapes will only be requested on Mac
  10196. * OS X 10.4 and later. There are two strategies for handling this
  10197. * event: the non-shape savvy way and the shape savvy way. The shape
  10198. * savvy way avoids costly conversions between regions and shapes
  10199. * which can slow your view's performance.
  10200. *
  10201. * Non-shape savvy way: Get the region out of the
  10202. * kEventParamControlRegion parameter and modify it appropriately to
  10203. * reflect the desired part. Before the advent of shapes, this was
  10204. * the only method for handling this event. If you always handle the
  10205. * event this way on Mac OS X 10.4 and later, you may force the
  10206. * Control Manager to convert the region to a shape, which adversely
  10207. * affects performance.
  10208. *
  10209. * Shape savvy way: Get the value of the
  10210. * kEventParamControlPrefersShape parameter. If the parameter
  10211. * doesn't exist or if its value is false, handle this event in the
  10212. * non-shape savvy way as described above. If the parameter exists
  10213. * and has a value of true, allocate an immutable shape that
  10214. * represents the given part of your view and use SetEventParameter
  10215. * to add the shape to the event in the kEventParamShape parameter.
  10216. * You may now release the shape, since it was retained by
  10217. * SetEventParameter. If for some reason you are unwilling or unable
  10218. * to provide a shape for the given part, you may still fall back to
  10219. * the non-shape savvy method.
  10220. *
  10221. * NOTE: If your handler attempts to pre- or post-process some other
  10222. * handler's processing of this event by calling
  10223. * CallNextEventHandler, you MUST NOT rely on the value of the
  10224. * kEventParamControlPrefersShape parameter being preserved across
  10225. * the call to CallNextEventHandler. This event may dynamically
  10226. * modify itself depending on how any given handler acts upon it.
  10227. *
  10228. * Mac OS X threading:
  10229. * Not thread safe
  10230. *
  10231. * Parameters:
  10232. *
  10233. * --> kEventParamDirectObject (in, typeControlRef)
  10234. * The control whose region/shape to return.
  10235. *
  10236. * --> kEventParamControlPart (in, typeControlPartCode)
  10237. * The control part code whose region/shape to return.
  10238. *
  10239. * --> kEventParamControlPrefersShape (in, typeBoolean)
  10240. * A Boolean indicating whether your view may respond to this
  10241. * event by adding a kEventParamShape parameter to it instead
  10242. * of modifying the region in the kEventParamControlRegion
  10243. * parameter. If the parameter is false, you must respond to
  10244. * the event by modifying the region in the
  10245. * kEventParamControlRegion parameter; you may not add a
  10246. * kEventParamShape parameter. If the parameter is true, you
  10247. * may Ñ but are not required to Ñ respond to the event by
  10248. * adding the kEventParamShape parameter; if you choose not
  10249. * to, you must respond to the event by modifying the region
  10250. * in the kEventParamControlRegion parameter. This parameter
  10251. * will only be present on Mac OS X 10.4 and later. In fact,
  10252. * even on Mac OS X 10.4 it is an optional parameter and will
  10253. * not always be present. If this parameter is not present,
  10254. * you should act as though its value were false.
  10255. *
  10256. * --> kEventParamControlRegion (in, typeQDRgnHandle)
  10257. * A pre-allocated RgnHandle. Unless your handler is allowed
  10258. * to and chooses to add a kEventParamShape parameter (see the
  10259. * discussion of kEventParamControlPrefersShape above), your
  10260. * handler should get the RgnHandle from the event and set the
  10261. * region contents appropriately. If your handler adds a
  10262. * kEventParamShape parameter to the event, it must neither
  10263. * get nor modify this parameter.
  10264. *
  10265. * <-- kEventParamShape (out, typeHIShapeRef)
  10266. * If your handler is allowed to and chooses to provide a
  10267. * shape (see the discussion of kEventParamControlPrefersShape
  10268. * above), your handler should create a new, immutable shape
  10269. * and return it in this parameter. After you call
  10270. * SetEventParameter, you may release the shape, as it will be
  10271. * retained by SetEventParameter and released when the event
  10272. * is destroyed. If your handler gets or modifies the
  10273. * kEventParamControlRegion parameter, it must not set this
  10274. * parameter.
  10275. *
  10276. * Availability:
  10277. * Mac OS X: in version 10.0 and later in Carbon.framework
  10278. * CarbonLib: not available
  10279. }
  10280. const
  10281. kEventControlGetPartRegion = 101;
  10282. {
  10283. * kEventClassControl / kEventControlGetPartBounds
  10284. *
  10285. * Summary:
  10286. * Sent when a client wants to get a particular rectangle of your
  10287. * control when it may be more efficient than asking for a region.
  10288. *
  10289. * Mac OS X threading:
  10290. * Not thread safe
  10291. *
  10292. * Parameters:
  10293. *
  10294. * --> kEventParamDirectObject (in, typeControlRef)
  10295. * The control whose bounds to return.
  10296. *
  10297. * --> kEventParamControlPart (in, typeControlPartCode)
  10298. * The control part whose bounds to return.
  10299. *
  10300. * <-- kEventParamControlPartBounds (out, typeHIRect)
  10301. * On exit, contains the bounds of the specified part.
  10302. *
  10303. * Availability:
  10304. * Mac OS X: in version 10.0 and later in Carbon.framework
  10305. * CarbonLib: not available
  10306. }
  10307. const
  10308. kEventControlGetPartBounds = 102;
  10309. {
  10310. * kEventClassControl / kEventControlSetData
  10311. *
  10312. * Summary:
  10313. * Sent by the SetControlData API when a client wants to change an
  10314. * arbitrary setting of your control.
  10315. *
  10316. * Mac OS X threading:
  10317. * Not thread safe
  10318. *
  10319. * Parameters:
  10320. *
  10321. * --> kEventParamDirectObject (in, typeControlRef)
  10322. * The control for which to set data.
  10323. *
  10324. * --> kEventParamControlPart (in, typeControlPartCode)
  10325. * The control part for which to set data.
  10326. *
  10327. * --> kEventParamControlDataTag (in, typeEnumeration)
  10328. * The type of data to set.
  10329. *
  10330. * --> kEventParamControlDataBuffer (in, typePtr)
  10331. * A pointer to the data.
  10332. *
  10333. * --> kEventParamControlDataBufferSize (in, typeLongInteger)
  10334. * The size of the data.
  10335. *
  10336. * Availability:
  10337. * Mac OS X: in version 10.0 and later in Carbon.framework
  10338. * CarbonLib: not available
  10339. }
  10340. const
  10341. kEventControlSetData = 103;
  10342. {
  10343. * kEventClassControl / kEventControlGetData
  10344. *
  10345. * Summary:
  10346. * Sent by the GetControlData API when a client wants to get an
  10347. * arbitrary setting of your control.
  10348. *
  10349. * Mac OS X threading:
  10350. * Not thread safe
  10351. *
  10352. * Parameters:
  10353. *
  10354. * --> kEventParamDirectObject (in, typeControlRef)
  10355. * The control from which to get data.
  10356. *
  10357. * --> kEventParamControlPart (in, typeControlPartCode)
  10358. * The control part for which to get data.
  10359. *
  10360. * --> kEventParamControlDataTag (in, typeEnumeration)
  10361. * The type of data to get.
  10362. *
  10363. * --> kEventParamControlDataBuffer (in, typePtr)
  10364. * A buffer in which to write the data.
  10365. *
  10366. * <-> kEventParamControlDataBufferSize (in/out, typeLongInteger)
  10367. * On entry, the size of the data buffer. On exit, the amount
  10368. * of data that was available.
  10369. *
  10370. * Availability:
  10371. * Mac OS X: in version 10.0 and later in Carbon.framework
  10372. * CarbonLib: not available
  10373. }
  10374. const
  10375. kEventControlGetData = 104;
  10376. {
  10377. * kEventClassControl / kEventControlGetSizeConstraints
  10378. *
  10379. * Summary:
  10380. * Sent by the HIViewGetSizeConstraints API to allow your custom
  10381. * control/view to specify its minimum and maximum size.
  10382. *
  10383. * Discussion:
  10384. * This is different from the optimal size event above. The optimal
  10385. * size might be larger than a viewÕs minimum size. A parent view
  10386. * can use this information to help it lay out subviews. The toolbar
  10387. * control uses this information to help lay out toolbar items, for
  10388. * example.
  10389. *
  10390. * Mac OS X threading:
  10391. * Not thread safe
  10392. *
  10393. * Parameters:
  10394. *
  10395. * --> kEventParamDirectObject (in, typeControlRef)
  10396. * The control for which to get size constraints.
  10397. *
  10398. * <-- kEventParamMinimumSize (out, typeHISize)
  10399. * On exit, contains the controlÕs minimum size.
  10400. *
  10401. * <-- kEventParamMaximumSize (out, typeHISize)
  10402. * On exit, contains the controlÕs maximum size.
  10403. *
  10404. * Availability:
  10405. * Mac OS X: in version 10.2 and later in Carbon.framework
  10406. * CarbonLib: not available
  10407. }
  10408. const
  10409. kEventControlGetSizeConstraints = 105;
  10410. {
  10411. * kEventClassControl / kEventControlGetFrameMetrics
  10412. *
  10413. * Summary:
  10414. * Sent when a control client needs to determine the width of the
  10415. * controlÕs structure region.
  10416. *
  10417. * Discussion:
  10418. * This event is not sent automatically by the Control Manager at
  10419. * any time, but may be sent by control clients during various
  10420. * layout operations. For example, the Window Manager will send this
  10421. * event to a window frame HIView to determine the window structure
  10422. * widths, and the Menu Manager will send this event to a menu
  10423. * content view to determine the content structure widths.
  10424. *
  10425. * Mac OS X threading:
  10426. * Not thread safe
  10427. *
  10428. * Parameters:
  10429. *
  10430. * --> kEventParamDirectObject (in, typeControlRef)
  10431. * The control for which to get frame metrics.
  10432. *
  10433. * <-- kEventParamControlFrameMetrics (out, typeControlFrameMetrics)
  10434. * On exit, contains the controlÕs frame metrics.
  10435. *
  10436. * Availability:
  10437. * Mac OS X: in version 10.3 and later in Carbon.framework
  10438. * CarbonLib: not available
  10439. }
  10440. const
  10441. kEventControlGetFrameMetrics = 106;
  10442. {
  10443. * kEventClassControl / kEventControlValueFieldChanged
  10444. *
  10445. * Summary:
  10446. * Sent when your controlÕs value, min, max, or view size has
  10447. * changed. Useful so other entities can watch for changes to your
  10448. * controlÕs value.
  10449. *
  10450. * Mac OS X threading:
  10451. * Not thread safe
  10452. *
  10453. * Parameters:
  10454. *
  10455. * --> kEventParamDirectObject (in, typeControlRef)
  10456. * The control whose value, min, max, or view size has changed.
  10457. *
  10458. * Availability:
  10459. * Mac OS X: in version 10.0 and later in Carbon.framework
  10460. * CarbonLib: not available
  10461. }
  10462. const
  10463. kEventControlValueFieldChanged = 151;
  10464. {
  10465. * kEventClassControl / kEventControlAddedSubControl
  10466. *
  10467. * Summary:
  10468. * Sent when a control was embedded within your control.
  10469. *
  10470. * Mac OS X threading:
  10471. * Not thread safe
  10472. *
  10473. * Parameters:
  10474. *
  10475. * --> kEventParamDirectObject (in, typeControlRef)
  10476. * The control that gained a new subcontrol.
  10477. *
  10478. * --> kEventParamControlSubControl (in, typeControlRef)
  10479. * The subcontrol that was added.
  10480. *
  10481. * Availability:
  10482. * Mac OS X: in version 10.0 and later in Carbon.framework
  10483. * CarbonLib: not available
  10484. }
  10485. const
  10486. kEventControlAddedSubControl = 152;
  10487. {
  10488. * kEventClassControl / kEventControlRemovingSubControl
  10489. *
  10490. * Summary:
  10491. * Sent when one of your child controls will be removed from your
  10492. * control.
  10493. *
  10494. * Mac OS X threading:
  10495. * Not thread safe
  10496. *
  10497. * Parameters:
  10498. *
  10499. * --> kEventParamDirectObject (in, typeControlRef)
  10500. * The control that will be losing a subcontrol.
  10501. *
  10502. * --> kEventParamControlSubControl (in, typeControlRef)
  10503. * The subcontrol that will be removed.
  10504. *
  10505. * Availability:
  10506. * Mac OS X: in version 10.0 and later in Carbon.framework
  10507. * CarbonLib: not available
  10508. }
  10509. const
  10510. kEventControlRemovingSubControl = 153;
  10511. {
  10512. * kEventClassControl / kEventControlBoundsChanged
  10513. *
  10514. * Summary:
  10515. * Sent when your controlÕs bounding rectangle has changed.
  10516. *
  10517. * Discussion:
  10518. * If you want to generate an efficient invalid region in response
  10519. * to a size change, you need to handle
  10520. * kEventControlInvalidateForSizeChange.
  10521. *
  10522. * Mac OS X threading:
  10523. * Not thread safe
  10524. *
  10525. * Parameters:
  10526. *
  10527. * --> kEventParamDirectObject (in, typeControlRef)
  10528. * The control whose bounds have changed.
  10529. *
  10530. * --> kEventParamAttributes (in, typeUInt32)
  10531. * Flags indicating how the bounds changed, including
  10532. * kControlBoundsChangeSizeChanged and
  10533. * kControlBoundsChangePositionChanged.
  10534. *
  10535. * --> kEventParamOriginalBounds (in, typeQDRectangle)
  10536. * The controlÕs bounds before the change. This is the
  10537. * controlÕs frame bounds; for a compositing view, this
  10538. * bounding rect is in the parent viewÕs coordinate system,
  10539. * and for a non-compositing view, it is in local GrafPort
  10540. * coordinates.
  10541. *
  10542. * --> kEventParamPreviousBounds (in, typeQDRectangle)
  10543. * The controlÕs bounds before the change. This parameter
  10544. * always has the same value as the kEventParamOriginalBounds
  10545. * parameter.
  10546. *
  10547. * --> kEventParamCurrentBounds (in, typeQDRectangle)
  10548. * The controlÕs new bounds. This is the controlÕs frame
  10549. * bounds; for a compositing view, this bounding rect is in
  10550. * the parent viewÕs coordinate system, and for a
  10551. * non-compositing view, it is in local GrafPort coordinates.
  10552. *
  10553. * Availability:
  10554. * Mac OS X: in version 10.0 and later in Carbon.framework
  10555. * CarbonLib: not available
  10556. }
  10557. const
  10558. kEventControlBoundsChanged = 154;
  10559. {
  10560. * kEventClassControl / kEventControlInvalidateForSizeChange
  10561. *
  10562. * Summary:
  10563. * Sent when a control's size changes so it can invalidate the area
  10564. * of itself that needs to be redrawn.
  10565. *
  10566. * Discussion:
  10567. * Handle this event by calling HIViewSetNeedsDisplayInRegion with a
  10568. * region that properly reflects the area of your control that needs
  10569. * to be redrawn after a size change. The default handler for this
  10570. * event will invalidate the entire control.
  10571. *
  10572. * Mac OS X threading:
  10573. * Not thread safe
  10574. *
  10575. * Parameters:
  10576. *
  10577. * --> kEventParamDirectObject (in, typeControlRef)
  10578. * The control whose size has changed.
  10579. *
  10580. * --> kEventParamOriginalBounds (in, typeQDRectangle)
  10581. * The controlÕs bounds before the change.
  10582. *
  10583. * --> kEventParamCurrentBounds (in, typeQDRectangle)
  10584. * The controlÕs new bounds.
  10585. *
  10586. * Availability:
  10587. * Mac OS X: in version 10.3 and later in Carbon.framework
  10588. * CarbonLib: not available
  10589. }
  10590. const
  10591. kEventControlInvalidateForSizeChange = 22;
  10592. {
  10593. * kEventClassControl / kEventControlVisibilityChanged
  10594. *
  10595. * Summary:
  10596. * Sent when a control is hidden or shown. This is here to support
  10597. * custom views/controls which need to update information when the
  10598. * visibility changes.
  10599. *
  10600. * Mac OS X threading:
  10601. * Not thread safe
  10602. *
  10603. * Parameters:
  10604. *
  10605. * --> kEventParamDirectObject (in, typeControlRef)
  10606. * The control whose visibility has changed.
  10607. *
  10608. * Availability:
  10609. * Mac OS X: in version 10.2 and later in Carbon.framework
  10610. * CarbonLib: not available
  10611. }
  10612. const
  10613. kEventControlVisibilityChanged = 157;
  10614. {
  10615. * kEventClassControl / kEventControlOwningWindowChanged
  10616. *
  10617. * Summary:
  10618. * Sent when your controlÕs owning window has changed. Useful to
  10619. * udpate any dependencies that your control has on its owning
  10620. * window.
  10621. *
  10622. * Mac OS X threading:
  10623. * Not thread safe
  10624. *
  10625. * Parameters:
  10626. *
  10627. * --> kEventParamDirectObject (in, typeControlRef)
  10628. * The control whose owning window has changed.
  10629. *
  10630. * --> kEventParamAttributes (in, typeUInt32)
  10631. * Currently unused.
  10632. *
  10633. * --> kEventParamControlOriginalOwningWindow (in, typeWindowRef)
  10634. * The controlÕs original owning window.
  10635. *
  10636. * --> kEventParamControlCurrentOwningWindow (in, typeWindowRef)
  10637. * The controlÕs new owning window.
  10638. *
  10639. * Availability:
  10640. * Mac OS X: in version 10.0 and later in Carbon.framework
  10641. * CarbonLib: not available
  10642. }
  10643. const
  10644. kEventControlOwningWindowChanged = 159;
  10645. {
  10646. * kEventClassControl / kEventControlTitleChanged
  10647. *
  10648. * Summary:
  10649. * Sent when the title of your control changes.
  10650. *
  10651. * Mac OS X threading:
  10652. * Not thread safe
  10653. *
  10654. * Parameters:
  10655. *
  10656. * --> kEventParamDirectObject (in, typeControlRef)
  10657. * The control whose title has changed.
  10658. *
  10659. * Availability:
  10660. * Mac OS X: in version 10.2 and later in Carbon.framework
  10661. * CarbonLib: not available
  10662. }
  10663. const
  10664. kEventControlTitleChanged = 158;
  10665. {
  10666. * kEventClassControl / kEventControlHiliteChanged
  10667. *
  10668. * Summary:
  10669. * Sent when the hilite state changes in a control. This is here to
  10670. * support custom views/controls which need to update information
  10671. * when the hilite state changes.
  10672. *
  10673. * Mac OS X threading:
  10674. * Not thread safe
  10675. *
  10676. * Parameters:
  10677. *
  10678. * --> kEventParamDirectObject (in, typeControlRef)
  10679. * The control whose hilite has changed.
  10680. *
  10681. * --> kEventParamControlPreviousPart (in, typeControlPartCode)
  10682. * The previously hilited part.
  10683. *
  10684. * --> kEventParamControlCurrentPart (in, typeControlPartCode)
  10685. * The newly hilited part.
  10686. *
  10687. * Availability:
  10688. * Mac OS X: in version 10.2 and later in Carbon.framework
  10689. * CarbonLib: not available
  10690. }
  10691. const
  10692. kEventControlHiliteChanged = 160;
  10693. {
  10694. * kEventClassControl / kEventControlEnabledStateChanged
  10695. *
  10696. * Summary:
  10697. * Sent when the enabled state changes in a control. This is here to
  10698. * support custom views/controls which need to update information
  10699. * when the enabled state changes.
  10700. *
  10701. * Mac OS X threading:
  10702. * Not thread safe
  10703. *
  10704. * Parameters:
  10705. *
  10706. * --> kEventParamDirectObject (in, typeControlRef)
  10707. * The control whose enabled state has changed.
  10708. *
  10709. * Availability:
  10710. * Mac OS X: in version 10.2 and later in Carbon.framework
  10711. * CarbonLib: not available
  10712. }
  10713. const
  10714. kEventControlEnabledStateChanged = 161;
  10715. {
  10716. * kEventClassControl / kEventControlLayoutInfoChanged
  10717. *
  10718. * Summary:
  10719. * Sent when the layout info changes in a control.
  10720. *
  10721. * Mac OS X threading:
  10722. * Not thread safe
  10723. *
  10724. * Parameters:
  10725. *
  10726. * --> kEventParamDirectObject (in, typeControlRef)
  10727. * The control whose enabled state has changed.
  10728. *
  10729. * Availability:
  10730. * Mac OS X: in version 10.2 and later in Carbon.framework
  10731. * CarbonLib: not available
  10732. }
  10733. const
  10734. kEventControlLayoutInfoChanged = 162;
  10735. {
  10736. * kEventClassControl / kEventControlArbitraryMessage
  10737. *
  10738. * Summary:
  10739. * Sent by the SendControlMessage API when someone is trying to send
  10740. * an old-style CDEF message to your control.
  10741. *
  10742. * Mac OS X threading:
  10743. * Not thread safe
  10744. *
  10745. * Parameters:
  10746. *
  10747. * --> kEventParamDirectObject (in, typeControlRef)
  10748. * The control that is receiving the message.
  10749. *
  10750. * --> kEventParamControlMessage (in, typeShortInteger)
  10751. * The message.
  10752. *
  10753. * --> kEventParamControlParam (in, typeLongInteger)
  10754. * The inParam parameter from SendControlMessage.
  10755. *
  10756. * <-- kEventParamControlResult (out, typeLongInteger)
  10757. * On exit, contains the result that should be returned from
  10758. * SendControlMessage.
  10759. *
  10760. * Availability:
  10761. * Mac OS X: in version 10.0 and later in Carbon.framework
  10762. * CarbonLib: not available
  10763. }
  10764. const
  10765. kEventControlArbitraryMessage = 201;
  10766. {
  10767. * Summary:
  10768. * Control bounds change event attributes
  10769. *
  10770. * Discussion:
  10771. * When the toolbox sends out a kEventControlBoundsChanged event, it
  10772. * also sends along a parameter containing attributes of the event.
  10773. * These attributes can be used to determine what aspect of the
  10774. * control changed (position, size, or both).
  10775. }
  10776. const
  10777. {
  10778. * The dimensions of the control (width and height) changed.
  10779. }
  10780. kControlBoundsChangeSizeChanged = 1 shl 2;
  10781. {
  10782. * The top left corner (position) changed.
  10783. }
  10784. kControlBoundsChangePositionChanged = 1 shl 3;
  10785. {--------------------------------------------------------------------------------------}
  10786. { Tablet Events (and tablet data in mouse events) }
  10787. {--------------------------------------------------------------------------------------}
  10788. {
  10789. kEventClassTablet quick reference:
  10790. kEventTabletPoint = 1,
  10791. kEventTabletProximity = 2,
  10792. }
  10793. {
  10794. * kEventClassTablet / kEventTabletPoint
  10795. *
  10796. * Summary:
  10797. * Indicates that the pen has moved on or near a tablet.
  10798. *
  10799. * Discussion:
  10800. * Same as deprecated kEventTabletPointer.
  10801. *
  10802. * Mac OS X threading:
  10803. * Not thread safe
  10804. *
  10805. * Parameters:
  10806. *
  10807. * --> kEventParamTabletPointRec (in, typeTabletPointRec)
  10808. * Tablet information for the event.
  10809. *
  10810. * Availability:
  10811. * Mac OS X: in version 10.0 and later in Carbon.framework
  10812. * CarbonLib: not available
  10813. }
  10814. const
  10815. kEventTabletPoint = 1;
  10816. {
  10817. * kEventClassTablet / kEventTabletProximity
  10818. *
  10819. * Summary:
  10820. * Indicates that the pen has entered or exited proximity of a
  10821. * tablet.
  10822. *
  10823. * Mac OS X threading:
  10824. * Not thread safe
  10825. *
  10826. * Parameters:
  10827. *
  10828. * --> kEventParamTabletProximityRec (in, typeTabletProximityRec)
  10829. * Tablet information for the event.
  10830. *
  10831. * Availability:
  10832. * Mac OS X: in version 10.0 and later in Carbon.framework
  10833. * CarbonLib: not available
  10834. }
  10835. const
  10836. kEventTabletProximity = 2;
  10837. type
  10838. TabletPointRecPtr = ^TabletPointRec;
  10839. TabletPointRec = record
  10840. absX: SInt32; { absolute x coordinate in tablet space at full tablet resolution }
  10841. absY: SInt32; { absolute y coordinate in tablet space at full tablet resolution }
  10842. absZ: SInt32; { absolute z coordinate in tablet space at full tablet resolution }
  10843. buttons: UInt16; { one bit per button - bit 0 is first button - 1 = closed }
  10844. pressure: UInt16; { scaled pressure value; MAXPRESSURE=(2^16)-1, MINPRESSURE=0 }
  10845. tiltX: SInt16; { scaled tilt x value; range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) }
  10846. tiltY: SInt16; { scaled tilt y value; range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) }
  10847. rotation: UInt16; { Fixed-point representation of device rotation in a 10.6 format }
  10848. tangentialPressure: SInt16; { tangential pressure on the device; range same as tilt }
  10849. deviceID: UInt16; { system-assigned unique device ID - matches to deviceID field in proximity event }
  10850. vendor1: SInt16; { vendor-defined signed 16-bit integer }
  10851. vendor2: SInt16; { vendor-defined signed 16-bit integer }
  10852. vendor3: SInt16; { vendor-defined signed 16-bit integer }
  10853. end;
  10854. type
  10855. TabletPointerRec = TabletPointRec;
  10856. TabletPointerRecPtr = ^TabletPointerRec;
  10857. TabletProximityRecPtr = ^TabletProximityRec;
  10858. TabletProximityRec = record
  10859. vendorID: UInt16; { vendor-defined ID - typically will be USB vendor ID }
  10860. tabletID: UInt16; { vendor-defined tablet ID - typically will be USB product ID for the tablet }
  10861. pointerID: UInt16; { vendor-defined ID of the specific pointing device }
  10862. deviceID: UInt16; { system-assigned unique device ID - matches to deviceID field in tablet event }
  10863. systemTabletID: UInt16; { system-assigned unique tablet ID }
  10864. vendorPointerType: UInt16; { vendor-defined pointer type }
  10865. pointerSerialNumber: UInt32; { vendor-defined serial number of the specific pointing device }
  10866. uniqueID: UInt64; { vendor-defined unique ID for this pointer }
  10867. capabilityMask: UInt32; { mask representing the capabilities of the device. }
  10868. { capability bits are defined in the tablet capability }
  10869. { masks section of <IOKit/hidsystem/IOLLEvent.h> }
  10870. pointerType: SInt8; { type of pointing device - enum to be defined }
  10871. enterProximity: SInt8; { non-zero = entering; zero = leaving }
  10872. end;
  10873. {--------------------------------------------------------------------------------------}
  10874. { Volume Events }
  10875. {--------------------------------------------------------------------------------------}
  10876. {
  10877. kEventClassVolume quick reference:
  10878. kEventVolumeMounted = 1, // new volume mounted
  10879. kEventVolumeUnmounted = 2 // volume has been ejected or unmounted
  10880. }
  10881. const
  10882. typeFSVolumeRefNum = $766F6C6E (* 'voln' *); { FSVolumeRefNum}
  10883. {
  10884. * kEventClassVolume / kEventVolumeMounted
  10885. *
  10886. * Summary:
  10887. * A new volume has been mounted (or new media inserted).
  10888. *
  10889. * Discussion:
  10890. * This event is sent to all handlers registered for it.
  10891. *
  10892. * Mac OS X threading:
  10893. * Not thread safe
  10894. *
  10895. * Parameters:
  10896. *
  10897. * --> kEventParamDirectObject (in, typeFSVolumeRefNum)
  10898. * The volume refnum of the volume that was mounted.
  10899. *
  10900. * Availability:
  10901. * Mac OS X: in version 10.0 and later in Carbon.framework
  10902. * CarbonLib: in CarbonLib 1.3.1 and later
  10903. }
  10904. const
  10905. kEventVolumeMounted = 1;
  10906. {
  10907. * kEventClassVolume / kEventVolumeUnmounted
  10908. *
  10909. * Summary:
  10910. * An existing volume has been unmounted (or media ejected).
  10911. *
  10912. * Discussion:
  10913. * This event is sent to all handlers registered for it.
  10914. *
  10915. * Mac OS X threading:
  10916. * Not thread safe
  10917. *
  10918. * Parameters:
  10919. *
  10920. * --> kEventParamDirectObject (in, typeFSVolumeRefNum)
  10921. * The volume refnum of the volume that was unmounted. At the
  10922. * point when this event is sent, this is no longer a valid
  10923. * volume refnum, and cannot be passed to any File Manager
  10924. * API; it is useful only for comparison with cached volume
  10925. * refnums in your own data structures.
  10926. *
  10927. * Availability:
  10928. * Mac OS X: in version 10.0 and later in Carbon.framework
  10929. * CarbonLib: in CarbonLib 1.3.1 and later
  10930. }
  10931. const
  10932. kEventVolumeUnmounted = 2;
  10933. {--------------------------------------------------------------------------------------}
  10934. { Appearance Events }
  10935. {--------------------------------------------------------------------------------------}
  10936. {
  10937. kEventClassAppearance quick reference:
  10938. kEventAppearanceScrollBarVariantChanged = 1
  10939. }
  10940. {
  10941. * kEventClassAppearance / kEventAppearanceScrollBarVariantChanged
  10942. *
  10943. * Summary:
  10944. * The scroll bar variant has changed. Available on Mac OS X 10.1
  10945. * and later.
  10946. *
  10947. * Discussion:
  10948. * This event is sent to all handlers registered for it on Mac OS X
  10949. * 10.3 and later.
  10950. *
  10951. * Mac OS X threading:
  10952. * Not thread safe
  10953. *
  10954. * Parameters:
  10955. *
  10956. * --> kEventParamNewScrollBarVariant (in, typeShortInteger)
  10957. * The new scroll bar variant.
  10958. *
  10959. * Availability:
  10960. * Mac OS X: in version 10.1 and later in Carbon.framework
  10961. * CarbonLib: not available
  10962. }
  10963. const
  10964. kEventAppearanceScrollBarVariantChanged = 1;
  10965. {--------------------------------------------------------------------------------------}
  10966. { Services Events }
  10967. {--------------------------------------------------------------------------------------}
  10968. {
  10969. kEventClassService quick reference:
  10970. Services are a feature by which applications can communicate with
  10971. one another to request and provide services. This communication
  10972. happens either through the Pasteboard or Scrap Manager. When an event is sent that
  10973. requires communication for processing or servicing a request,
  10974. you will need to use the pasteboard or scrap given in the kEventParamPasteboardRef and
  10975. kEventParamScrapRef parameters of the event in order to communicate.
  10976. When your app requests a service, it is usually acting on data that is
  10977. currently selected or in focus. Therefore all of the Services events
  10978. are sent to the UserFocus event target.
  10979. <BR><BR>
  10980. Service events are available on Mac OS X 10.1 and later.
  10981. kEventServiceCopy = 1,
  10982. kEventServicePaste = 2,
  10983. kEventServiceGetTypes = 3,
  10984. kEventServicePerform = 4
  10985. }
  10986. {
  10987. * kEventClassService / kEventServiceCopy
  10988. *
  10989. * Summary:
  10990. * The user has invoked a service that requires the application to
  10991. * update the given pasteboard or scrap in the
  10992. * kEventParamPasteboardRef and kEventParamScrapRef parameters with
  10993. * appropriate data from the focus.
  10994. *
  10995. * Discussion:
  10996. * On Mac OS X 10.3 and later, this event includes both a
  10997. * PasteboardRef and a ScrapRef. A handler for this event should
  10998. * provide its data using either Pasteboard or Scrap Manager APIs,
  10999. * and the corresponding pasteboard or scrap reference, depending on
  11000. * which is more convenient or appropriate. Data only needs to be
  11001. * placed on one of the pasteboard or scrap; it does not need to be
  11002. * placed on both. Data written to the pasteboard will also be
  11003. * available on the scrap, and vice versa.
  11004. *
  11005. * Mac OS X threading:
  11006. * Not thread safe
  11007. *
  11008. * Parameters:
  11009. *
  11010. * --> kEventParamPasteboardRef (in, typePasteboardRef)
  11011. * Data from the current selection should be placed into this
  11012. * pasteboard. This parameter is provided on Mac OS X 10.3 and
  11013. * later.
  11014. *
  11015. * --> kEventParamScrapRef (in, typeScrapRef)
  11016. * Data from the current selection should be placed into this
  11017. * scrap.
  11018. *
  11019. * Availability:
  11020. * Mac OS X: in version 10.1 and later in Carbon.framework
  11021. * CarbonLib: not available
  11022. }
  11023. const
  11024. kEventServiceCopy = 1;
  11025. {
  11026. * kEventClassService / kEventServicePaste
  11027. *
  11028. * Summary:
  11029. * The user has invoked a service that requires the application to
  11030. * update the current focus with data from the pasteboard or scrap
  11031. * given in the kEventParamPasteboardRef and kEventParamScrapRef
  11032. * parameters.
  11033. *
  11034. * Discussion:
  11035. * On Mac OS X 10.3 and later, this event includes both a
  11036. * PasteboardRef and a ScrapRef. A handler for this event should
  11037. * retrieve its data using either Pasteboard or Scrap Manager APIs,
  11038. * and the corresponding pasteboard or scrap reference, depending on
  11039. * which is more convenient or appropriate. Data only needs to be
  11040. * read from one of the pasteboard or scrap; it does not need to be
  11041. * read from both. Data available on the pasteboard will also be
  11042. * available on the scrap, and vice versa.
  11043. *
  11044. * Mac OS X threading:
  11045. * Not thread safe
  11046. *
  11047. * Parameters:
  11048. *
  11049. * --> kEventParamPasteboardRef (in, typePasteboardRef)
  11050. * The current selection should be replaced by data from this
  11051. * pasteboard. This parameter is provided on Mac OS X 10.3 and
  11052. * later.
  11053. *
  11054. * --> kEventParamScrapRef (in, typeScrapRef)
  11055. * The current selection should be replaced by data from this
  11056. * scrap.
  11057. *
  11058. * Availability:
  11059. * Mac OS X: in version 10.1 and later in Carbon.framework
  11060. * CarbonLib: not available
  11061. }
  11062. const
  11063. kEventServicePaste = 2;
  11064. {
  11065. * kEventClassService / kEventServiceGetTypes
  11066. *
  11067. * Summary:
  11068. * The Services Manager needs to know what types of data the
  11069. * application can copy and paste to and from the pasteboard or
  11070. * scrap in order to update the Services menu to enable items that
  11071. * the user can select.
  11072. *
  11073. * Discussion:
  11074. * This event sends two CFMutableArrayRefs for the application to
  11075. * add the types to: the kEventParamServiceCopyTypes and the
  11076. * kEventParamServicePasteTypes parameters. The types that are added
  11077. * are CFStringRefs. There is a convenience function,
  11078. * CreateTypeStringWithOSType, which takes an OSType and will create
  11079. * a CFStringRef that you can add to the array(s).
  11080. *
  11081. * Mac OS X threading:
  11082. * Not thread safe
  11083. *
  11084. * Parameters:
  11085. *
  11086. * --> kEventParamServiceCopyTypes (in, typeCFMutableArrayRef)
  11087. * Add CFStringRefs to this array to report the types that can
  11088. * be copied from the current selection. These strings will be
  11089. * released automatically after the event is handled.
  11090. *
  11091. * --> kEventParamServicePasteTypes (in, typeCFMutableArrayRef)
  11092. * Add CFStringRefs to this array to report the types that can
  11093. * be pasted into the currently focused object. These strings
  11094. * will be released automatically after the event is handled.
  11095. *
  11096. * Availability:
  11097. * Mac OS X: in version 10.1 and later in Carbon.framework
  11098. * CarbonLib: not available
  11099. }
  11100. const
  11101. kEventServiceGetTypes = 3;
  11102. {
  11103. * kEventClassService / kEventServicePerform
  11104. *
  11105. * Summary:
  11106. * If the application is a service provider, this event will get
  11107. * sent when a service is requested of the app.
  11108. *
  11109. * Discussion:
  11110. * On Mac OS X 10.3 and later, this event includes both a
  11111. * PasteboardRef and a ScrapRef. A handler for this event may
  11112. * provide its data using either Pasteboard or Scrap Manager APIs,
  11113. * and the corresponding pasteboard or scrap reference, depending on
  11114. * which is more convenient or appropriate.
  11115. *
  11116. * Mac OS X threading:
  11117. * Not thread safe
  11118. *
  11119. * Parameters:
  11120. *
  11121. * --> kEventParamPasteboardRef (in, typePasteboardRef)
  11122. * The pasteboard that should be used to send and receive data
  11123. * from the requester. This parameter is only provided on Mac
  11124. * OS X 10.3 and later.
  11125. *
  11126. * --> kEventParamScrapRef (in, typeScrapRef)
  11127. * The scrap that should be used to send and receive data from
  11128. * the requester.
  11129. *
  11130. * --> kEventParamServiceMessageName (in, typeCFStringRef)
  11131. * A string with the name of the advertised service that was
  11132. * invoked.
  11133. *
  11134. * --> kEventParamServiceUserData (in, typeCFStringRef)
  11135. * Extra data provided by the requestor.
  11136. *
  11137. * Availability:
  11138. * Mac OS X: in version 10.1 and later in Carbon.framework
  11139. * CarbonLib: not available
  11140. }
  11141. const
  11142. kEventServicePerform = 4;
  11143. {
  11144. * CreateTypeStringWithOSType()
  11145. *
  11146. * Discussion:
  11147. * This routine is used to convert an OSType to a CFStringRef that
  11148. * services will understand.
  11149. *
  11150. * Mac OS X threading:
  11151. * Not thread safe
  11152. *
  11153. * Parameters:
  11154. *
  11155. * inType:
  11156. * The OSType that needs to be converted to a CFString.
  11157. *
  11158. * Result:
  11159. * A CFStringRef that contains the string that corresponds to the
  11160. * given OSType. This follows CoreFoundation semantics in that it
  11161. * will return NULL for failure, and because it is a "Create"
  11162. * function you will need to CFRelease this string when it is no
  11163. * longer needed.
  11164. *
  11165. * Availability:
  11166. * Mac OS X: in version 10.1 and later in Carbon.framework
  11167. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  11168. * Non-Carbon CFM: not available
  11169. }
  11170. function CreateTypeStringWithOSType( inType: OSType ): CFStringRef; external name '_CreateTypeStringWithOSType';
  11171. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  11172. {
  11173. * kHIServicesMenuProviderName
  11174. *
  11175. * Discussion:
  11176. * A CFDictionaryRef key in a dictionary returned by
  11177. * CopyServicesMenuCommandKeys. The value for this key is the name
  11178. * of the service provider represented as a CFString.
  11179. }
  11180. {$ifc USE_CFSTR_CONSTANT_MACROS}
  11181. {$definec kHIServicesMenuProviderName CFSTRP('kHIServicesMenuProviderName')}
  11182. {$endc}
  11183. {
  11184. * kHIServicesMenuItemName
  11185. *
  11186. * Discussion:
  11187. * A CFDictionaryRef key in a dictionary returned by
  11188. * CopyServicesMenuCommandKeys. The value for this key is the name
  11189. * of the menu item represented as a CFString.
  11190. }
  11191. {$ifc USE_CFSTR_CONSTANT_MACROS}
  11192. {$definec kHIServicesMenuItemName CFSTRP('kHIServicesMenuItemName')}
  11193. {$endc}
  11194. {
  11195. * kHIServicesMenuCharCode
  11196. *
  11197. * Discussion:
  11198. * A CFDictionaryRef key in a dictionary returned by
  11199. * CopyServicesMenuCommandKeys. The value for this key is the
  11200. * character code of the menu item shortcut, represented as a
  11201. * CFString.
  11202. }
  11203. {$ifc USE_CFSTR_CONSTANT_MACROS}
  11204. {$definec kHIServicesMenuCharCode CFSTRP('kHIServicesMenuCharCode')}
  11205. {$endc}
  11206. {
  11207. * kHIServicesMenuKeyModifiers
  11208. *
  11209. * Discussion:
  11210. * A CFDictionaryRef key in a dictionary returned by
  11211. * CopyServicesMenuCommandKeys. The value for this key is the
  11212. * keyboard modifiers of the menu item shortcut in Menu Manager
  11213. * modifiers format, represented as a CFNumber.
  11214. }
  11215. {$ifc USE_CFSTR_CONSTANT_MACROS}
  11216. {$definec kHIServicesMenuKeyModifiers CFSTRP('kHIServicesMenuKeyModifiers')}
  11217. {$endc}
  11218. {
  11219. * CopyServicesMenuCommandKeys()
  11220. *
  11221. * Summary:
  11222. * Returns an array of CFDictionaryRefs containing information about
  11223. * the command-key short cuts for items in the application services
  11224. * menu.
  11225. *
  11226. * Discussion:
  11227. * Each array entry is a CFDictionaryRef, and each dictionary
  11228. * contains information about a single command key shortcut for
  11229. * items in the application's Services menu. Each dictionary
  11230. * contains the following keys: kHIServicesMenuProviderName,
  11231. * kHIServicesMenuItemName, kHIServicesMenuCharCode, and
  11232. * kHIServicesMenuKeyModifiers. The array must be released by the
  11233. * caller; the dictionaries do not need to be released (they will be
  11234. * auto-released when the array is released).
  11235. *
  11236. * Mac OS X threading:
  11237. * Not thread safe
  11238. *
  11239. * Parameters:
  11240. *
  11241. * outCommandKeyArray:
  11242. * On exit, contains an array of the values of the Services menu
  11243. * items that have command key shortcuts associated with them.
  11244. *
  11245. * Result:
  11246. * An operating system status code.
  11247. *
  11248. * Availability:
  11249. * Mac OS X: in version 10.4 and later in Carbon.framework
  11250. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  11251. * Non-Carbon CFM: not available
  11252. }
  11253. function CopyServicesMenuCommandKeys( var outCommandKeyArray: CFArrayRef ): OSStatus; external name '_CopyServicesMenuCommandKeys';
  11254. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  11255. {--------------------------------------------------------------------------------------}
  11256. { Accessibility Events }
  11257. {--------------------------------------------------------------------------------------}
  11258. {
  11259. kEventClassAccessibility quick reference:
  11260. kEventAccessibleGetChildAtPoint = 1,
  11261. kEventAccessibleGetFocusedChild = 2,
  11262. kEventAccessibleGetAllAttributeNames = 21,
  11263. kEventAccessibleGetAllParameterizedAttributeNames = 25,
  11264. kEventAccessibleGetNamedAttribute = 22,
  11265. kEventAccessibleSetNamedAttribute = 23,
  11266. kEventAccessibleIsNamedAttributeSettable = 24,
  11267. kEventAccessibleGetAllActionNames = 41,
  11268. kEventAccessiblePerformNamedAction = 42,
  11269. kEventAccessibleGetNamedActionDescription = 44
  11270. }
  11271. {
  11272. * kEventClassAccessibility / kEventAccessibleGetChildAtPoint
  11273. *
  11274. * Summary:
  11275. * Finds the child of an accessible object at a given point.
  11276. *
  11277. * Discussion:
  11278. * The kEventParamMouseLocation parameter will contain a global
  11279. * point. Your handler for this event should find the child of
  11280. * yourself which is underneath that point and return it in the
  11281. * kEventParamAccessibleChild parameter.
  11282. *
  11283. * Mac OS X threading:
  11284. * Not thread safe
  11285. *
  11286. * Parameters:
  11287. *
  11288. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  11289. * The accessible object, in the form of an AXUIElementRef.
  11290. *
  11291. * --> kEventParamMouseLocation (in, typeHIPoint)
  11292. * The location in global coordinates.
  11293. *
  11294. * <-- kEventParamAccessibleChild (out, typeCFTypeRef)
  11295. * On exit, contains the child of the accessible object at the
  11296. * specified point, in the form of an AXUIElementRef. If there
  11297. * is no child at the given point, you should still return
  11298. * noErr, but leave the parameter empty (do not call
  11299. * SetEventParameter). Only return immediate children; do not
  11300. * return grandchildren of yourself.
  11301. *
  11302. * Availability:
  11303. * Mac OS X: in version 10.2 and later in Carbon.framework
  11304. * CarbonLib: not available
  11305. }
  11306. const
  11307. kEventAccessibleGetChildAtPoint = 1;
  11308. {
  11309. * kEventClassAccessibility / kEventAccessibleGetFocusedChild
  11310. *
  11311. * Summary:
  11312. * Finds the focused child of an accessible object.
  11313. *
  11314. * Discussion:
  11315. * Your handler for this event should find the child of itself which
  11316. * is part of the focus chain and return it in the
  11317. * kEventParamAccessibleChild parameter.
  11318. *
  11319. * Mac OS X threading:
  11320. * Not thread safe
  11321. *
  11322. * Parameters:
  11323. *
  11324. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  11325. * The accessible object, in the form of an AXUIElementRef.
  11326. *
  11327. * <-- kEventParamAccessibleChild (out, typeCFTypeRef)
  11328. * On exit, contains the focused child of the accessible
  11329. * object, in the form of an AXUIElementRef. If there is no
  11330. * child in the focus chain, you should still return noErr,
  11331. * but leave the parameter empty (do not call
  11332. * SetEventParameter). Only return immediate children; do not
  11333. * return grandchildren of yourself.
  11334. *
  11335. * Availability:
  11336. * Mac OS X: in version 10.2 and later in Carbon.framework
  11337. * CarbonLib: not available
  11338. }
  11339. const
  11340. kEventAccessibleGetFocusedChild = 2;
  11341. {
  11342. * kEventClassAccessibility / kEventAccessibleGetAllAttributeNames
  11343. *
  11344. * Summary:
  11345. * Returns the attributes supported by an accessible object. You
  11346. * must only return the names of your regular (non-parameterized)
  11347. * attributes via this event. If you support parameterized
  11348. * attributes, you must return them via the new
  11349. * kEventAccessibleGetAllParameterizedAttributeNames event.
  11350. *
  11351. * Mac OS X threading:
  11352. * Not thread safe
  11353. *
  11354. * Parameters:
  11355. *
  11356. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  11357. * The accessible object, in the form of an AXUIElementRef.
  11358. *
  11359. * <-> kEventParamAccessibleAttributeNames (in/out, typeCFMutableArrayRef)
  11360. * Add each of the regular (non-parameterized) attribute names
  11361. * supported by the accessible object to this array, as
  11362. * CFStringRefs.
  11363. *
  11364. * Availability:
  11365. * Mac OS X: in version 10.2 and later in Carbon.framework
  11366. * CarbonLib: not available
  11367. }
  11368. const
  11369. kEventAccessibleGetAllAttributeNames = 21;
  11370. {
  11371. * kEventClassAccessibility / kEventAccessibleGetAllParameterizedAttributeNames
  11372. *
  11373. * Summary:
  11374. * Returns the parameterized attributes supported by an accessible
  11375. * object. You must not return the names of your regular
  11376. * (non-parameterized) attributes via this event. If you support
  11377. * regular attributes, you must return them via the original
  11378. * kEventAccessibleGetAllAttributeNames event. Parameterized
  11379. * attributes are introduced in Mac OS X 10.3.
  11380. *
  11381. * Mac OS X threading:
  11382. * Not thread safe
  11383. *
  11384. * Parameters:
  11385. *
  11386. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  11387. * The accessible object, in the form of an AXUIElementRef.
  11388. *
  11389. * <-> kEventParamAccessibleAttributeNames (in/out, typeCFMutableArrayRef)
  11390. * Add each of the parameterized attribute names supported by
  11391. * the accessible object to this array, as CFStringRefs.
  11392. *
  11393. * Availability:
  11394. * Mac OS X: in version 10.3 and later in Carbon.framework
  11395. * CarbonLib: not available
  11396. }
  11397. const
  11398. kEventAccessibleGetAllParameterizedAttributeNames = 25;
  11399. {
  11400. * kEventClassAccessibility / kEventAccessibleGetNamedAttribute
  11401. *
  11402. * Summary:
  11403. * Returns the value of an attribute of an accessible object.
  11404. *
  11405. * Discussion:
  11406. * The kEventParamAccessibleAttributeName parameter will contain an
  11407. * attribute name in the form of a CFStringRef. If you support the
  11408. * named attribute, return the attributeÕs value in the
  11409. * kEventParamAccessibleAttributeValue parameter.
  11410. *
  11411. * Mac OS X threading:
  11412. * Not thread safe
  11413. *
  11414. * Parameters:
  11415. *
  11416. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  11417. * The accessible object, in the form of an AXUIElementRef.
  11418. *
  11419. * --> kEventParamAccessibleAttributeName (in, typeCFStringRef)
  11420. * The name of the requested attribute.
  11421. *
  11422. * --> kEventParamAccessibleAttributeParameter (in, typeCFTypeRef)
  11423. * This parameter is optional and will only exist if your
  11424. * accessible object is being asked for the value of a
  11425. * parameterized attribute. When present, this event parameter
  11426. * will contain a CFTypeRef describing the parameters of the
  11427. * request. Parameterized attributes are introduced in Mac OS
  11428. * X 10.3.
  11429. *
  11430. * <-- kEventParamAccessibleAttributeValue (out, typeCFTypeRef)
  11431. * On exit, contains the attribute's value. The type of this
  11432. * parameter varies according to the attribute; it might
  11433. * typically be typeCFStringRef (for a textual attribute),
  11434. * typeBoolean (for a boolean attribute), or typeSInt32 (for
  11435. * an integer-valued attribute).
  11436. *
  11437. * Availability:
  11438. * Mac OS X: in version 10.2 and later in Carbon.framework
  11439. * CarbonLib: not available
  11440. }
  11441. const
  11442. kEventAccessibleGetNamedAttribute = 22;
  11443. {
  11444. * kEventClassAccessibility / kEventAccessibleSetNamedAttribute
  11445. *
  11446. * Summary:
  11447. * Sets the value of an attribute of an accessible object.
  11448. *
  11449. * Discussion:
  11450. * The kEventParamAccessibleAttributeName parameter will contain an
  11451. * attribute name in the form of a CFStringRef. The
  11452. * kEventParamAccessibleAttributeValue parameter will contain data
  11453. * in an arbitrary format. If you support the named attribute, set
  11454. * the named attributeÕs value to the data provided in the event.
  11455. *
  11456. * Mac OS X threading:
  11457. * Not thread safe
  11458. *
  11459. * Parameters:
  11460. *
  11461. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  11462. * The accessible object, in the form of an AXUIElementRef.
  11463. *
  11464. * --> kEventParamAccessibleAttributeName (in, typeCFStringRef)
  11465. * The name of the requested attribute.
  11466. *
  11467. * --> kEventParamAccessibleAttributeValue (in, typeCFTypeRef)
  11468. * The new value of the attribute. The type of this parameter
  11469. * varies according to the attribute; it might typically be
  11470. * typeCFStringRef (for a textual attribute), typeBoolean (for
  11471. * a boolean attribute), or typeSInt32 (for an integer-valued
  11472. * attribute).
  11473. *
  11474. * Availability:
  11475. * Mac OS X: in version 10.2 and later in Carbon.framework
  11476. * CarbonLib: not available
  11477. }
  11478. const
  11479. kEventAccessibleSetNamedAttribute = 23;
  11480. {
  11481. * kEventClassAccessibility / kEventAccessibleIsNamedAttributeSettable
  11482. *
  11483. * Summary:
  11484. * Determines whether an attribute of an accessible object can be
  11485. * modified.
  11486. *
  11487. * Discussion:
  11488. * The kEventParamAccessibleAttributeName parameter will contain an
  11489. * attribute name in the form of a CFStringRef. If you support the
  11490. * named attribute, set the kEventParamAccessibleAttributeSettable
  11491. * parameter to a Boolean indicating whether the named attribute can
  11492. * have its value changed via the kEventAccessibleSetNamedAttribute
  11493. * event.
  11494. *
  11495. * Mac OS X threading:
  11496. * Not thread safe
  11497. *
  11498. * Parameters:
  11499. *
  11500. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  11501. * The accessible object, in the form of an AXUIElementRef.
  11502. *
  11503. * --> kEventParamAccessibleAttributeName (in, typeCFStringRef)
  11504. * The name of the requested attribute.
  11505. *
  11506. * <-- kEventParamAccessibleAttributeSettable (out, typeBoolean)
  11507. * On exit, indicates whether the attribute may be modified.
  11508. *
  11509. * Availability:
  11510. * Mac OS X: in version 10.2 and later in Carbon.framework
  11511. * CarbonLib: not available
  11512. }
  11513. const
  11514. kEventAccessibleIsNamedAttributeSettable = 24;
  11515. {
  11516. * kEventClassAccessibility / kEventAccessibleGetAllActionNames
  11517. *
  11518. * Summary:
  11519. * Returns the actions supported by an accessible object.
  11520. *
  11521. * Discussion:
  11522. * The kEventParamAccessibleActionNames parameter will contain a
  11523. * CFMutableArrayRef. Add each of the action names you support to
  11524. * this array in the form of a CFStringRef.
  11525. *
  11526. * Mac OS X threading:
  11527. * Not thread safe
  11528. *
  11529. * Parameters:
  11530. *
  11531. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  11532. * The accessible object, in the form of an AXUIElementRef.
  11533. *
  11534. * <-> kEventParamAccessibleActionNames (in/out, typeCFMutableArrayRef)
  11535. * Add each of the actions supported by the accessible object
  11536. * to this array, as CFStringRefs.
  11537. *
  11538. * Availability:
  11539. * Mac OS X: in version 10.2 and later in Carbon.framework
  11540. * CarbonLib: not available
  11541. }
  11542. const
  11543. kEventAccessibleGetAllActionNames = 41;
  11544. {
  11545. * kEventClassAccessibility / kEventAccessiblePerformNamedAction
  11546. *
  11547. * Summary:
  11548. * Requests that a specific action be performed by an accessible
  11549. * object.
  11550. *
  11551. * Discussion:
  11552. * The kEventParamAccessibleActionName parameter will contain an
  11553. * attribute name in the form of a CFStringRef. If you support the
  11554. * named action, perform the action. There are times, however, when
  11555. * performing an action causes an accessible object to call a
  11556. * routine which may not return immediately, such as StandardAlert
  11557. * or PopUpMenuSelect. You should only call such routines when you
  11558. * receive an action request that was queued; if you call such a
  11559. * routine when processing an event that was directly dispatched,
  11560. * you will probably cause the assistive app to receive a timeout
  11561. * error. On Mac OS X 10.3 and later, the
  11562. * kEventParamAccessibilityEventQueued parameter will indicate
  11563. * whether the event was queued. If so, process the request
  11564. * normally. If not, you can request that the event be posted to the
  11565. * queue and sent to you later by returning
  11566. * eventDeferAccessibilityEventErr from your handler. On Mac OS X
  11567. * 10.2, the parameter will not exist, the event will always be
  11568. * directly dispatched, and there is no way to request that it be
  11569. * posted to the queue; in this case, you should perform the action
  11570. * even if it will cause the assistive app to receive a timeout
  11571. * error.
  11572. *
  11573. * Mac OS X threading:
  11574. * Not thread safe
  11575. *
  11576. * Parameters:
  11577. *
  11578. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  11579. * The accessible object, in the form of an AXUIElementRef.
  11580. *
  11581. * --> kEventParamAccessibleActionName (in, typeCFStringRef)
  11582. * The name of the requested action.
  11583. *
  11584. * --> kEventParamAccessibilityEventQueued (in, typeBoolean)
  11585. * An indication of whether this event was delivered to you
  11586. * via the main event queue. This parameter only exists on Mac
  11587. * OS X 10.3 and later. See the discussion for more details.
  11588. *
  11589. * Availability:
  11590. * Mac OS X: in version 10.2 and later in Carbon.framework
  11591. * CarbonLib: not available
  11592. }
  11593. const
  11594. kEventAccessiblePerformNamedAction = 42;
  11595. {
  11596. * kEventClassAccessibility / kEventAccessibleGetNamedActionDescription
  11597. *
  11598. * Summary:
  11599. * Returns a human-language description of an action supported by an
  11600. * accessible object.
  11601. *
  11602. * Discussion:
  11603. * The kEventParamAccessibleActionName parameter will contain an
  11604. * attribute name in the form of a CFStringRef. The
  11605. * kEventParamAccessibleActionDescription parameter will contain a
  11606. * CFMutableStringRef. If you support the named action, alter the
  11607. * mutable string to contain a textual description of the actionÕs
  11608. * significance.
  11609. *
  11610. * Mac OS X threading:
  11611. * Not thread safe
  11612. *
  11613. * Parameters:
  11614. *
  11615. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  11616. * The accessible object, in the form of an AXUIElementRef.
  11617. *
  11618. * --> kEventParamAccessibleActionName (in, typeCFStringRef)
  11619. * The name of the requested action.
  11620. *
  11621. * <-> kEventParamAccessibleActionDescription (in/out, typeCFMutableStringRef)
  11622. * If you support the action, extract this parameter from the
  11623. * event and set the contents of the mutable string to contain
  11624. * a description of the action. Do not set this event
  11625. * parameter to a CFStringRef of your own creation; you must
  11626. * modify the preexisting mutable string stored in the event
  11627. * parameter.
  11628. *
  11629. * Availability:
  11630. * Mac OS X: in version 10.2 and later in Carbon.framework
  11631. * CarbonLib: not available
  11632. }
  11633. const
  11634. kEventAccessibleGetNamedActionDescription = 44;
  11635. {
  11636. * AXUIElementCreateWithHIObjectAndIdentifier()
  11637. *
  11638. * Discussion:
  11639. * This routine creates an AXUIElementRef to represent an accessible
  11640. * object for a Carbon application. A Carbon accessible object is
  11641. * comprised of an HIObjectRef and a 64-bit identifier. The
  11642. * resulting AXUIElementRef is a CFTypeRef, and must be managed as
  11643. * such. You can create a new AXUIElementRef every time you need
  11644. * one. Even though the actual hex values of two AXUIElementRefs
  11645. * might be different, they may represent the same accessible
  11646. * object; because AXUIElementRefs are Core Foundation objects, you
  11647. * can use CFEqual to compare them.
  11648. *
  11649. * Mac OS X threading:
  11650. * Not thread safe
  11651. *
  11652. * Parameters:
  11653. *
  11654. * inHIObject:
  11655. * The HIObjectRef of the accessible object.
  11656. *
  11657. * inIdentifier:
  11658. * The 64-bit identifier of the accessible object.
  11659. *
  11660. * Result:
  11661. * An AXUIElementRef that represents the Carbon accessible object
  11662. * identified by the given HIObjectRef and 64-bit identifier. This
  11663. * follows CoreFoundation semantics in that it will return NULL for
  11664. * failure, and because it is a "Create" function you will need to
  11665. * CFRelease() this AXUIElementRef when it is no longer needed.
  11666. *
  11667. * Availability:
  11668. * Mac OS X: in version 10.2 and later in Carbon.framework
  11669. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  11670. * Non-Carbon CFM: not available
  11671. }
  11672. function AXUIElementCreateWithHIObjectAndIdentifier( inHIObject: HIObjectRef; inIdentifier: UInt64 ): AXUIElementRef; external name '_AXUIElementCreateWithHIObjectAndIdentifier';
  11673. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  11674. {
  11675. * AXUIElementGetHIObject()
  11676. *
  11677. * Discussion:
  11678. * If the incoming AXUIElementRef is a Carbon accessible object,
  11679. * this routine will return the HIObjectRef of the accessible object.
  11680. *
  11681. * Mac OS X threading:
  11682. * Not thread safe
  11683. *
  11684. * Parameters:
  11685. *
  11686. * inUIElement:
  11687. * The AXUIElementRef of whom you'd like to get the HIObjectRef.
  11688. *
  11689. * Result:
  11690. * The HIObjectRef of the AXUIElementRef. If the incoming
  11691. * AXUIElementRef is not a Carbon accessible object, this routine
  11692. * will return NULL.
  11693. *
  11694. * Availability:
  11695. * Mac OS X: in version 10.2 and later in Carbon.framework
  11696. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  11697. * Non-Carbon CFM: not available
  11698. }
  11699. function AXUIElementGetHIObject( inUIElement: AXUIElementRef ): HIObjectRef; external name '_AXUIElementGetHIObject';
  11700. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  11701. {
  11702. * AXUIElementGetIdentifier()
  11703. *
  11704. * Discussion:
  11705. * If the incoming AXUIElementRef is a Carbon accessible object,
  11706. * this routine will pass back the 64-bit identifier of the
  11707. * accessible object.
  11708. *
  11709. * Mac OS X threading:
  11710. * Not thread safe
  11711. *
  11712. * Parameters:
  11713. *
  11714. * inUIElement:
  11715. * The AXUIElementRef of whom you'd like to get the 64-bit
  11716. * identifier.
  11717. *
  11718. * outIdentifier:
  11719. * The 64-bit identifier of the AXUIElementRef. If the incoming
  11720. * AXUIElementRef is not a Carbon accessible object, this routine
  11721. * will pass back zero. Note that zero is often a legal value for
  11722. * Carbon accessible object, so do not assume that the accessible
  11723. * object is not a Carbon accessible object just because you get a
  11724. * result of zero.
  11725. *
  11726. * Availability:
  11727. * Mac OS X: in version 10.2 and later in Carbon.framework
  11728. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  11729. * Non-Carbon CFM: not available
  11730. }
  11731. procedure AXUIElementGetIdentifier( inUIElement: AXUIElementRef; var outIdentifier: UInt64 ); external name '_AXUIElementGetIdentifier';
  11732. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  11733. {
  11734. * AXNotificationHIObjectNotify()
  11735. *
  11736. * Discussion:
  11737. * Posts a notification for the given pseudo-AXUIElementRef. Though
  11738. * an actual AXUIElementRef is not actually passed in to this
  11739. * function, its component parts are. This saves the implementation
  11740. * the hassle of dismantling the AXUIElementRef into its component
  11741. * parts.
  11742. *
  11743. * Mac OS X threading:
  11744. * Not thread safe
  11745. *
  11746. * Parameters:
  11747. *
  11748. * inNotification:
  11749. * The notification name string.
  11750. *
  11751. * inHIObject:
  11752. * The HIObjectRef component of the AXUIElementRef to whom the
  11753. * notification applies.
  11754. *
  11755. * inIdentifier:
  11756. * The 64-bit identifier component of the AXUIElementRef to whom
  11757. * the notification applies.
  11758. *
  11759. * Availability:
  11760. * Mac OS X: in version 10.2 and later in Carbon.framework
  11761. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  11762. * Non-Carbon CFM: not available
  11763. }
  11764. procedure AXNotificationHIObjectNotify( inNotification: CFStringRef; inHIObject: HIObjectRef; inIdentifier: UInt64 ); external name '_AXNotificationHIObjectNotify';
  11765. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  11766. {
  11767. * HICopyAccessibilityRoleDescription()
  11768. *
  11769. * Summary:
  11770. * Returns the role description string for a standard role or a
  11771. * standard role-subrole pair.
  11772. *
  11773. * Discussion:
  11774. * This routine is useful if you are implementing an accessible
  11775. * object that has a standard role or role-subrole pair and you want
  11776. * to make sure your object provides the same role description
  11777. * string that the equivalent system-supplied object provides. In
  11778. * other words, if you are implementing an accessible object of role
  11779. * kAXButtonRole, you can use this routine to make sure it provides
  11780. * the same role description that the standard push button provides.
  11781. *
  11782. * This routine can provide role description strings for all roles
  11783. * and role-subrole pairs that are used in the standard/system
  11784. * accessible objects on Mac OS X 10.4 and later. Once this routine
  11785. * is able to provide a role description string for a role or
  11786. * role-subrole pair, it will continue to do so on subsequent system
  11787. * releases, even if the system no longer produces a standard
  11788. * accessible object with that role or role-subrole pair.
  11789. *
  11790. * Mac OS X threading:
  11791. * Not thread safe
  11792. *
  11793. * Parameters:
  11794. *
  11795. * inRole:
  11796. * The role CFStringRef for your accessible object. Callers
  11797. * typically pass one of the kAXFooRole constant strings from
  11798. * within the HIServices framework.
  11799. *
  11800. * inSubrole:
  11801. * The subrole CFStringRef for your accessible object. Callers
  11802. * typically pass one of the kAXFooSubrole constant strings from
  11803. * within the HIServices framework. Pass NULL if your accessible
  11804. * object does not have a subrole.
  11805. *
  11806. * Result:
  11807. * A CFStringRef with the standard role description for the role or
  11808. * role-subrole pair. You must release the role description when you
  11809. * are finished with it. If there is no standard role description
  11810. * for the role or role-subrole pair, this routine will return NULL.
  11811. * If you pass either an unknown role or an unknown subrole, this
  11812. * routine will return NULL.
  11813. *
  11814. * Availability:
  11815. * Mac OS X: in version 10.4 and later in Carbon.framework
  11816. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  11817. * Non-Carbon CFM: not available
  11818. }
  11819. function HICopyAccessibilityRoleDescription( inRole: CFStringRef; inSubrole: CFStringRef { can be NULL } ): CFStringRef; external name '_HICopyAccessibilityRoleDescription';
  11820. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  11821. {
  11822. * HICopyAccessibilityActionDescription()
  11823. *
  11824. * Summary:
  11825. * Returns the action description string for a standard
  11826. * accessibility action.
  11827. *
  11828. * Discussion:
  11829. * This routine is useful if you are implementing an accessible
  11830. * object that implements a standard action and you want to make
  11831. * sure your object provides the same role action string that the a
  11832. * system-supplied object provides.
  11833. * This routine can provide action description strings for all
  11834. * actions that are used in the standard/system accessible objects
  11835. * on Mac OS X 10.4 and later. Once this routine is able to provide
  11836. * a description string for an action, it will continue to do so on
  11837. * subsequent system releases, even if the system no longer produces
  11838. * a standard accessible object that supports the action.
  11839. *
  11840. * Mac OS X threading:
  11841. * Not thread safe
  11842. *
  11843. * Parameters:
  11844. *
  11845. * inAction:
  11846. * The action CFStringRef for which you'd like to generate a
  11847. * description. Callers must pass one of the kAXFooAction constant
  11848. * strings from within the HIServices framework.
  11849. *
  11850. * Result:
  11851. * A CFStringRef with the standard description for the action. You
  11852. * must release the description when you are finished with it. If
  11853. * you pass an unsupported action to this routine, the behavior is
  11854. * undefined.
  11855. *
  11856. * Availability:
  11857. * Mac OS X: in version 10.4 and later in Carbon.framework
  11858. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  11859. * Non-Carbon CFM: not available
  11860. }
  11861. function HICopyAccessibilityActionDescription( inAction: CFStringRef ): CFStringRef; external name '_HICopyAccessibilityActionDescription';
  11862. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  11863. {--------------------------------------------------------------------------------------}
  11864. { System Events }
  11865. {--------------------------------------------------------------------------------------}
  11866. {
  11867. kEventClassSystem quick reference:
  11868. kEventSystemTimeDateChanged = 2,
  11869. kEventSystemUserSessionActivated = 10,
  11870. kEventSystemUserSessionDeactivated = 11
  11871. }
  11872. {
  11873. * kEventClassSystem / kEventSystemTimeDateChanged
  11874. *
  11875. * Summary:
  11876. * The system time and/or date has changed via the preferences panel.
  11877. *
  11878. * Discussion:
  11879. * This event is sent to all handlers registered for it on the
  11880. * application event target.
  11881. *
  11882. * Mac OS X threading:
  11883. * Not thread safe
  11884. *
  11885. * Availability:
  11886. * Mac OS X: in version 10.3 and later in Carbon.framework
  11887. * CarbonLib: not available
  11888. }
  11889. const
  11890. kEventSystemTimeDateChanged = 2;
  11891. {
  11892. * kEventClassSystem / kEventSystemUserSessionActivated
  11893. *
  11894. * Summary:
  11895. * The current user login session has been activated.
  11896. *
  11897. * Discussion:
  11898. * This event is sent to all handlers registered for it on the
  11899. * application event target. It is sent when the Fast User Switching
  11900. * feature of Mac OS X 10.3 is used to activate the login session in
  11901. * which the current application is running.
  11902. *
  11903. * Mac OS X threading:
  11904. * Not thread safe
  11905. *
  11906. * Availability:
  11907. * Mac OS X: in version 10.3 and later in Carbon.framework
  11908. * CarbonLib: not available
  11909. }
  11910. const
  11911. kEventSystemUserSessionActivated = 10;
  11912. {
  11913. * kEventClassSystem / kEventSystemUserSessionDeactivated
  11914. *
  11915. * Summary:
  11916. * The current user login session has been deactivated.
  11917. *
  11918. * Discussion:
  11919. * This event is sent to all handlers registered for it on the
  11920. * application event target. It is sent when the Fast User Switching
  11921. * feature of Mac OS X 10.3 is used to switch to another user's
  11922. * login session.
  11923. *
  11924. * Mac OS X threading:
  11925. * Not thread safe
  11926. *
  11927. * Availability:
  11928. * Mac OS X: in version 10.3 and later in Carbon.framework
  11929. * CarbonLib: not available
  11930. }
  11931. const
  11932. kEventSystemUserSessionDeactivated = 11;
  11933. {--------------------------------------------------------------------------------------}
  11934. { Installing Event Handlers }
  11935. {--------------------------------------------------------------------------------------}
  11936. {
  11937. * GetWindowEventTarget()
  11938. *
  11939. * Discussion:
  11940. * Returns the EventTargetRef for the specified window. Once you
  11941. * obtain this reference, you can send events to the target and
  11942. * install an event handler on it.
  11943. *
  11944. * Mac OS X threading:
  11945. * Not thread safe
  11946. *
  11947. * Parameters:
  11948. *
  11949. * inWindow:
  11950. * The window to return the target for.
  11951. *
  11952. * Result:
  11953. * An EventTargetRef.
  11954. *
  11955. * Availability:
  11956. * Mac OS X: in version 10.0 and later in Carbon.framework
  11957. * CarbonLib: in CarbonLib 1.1 and later
  11958. * Non-Carbon CFM: not available
  11959. }
  11960. function GetWindowEventTarget( inWindow: WindowRef ): EventTargetRef; external name '_GetWindowEventTarget';
  11961. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  11962. {
  11963. * GetControlEventTarget()
  11964. *
  11965. * Discussion:
  11966. * Returns the EventTargetRef for the specified control. Once you
  11967. * obtain this reference, you can send events to the target and
  11968. * install event handler on it.
  11969. *
  11970. * Mac OS X threading:
  11971. * Not thread safe
  11972. *
  11973. * Parameters:
  11974. *
  11975. * inControl:
  11976. * The control to return the target for.
  11977. *
  11978. * Result:
  11979. * An EventTargetRef.
  11980. *
  11981. * Availability:
  11982. * Mac OS X: in version 10.0 and later in Carbon.framework
  11983. * CarbonLib: in CarbonLib 1.1 and later
  11984. * Non-Carbon CFM: not available
  11985. }
  11986. function GetControlEventTarget( inControl: ControlRef ): EventTargetRef; external name '_GetControlEventTarget';
  11987. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  11988. {
  11989. * GetMenuEventTarget()
  11990. *
  11991. * Discussion:
  11992. * Returns the EventTargetRef for the specified menu. Once you
  11993. * obtain this reference, you can send events to the target and
  11994. * install event handler on it.
  11995. *
  11996. * Mac OS X threading:
  11997. * Not thread safe
  11998. *
  11999. * Parameters:
  12000. *
  12001. * inMenu:
  12002. * The menu to return the target for.
  12003. *
  12004. * Result:
  12005. * An EventTargetRef.
  12006. *
  12007. * Availability:
  12008. * Mac OS X: in version 10.0 and later in Carbon.framework
  12009. * CarbonLib: in CarbonLib 1.1 and later
  12010. * Non-Carbon CFM: not available
  12011. }
  12012. function GetMenuEventTarget( inMenu: MenuRef ): EventTargetRef; external name '_GetMenuEventTarget';
  12013. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12014. {
  12015. * GetApplicationEventTarget()
  12016. *
  12017. * Discussion:
  12018. * Returns the EventTargetRef for the application. Once you obtain
  12019. * this reference, you can send events to the target and install
  12020. * event handler on it.
  12021. *
  12022. * Mac OS X threading:
  12023. * Not thread safe
  12024. *
  12025. * Result:
  12026. * An EventTargetRef.
  12027. *
  12028. * Availability:
  12029. * Mac OS X: in version 10.0 and later in Carbon.framework
  12030. * CarbonLib: in CarbonLib 1.1 and later
  12031. * Non-Carbon CFM: not available
  12032. }
  12033. function GetApplicationEventTarget: EventTargetRef; external name '_GetApplicationEventTarget';
  12034. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12035. {
  12036. * GetUserFocusEventTarget()
  12037. *
  12038. * Discussion:
  12039. * Returns the EventTargetRef for the current user focus at the time
  12040. * of the call. Keyboard events are always sent to this target.
  12041. * Events that are sent to this target are automatically propagated
  12042. * to the following other targets: first to the focused control in
  12043. * the focused window, then up the control hierarchy to the focused
  12044. * window itself, and then to the application target.
  12045. *
  12046. * Note that command key processing occurs before key events are
  12047. * sent to this target; to intercept key events before command key
  12048. * processing occurs, install a handler on the event dispatcher
  12049. * target instead of this target.
  12050. *
  12051. * Mac OS X threading:
  12052. * Not thread safe
  12053. *
  12054. * Result:
  12055. * An EventTargetRef.
  12056. *
  12057. * Availability:
  12058. * Mac OS X: in version 10.0 and later in Carbon.framework
  12059. * CarbonLib: in CarbonLib 1.1 and later
  12060. * Non-Carbon CFM: not available
  12061. }
  12062. function GetUserFocusEventTarget: EventTargetRef; external name '_GetUserFocusEventTarget';
  12063. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12064. {
  12065. * GetEventDispatcherTarget()
  12066. *
  12067. * Discussion:
  12068. * Returns the EventTargetRef for the standard toolbox dispatcher.
  12069. * You typically would never need to use this, but there are some
  12070. * exotic apps that need to pick events off the event queue and call
  12071. * the dispatcher themselves. This allows you to do just that
  12072. * instead of calling RunApplicationEventLoop to handle it all.
  12073. *
  12074. * Mac OS X threading:
  12075. * Not thread safe
  12076. *
  12077. * Result:
  12078. * An EventTargetRef.
  12079. *
  12080. * Availability:
  12081. * Mac OS X: in version 10.0 and later in Carbon.framework
  12082. * CarbonLib: in CarbonLib 1.3 and later
  12083. * Non-Carbon CFM: not available
  12084. }
  12085. function GetEventDispatcherTarget: EventTargetRef; external name '_GetEventDispatcherTarget';
  12086. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12087. {
  12088. * GetEventMonitorTarget()
  12089. *
  12090. * Summary:
  12091. * Returns the event monitor target.
  12092. *
  12093. * Discussion:
  12094. * The event monitor target is a special event target used to
  12095. * monitor user input events across all processes. When an event
  12096. * handler is installed on the event monitor target, the Carbon
  12097. * Event Manager examines the EventTypeSpec for user input event
  12098. * types, such as mouse-down, mouse-up, key-down, and so forth. It
  12099. * then requests that the WindowServer make copies of any of these
  12100. * events that are sent to any process, and deliver them to the
  12101. * current process also. These events are queued into the main
  12102. * threadÕs event queue, and during normal event dispatching are
  12103. * sent directly to the event handlers installed on the event
  12104. * monitor target. Monitored events are not sent through the normal
  12105. * event dispatching path for the current process; they will pass
  12106. * through the event dispatcher target, and will then be sent
  12107. * directly to the event monitor target.
  12108. *
  12109. * Handlers installed on the event monitor target will only receive
  12110. * events when the current application is inactive. When the current
  12111. * application is active, all event flow occurs through the event
  12112. * dispatcher target, and no events are sent to the event monitor
  12113. * target.
  12114. *
  12115. * Currently, the event monitor supports the following event kinds:
  12116. * kEventRawKeyDown, kEventRawKeyUp, kEventRawKeyRepeat,
  12117. * kEventRawKeyModifiersChanged, kEventMouseDown, kEventMouseUp,
  12118. * kEventMouseMoved, kEventMouseDragged, kEventMouseWheelMoved,
  12119. * kEventTabletPoint, and kEventTabletProximity.
  12120. *
  12121. * Note that both Carbon and Cocoa password edit text controls
  12122. * enable a secure input mode while the focus is on the control,
  12123. * which prevents keyboard events from being passed to other
  12124. * applications. This prevents the monitoring event target from
  12125. * being used to sniff password keystrokes.
  12126. *
  12127. * For added security, GetEventMonitorTarget requires that "Enable
  12128. * access for assistive devices" be checked in the Universal Access
  12129. * preference pane in order to monitor RawKeyDown, RawKeyUp, and
  12130. * RawKeyRepeat events. If this control is not checked, you can
  12131. * still install handlers for these events on the event monitor
  12132. * target, but no events of these types will be sent to your
  12133. * handler. Administrator privileges are required to enable this
  12134. * feature. You can determine whether this control is checked using
  12135. * the AXAPIEnabled API in AXUIElement.h.
  12136. *
  12137. * Mac OS X threading:
  12138. * Not thread safe
  12139. *
  12140. * Result:
  12141. * An EventTargetRef.
  12142. *
  12143. * Availability:
  12144. * Mac OS X: in version 10.3 and later in Carbon.framework
  12145. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  12146. * Non-Carbon CFM: not available
  12147. }
  12148. function GetEventMonitorTarget: EventTargetRef; external name '_GetEventMonitorTarget';
  12149. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  12150. (*
  12151. #define InstallApplicationEventHandler( handler, numTypes, list, userData, outHandlerRef ) \
  12152. InstallEventHandler( GetApplicationEventTarget(), (handler), (numTypes), (list), (userData), (outHandlerRef) )
  12153. #define InstallHIObjectEventHandler( target, handler, numTypes, list, userData, outHandlerRef ) \
  12154. InstallEventHandler( HIObjectGetEventTarget( target ), (handler), (numTypes), (list), (userData), (outHandlerRef) )
  12155. #define InstallWindowEventHandler( target, handler, numTypes, list, userData, outHandlerRef ) \
  12156. InstallEventHandler( GetWindowEventTarget( target ), (handler), (numTypes), (list), (userData), (outHandlerRef) )
  12157. #define InstallControlEventHandler( target, handler, numTypes, list, userData, outHandlerRef ) \
  12158. InstallEventHandler( GetControlEventTarget( target ), (handler), (numTypes), (list), (userData), (outHandlerRef) )
  12159. #define InstallMenuEventHandler( target, handler, numTypes, list, userData, outHandlerRef ) \
  12160. InstallEventHandler( GetMenuEventTarget( target ), (handler), (numTypes), (list), (userData), (outHandlerRef) )
  12161. #define HIViewInstallEventHandler( target, handler, numTypes, list, userData, outHandlerRef ) \
  12162. InstallEventHandler( HIObjectGetEventTarget( (HIObjectRef) (target) ), (handler), (numTypes), (list), (userData), (outHandlerRef) )
  12163. {
  12164. You can use the following macro in your code to allow you to set up an
  12165. event handler lazily. You pass the name of your event handler in. You should
  12166. use this with caution on Mac OS 9 systems since it could cause heap fragmentation.
  12167. }
  12168. #define DEFINE_ONE_SHOT_HANDLER_GETTER( x ) \
  12169. EventHandlerUPP Get ## x ## UPP() \
  12170. { \
  12171. static EventHandlerUPP sHandler = NULL; \
  12172. \
  12173. if ( sHandler == NULL ) \
  12174. sHandler = NewEventHandlerUPP( x ); \
  12175. \
  12176. return sHandler; \
  12177. }
  12178. #define SendEventToApplication( e ) \
  12179. SendEventToEventTarget( (e), GetApplicationEventTarget() )
  12180. #define SendEventToHIObject( e, t ) \
  12181. SendEventToEventTarget( (e), HIObjectGetEventTarget( t ) )
  12182. #define SendEventToWindow( e, t ) \
  12183. SendEventToEventTarget( (e), GetWindowEventTarget( t ) )
  12184. #define SendEventToControl( e, t ) \
  12185. SendEventToEventTarget( (e), GetControlEventTarget( t ) )
  12186. #define SendEventToMenu( e, t ) \
  12187. SendEventToEventTarget( (e), GetMenuEventTarget( t ) )
  12188. #define SendEventToUserFocus( e ) \
  12189. SendEventToEventTarget( (e), GetUserFocusEventTarget() )
  12190. *)
  12191. {======================================================================================}
  12192. { ¥ Command Routines }
  12193. {======================================================================================}
  12194. {
  12195. * ProcessHICommand()
  12196. *
  12197. * Summary:
  12198. * Sends a kEventCommandProcess event.
  12199. *
  12200. * Discussion:
  12201. * ProcessHICommand is a convenience function for dispatching
  12202. * kEventCommandProcesss events. Normally these events are created
  12203. * and dispatched automatically by the toolbox when a menu item or
  12204. * control is selected, but you may need to dispatch an event
  12205. * yourself at times. This API creates a CommandProcess event, adds
  12206. * the specified HICommand structure as an event parameter, and
  12207. * sends the event to the user focus target for handling.
  12208. *
  12209. * If you need to send a CommandProcess event to some other target,
  12210. * or you need to add other event parameters to the event besides
  12211. * the HICommand structure, it is correct and supported to simply
  12212. * create the event yourself and send it to the desired target,
  12213. * without using this API.
  12214. *
  12215. * Mac OS X threading:
  12216. * Not thread safe
  12217. *
  12218. * Availability:
  12219. * Mac OS X: in version 10.0 and later in Carbon.framework
  12220. * CarbonLib: in CarbonLib 1.1 and later
  12221. * Non-Carbon CFM: not available
  12222. }
  12223. function ProcessHICommand( const (*var*) inCommand: HICommand ): OSStatus; external name '_ProcessHICommand';
  12224. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12225. {--------------------------------------------------------------------------------------}
  12226. { ¥ Event Loop Routines }
  12227. {--------------------------------------------------------------------------------------}
  12228. {
  12229. * RunApplicationEventLoop()
  12230. *
  12231. * Discussion:
  12232. * This routine is used as the main event loop for a Carbon
  12233. * Event-based application. Once entered, this function waits for
  12234. * events to arrive and dispatches them to your event handlers
  12235. * automatically.
  12236. *
  12237. * Mac OS X threading:
  12238. * Not thread safe
  12239. *
  12240. * Availability:
  12241. * Mac OS X: in version 10.0 and later in Carbon.framework
  12242. * CarbonLib: in CarbonLib 1.1 and later
  12243. * Non-Carbon CFM: not available
  12244. }
  12245. procedure RunApplicationEventLoop; external name '_RunApplicationEventLoop';
  12246. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12247. {
  12248. * QuitApplicationEventLoop()
  12249. *
  12250. * Discussion:
  12251. * This routine is used to quit the RunApplicationEventLoop
  12252. * function. Typically, your application doesn't need to call this.
  12253. * If your application has the Quit menu item tagged with the
  12254. * kHICommandQuit Menu Command ID, the toolbox will automatically
  12255. * call this for your application, automatically terminating your
  12256. * event loop. If your application wants to do pre-processing before
  12257. * the event loop exits, it should intercept either the
  12258. * kHICommandQuit menu command, or the kEventApplicationQuit event.
  12259. *
  12260. * Mac OS X threading:
  12261. * Not thread safe
  12262. *
  12263. * Availability:
  12264. * Mac OS X: in version 10.0 and later in Carbon.framework
  12265. * CarbonLib: in CarbonLib 1.1 and later
  12266. * Non-Carbon CFM: not available
  12267. }
  12268. procedure QuitApplicationEventLoop; external name '_QuitApplicationEventLoop';
  12269. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12270. {--------------------------------------------------------------------------------------}
  12271. { ¥ Event Modality routines }
  12272. {--------------------------------------------------------------------------------------}
  12273. {
  12274. * RunAppModalLoopForWindow()
  12275. *
  12276. * Discussion:
  12277. * This routine is used as a replacement to ModalDialog to drive a
  12278. * Carbon Event-based modal dialog. Once called, this routine will
  12279. * not exit until QuitAppModalLoopForWindow is called. Calls to
  12280. * RunAppModalLoopForWindow can be nested, as long as each call is
  12281. * made on a different window. The window must be visible when
  12282. * calling RunAppModalLoopForWindow; otherwise, windowWrongStateErr
  12283. * is returned. In Mac OS X 10.0.x, RunAppModalLoopForWindow will
  12284. * fail to re-enable the menubar before exiting if you dispose of
  12285. * the window during the modal loop (for example, from a Carbon
  12286. * event handler). You can work around this bug by retaining the
  12287. * window before calling RunAppModalLoopForWindow, and releasing it
  12288. * afterwards.
  12289. *
  12290. * Mac OS X threading:
  12291. * Not thread safe
  12292. *
  12293. * Parameters:
  12294. *
  12295. * inWindow:
  12296. * The window you wish to behave modally.
  12297. *
  12298. * Result:
  12299. * An operating system status code. windowWrongStateErr will be
  12300. * returned if the window is invisible.
  12301. *
  12302. * Availability:
  12303. * Mac OS X: in version 10.0 and later in Carbon.framework
  12304. * CarbonLib: in CarbonLib 1.3 and later
  12305. * Non-Carbon CFM: not available
  12306. }
  12307. function RunAppModalLoopForWindow( inWindow: WindowRef ): OSStatus; external name '_RunAppModalLoopForWindow';
  12308. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12309. {
  12310. * QuitAppModalLoopForWindow()
  12311. *
  12312. * Discussion:
  12313. * This routine is used to quit a currently running call to
  12314. * RunAppModalLoopForWindow, i.e. it terminates a modal loop.
  12315. * Typically this would be called from a handler you have installed
  12316. * on the modal window in question when the user clicks the
  12317. * appropriate button, etc.
  12318. *
  12319. * Mac OS X threading:
  12320. * Not thread safe
  12321. *
  12322. * Parameters:
  12323. *
  12324. * inWindow:
  12325. * The window for which to quit the modal state.
  12326. *
  12327. * Result:
  12328. * An operating system status code.
  12329. *
  12330. * Availability:
  12331. * Mac OS X: in version 10.0 and later in Carbon.framework
  12332. * CarbonLib: in CarbonLib 1.3 and later
  12333. * Non-Carbon CFM: not available
  12334. }
  12335. function QuitAppModalLoopForWindow( inWindow: WindowRef ): OSStatus; external name '_QuitAppModalLoopForWindow';
  12336. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12337. {
  12338. * BeginAppModalStateForWindow()
  12339. *
  12340. * Discussion:
  12341. * This routine is a lower level routine than
  12342. * RunAppModalLoopForWindow. It can be used if you wish to enter an
  12343. * app modal state for a window, but need to control the event loop
  12344. * yourself for whatever reason. In most cases, you would use
  12345. * RunAppModalLoopForWindow. Once you begin your app modal state,
  12346. * the menu bar will disable and prepare for the modal situation.
  12347. * The window must be visible when calling
  12348. * BeginAppModalStateForWindow; otherwise, windowWrongStateErr is
  12349. * returned. Calls to BeginAppModalStateForWindow can be nested, as
  12350. * long as each call is made on a different window. In Mac OS 10.0.x
  12351. * and CarbonLib 1.3.1, BeginAppModalStateForWindow can only be
  12352. * called on a window once; future calls will return an error. This
  12353. * bug is fixed in Mac OS 10.1 and CarbonLib 1.4.
  12354. *
  12355. * Mac OS X threading:
  12356. * Not thread safe
  12357. *
  12358. * Parameters:
  12359. *
  12360. * inWindow:
  12361. * The window you wish to behave modally.
  12362. *
  12363. * Result:
  12364. * An operating system status code. windowWrongStateErr will be
  12365. * returned if the window is invisible.
  12366. *
  12367. * Availability:
  12368. * Mac OS X: in version 10.0 and later in Carbon.framework
  12369. * CarbonLib: in CarbonLib 1.3 and later
  12370. * Non-Carbon CFM: not available
  12371. }
  12372. function BeginAppModalStateForWindow( inWindow: WindowRef ): OSStatus; external name '_BeginAppModalStateForWindow';
  12373. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12374. {
  12375. * EndAppModalStateForWindow()
  12376. *
  12377. * Discussion:
  12378. * This routine ends an app modal state started with
  12379. * BeginAppModalStateForWindow.
  12380. *
  12381. * Mac OS X threading:
  12382. * Not thread safe
  12383. *
  12384. * Parameters:
  12385. *
  12386. * inWindow:
  12387. * The window you wish to stop acting as app modal.
  12388. *
  12389. * Result:
  12390. * An operating system status code.
  12391. *
  12392. * Availability:
  12393. * Mac OS X: in version 10.0 and later in Carbon.framework
  12394. * CarbonLib: in CarbonLib 1.3 and later
  12395. * Non-Carbon CFM: not available
  12396. }
  12397. function EndAppModalStateForWindow( inWindow: WindowRef ): OSStatus; external name '_EndAppModalStateForWindow';
  12398. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12399. {--------------------------------------------------------------------------------------}
  12400. { ¥ User Focus }
  12401. { The 'user focus' is where keyboard input goes. We also use the term 'key' applied }
  12402. { to windows to mean this. The user focus window is normally the active non-floating }
  12403. { window or dialog. It is possible to make a floater get the focus, however, by calling}
  12404. { SetUserFocusWindow. After that call, the event model will automatically route key }
  12405. { input to the active keyboard focus of that window, if any. Passing kUserFocusAuto }
  12406. { into the window parameter tells the toolbox to pick what it considers to be the best }
  12407. { candidate for focus. You should call this to restore focus, rather than getting the }
  12408. { focus, setting it to a special window, and then restoring to the saved focus. There }
  12409. { are cases, however, when you might want to restore to an explicit window, but the }
  12410. { typical usage should just be to restore to the kUserFocusAuto focus. }
  12411. { Keep in mind that setting the focus will only last until you restore focus, or the }
  12412. { user starts clicking in other windows. When that happens, the toolbox will auto- }
  12413. { redirect the user focus to a newly selected window. }
  12414. {--------------------------------------------------------------------------------------}
  12415. { pick the most appropriate window for focus}
  12416. const
  12417. kUserFocusAuto = WindowRef(-1);
  12418. {
  12419. * SetUserFocusWindow()
  12420. *
  12421. * Mac OS X threading:
  12422. * Not thread safe
  12423. *
  12424. * Availability:
  12425. * Mac OS X: in version 10.0 and later in Carbon.framework
  12426. * CarbonLib: in CarbonLib 1.1 and later
  12427. * Non-Carbon CFM: not available
  12428. }
  12429. function SetUserFocusWindow( inWindow: WindowRef ): OSStatus; external name '_SetUserFocusWindow';
  12430. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12431. {
  12432. * GetUserFocusWindow()
  12433. *
  12434. * Mac OS X threading:
  12435. * Not thread safe
  12436. *
  12437. * Availability:
  12438. * Mac OS X: in version 10.0 and later in Carbon.framework
  12439. * CarbonLib: in CarbonLib 1.1 and later
  12440. * Non-Carbon CFM: not available
  12441. }
  12442. function GetUserFocusWindow: WindowRef; external name '_GetUserFocusWindow';
  12443. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12444. {--------------------------------------------------------------------------------------}
  12445. { ¥ Default/Cancel buttons }
  12446. { In our quest to eliminate the need for dialogs when using the new event model, we }
  12447. { have added the following routines which add dialog-like button control to normal }
  12448. { windows. With these routines, you can set the default and cancel buttons for a }
  12449. { window; these work just like the corresponding concepts in dialogs, and when }
  12450. { present, the standard toolbox handlers will handle keyboard input mapping to these }
  12451. { buttons. This means that pressing return or enter will 'press' the default button }
  12452. { and escape or command-period will 'press' the cancel button. }
  12453. {--------------------------------------------------------------------------------------}
  12454. {
  12455. * SetWindowDefaultButton()
  12456. *
  12457. * Mac OS X threading:
  12458. * Not thread safe
  12459. *
  12460. * Availability:
  12461. * Mac OS X: in version 10.0 and later in Carbon.framework
  12462. * CarbonLib: in CarbonLib 1.1 and later
  12463. * Non-Carbon CFM: not available
  12464. }
  12465. function SetWindowDefaultButton( inWindow: WindowRef; inControl: ControlRef { can be NULL } ): OSStatus; external name '_SetWindowDefaultButton';
  12466. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12467. {
  12468. * SetWindowCancelButton()
  12469. *
  12470. * Mac OS X threading:
  12471. * Not thread safe
  12472. *
  12473. * Availability:
  12474. * Mac OS X: in version 10.0 and later in Carbon.framework
  12475. * CarbonLib: in CarbonLib 1.1 and later
  12476. * Non-Carbon CFM: not available
  12477. }
  12478. function SetWindowCancelButton( inWindow: WindowRef; inControl: ControlRef { can be NULL } ): OSStatus; external name '_SetWindowCancelButton';
  12479. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12480. {
  12481. * GetWindowDefaultButton()
  12482. *
  12483. * Mac OS X threading:
  12484. * Not thread safe
  12485. *
  12486. * Availability:
  12487. * Mac OS X: in version 10.0 and later in Carbon.framework
  12488. * CarbonLib: in CarbonLib 1.1 and later
  12489. * Non-Carbon CFM: not available
  12490. }
  12491. function GetWindowDefaultButton( inWindow: WindowRef; var outControl: ControlRef ): OSStatus; external name '_GetWindowDefaultButton';
  12492. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12493. {
  12494. * GetWindowCancelButton()
  12495. *
  12496. * Mac OS X threading:
  12497. * Not thread safe
  12498. *
  12499. * Availability:
  12500. * Mac OS X: in version 10.0 and later in Carbon.framework
  12501. * CarbonLib: in CarbonLib 1.1 and later
  12502. * Non-Carbon CFM: not available
  12503. }
  12504. function GetWindowCancelButton( inWindow: WindowRef; var outControl: ControlRef ): OSStatus; external name '_GetWindowCancelButton';
  12505. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12506. {--------------------------------------------------------------------------------------}
  12507. { ¥ Global HotKey API }
  12508. {--------------------------------------------------------------------------------------}
  12509. type
  12510. EventHotKeyIDPtr = ^EventHotKeyID;
  12511. EventHotKeyID = record
  12512. signature: OSType;
  12513. id: UInt32;
  12514. end;
  12515. type
  12516. EventHotKeyRef = ^SInt32; { an opaque 32-bit type }
  12517. {
  12518. * RegisterEventHotKey()
  12519. *
  12520. * Discussion:
  12521. * Registers a global hot key based on the virtual key code and
  12522. * modifiers you pass in. Only one such combination can exist for
  12523. * the current application, i.e. multiple entities in the same
  12524. * application cannot register for the same hot key combination. The
  12525. * same hot key can, however, be registered by multiple
  12526. * applications. This means that multiple applications can
  12527. * potentially be notified when a particular hot key is requested.
  12528. * This might not necessarily be desirable, but it is how it works
  12529. * at present.
  12530. *
  12531. * Mac OS X threading:
  12532. * Not thread safe
  12533. *
  12534. * Parameters:
  12535. *
  12536. * inHotKeyCode:
  12537. * The virtual key code of the key to watch
  12538. *
  12539. * inHotKeyModifiers:
  12540. * The keyboard modifiers to look for. On Mac OS X 10.2 or
  12541. * earlier, this parameter must be non-zero, i.e. there must be a
  12542. * modifier specified. On Mac OS X 10.3 or later, you may pass
  12543. * zero.
  12544. *
  12545. * inHotKeyID:
  12546. * The application-specified hot key ID. You will receive this in
  12547. * the kEventHotKeyPressed event as the direct object parameter.
  12548. *
  12549. * inTarget:
  12550. * The target to notify when the hot key is pressed.
  12551. *
  12552. * inOptions:
  12553. * Currently unused. Pass 0 or face the consequences.
  12554. *
  12555. * outRef:
  12556. * The EventHotKeyRef that represents your new, shiny hot key. You
  12557. * need this if you later wish to unregister it.
  12558. *
  12559. * Result:
  12560. * An operating system status code.
  12561. *
  12562. * Availability:
  12563. * Mac OS X: in version 10.0 and later in Carbon.framework
  12564. * CarbonLib: in CarbonLib 1.3 and later
  12565. * Non-Carbon CFM: not available
  12566. }
  12567. function RegisterEventHotKey( inHotKeyCode: UInt32; inHotKeyModifiers: UInt32; inHotKeyID: EventHotKeyID; inTarget: EventTargetRef; inOptions: OptionBits; var outRef: EventHotKeyRef ): OSStatus; external name '_RegisterEventHotKey';
  12568. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12569. {
  12570. * UnregisterEventHotKey()
  12571. *
  12572. * Discussion:
  12573. * Unregisters a global hot key that was previously registered with
  12574. * the RegisterEventHotKey API. You do not need to unregister a hot
  12575. * key when your application terminates, the system will take care
  12576. * of that for you. This would be used if the user changes a hot key
  12577. * for something in your application - you would unregister the
  12578. * previous key and register your new key.
  12579. *
  12580. * Mac OS X threading:
  12581. * Not thread safe
  12582. *
  12583. * Parameters:
  12584. *
  12585. * inHotKey:
  12586. * The EventHotKeyRef to unregister.
  12587. *
  12588. * Result:
  12589. * An operating system status code.
  12590. *
  12591. * Availability:
  12592. * Mac OS X: in version 10.0 and later in Carbon.framework
  12593. * CarbonLib: in CarbonLib 1.3 and later
  12594. * Non-Carbon CFM: not available
  12595. }
  12596. function UnregisterEventHotKey( inHotKey: EventHotKeyRef ): OSStatus; external name '_UnregisterEventHotKey';
  12597. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  12598. {
  12599. * kHISymbolicHotKeyCode
  12600. *
  12601. * Discussion:
  12602. * A CFDictionaryRef key in a dictionary returned by
  12603. * CopySymbolicHotKeys. The value for this key is the virtual
  12604. * keycode of the hotkey, represented as a CFNumber.
  12605. }
  12606. {$ifc USE_CFSTR_CONSTANT_MACROS}
  12607. {$definec kHISymbolicHotKeyCode CFSTRP('kHISymbolicHotKeyCode')}
  12608. {$endc}
  12609. {
  12610. * kHISymbolicHotKeyModifiers
  12611. *
  12612. * Discussion:
  12613. * A CFDictionaryRef key in a dictionary returned by
  12614. * CopySymbolicHotKeys. The value for this key is the keyboard
  12615. * modifiers of the hotkey, represented as a CFNumber.
  12616. }
  12617. {$ifc USE_CFSTR_CONSTANT_MACROS}
  12618. {$definec kHISymbolicHotKeyModifiers CFSTRP('kHISymbolicHotKeyModifiers')}
  12619. {$endc}
  12620. {
  12621. * kHISymbolicHotKeyEnabled
  12622. *
  12623. * Discussion:
  12624. * A CFDictionaryRef key in a dictionary returned by
  12625. * CopySymbolicHotKeys. The value for this key is the enable state
  12626. * of the hotkey, represented as a CFBoolean.
  12627. }
  12628. {$ifc USE_CFSTR_CONSTANT_MACROS}
  12629. {$definec kHISymbolicHotKeyEnabled CFSTRP('kHISymbolicHotKeyEnabled')}
  12630. {$endc}
  12631. {
  12632. * CopySymbolicHotKeys()
  12633. *
  12634. * Summary:
  12635. * Returns an array of CFDictionaryRefs containing information about
  12636. * the system-wide symbolic hotkeys that are defined in the Keyboard
  12637. * preferences pane.
  12638. *
  12639. * Discussion:
  12640. * The hotkey info returned by this API describes the system-wide
  12641. * hotkeys such as the Screen Capture, Universal Access, and
  12642. * Keyboard Navigation keys. It does not include customized
  12643. * application-specific command keys.
  12644. *
  12645. * Each array entry is a CFDictionaryRef, and each dictionary
  12646. * contains information about a single hotkey. There is currently no
  12647. * way to determine which hotkey in the Keyboards preference pane
  12648. * corresponds to a specific dictionary. Each dictionary contains
  12649. * the following keys: kHISymbolicHotKeyCode,
  12650. * kHISymbolicHotKeyModifiers, and kHISymbolicHotKeyEnabled. The
  12651. * array must be released by the caller; the dictionaries do not
  12652. * need to be released (they will be auto-released when the array is
  12653. * released).
  12654. *
  12655. * Note that this API will require O(number of hotkeys) to run, and
  12656. * the number of hotkeys will increase in the future, so do not call
  12657. * this API unnecessarily or in highly performance-sensitive code.
  12658. *
  12659. * Mac OS X threading:
  12660. * Not thread safe
  12661. *
  12662. * Parameters:
  12663. *
  12664. * outHotKeyArray:
  12665. * On exit, contains an array of the values of all symbolic hot
  12666. * keys.
  12667. *
  12668. * Result:
  12669. * An operating system result code; currently, noErr and memFullErr
  12670. * may be returned.
  12671. *
  12672. * Availability:
  12673. * Mac OS X: in version 10.3 and later in Carbon.framework
  12674. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  12675. * Non-Carbon CFM: not available
  12676. }
  12677. function CopySymbolicHotKeys( var outHotKeyArray: CFArrayRef ): OSStatus; external name '_CopySymbolicHotKeys';
  12678. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  12679. {
  12680. * Summary:
  12681. * Parameters to the PushSymbolicHotKeyMode SPI.
  12682. }
  12683. const
  12684. {
  12685. * All hotkeys are enabled.
  12686. }
  12687. kHIHotKeyModeAllEnabled = 0;
  12688. {
  12689. * All hotkeys are disabled.
  12690. }
  12691. kHIHotKeyModeAllDisabled = 1 shl 0;
  12692. {
  12693. * All hotkeys are disabled except for the Universal Access hotkeys
  12694. * (zooming, white-on-black, and enhanced contrast).
  12695. }
  12696. kHIHotKeyModeAllDisabledExceptUniversalAccess = 1 shl 1;
  12697. {
  12698. * PushSymbolicHotKeyMode()
  12699. *
  12700. * Summary:
  12701. * Sets a new mode for enabling or disabling symbolic hotkeys.
  12702. *
  12703. * Discussion:
  12704. * The Event Manager keeps a stack of hotkey modes that have been
  12705. * requested using the PushSymbolicHotKeyMode API. The most recently
  12706. * pushed mode is the mode that is currently in use.
  12707. *
  12708. * Because disabling hotkeys can significantly affect the usability
  12709. * of Mac OS X, applications are only allowed to disable hotkeys if
  12710. * the "Enable access for assistive devices" checkbox is checked in
  12711. * the Universal Access preference pane. If this feature is not
  12712. * enabled, PushSymbolicHotKeyMode will still push the mode request
  12713. * onto the mode stack and return a valid token, but the actual
  12714. * hotkey mode will not change.
  12715. *
  12716. * If an application that pushes a new hotkey mode is frontmost,
  12717. * then the new mode (if it disables any hotkeys) will only be
  12718. * active while the application remains frontmost. If the
  12719. * application is deactivated or exits without reenabling hotkeys,
  12720. * the hotkey mode will automatically revert to the previous mode.
  12721. *
  12722. * Mac OS X threading:
  12723. * Not thread safe
  12724. *
  12725. * Parameters:
  12726. *
  12727. * inOptions:
  12728. * The symbolic hotkey mode that is requested.
  12729. *
  12730. * Result:
  12731. * A token that should be passed to PopSymbolicHotKeyMode to remove
  12732. * this mode request from the stack.
  12733. *
  12734. * Availability:
  12735. * Mac OS X: in version 10.4 and later in Carbon.framework
  12736. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  12737. * Non-Carbon CFM: not available
  12738. }
  12739. function PushSymbolicHotKeyMode( inOptions: OptionBits ): UnivPtr; external name '_PushSymbolicHotKeyMode';
  12740. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  12741. {
  12742. * PopSymbolicHotKeyMode()
  12743. *
  12744. * Summary:
  12745. * Removes a hotkey mode request from the hotkey mode stack.
  12746. *
  12747. * Discussion:
  12748. * This API removes a mode request from the mode stack. If this
  12749. * request was the topmost request in the stack, the actual hotkey
  12750. * mode will change to the next request in the stack; if there are
  12751. * other mode requests on top of this one on the stack, the actual
  12752. * mode will not change.
  12753. *
  12754. * Mac OS X threading:
  12755. * Not thread safe
  12756. *
  12757. * Parameters:
  12758. *
  12759. * inToken:
  12760. * A hotkey mode token that was returned by PushSymbolicHotKeyMode.
  12761. *
  12762. * Availability:
  12763. * Mac OS X: in version 10.4 and later in Carbon.framework
  12764. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  12765. * Non-Carbon CFM: not available
  12766. }
  12767. procedure PopSymbolicHotKeyMode( inToken: UnivPtr ); external name '_PopSymbolicHotKeyMode';
  12768. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  12769. {
  12770. * GetSymbolicHotKeyMode()
  12771. *
  12772. * Summary:
  12773. * Returns the current hotkey mode in use.
  12774. *
  12775. * Mac OS X threading:
  12776. * Not thread safe
  12777. *
  12778. * Result:
  12779. * The mode request at the top of the hotkey mode stack. If there
  12780. * are no requests on the stack, it returns zero, indicating that
  12781. * hotkeys are currently enabled.
  12782. *
  12783. * Note that even if hotkeys are enabled in the current process,
  12784. * hotkeys can still be disabled for the current user session if
  12785. * they are disabled by some other process.
  12786. *
  12787. * Note that if "Enable access for assistive devices" is not checked
  12788. * in the Universal Access preference pane, then even if this API
  12789. * returns a non-zero value, the actual hotkey mode will still be
  12790. * that all hotkeys are enabled.
  12791. *
  12792. * Availability:
  12793. * Mac OS X: in version 10.4 and later in Carbon.framework
  12794. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  12795. * Non-Carbon CFM: not available
  12796. }
  12797. function GetSymbolicHotKeyMode: OptionBits; external name '_GetSymbolicHotKeyMode';
  12798. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  12799. {--------------------------------------------------------------------------------------}
  12800. { Ink Events }
  12801. {--------------------------------------------------------------------------------------}
  12802. const
  12803. kEventParamInkTextRef = $69777264 (* 'iwrd' *); { typePtr }
  12804. kEventParamInkKeyboardShortcut = $696B6264 (* 'ikbd' *); { typeBoolean }
  12805. kEventParamInkGestureKind = $676B6E64 (* 'gknd' *); { typeUInt32 }
  12806. kEventParamInkGestureBounds = $67626E64 (* 'gbnd' *); { typeHIRect }
  12807. kEventParamInkGestureHotspot = $67686F74 (* 'ghot' *); { typeHIPoint }
  12808. {
  12809. * kEventClassInk / kEventInkPoint
  12810. *
  12811. * Summary:
  12812. * A mouse event will be handled as an Ink point and used for
  12813. * recognition.
  12814. *
  12815. * Discussion:
  12816. * The Ink manager has determined that the mouse event in
  12817. * kEventParamEventRef should be used for recognition. If the
  12818. * application handles the event and returns noErr, then the Ink
  12819. * Manager does nothing further with the mouse event. If the
  12820. * application returns any other value (including
  12821. * eventNotHandledErr), the point will be processed normally by the
  12822. * Ink Manager.
  12823. *
  12824. * Mac OS X threading:
  12825. * Not thread safe
  12826. *
  12827. * Parameters:
  12828. *
  12829. * --> kEventParamEventRef (in, typeEventRef)
  12830. * The mouse event being handled.
  12831. *
  12832. * Availability:
  12833. * Mac OS X: in version 10.3 and later in Carbon.framework
  12834. * CarbonLib: not available
  12835. }
  12836. const
  12837. kEventInkPoint = 10;
  12838. {
  12839. * kEventClassInk / kEventInkGesture
  12840. *
  12841. * Summary:
  12842. * An Ink gesture has been generated.
  12843. *
  12844. * Discussion:
  12845. * This Ink event is sent when the Ink Manager has recognized the
  12846. * current ink phrase as one of the known system gestures.
  12847. * Applications can install a handler for these events, to provide
  12848. * targeted gestures and support for context-dependent (tentative)
  12849. * gestures. Applications should return noErr if they handled the
  12850. * gesture. If the gesture was context-dependent and does not apply
  12851. * to the current situation, then return eventNotHandledErr.
  12852. *
  12853. * Mac OS X threading:
  12854. * Not thread safe
  12855. *
  12856. * Parameters:
  12857. *
  12858. * --> kEventParamInkGestureKind (in, typeUInt32)
  12859. * Kind of gesture.
  12860. *
  12861. * --> kEventParamInkGestureBounds (in, typeHIRect)
  12862. * Bounds of the gesture in global coordinates.
  12863. *
  12864. * --> kEventParamInkGestureHotspot (in, typeHIPoint)
  12865. * Hotspot for the gesture in global coordinates.
  12866. *
  12867. * Availability:
  12868. * Mac OS X: in version 10.3 and later in Carbon.framework
  12869. * CarbonLib: not available
  12870. }
  12871. const
  12872. kEventInkGesture = 11;
  12873. {
  12874. * kEventClassInk / kEventInkText
  12875. *
  12876. * Summary:
  12877. * A recognized word from the Ink Manager.
  12878. *
  12879. * Discussion:
  12880. * The Ink Manager has recognized a word. kEventParamInkTextRef
  12881. * contains the InkTextRef with all of the information about the
  12882. * word. See Ink.h for more information.
  12883. *
  12884. * Mac OS X threading:
  12885. * Not thread safe
  12886. *
  12887. * Parameters:
  12888. *
  12889. * --> kEventParamInkTextRef (in, typePtr)
  12890. * The InkTextRef containing the data for the recognized word.
  12891. *
  12892. * --> kEventParamInkKeyboardShortcut (in, typeBoolean)
  12893. * Is this likely a keyboard shortcut? (Command or Control key
  12894. * is held down and the top-choice alternate text is a single
  12895. * character.)
  12896. *
  12897. * Availability:
  12898. * Mac OS X: in version 10.3 and later in Carbon.framework
  12899. * CarbonLib: not available
  12900. }
  12901. const
  12902. kEventInkText = 12;
  12903. {--------------------------------------------------------------------------------------}
  12904. { ¥ DEPRECATED }
  12905. { All functions below this point are either deprecated (they continue to function }
  12906. { but are not the most modern nor most efficient solution to a problem), or they are }
  12907. { completely unavailable on Mac OS X. }
  12908. {--------------------------------------------------------------------------------------}
  12909. {--------------------------------------------------------------------------------------}
  12910. { ¥ MouseTrackingRegions }
  12911. {--------------------------------------------------------------------------------------}
  12912. {
  12913. * MouseTrackingRef
  12914. *
  12915. * Discussion:
  12916. * MouseTrackingRef *** DEPRECATED ***
  12917. *
  12918. * Deprecated:
  12919. * Applications should use HIViewTrackingAreas, described in
  12920. * HIView.h, instead of MouseTrackingRegions and their associated
  12921. * settings.
  12922. *
  12923. * A MouseTrackingRef is an object that controls the generation of
  12924. * mouse-enter and mouse-exit events. When the user moves the mouse
  12925. * into a tracking region, a kEventClassMouse/kEventMouseEntered
  12926. * event is sent to the app. When the user moves the mouse out of a
  12927. * tracking region, an event of type
  12928. * kEventClassMouse/kEventMouseExited is sent.
  12929. *
  12930. * Mouse tracking regions are uniquely identified within the scope
  12931. * of a window by a MouseTrackingRegionID which is a client
  12932. * signature/id pair. The client signature should be any unique
  12933. * four-character constant that does not have entirely lowercase
  12934. * characters; a good choice is the usual DTS-registered creator
  12935. * OSType, but you can use any constant that you like.
  12936. *
  12937. * Mouse tracking regions can overlap, but are not exclusive. Mouse
  12938. * motion events are generated for each of the tracking areas
  12939. * intersected by the mouse.
  12940. *
  12941. * Mouse tracking regions are initially enabled. You can explicitly
  12942. * disable a mouse tracking area to prevent mouse-enter/exit events
  12943. * from being generated.
  12944. *
  12945. * Unlike global mouse-moved events, mouse-enter and mouse-exit
  12946. * events are generated while your app is in the background. If this
  12947. * is not considered desirable, disable the tracking areas while the
  12948. * application is in the background.
  12949. *
  12950. * MouseTrackingRefs become invalid when the window that they are
  12951. * bound to is disposed.
  12952. }
  12953. type
  12954. MouseTrackingRef = ^SInt32; { an opaque 32-bit type }
  12955. {
  12956. * MouseTrackingOptions
  12957. *
  12958. * Discussion:
  12959. * MouseTrackingOptions *** DEPRECATED ***
  12960. *
  12961. * Deprecated:
  12962. * Applications should use HIViewTrackingAreas, described in
  12963. * HIView.h, instead of MouseTrackingRegions and their associated
  12964. * settings.
  12965. *
  12966. * These values define how the userÕs region is handled by the Mouse
  12967. * Tracking Region API. They define the behavior throughout the life
  12968. * of the Mouse Tracking Region. For example, if a region is created
  12969. * with the option of kMouseTrackingOptionsGlobalClip then all
  12970. * operations on this region will be interpreted in global
  12971. * coordinates and will be clipped to the owning windowÕs structure.
  12972. }
  12973. type
  12974. MouseTrackingOptions = UInt32;
  12975. const
  12976. {
  12977. * The region is expected in local coordinates and mouse movement
  12978. * tracking is clipped to the owning windowÕs content region.
  12979. }
  12980. kMouseTrackingOptionsLocalClip = 0;
  12981. {
  12982. * The region is expected in global coordinates and mouse movement
  12983. * tracking is clipped to the owning windowÕs structure region.
  12984. }
  12985. kMouseTrackingOptionsGlobalClip = 1;
  12986. {
  12987. * Standard options. The region will be handled in local coordinates
  12988. * and remain clipped against the windows content region.
  12989. }
  12990. kMouseTrackingOptionsStandard = kMouseTrackingOptionsLocalClip;
  12991. type
  12992. MouseTrackingRegionID = record
  12993. signature: OSType;
  12994. id: SInt32;
  12995. end;
  12996. { Creation}
  12997. {
  12998. * CreateMouseTrackingRegion() *** DEPRECATED ***
  12999. *
  13000. * Deprecated:
  13001. * Use HIView-based tracking areas instead of MouseTrackingRegions.
  13002. * In this case, use HIViewNewTrackingArea(), defined in HIView.h,
  13003. * instead of CreateMouseTrackingRegion().
  13004. *
  13005. * Discussion:
  13006. * Creates a mouse tracking region and installs it into the window
  13007. * system.
  13008. *
  13009. * Mac OS X threading:
  13010. * Not thread safe
  13011. *
  13012. * Parameters:
  13013. *
  13014. * inWindow:
  13015. * The window that will contain the created region.
  13016. *
  13017. * inRegion:
  13018. * The region for which you will receive entered/exit events.
  13019. *
  13020. * inClip:
  13021. * A region to clip inRegion against (can be NULL).
  13022. *
  13023. * inOptions:
  13024. * The options which define whether inRegion is given in global or
  13025. * local coordinates. If local coordinates are used, inRegion will
  13026. * be clipped against the window's current content region; if
  13027. * global coordinates are used, inRegion will be clipped against
  13028. * the window's current structure region. All clipping occurs
  13029. * against the regions as they are at the moment when the tracking
  13030. * region is created; changes to the window content or structure
  13031. * regions after the tracking region is created will not affect
  13032. * the tracking region.
  13033. *
  13034. * inID:
  13035. * The signature/id pair which uniquely defines this region. Note
  13036. * that if you are creating both LocalClip and GlobalClip tracking
  13037. * regions for a given window, the global regions must use a
  13038. * different inID.signature value from the local regions.
  13039. *
  13040. * inRefCon:
  13041. * Any user defined value. This value can be retrieved later by
  13042. * calling GetMouseTrackingRegionRefCon on the MouseTrackingRef.
  13043. *
  13044. * inTargetToNotify:
  13045. * The event target that should receive kEventMouseEntered/Exited
  13046. * events for this tracking region. If NULL, the windowÕs event
  13047. * target receives these events.
  13048. *
  13049. * outTrackingRef:
  13050. * A reference to the newly created mouse tracking region. This
  13051. * reference will also be provided in the
  13052. * kEventMouseEntered/Exited events sent to your event target.
  13053. *
  13054. * Result:
  13055. * An operating system status code.
  13056. *
  13057. * Availability:
  13058. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13059. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13060. * Non-Carbon CFM: not available
  13061. }
  13062. function CreateMouseTrackingRegion( inWindow: WindowRef; inRegion: RgnHandle; inClip: RgnHandle { can be NULL }; inOptions: MouseTrackingOptions; inID: MouseTrackingRegionID; inRefCon: UnivPtr; inTargetToNotify: EventTargetRef { can be NULL }; var outTrackingRef: MouseTrackingRef ): OSStatus; external name '_CreateMouseTrackingRegion';
  13063. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13064. {
  13065. * RetainMouseTrackingRegion() *** DEPRECATED ***
  13066. *
  13067. * Deprecated:
  13068. * Use HIView-based tracking areas, described in HIView.h, instead
  13069. * of MouseTrackingRegions.
  13070. *
  13071. * Discussion:
  13072. * Retains the MouseTrackingRef.
  13073. *
  13074. * Mac OS X threading:
  13075. * Not thread safe
  13076. *
  13077. * Parameters:
  13078. *
  13079. * inMouseRef:
  13080. * A valid MouseTrackingRef to retain.
  13081. *
  13082. * Result:
  13083. * An operating system status code.
  13084. *
  13085. * Availability:
  13086. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13087. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13088. * Non-Carbon CFM: not available
  13089. }
  13090. function RetainMouseTrackingRegion( inMouseRef: MouseTrackingRef ): OSStatus; external name '_RetainMouseTrackingRegion';
  13091. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13092. {
  13093. * ReleaseMouseTrackingRegion() *** DEPRECATED ***
  13094. *
  13095. * Deprecated:
  13096. * Use HIView-based tracking areas instead of MouseTrackingRegions.
  13097. * In this case, use HIViewDisposeTrackingArea(), defined in
  13098. * HIView.h, instead of ReleaseMouseTrackingRegion().
  13099. *
  13100. * Discussion:
  13101. * Releases the MouseTrackingRef. Since mouse tracking regions are
  13102. * bound to a window, they are automatically released when the
  13103. * window is disposed of.
  13104. *
  13105. * Mac OS X threading:
  13106. * Not thread safe
  13107. *
  13108. * Parameters:
  13109. *
  13110. * inMouseRef:
  13111. * A valid MouseTrackingRef to release.
  13112. *
  13113. * Result:
  13114. * An operating system status code.
  13115. *
  13116. * Availability:
  13117. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13118. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13119. * Non-Carbon CFM: not available
  13120. }
  13121. function ReleaseMouseTrackingRegion( inMouseRef: MouseTrackingRef ): OSStatus; external name '_ReleaseMouseTrackingRegion';
  13122. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13123. {
  13124. * ChangeMouseTrackingRegion() *** DEPRECATED ***
  13125. *
  13126. * Deprecated:
  13127. * Use HIView-based tracking areas instead of MouseTrackingRegions.
  13128. * In this case, use HIViewChangeTrackingArea(), defined in
  13129. * HIView.h, instead of ChangeMouseTrackingRegion().
  13130. *
  13131. * Discussion:
  13132. * Changes the MouseTrackingRefs region and optionally, its clip.
  13133. * This will not change the enabled state or options of the region.
  13134. *
  13135. * Mac OS X threading:
  13136. * Not thread safe
  13137. *
  13138. * Parameters:
  13139. *
  13140. * inMouseRef:
  13141. * A valid MouseTrackingRef to modify.
  13142. *
  13143. * inRegion:
  13144. * The region to set as the mouse tracking region.
  13145. *
  13146. * inClip:
  13147. * An optional clip to clip inRegion against (may be NULL).
  13148. *
  13149. * Result:
  13150. * An operating system status code.
  13151. *
  13152. * Availability:
  13153. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13154. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13155. * Non-Carbon CFM: not available
  13156. }
  13157. function ChangeMouseTrackingRegion( inMouseRef: MouseTrackingRef; inRegion: RgnHandle; inClip: RgnHandle { can be NULL } ): OSStatus; external name '_ChangeMouseTrackingRegion';
  13158. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13159. {
  13160. * ClipMouseTrackingRegion() *** DEPRECATED ***
  13161. *
  13162. * Deprecated:
  13163. * Use HIView-based tracking areas, described in HIView.h, instead
  13164. * of MouseTrackingRegions.
  13165. *
  13166. * Discussion:
  13167. * Adjust the region to clip the MouseTrackingRef against. This can
  13168. * be used in the case where a window is resized or when a
  13169. * previously obscured region becomes exposed.
  13170. *
  13171. * Mac OS X threading:
  13172. * Not thread safe
  13173. *
  13174. * Parameters:
  13175. *
  13176. * inMouseRef:
  13177. * A valid MouseTrackingRef to adjust.
  13178. *
  13179. * inRegion:
  13180. * A new region to clip inMouseRef against (can be NULL). If NULL,
  13181. * standard clipping will be provided.
  13182. *
  13183. * Result:
  13184. * An operating system status code.
  13185. *
  13186. * Availability:
  13187. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13188. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13189. * Non-Carbon CFM: not available
  13190. }
  13191. function ClipMouseTrackingRegion( inMouseRef: MouseTrackingRef; inRegion: RgnHandle ): OSStatus; external name '_ClipMouseTrackingRegion';
  13192. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13193. { Accessors}
  13194. {
  13195. * GetMouseTrackingRegionID() *** DEPRECATED ***
  13196. *
  13197. * Deprecated:
  13198. * Use HIView-based tracking areas instead of MouseTrackingRegions.
  13199. * In this case, use HIViewGetTrackingAreaID(), defined in HIView.h,
  13200. * instead of GetMouseTrackingRegionID().
  13201. *
  13202. * Discussion:
  13203. * Retrieves the MouseTrackingRegionID of the given
  13204. * MouseTrackingRef. Can be used to determine if the region belongs
  13205. * to your app, and if so, which region it is.
  13206. *
  13207. * Mac OS X threading:
  13208. * Not thread safe
  13209. *
  13210. * Parameters:
  13211. *
  13212. * inMouseRef:
  13213. * A valid MouseTrackingRef from which to obtain the
  13214. * MouseTrackingRegionID.
  13215. *
  13216. * outID:
  13217. * Receives the MouseTrackingRegionID.
  13218. *
  13219. * Result:
  13220. * An operating system status code.
  13221. *
  13222. * Availability:
  13223. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13224. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13225. * Non-Carbon CFM: not available
  13226. }
  13227. function GetMouseTrackingRegionID( inMouseRef: MouseTrackingRef; var outID: MouseTrackingRegionID ): OSStatus; external name '_GetMouseTrackingRegionID';
  13228. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13229. {
  13230. * GetMouseTrackingRegionRefCon() *** DEPRECATED ***
  13231. *
  13232. * Deprecated:
  13233. * Use HIView-based tracking areas, described in HIView.h, instead
  13234. * of MouseTrackingRegions.
  13235. *
  13236. * Discussion:
  13237. * Retrieves the RefCon from the given mouse tracking region.
  13238. *
  13239. * Mac OS X threading:
  13240. * Not thread safe
  13241. *
  13242. * Parameters:
  13243. *
  13244. * inMouseRef:
  13245. * A valid MouseTrackingRef from which to obtain the refcon.
  13246. *
  13247. * outRefCon:
  13248. * Receives the refcon that was provided to
  13249. * CreateMouseTrackingRegion.
  13250. *
  13251. * Result:
  13252. * An operating system status code.
  13253. *
  13254. * Availability:
  13255. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13256. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13257. * Non-Carbon CFM: not available
  13258. }
  13259. function GetMouseTrackingRegionRefCon( inMouseRef: MouseTrackingRef; var outRefCon: UnivPtr ): OSStatus; external name '_GetMouseTrackingRegionRefCon';
  13260. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13261. { Geometry}
  13262. {
  13263. * MoveMouseTrackingRegion() *** DEPRECATED ***
  13264. *
  13265. * Deprecated:
  13266. * Use HIView-based tracking areas, described in HIView.h, instead
  13267. * of MouseTrackingRegions.
  13268. *
  13269. * Discussion:
  13270. * Moves the given mouse tracking region by the specified delta. It
  13271. * can also optionally reclip the region, such as if the region is
  13272. * scrolled within a pane.
  13273. *
  13274. * Mac OS X threading:
  13275. * Not thread safe
  13276. *
  13277. * Parameters:
  13278. *
  13279. * inMouseRef:
  13280. * A valid MouseTrackingRef to move.
  13281. *
  13282. * deltaH:
  13283. * The horizontal delta to move the MouseTrackingRef.
  13284. *
  13285. * deltaV:
  13286. * The vertical delta to move the MouseTrackingRef.
  13287. *
  13288. * inClip:
  13289. * A region to optionally clip against (can be NULL).
  13290. *
  13291. * Result:
  13292. * An operating system status code.
  13293. *
  13294. * Availability:
  13295. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13296. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13297. * Non-Carbon CFM: not available
  13298. }
  13299. function MoveMouseTrackingRegion( inMouseRef: MouseTrackingRef; deltaH: SInt16; deltaV: SInt16; inClip: RgnHandle { can be NULL } ): OSStatus; external name '_MoveMouseTrackingRegion';
  13300. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13301. { Enable/disable}
  13302. {
  13303. * SetMouseTrackingRegionEnabled() *** DEPRECATED ***
  13304. *
  13305. * Deprecated:
  13306. * Use HIView-based tracking areas, described in HIView.h, instead
  13307. * of MouseTrackingRegions.
  13308. *
  13309. * Discussion:
  13310. * Set the enabled state of the mouse tracking region
  13311. *
  13312. * Mac OS X threading:
  13313. * Not thread safe
  13314. *
  13315. * Parameters:
  13316. *
  13317. * inMouseRef:
  13318. * A valid MouseTrackingRef to modify.
  13319. *
  13320. * inEnabled:
  13321. * Indicate whether this region should be enabled (true) or
  13322. * disabled (false).
  13323. *
  13324. * Result:
  13325. * An operating system status code.
  13326. *
  13327. * Availability:
  13328. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13329. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13330. * Non-Carbon CFM: not available
  13331. }
  13332. function SetMouseTrackingRegionEnabled( inMouseRef: MouseTrackingRef; inEnabled: Boolean ): OSStatus; external name '_SetMouseTrackingRegionEnabled';
  13333. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13334. {
  13335. Namespace operators
  13336. }
  13337. {
  13338. * ClipWindowMouseTrackingRegions() *** DEPRECATED ***
  13339. *
  13340. * Deprecated:
  13341. * Use HIView-based tracking areas, described in HIView.h, instead
  13342. * of MouseTrackingRegions.
  13343. *
  13344. * Discussion:
  13345. * Bulk clip operation to modify the region that all mouse tracking
  13346. * regions with the given signature will be clipped against.
  13347. *
  13348. * Mac OS X threading:
  13349. * Not thread safe
  13350. *
  13351. * Parameters:
  13352. *
  13353. * inWindow:
  13354. * The window that contains the regions with the given signature
  13355. * that you are interested in updating.
  13356. *
  13357. * inSignature:
  13358. * The signature of the mouse tracking regions that will be
  13359. * reclipped.
  13360. *
  13361. * inClip:
  13362. * The region to clip all of the regions against (can be NULL). If
  13363. * NULL, standard clipping will be provided.
  13364. *
  13365. * Result:
  13366. * An operating system status code.
  13367. *
  13368. * Availability:
  13369. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13370. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13371. * Non-Carbon CFM: not available
  13372. }
  13373. function ClipWindowMouseTrackingRegions( inWindow: WindowRef; inSignature: OSType; inClip: RgnHandle { can be NULL } ): OSStatus; external name '_ClipWindowMouseTrackingRegions';
  13374. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13375. {
  13376. * MoveWindowMouseTrackingRegions() *** DEPRECATED ***
  13377. *
  13378. * Deprecated:
  13379. * Use HIView-based tracking areas, described in HIView.h, instead
  13380. * of MouseTrackingRegions.
  13381. *
  13382. * Discussion:
  13383. * Bulk move operation to move all regions with the given signature
  13384. * the specified delta. An optional clip can be provided to reclip
  13385. * the regions against, such as in the case of the regions are being
  13386. * scrolled within a pane.
  13387. *
  13388. * Mac OS X threading:
  13389. * Not thread safe
  13390. *
  13391. * Parameters:
  13392. *
  13393. * inWindow:
  13394. * The window that contains the regions with the given signature
  13395. * that you are interested in moving.
  13396. *
  13397. * inSignature:
  13398. * The signature of the mouse tracking regions that will be moved.
  13399. *
  13400. * deltaH:
  13401. * The horizontal delta to move all of the regions.
  13402. *
  13403. * deltaV:
  13404. * The vertical delta to move all of the regions.
  13405. *
  13406. * inClip:
  13407. * An optional clipping region to clip against (can be NULL). If
  13408. * NULL, standard clipping will be provided.
  13409. *
  13410. * Result:
  13411. * An operating system status code.
  13412. *
  13413. * Availability:
  13414. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13415. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13416. * Non-Carbon CFM: not available
  13417. }
  13418. function MoveWindowMouseTrackingRegions( inWindow: WindowRef; inSignature: OSType; deltaH: SInt16; deltaV: SInt16; inClip: RgnHandle { can be NULL } ): OSStatus; external name '_MoveWindowMouseTrackingRegions';
  13419. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13420. {
  13421. * SetWindowMouseTrackingRegionsEnabled() *** DEPRECATED ***
  13422. *
  13423. * Deprecated:
  13424. * Use HIView-based tracking areas, described in HIView.h, instead
  13425. * of MouseTrackingRegions.
  13426. *
  13427. * Discussion:
  13428. * Bulk set the enabled state of the mouse tracking regions of the
  13429. * given signature belonging to the given window.
  13430. *
  13431. * Mac OS X threading:
  13432. * Not thread safe
  13433. *
  13434. * Parameters:
  13435. *
  13436. * inWindow:
  13437. * The window which contains the mouse tracking regions that you
  13438. * are interested in modifying.
  13439. *
  13440. * inSignature:
  13441. * The signature of the mouse tracking regions whose enabled state
  13442. * you wish to modify.
  13443. *
  13444. * inEnabled:
  13445. * Indicates whether the regions should be enabled (true) or
  13446. * disabled (false).
  13447. *
  13448. * Result:
  13449. * An operating system status code.
  13450. *
  13451. * Availability:
  13452. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13453. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13454. * Non-Carbon CFM: not available
  13455. }
  13456. function SetWindowMouseTrackingRegionsEnabled( inWindow: WindowRef; inSignature: OSType; inEnabled: Boolean ): OSStatus; external name '_SetWindowMouseTrackingRegionsEnabled';
  13457. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13458. {
  13459. * ReleaseWindowMouseTrackingRegions() *** DEPRECATED ***
  13460. *
  13461. * Deprecated:
  13462. * Use HIView-based tracking areas, described in HIView.h, instead
  13463. * of MouseTrackingRegions.
  13464. *
  13465. * Discussion:
  13466. * Bulk release the mouse tracking regions with the given signature.
  13467. *
  13468. * Mac OS X threading:
  13469. * Not thread safe
  13470. *
  13471. * Parameters:
  13472. *
  13473. * inWindow:
  13474. * The window to which the regions to be released belong.
  13475. *
  13476. * inSignature:
  13477. * The signature of the regions to be released.
  13478. *
  13479. * Result:
  13480. * An operating system status code.
  13481. *
  13482. * Availability:
  13483. * Mac OS X: in version 10.2 and later in Carbon.framework but deprecated in 10.4
  13484. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  13485. * Non-Carbon CFM: not available
  13486. }
  13487. function ReleaseWindowMouseTrackingRegions( inWindow: WindowRef; inSignature: OSType ): OSStatus; external name '_ReleaseWindowMouseTrackingRegions';
  13488. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  13489. {======================================================================================}
  13490. { EVENT-BASED OBJECT CLASSES }
  13491. { *** DEPRECATED *** }
  13492. { Here it is - the replacement for classic defprocs. This is also a convenient way }
  13493. { to create toolbox objects (windows, etc.) that have a specific behavior without }
  13494. { installing handlers on each instance of the object. With a toolbox object class, }
  13495. { you register your class, then use special creation routines to create objects of }
  13496. { that class. The event handlers are automatically installed and ready to go. }
  13497. { Note that on Mac OS X 10.2 and later, we recommend using the HIObject API }
  13498. { HIObjectRegisterSubclass rather than RegisterToolboxObjectClass. This API is }
  13499. { considered deprecated on Mac OS X 10.2 and later. }
  13500. {======================================================================================}
  13501. type
  13502. ToolboxObjectClassRef = ^SInt32; { an opaque 32-bit type }
  13503. {
  13504. * RegisterToolboxObjectClass()
  13505. *
  13506. * Mac OS X threading:
  13507. * Not thread safe
  13508. *
  13509. * Availability:
  13510. * Mac OS X: in version 10.0 and later in Carbon.framework
  13511. * CarbonLib: in CarbonLib 1.1 and later
  13512. * Non-Carbon CFM: not available
  13513. }
  13514. function RegisterToolboxObjectClass( inClassID: CFStringRef; inBaseClass: ToolboxObjectClassRef { can be NULL }; inNumEvents: UInt32; {const} inEventList: {variable-size-array} EventTypeSpecPtr; inEventHandler: EventHandlerUPP; inEventHandlerData: UnivPtr; var outClassRef: ToolboxObjectClassRef ): OSStatus; external name '_RegisterToolboxObjectClass';
  13515. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  13516. {
  13517. * UnregisterToolboxObjectClass()
  13518. *
  13519. * Mac OS X threading:
  13520. * Not thread safe
  13521. *
  13522. * Availability:
  13523. * Mac OS X: in version 10.0 and later in Carbon.framework
  13524. * CarbonLib: in CarbonLib 1.1 and later
  13525. * Non-Carbon CFM: not available
  13526. }
  13527. function UnregisterToolboxObjectClass( inClassRef: ToolboxObjectClassRef ): OSStatus; external name '_UnregisterToolboxObjectClass';
  13528. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  13529. {--------------------------------------------------------------------------------------}
  13530. { Obsolete constant names - use the new ones. }
  13531. {--------------------------------------------------------------------------------------}
  13532. const
  13533. kEventParamTabletPointerRec = $74627263 (* 'tbrc' *); { typeTabletPointerRec -- deprecated, for compatibility only}
  13534. typeTabletPointerRec = $74627263 (* 'tbrc' *); { kEventParamTabletPointerRec -- deprecated, for compatibility only}
  13535. const
  13536. kEventWindowDefDrawFrame = kEventWindowDrawFrame;
  13537. kEventWindowDefDrawPart = kEventWindowDrawPart;
  13538. kEventWindowDefGetRegion = kEventWindowGetRegion;
  13539. kEventWindowDefHitTest = kEventWindowHitTest;
  13540. kEventWindowDefInit = kEventWindowInit;
  13541. kEventWindowDefDispose = kEventWindowDispose;
  13542. kEventWindowDefDragHilite = kEventWindowDragHilite;
  13543. kEventWindowDefModified = kEventWindowModified;
  13544. kEventWindowDefSetupProxyDragImage = kEventWindowSetupProxyDragImage;
  13545. kEventWindowDefStateChanged = kEventWindowStateChanged;
  13546. kEventWindowDefMeasureTitle = kEventWindowMeasureTitle;
  13547. kEventWindowDefDrawGrowBox = kEventWindowDrawGrowBox;
  13548. kEventWindowDefGetGrowImageRegion = kEventWindowGetGrowImageRegion;
  13549. const
  13550. kEventClassEPPC = kEventClassAppleEvent;
  13551. kEventHighLevelEvent = kEventAppleEvent;
  13552. const
  13553. kEventUpdateActiveInputArea = kEventTextInputUpdateActiveInputArea;
  13554. kEventUnicodeForKeyEvent = kEventTextInputUnicodeForKeyEvent;
  13555. kEventOffsetToPos = kEventTextInputOffsetToPos;
  13556. kEventPosToOffset = kEventTextInputPosToOffset;
  13557. kEventShowHideBottomWindow = kEventTextInputShowHideBottomWindow;
  13558. kEventGetSelectedText = kEventTextInputGetSelectedText;
  13559. const
  13560. kEventProcessCommand = kEventCommandProcess;
  13561. kEventTabletPointer = kEventTabletPoint;
  13562. {--------------------------------------------------------------------------------------}
  13563. { Obsolete typedefs. }
  13564. {--------------------------------------------------------------------------------------}
  13565. type
  13566. EventClassID = UInt32;
  13567. type
  13568. EventClass = UInt32;
  13569. type
  13570. EventType = UInt32;
  13571. { OBSOLETE CONSTANTS}
  13572. const
  13573. kMouseTrackingMousePressed = kMouseTrackingMouseDown;
  13574. kMouseTrackingMouseReleased = kMouseTrackingMouseUp;
  13575. const
  13576. kEventControlGetSubviewForMouseEvent = kEventControlInterceptSubviewClick;
  13577. end.