|
Mac OS 9
|
Carbon Event Manager. More...
#include <Events.h>#include <Menus.h>#include <Controls.h>#include <MacWindows.h>#include <CFString.h>#include <AERegistry.h>#include <AEDataModel.h>Go to the source code of this file.
Data Structures | |
| struct | EventTypeSpec |
| struct | HIPoint |
| struct | HICommand |
| struct | TabletPointRec |
| struct | TabletProximityRec |
| struct | EventHotKeyID |
Macros | |
| #define | kEventDurationSecond ((EventTime)1.0) |
| #define | kEventDurationMillisecond ((EventTime)(kEventDurationSecond / 1000)) |
| #define | kEventDurationMicrosecond ((EventTime)(kEventDurationSecond / 1000000)) |
| #define | kEventDurationNanosecond ((EventTime)(kEventDurationSecond / 1000000000)) |
| #define | kEventDurationMinute ((EventTime)(kEventDurationSecond * 60)) |
| #define | kEventDurationHour ((EventTime)(kEventDurationMinute * 60)) |
| #define | kEventDurationDay ((EventTime)(kEventDurationHour * 24)) |
| #define | kEventDurationNoWait ((EventTime)0.0) |
| #define | kEventDurationForever ((EventTime)(-1.0)) |
| #define | TicksToEventTime(t) ((EventTime)((t) / 60.0)) |
| #define | EventTimeToTicks(t) ((UInt32)(((t) * 60) + 0.5)) |
| #define | GetEventTypeCount(t) (sizeof((t)) / sizeof(EventTypeSpec)) |
| #define | NewEventComparatorUPP(userRoutine) |
| #define | DisposeEventComparatorUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeEventComparatorUPP(inEvent, inCompareData, userUPP) |
| #define | NewEventComparatorProc(userRoutine) NewEventComparatorUPP(userRoutine) |
| #define | CallEventComparatorProc(userRoutine, inEvent, inCompareData) InvokeEventComparatorUPP(inEvent, inCompareData, userRoutine) |
| #define | NewEventLoopTimerUPP(userRoutine) |
| #define | DisposeEventLoopTimerUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeEventLoopTimerUPP(inTimer, inUserData, userUPP) |
| #define | NewEventLoopTimerProc(userRoutine) NewEventLoopTimerUPP(userRoutine) |
| #define | CallEventLoopTimerProc(userRoutine, inTimer, inUserData) InvokeEventLoopTimerUPP(inTimer, inUserData, userRoutine) |
| #define | NewEventHandlerUPP(userRoutine) |
| #define | DisposeEventHandlerUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeEventHandlerUPP(inHandlerCallRef, inEvent, inUserData, userUPP) |
| #define | NewEventHandlerProc(userRoutine) NewEventHandlerUPP(userRoutine) |
| #define | CallEventHandlerProc(userRoutine, inHandlerCallRef, inEvent, inUserData) InvokeEventHandlerUPP(inHandlerCallRef, inEvent, inUserData, userRoutine) |
| #define | InstallApplicationEventHandler(h, n, l, u, r) InstallEventHandler(GetApplicationEventTarget(), (h), (n), (l), (u), (r)) |
| #define | InstallWindowEventHandler(t, h, n, l, u, r) InstallEventHandler(GetWindowEventTarget(t), (h), (n), (l), (u), (r)) |
| #define | InstallControlEventHandler(t, h, n, l, u, r) InstallEventHandler(GetControlEventTarget(t), (h), (n), (l), (u), (r)) |
| #define | InstallMenuEventHandler(t, h, n, l, u, r) InstallEventHandler(GetMenuEventTarget(t), (h), (n), (l), (u), (r)) |
| #define | DEFINE_ONE_SHOT_HANDLER_GETTER(x) |
| #define | SendEventToApplication(e) SendEventToEventTarget((e), GetApplicationEventTarget()) |
| #define | SendEventToWindow(e, t) SendEventToEventTarget((e), GetWindowEventTarget(t)) |
| #define | SendEventToControl(e, t) SendEventToEventTarget((e), GetControlEventTarget(t)) |
| #define | SendEventToMenu(e, t) SendEventToEventTarget((e), GetMenuEventTarget(t)) |
| #define | SendEventToUserFocus(e) SendEventToEventTarget((e), GetUserFocusEventTarget()) |
Typedefs | |
| typedef SInt16 | EventPriority |
| typedef double | EventTime |
| typedef EventTime | EventTimeout |
| typedef EventTime | EventTimerInterval |
| typedef struct EventTypeSpec | EventTypeSpec |
| typedef UInt16 | MouseTrackingResult |
| typedef OSType | EventParamName |
| typedef OSType | EventParamType |
| typedef struct OpaqueEventLoopRef * | EventLoopRef |
| typedef UInt32 | EventAttributes |
| typedef struct OpaqueEventQueueRef * | EventQueueRef |
| typedef void * | inCompareData |
| typedef struct OpaqueEventLoopTimerRef * | EventLoopTimerRef |
| typedef void * | inUserData |
| typedef struct HIPoint | HIPoint |
| typedef UInt16 | EventMouseButton |
| typedef UInt16 | EventMouseWheelAxis |
| typedef struct HICommand | HICommand |
| typedef struct TabletPointRec | TabletPointRec |
| typedef TabletPointRec | TabletPointerRec |
| typedef struct TabletProximityRec | TabletProximityRec |
| typedef struct OpaqueEventHandlerRef * | EventHandlerRef |
| typedef struct OpaqueEventHandlerCallRef * | EventHandlerCallRef |
| typedef EventRef | inEvent |
| typedef struct OpaqueEventTargetRef * | EventTargetRef |
| typedef struct OpaqueToolboxObjectClassRef * | ToolboxObjectClassRef |
| typedef struct EventHotKeyID | EventHotKeyID |
| typedef struct OpaqueEventHotKeyRef * | EventHotKeyRef |
Enumerations | |
| enum | { eventAlreadyPostedErr = -9860 , eventTargetBusyErr = -9861 , eventClassInvalidErr = -9862 , eventClassIncorrectErr = -9864 , eventHandlerAlreadyInstalledErr = -9866 , eventInternalErr = -9868 , eventKindIncorrectErr = -9869 , eventParameterNotFoundErr = -9870 , eventNotHandledErr = -9874 , eventLoopTimedOutErr = -9875 , eventLoopQuitErr = -9876 , eventNotInQueueErr = -9877 , eventHotKeyExistsErr = -9878 , eventHotKeyInvalidErr = -9879 } |
| enum | { kEventPriorityLow = 0 , kEventPriorityStandard = 1 , kEventPriorityHigh = 2 } |
| enum | { kEventLeaveInQueue = false , kEventRemoveFromQueue = true } |
| enum | { kTrackMouseLocationOptionDontConsumeMouseUp = (1 << 0) } |
| enum | { kMouseTrackingMouseDown = 1 , kMouseTrackingMouseUp = 2 , kMouseTrackingMouseExited = 3 , kMouseTrackingMouseEntered = 4 , kMouseTrackingMouseDragged = 5 , kMouseTrackingKeyModifiersChanged = 6 , kMouseTrackingUserCancelled = 7 , kMouseTrackingTimedOut = 8 } |
| enum | { kEventAttributeNone = 0 , kEventAttributeUserEvent = (1 << 0) } |
| enum | { uppEventComparatorProcInfo = 0x000003D0 } |
| enum | { uppEventLoopTimerProcInfo = 0x000003C0 } |
| enum | { kEventClassMouse = FOUR_CHAR_CODE('mous') , kEventClassKeyboard = FOUR_CHAR_CODE('keyb') , kEventClassTextInput = FOUR_CHAR_CODE('text') , kEventClassApplication = FOUR_CHAR_CODE('appl') , kEventClassAppleEvent = FOUR_CHAR_CODE('eppc') , kEventClassMenu = FOUR_CHAR_CODE('menu') , kEventClassWindow = FOUR_CHAR_CODE('wind') , kEventClassControl = FOUR_CHAR_CODE('cntl') , kEventClassCommand = FOUR_CHAR_CODE('cmds') , kEventClassTablet = FOUR_CHAR_CODE('tblt') , kEventClassVolume = FOUR_CHAR_CODE('vol ') , kEventClassAppearance = FOUR_CHAR_CODE('appm') , kEventClassService = FOUR_CHAR_CODE('serv') } |
| enum | { kEventMouseDown = 1 , kEventMouseUp = 2 , kEventMouseMoved = 5 , kEventMouseDragged = 6 , kEventMouseWheelMoved = 10 } |
| enum | { kEventMouseButtonPrimary = 1 , kEventMouseButtonSecondary = 2 , kEventMouseButtonTertiary = 3 } |
| enum | { kEventMouseWheelAxisX = 0 , kEventMouseWheelAxisY = 1 } |
| enum | { kEventTextInputUpdateActiveInputArea = 1 , kEventTextInputUnicodeForKeyEvent = 2 , kEventTextInputOffsetToPos = 3 , kEventTextInputPosToOffset = 4 , kEventTextInputShowHideBottomWindow = 5 , kEventTextInputGetSelectedText = 6 } |
| enum | { kEventRawKeyDown = 1 , kEventRawKeyRepeat = 2 , kEventRawKeyUp = 3 , kEventRawKeyModifiersChanged = 4 , kEventHotKeyPressed = 5 , kEventHotKeyReleased = 6 } |
| enum | { kEventKeyModifierNumLockBit = 16 , kEventKeyModifierFnBit = 17 } |
| enum | { kEventKeyModifierNumLockMask = 1L << kEventKeyModifierNumLockBit , kEventKeyModifierFnMask = 1L << kEventKeyModifierFnBit } |
| enum | { kEventAppActivated = 1 , kEventAppDeactivated = 2 , kEventAppQuit = 3 , kEventAppLaunchNotification = 4 , kEventAppLaunched = 5 , kEventAppTerminated = 6 , kEventAppFrontSwitched = 7 , kEventAppGetDockTileMenu = 20 } |
| enum | { kEventAppleEvent = 1 } |
| enum | { kEventWindowUpdate = 1 , kEventWindowDrawContent = 2 } |
| enum | { kEventWindowActivated = 5 , kEventWindowDeactivated = 6 , kEventWindowGetClickActivation = 7 } |
| enum | { kEventWindowShowing = 22 , kEventWindowHiding = 23 , kEventWindowShown = 24 , kEventWindowHidden = 25 , kEventWindowBoundsChanging = 26 , kEventWindowBoundsChanged = 27 , kEventWindowResizeStarted = 28 , kEventWindowResizeCompleted = 29 , kEventWindowDragStarted = 30 , kEventWindowDragCompleted = 31 } |
| enum | { kWindowBoundsChangeUserDrag = (1 << 0) , kWindowBoundsChangeUserResize = (1 << 1) , kWindowBoundsChangeSizeChanged = (1 << 2) , kWindowBoundsChangeOriginChanged = (1 << 3) } |
| enum | { kEventWindowClickDragRgn = 32 , kEventWindowClickResizeRgn = 33 , kEventWindowClickCollapseRgn = 34 , kEventWindowClickCloseRgn = 35 , kEventWindowClickZoomRgn = 36 , kEventWindowClickContentRgn = 37 , kEventWindowClickProxyIconRgn = 38 , kEventWindowClickToolbarButtonRgn = 41 , kEventWindowClickStructureRgn = 42 } |
| enum | { kEventWindowCursorChange = 40 } |
| enum | { kEventWindowCollapse = 66 , kEventWindowCollapsed = 67 , kEventWindowCollapseAll = 68 , kEventWindowExpand = 69 , kEventWindowExpanded = 70 , kEventWindowExpandAll = 71 , kEventWindowClose = 72 , kEventWindowClosed = 73 , kEventWindowCloseAll = 74 , kEventWindowZoom = 75 , kEventWindowZoomed = 76 , kEventWindowZoomAll = 77 , kEventWindowContextualMenuSelect = 78 , kEventWindowPathSelect = 79 , kEventWindowGetIdealSize = 80 , kEventWindowGetMinimumSize = 81 , kEventWindowGetMaximumSize = 82 , kEventWindowConstrain = 83 , kEventWindowHandleContentClick = 85 , kEventWindowProxyBeginDrag = 128 , kEventWindowProxyEndDrag = 129 , kEventWindowToolbarSwitchMode = 150 } |
| enum | { kEventWindowFocusAcquired = 200 , kEventWindowFocusRelinquish = 201 } |
| enum | { kEventWindowDrawFrame = 1000 , kEventWindowDrawPart = 1001 , kEventWindowGetRegion = 1002 , kEventWindowHitTest = 1003 , kEventWindowInit = 1004 , kEventWindowDispose = 1005 , kEventWindowDragHilite = 1006 , kEventWindowModified = 1007 , kEventWindowSetupProxyDragImage = 1008 , kEventWindowStateChanged = 1009 , kEventWindowMeasureTitle = 1010 , kEventWindowDrawGrowBox = 1011 , kEventWindowGetGrowImageRegion = 1012 , kEventWindowPaint = 1013 } |
| enum | { kEventMenuBeginTracking = 1 , kEventMenuEndTracking = 2 , kEventMenuChangeTrackingMode = 3 , kEventMenuOpening = 4 , kEventMenuClosed = 5 , kEventMenuTargetItem = 6 , kEventMenuMatchKey = 7 , kEventMenuEnableItems = 8 , kEventMenuPopulate = 9 , kEventMenuMeasureItemWidth = 100 , kEventMenuMeasureItemHeight = 101 , kEventMenuDrawItem = 102 , kEventMenuDrawItemContent = 103 , kEventMenuDispose = 1001 } |
| enum | { kMenuContextMenuBar = 1 << 0 , kMenuContextPullDown = 1 << 8 , kMenuContextPopUp = 1 << 9 , kMenuContextSubmenu = 1 << 10 , kMenuContextMenuBarTracking = 1 << 16 , kMenuContextPopUpTracking = 1 << 17 , kMenuContextKeyMatching = 1 << 18 , kMenuContextMenuEnabling = 1 << 19 } |
| enum | { kEventProcessCommand = 1 , kEventCommandProcess = 1 , kEventCommandUpdateStatus = 2 } |
| enum | { kHICommandOK = FOUR_CHAR_CODE('ok ') , kHICommandCancel = FOUR_CHAR_CODE('not!') , kHICommandQuit = FOUR_CHAR_CODE('quit') , kHICommandUndo = FOUR_CHAR_CODE('undo') , kHICommandRedo = FOUR_CHAR_CODE('redo') , kHICommandCut = FOUR_CHAR_CODE('cut ') , kHICommandCopy = FOUR_CHAR_CODE('copy') , kHICommandPaste = FOUR_CHAR_CODE('past') , kHICommandClear = FOUR_CHAR_CODE('clea') , kHICommandSelectAll = FOUR_CHAR_CODE('sall') , kHICommandHide = FOUR_CHAR_CODE('hide') , kHICommandHideOthers = FOUR_CHAR_CODE('hido') , kHICommandShowAll = FOUR_CHAR_CODE('shal') , kHICommandPreferences = FOUR_CHAR_CODE('pref') , kHICommandZoomWindow = FOUR_CHAR_CODE('zoom') , kHICommandMinimizeWindow = FOUR_CHAR_CODE('mini') , kHICommandMinimizeAll = FOUR_CHAR_CODE('mina') , kHICommandMaximizeWindow = FOUR_CHAR_CODE('maxi') , kHICommandMaximizeAll = FOUR_CHAR_CODE('maxa') , kHICommandArrangeInFront = FOUR_CHAR_CODE('frnt') , kHICommandBringAllToFront = FOUR_CHAR_CODE('bfrt') , kHICommandWindowListSeparator = FOUR_CHAR_CODE('wldv') , kHICommandWindowListTerminator = FOUR_CHAR_CODE('wlst') , kHICommandSelectWindow = FOUR_CHAR_CODE('swin') , kHICommandAbout = FOUR_CHAR_CODE('abou') , kHICommandNew = FOUR_CHAR_CODE('new ') , kHICommandOpen = FOUR_CHAR_CODE('open') , kHICommandClose = FOUR_CHAR_CODE('clos') , kHICommandSave = FOUR_CHAR_CODE('save') , kHICommandSaveAs = FOUR_CHAR_CODE('svas') , kHICommandRevert = FOUR_CHAR_CODE('rvrt') , kHICommandPrint = FOUR_CHAR_CODE('prnt') , kHICommandPageSetup = FOUR_CHAR_CODE('page') , kHICommandAppHelp = FOUR_CHAR_CODE('ahlp') } |
| enum | { kHICommandFromMenu = (1L << 0) } |
| enum | { kEventControlInitialize = 1000 , kEventControlDispose = 1001 , kEventControlGetOptimalBounds = 1003 , kEventControlDefInitialize = kEventControlInitialize , kEventControlDefDispose = kEventControlDispose , kEventControlHit = 1 , kEventControlSimulateHit = 2 , kEventControlHitTest = 3 , kEventControlDraw = 4 , kEventControlApplyBackground = 5 , kEventControlApplyTextColor = 6 , kEventControlSetFocusPart = 7 , kEventControlGetFocusPart = 8 , kEventControlActivate = 9 , kEventControlDeactivate = 10 , kEventControlSetCursor = 11 , kEventControlContextualMenuClick = 12 , kEventControlClick = 13 , kEventControlTrack = 51 , kEventControlGetScrollToHereStartPoint = 52 , kEventControlGetIndicatorDragConstraint = 53 , kEventControlIndicatorMoved = 54 , kEventControlGhostingFinished = 55 , kEventControlGetActionProcPart = 56 , kEventControlGetPartRegion = 101 , kEventControlGetPartBounds = 102 , kEventControlSetData = 103 , kEventControlGetData = 104 , kEventControlValueFieldChanged = 151 , kEventControlAddedSubControl = 152 , kEventControlRemovingSubControl = 153 , kEventControlBoundsChanged = 154 , kEventControlOwningWindowChanged = 159 , kEventControlArbitraryMessage = 201 } |
| enum | { kControlBoundsChangeSizeChanged = (1 << 2) , kControlBoundsChangePositionChanged = (1 << 3) } |
| enum | { kEventTabletPoint = 1 , kEventTabletProximity = 2 , kEventTabletPointer } |
| enum | { kEventVolumeMounted = 1 , kEventVolumeUnmounted = 2 } |
| enum | { typeFSVolumeRefNum = FOUR_CHAR_CODE('voln') } |
| enum | { kEventAppearanceScrollBarVariantChanged = 1 } |
| enum | { kEventServiceCopy = 1 , kEventServicePaste = 2 , kEventServiceGetTypes = 3 , kEventServicePerform = 4 } |
| enum | { kEventParamDirectObject } |
| enum | { kEventParamWindowRef = FOUR_CHAR_CODE('wind') , kEventParamGrafPort = FOUR_CHAR_CODE('graf') , kEventParamDragRef = FOUR_CHAR_CODE('drag') , kEventParamMenuRef = FOUR_CHAR_CODE('menu') , kEventParamEventRef = FOUR_CHAR_CODE('evnt') , kEventParamControlRef = FOUR_CHAR_CODE('ctrl') , kEventParamRgnHandle = FOUR_CHAR_CODE('rgnh') , kEventParamEnabled = FOUR_CHAR_CODE('enab') , kEventParamDimensions = FOUR_CHAR_CODE('dims') , kEventParamAvailableBounds = FOUR_CHAR_CODE('avlb') , kEventParamAEEventID = keyAEEventID , kEventParamAEEventClass = keyAEEventClass , kEventParamCGContextRef = FOUR_CHAR_CODE('cntx') , kEventParamDeviceDepth = FOUR_CHAR_CODE('devd') , kEventParamDeviceColor = FOUR_CHAR_CODE('devc') , typeWindowRef = FOUR_CHAR_CODE('wind') , typeGrafPtr = FOUR_CHAR_CODE('graf') , typeGWorldPtr = FOUR_CHAR_CODE('gwld') , typeDragRef = FOUR_CHAR_CODE('drag') , typeMenuRef = FOUR_CHAR_CODE('menu') , typeControlRef = FOUR_CHAR_CODE('ctrl') , typeCollection = FOUR_CHAR_CODE('cltn') , typeQDRgnHandle = FOUR_CHAR_CODE('rgnh') , typeOSStatus = FOUR_CHAR_CODE('osst') , typeCFStringRef = FOUR_CHAR_CODE('cfst') , typeCGContextRef = FOUR_CHAR_CODE('cntx') , typeHIPoint = FOUR_CHAR_CODE('hipt') } |
| enum | { kEventParamMouseLocation = FOUR_CHAR_CODE('mloc') , kEventParamMouseButton = FOUR_CHAR_CODE('mbtn') , kEventParamClickCount = FOUR_CHAR_CODE('ccnt') , kEventParamMouseWheelAxis = FOUR_CHAR_CODE('mwax') , kEventParamMouseWheelDelta = FOUR_CHAR_CODE('mwdl') , kEventParamMouseDelta = FOUR_CHAR_CODE('mdta') , kEventParamMouseChord = FOUR_CHAR_CODE('chor') , kEventParamTabletEventType = FOUR_CHAR_CODE('tblt') , typeMouseButton = FOUR_CHAR_CODE('mbtn') , typeMouseWheelAxis = FOUR_CHAR_CODE('mwax') } |
| enum | { kEventParamKeyCode = FOUR_CHAR_CODE('kcod') , kEventParamKeyMacCharCodes = FOUR_CHAR_CODE('kchr') , kEventParamKeyModifiers = FOUR_CHAR_CODE('kmod') , kEventParamKeyUnicodes = FOUR_CHAR_CODE('kuni') , kEventParamKeyboardType = FOUR_CHAR_CODE('kbdt') , typeEventHotKeyID = FOUR_CHAR_CODE('hkid') } |
| enum | { kEventParamTextInputSendRefCon , kEventParamTextInputSendComponentInstance , kEventParamTextInputSendSLRec , kEventParamTextInputReplySLRec , kEventParamTextInputSendText , kEventParamTextInputReplyText , kEventParamTextInputSendUpdateRng , kEventParamTextInputSendHiliteRng , kEventParamTextInputSendClauseRng , kEventParamTextInputSendPinRng = FOUR_CHAR_CODE('tspn') , kEventParamTextInputSendFixLen , kEventParamTextInputSendLeadingEdge , kEventParamTextInputReplyLeadingEdge , kEventParamTextInputSendTextOffset , kEventParamTextInputReplyTextOffset , kEventParamTextInputReplyRegionClass , kEventParamTextInputSendCurrentPoint , kEventParamTextInputSendDraggingMode , kEventParamTextInputReplyPoint = FOUR_CHAR_CODE('trpt') , kEventParamTextInputReplyFont , kEventParamTextInputReplyFMFont = FOUR_CHAR_CODE('trfm') , kEventParamTextInputReplyPointSize = FOUR_CHAR_CODE('trpz') , kEventParamTextInputReplyLineHeight , kEventParamTextInputReplyLineAscent , kEventParamTextInputReplyTextAngle = FOUR_CHAR_CODE('trta') , kEventParamTextInputSendShowHide = FOUR_CHAR_CODE('tssh') , kEventParamTextInputReplyShowHide , kEventParamTextInputSendKeyboardEvent , kEventParamTextInputSendTextServiceEncoding , kEventParamTextInputSendTextServiceMacEncoding } |
| enum | { kEventParamHICommand = FOUR_CHAR_CODE('hcmd') , typeHICommand = FOUR_CHAR_CODE('hcmd') } |
| enum | { kEventParamWindowFeatures = FOUR_CHAR_CODE('wftr') , kEventParamWindowDefPart = FOUR_CHAR_CODE('wdpc') , kEventParamCurrentBounds = FOUR_CHAR_CODE('crct') , kEventParamOriginalBounds = FOUR_CHAR_CODE('orct') , kEventParamPreviousBounds = FOUR_CHAR_CODE('prct') , kEventParamClickActivation , kEventParamWindowRegionCode , kEventParamWindowDragHiliteFlag = FOUR_CHAR_CODE('wdhf') , kEventParamWindowModifiedFlag = FOUR_CHAR_CODE('wmff') , kEventParamWindowProxyGWorldPtr = FOUR_CHAR_CODE('wpgw') , kEventParamWindowProxyImageRgn = FOUR_CHAR_CODE('wpir') , kEventParamWindowProxyOutlineRgn , kEventParamWindowStateChangedFlags = FOUR_CHAR_CODE('wscf') , kEventParamWindowTitleFullWidth = FOUR_CHAR_CODE('wtfw') , kEventParamWindowTitleTextWidth = FOUR_CHAR_CODE('wttw') , kEventParamWindowGrowRect = FOUR_CHAR_CODE('grct') , kEventParamAttributes = FOUR_CHAR_CODE('attr') , typeWindowRegionCode = FOUR_CHAR_CODE('wshp') , typeWindowDefPartCode = FOUR_CHAR_CODE('wdpt') , typeClickActivationResult = FOUR_CHAR_CODE('clac') } |
| enum | { kEventParamControlPart = FOUR_CHAR_CODE('cprt') , kEventParamInitCollection = FOUR_CHAR_CODE('icol') , kEventParamControlMessage = FOUR_CHAR_CODE('cmsg') , kEventParamControlParam = FOUR_CHAR_CODE('cprm') , kEventParamControlResult = FOUR_CHAR_CODE('crsl') , kEventParamControlRegion = FOUR_CHAR_CODE('crgn') , kEventParamControlAction = FOUR_CHAR_CODE('caup') , kEventParamControlIndicatorDragConstraint , kEventParamControlIndicatorRegion , kEventParamControlIsGhosting = FOUR_CHAR_CODE('cgst') , kEventParamControlIndicatorOffset = FOUR_CHAR_CODE('ciof') , kEventParamControlClickActivationResult , kEventParamControlSubControl = FOUR_CHAR_CODE('csub') , kEventParamControlOptimalBounds = FOUR_CHAR_CODE('cobn') , kEventParamControlOptimalBaselineOffset , kEventParamControlDataTag = FOUR_CHAR_CODE('cdtg') , kEventParamControlDataBuffer = FOUR_CHAR_CODE('cdbf') , kEventParamControlDataBufferSize , kEventParamControlDrawDepth = FOUR_CHAR_CODE('cddp') , kEventParamControlDrawInColor = FOUR_CHAR_CODE('cdic') , kEventParamControlFeatures = FOUR_CHAR_CODE('cftr') , kEventParamControlPartBounds = FOUR_CHAR_CODE('cpbd') , kEventParamControlOriginalOwningWindow , kEventParamControlCurrentOwningWindow , typeControlActionUPP = FOUR_CHAR_CODE('caup') , typeIndicatorDragConstraint , typeControlPartCode = FOUR_CHAR_CODE('cprt') } |
| enum | { kEventParamCurrentMenuTrackingMode , kEventParamNewMenuTrackingMode , kEventParamMenuFirstOpen = FOUR_CHAR_CODE('1sto') , kEventParamMenuItemIndex = FOUR_CHAR_CODE('item') , kEventParamMenuCommand = FOUR_CHAR_CODE('mcmd') , kEventParamEnableMenuForKeyEvent = FOUR_CHAR_CODE('fork') , kEventParamMenuEventOptions , kEventParamMenuContext = FOUR_CHAR_CODE('mctx') , kEventParamMenuItemBounds = FOUR_CHAR_CODE('mitb') , kEventParamMenuMarkBounds = FOUR_CHAR_CODE('mmkb') , kEventParamMenuIconBounds = FOUR_CHAR_CODE('micb') , kEventParamMenuTextBounds = FOUR_CHAR_CODE('mtxb') , kEventParamMenuTextBaseline = FOUR_CHAR_CODE('mtbl') , kEventParamMenuCommandKeyBounds = FOUR_CHAR_CODE('mcmb') , kEventParamMenuVirtualTop = FOUR_CHAR_CODE('mvrt') , kEventParamMenuVirtualBottom = FOUR_CHAR_CODE('mvrb') , kEventParamMenuDrawState = FOUR_CHAR_CODE('mdrs') , kEventParamMenuItemType = FOUR_CHAR_CODE('mitp') , kEventParamMenuItemWidth = FOUR_CHAR_CODE('mitw') , kEventParamMenuItemHeight = FOUR_CHAR_CODE('mith') , typeMenuItemIndex = FOUR_CHAR_CODE('midx') , typeMenuCommand = FOUR_CHAR_CODE('mcmd') , typeMenuTrackingMode = FOUR_CHAR_CODE('mtmd') , typeMenuEventOptions = FOUR_CHAR_CODE('meop') , typeThemeMenuState = FOUR_CHAR_CODE('tmns') , typeThemeMenuItemType = FOUR_CHAR_CODE('tmit') } |
| enum | { kEventParamProcessID = FOUR_CHAR_CODE('psn ') , kEventParamLaunchRefCon = FOUR_CHAR_CODE('lref') , kEventParamLaunchErr = FOUR_CHAR_CODE('err ') } |
| enum | { kEventParamTabletPointRec = FOUR_CHAR_CODE('tbrc') , kEventParamTabletProximityRec , typeTabletPointRec = FOUR_CHAR_CODE('tbrc') , typeTabletProximityRec , kEventParamTabletPointerRec , typeTabletPointerRec } |
| enum | { kEventParamNewScrollBarVariant = FOUR_CHAR_CODE('nsbv') } |
| enum | { kEventParamScrapRef = FOUR_CHAR_CODE('scrp') , kEventParamServiceCopyTypes , kEventParamServicePasteTypes , kEventParamServiceMessageName , kEventParamServiceUserData = FOUR_CHAR_CODE('svud') , typeScrapRef = FOUR_CHAR_CODE('scrp') , typeCFMutableArrayRef = FOUR_CHAR_CODE('cfma') } |
| enum | { uppEventHandlerProcInfo = 0x00000FF0 } |
| enum | { kUserFocusAuto = -1 } |
| enum | { kMouseTrackingMousePressed = kMouseTrackingMouseDown , kMouseTrackingMouseReleased = kMouseTrackingMouseUp , kMouseTrackingMouseMoved = kMouseTrackingMouseDragged } |
Functions | |
| EventLoopRef | GetCurrentEventLoop (void) |
| EventLoopRef | GetMainEventLoop (void) |
| OSStatus | RunCurrentEventLoop (EventTimeout inTimeout) |
| OSStatus | QuitEventLoop (EventLoopRef inEventLoop) |
| CFTypeRef | GetCFRunLoopFromEventLoop (EventLoopRef inEventLoop) |
| OSStatus | ReceiveNextEvent (UInt32 inNumTypes, const EventTypeSpec *inList, EventTimeout inTimeout, Boolean inPullEvent, EventRef *outEvent) |
| OSStatus | MacCreateEvent (CFAllocatorRef inAllocator, UInt32 inClassID, UInt32 kind, EventTime when, EventAttributes flags, EventRef *outEvent) |
| EventRef | CopyEvent (EventRef inOther) |
| EventRef | RetainEvent (EventRef inEvent) |
| UInt32 | GetEventRetainCount (EventRef inEvent) |
| void | ReleaseEvent (EventRef inEvent) |
| OSStatus | SetEventParameter (EventRef inEvent, EventParamName inName, EventParamType inType, UInt32 inSize, const void *inDataPtr) |
| OSStatus | GetEventParameter (EventRef inEvent, EventParamName inName, EventParamType inDesiredType, EventParamType *outActualType, UInt32 inBufferSize, UInt32 *outActualSize, void *outData) |
| UInt32 | GetEventClass (EventRef inEvent) |
| UInt32 | GetEventKind (EventRef inEvent) |
| EventTime | GetEventTime (EventRef inEvent) |
| OSStatus | SetEventTime (EventRef inEvent, EventTime inTime) |
| EventQueueRef | GetCurrentEventQueue (void) |
| EventQueueRef | GetMainEventQueue (void) |
| typedef | CALLBACK_API (Boolean, EventComparatorProcPtr)(EventRef inEvent |
| typedef | STACK_UPP_TYPE (EventComparatorProcPtr) EventComparatorUPP |
| EventComparatorUPP | NewEventComparatorUPP (EventComparatorProcPtr userRoutine) |
| void | DisposeEventComparatorUPP (EventComparatorUPP userUPP) |
| Boolean | InvokeEventComparatorUPP (EventRef inEvent, void *inCompareData, EventComparatorUPP userUPP) |
| OSStatus | PostEventToQueue (EventQueueRef inQueue, EventRef inEvent, EventPriority inPriority) |
| OSStatus | FlushEventsMatchingListFromQueue (EventQueueRef inQueue, UInt32 inNumTypes, const EventTypeSpec *inList) |
| OSStatus | FlushSpecificEventsFromQueue (EventQueueRef inQueue, EventComparatorUPP inComparator, void *inCompareData) |
| OSStatus | FlushEventQueue (EventQueueRef inQueue) |
| EventRef | FindSpecificEventInQueue (EventQueueRef inQueue, EventComparatorUPP inComparator, void *inCompareData) |
| UInt32 | GetNumEventsInQueue (EventQueueRef inQueue) |
| OSStatus | RemoveEventFromQueue (EventQueueRef inQueue, EventRef inEvent) |
| Boolean | IsEventInQueue (EventQueueRef inQueue, EventRef inEvent) |
| EventTime | GetCurrentEventTime (void) |
| Boolean | IsUserCancelEventRef (EventRef event) |
| OSStatus | TrackMouseLocation (GrafPtr inPort, Point *outPt, MouseTrackingResult *outResult) |
| OSStatus | TrackMouseLocationWithOptions (GrafPtr inPort, OptionBits inOptions, EventTimeout inTimeout, Point *outPt, UInt32 *outModifiers, MouseTrackingResult *outResult) |
| OSStatus | TrackMouseRegion (GrafPtr inPort, RgnHandle inRegion, Boolean *ioWasInRgn, MouseTrackingResult *outResult) |
| Boolean | ConvertEventRefToEventRecord (EventRef inEvent, EventRecord *outEvent) |
| Boolean | IsEventInMask (EventRef inEvent, EventMask inMask) |
| EventTime | GetLastUserEventTime (void) |
| Boolean | IsMouseCoalescingEnabled (void) |
| OSStatus | SetMouseCoalescingEnabled (Boolean inNewState, Boolean *outOldState) |
| typedef | CALLBACK_API (void, EventLoopTimerProcPtr)(EventLoopTimerRef inTimer |
| typedef | STACK_UPP_TYPE (EventLoopTimerProcPtr) EventLoopTimerUPP |
| EventLoopTimerUPP | NewEventLoopTimerUPP (EventLoopTimerProcPtr userRoutine) |
| void | DisposeEventLoopTimerUPP (EventLoopTimerUPP userUPP) |
| void | InvokeEventLoopTimerUPP (EventLoopTimerRef inTimer, void *inUserData, EventLoopTimerUPP userUPP) |
| OSStatus | InstallEventLoopTimer (EventLoopRef inEventLoop, EventTimerInterval inFireDelay, EventTimerInterval inInterval, EventLoopTimerUPP inTimerProc, void *inTimerData, EventLoopTimerRef *outTimer) |
| OSStatus | RemoveEventLoopTimer (EventLoopTimerRef inTimer) |
| OSStatus | SetEventLoopTimerNextFireTime (EventLoopTimerRef inTimer, EventTimerInterval inNextFire) |
| CFStringRef | CreateTypeStringWithOSType (OSType inType) |
| typedef | CALLBACK_API (OSStatus, EventHandlerProcPtr)(EventHandlerCallRef inHandlerCallRef |
| typedef | STACK_UPP_TYPE (EventHandlerProcPtr) EventHandlerUPP |
| EventHandlerUPP | NewEventHandlerUPP (EventHandlerProcPtr userRoutine) |
| void | DisposeEventHandlerUPP (EventHandlerUPP userUPP) |
| OSStatus | InvokeEventHandlerUPP (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData, EventHandlerUPP userUPP) |
| EventTargetRef | GetWindowEventTarget (WindowRef inWindow) |
| EventTargetRef | GetControlEventTarget (ControlRef inControl) |
| EventTargetRef | GetMenuEventTarget (MenuRef inMenu) |
| EventTargetRef | GetApplicationEventTarget (void) |
| EventTargetRef | GetUserFocusEventTarget (void) |
| EventTargetRef | GetEventDispatcherTarget (void) |
| OSStatus | InstallEventHandler (EventTargetRef inTarget, EventHandlerUPP inHandler, UInt32 inNumTypes, const EventTypeSpec *inList, void *inUserData, EventHandlerRef *outRef) |
| OSStatus | InstallStandardEventHandler (EventTargetRef inTarget) |
| OSStatus | RemoveEventHandler (EventHandlerRef inHandlerRef) |
| OSStatus | AddEventTypesToHandler (EventHandlerRef inHandlerRef, UInt32 inNumTypes, const EventTypeSpec *inList) |
| OSStatus | RemoveEventTypesFromHandler (EventHandlerRef inHandlerRef, UInt32 inNumTypes, const EventTypeSpec *inList) |
| OSStatus | CallNextEventHandler (EventHandlerCallRef inCallRef, EventRef inEvent) |
| OSStatus | SendEventToEventTarget (EventRef inEvent, EventTargetRef inTarget) |
| OSStatus | RegisterToolboxObjectClass (CFStringRef inClassID, ToolboxObjectClassRef inBaseClass, UInt32 inNumEvents, const EventTypeSpec *inEventList, EventHandlerUPP inEventHandler, void *inEventHandlerData, ToolboxObjectClassRef *outClassRef) |
| OSStatus | UnregisterToolboxObjectClass (ToolboxObjectClassRef inClassRef) |
| OSStatus | ProcessHICommand (const HICommand *inCommand) |
| void | RunApplicationEventLoop (void) |
| void | QuitApplicationEventLoop (void) |
| OSStatus | RunAppModalLoopForWindow (WindowRef inWindow) |
| OSStatus | QuitAppModalLoopForWindow (WindowRef inWindow) |
| OSStatus | BeginAppModalStateForWindow (WindowRef inWindow) |
| OSStatus | EndAppModalStateForWindow (WindowRef inWindow) |
| OSStatus | SetUserFocusWindow (WindowRef inWindow) |
| WindowRef | GetUserFocusWindow (void) |
| OSStatus | SetWindowDefaultButton (WindowRef inWindow, ControlRef inControl) |
| OSStatus | SetWindowCancelButton (WindowRef inWindow, ControlRef inControl) |
| OSStatus | GetWindowDefaultButton (WindowRef inWindow, ControlRef *outControl) |
| OSStatus | GetWindowCancelButton (WindowRef inWindow, ControlRef *outControl) |
| OSStatus | RegisterEventHotKey (UInt32 inHotKeyCode, UInt32 inHotKeyModifiers, EventHotKeyID inHotKeyID, EventTargetRef inTarget, OptionBits inOptions, EventHotKeyRef *outRef) |
| OSStatus | UnregisterEventHotKey (EventHotKeyRef inHotKey) |
Carbon Event Manager.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
| #define DEFINE_ONE_SHOT_HANDLER_GETTER | ( | x | ) |
You can use the following macro in your code to allow you to set up an event handler lazily. You pass the name of your event handler in. You should use this with caution on Mac OS 9 systems since it could cause heap fragmentation.
| #define InvokeEventComparatorUPP | ( | inEvent, | |
| inCompareData, | |||
| userUPP | |||
| ) |
| #define InvokeEventHandlerUPP | ( | inHandlerCallRef, | |
| inEvent, | |||
| inUserData, | |||
| userUPP | |||
| ) |
| #define InvokeEventLoopTimerUPP | ( | inTimer, | |
| inUserData, | |||
| userUPP | |||
| ) |
| #define NewEventComparatorUPP | ( | userRoutine | ) |
| #define NewEventHandlerUPP | ( | userRoutine | ) |
| #define NewEventLoopTimerUPP | ( | userRoutine | ) |
| typedef struct OpaqueEventLoopRef* EventLoopRef |
EventLoopRef
Discussion: An EventLoopRef represents an 'event loop', which is the conceptual entity that you 'run' to fetch events from hardware and other sources and also fires timers that might be installed with InstallEventLoopTimer. The term 'run' is a bit of a misnomer, as the event loop's goal is to stay as blocked as possible to minimize CPU usage for the current application. The event loop is run implicitly thru APIs like ReceiveNextEvent, RunApplicationEventLoop, or even WaitNextEvent. It can also be run explicitly thru a call to RunCurrentEventLoop. Each preemptive thread can have an event loop. Cooperative threads share the main thread's event loop.
| typedef struct OpaqueEventLoopTimerRef* EventLoopTimerRef |
EventLoopTimerRef
Discussion: An EventLoopTimerRef represents what we term a 'timer'. A timer is a function that is called either once or at regular intervals. It executes at task level and should not be confused with Time Manager Tasks or any other interrupt-level callback. This means you can call Toolbox routines, allocate memory and draw. When a timer 'fires', it calls a callback that you specify when the timer is installed. Timers in general have two uses - as a timeout mechanism and as a periodic task. An everyday example of using a timer for a timeout might be a light that goes out if no motion is detected in a room for 5 minutes. For this, you might install a timer which will fire in 5 minutes. If motion is detected, you would reset the timer fire time and let the clock start over. If no motion is detected for the full 5 minutes, the timer will fire and you could power off the light. A periodic timer is one that fires at regular intervals (say every second or so). You might use such a timer to blink the insertion point in your editor, etc. One advantage of timers is that you can install the timer right from the code that wants the time. For example, the standard Toolbox Edit Text control can install a timer to blink the cursor when it's active, meaning that IdleControls is a no-op for that control and doesn't need to be called. When the control is inactive, it removes its timer and doesn't waste CPU time in that state. NOTE: Currently, if you do decide to draw when your timer is called, be sure to save and restore the current port so that calling your timer doesn't inadvertently change the port out from under someone.
| typedef UInt16 EventMouseButton |
Parameters for mouse events:
kEventMouseDown --> kEventParamMouseLocation typeHIPoint --> kEventParamKeyModifiers typeUInt32 --> kEventParamMouseButton typeMouseButton --> kEventParamClickCount typeUInt32 --> kEventParamMouseChord typeUInt32 (Mac OS X only) --> kEventParamTabletEventType typeUInt32 (Mac OS X 10.1, CarbonLib 1.5, and later) --> kEventParamTabletPointRec typeTabletPointRec (if kEventParamTabletEventType is kEventTabletPoint) --> kEventParamTabletProximityRec typeTabletProximityRec (if kEventParamTabletEventType is kEventTabletProximity)
kEventMouseUp --> kEventParamMouseLocation typeHIPoint --> kEventParamKeyModifiers typeUInt32 --> kEventParamMouseButton typeMouseButton --> kEventParamClickCount typeUInt32 --> kEventParamMouseChord typeUInt32 (Mac OS X only) --> kEventParamTabletEventType typeUInt32 (Mac OS X 10.1, CarbonLib 1.5, and later) --> kEventParamTabletPointRec typeTabletPointRec (if kEventParamTabletEventType is kEventTabletPoint) --> kEventParamTabletProximityRec typeTabletProximityRec (if kEventParamTabletEventType is kEventTabletProximity)
kEventMouseMoved --> kEventParamMouseLocation typeHIPoint --> kEventParamMouseDelta typeHIPoint (Mac OS X only) --> kEventParamKeyModifiers typeUInt32 --> kEventParamTabletEventType typeUInt32 (Mac OS X 10.1, CarbonLib 1.5, and later) --> kEventParamTabletPointRec typeTabletPointRec (if kEventParamTabletEventType is kEventTabletPoint) --> kEventParamTabletProximityRec typeTabletProximityRec (if kEventParamTabletEventType is kEventTabletProximity)
kEventMouseDragged --> kEventParamMouseLocation typeHIPoint --> kEventParamMouseDelta typeHIPoint (Mac OS X only) --> kEventParamKeyModifiers typeUInt32 --> kEventParamMouseButton typeMouseButton --> kEventParamMouseChord typeUInt32 (Mac OS X only) --> kEventParamTabletEventType typeUInt32 (Mac OS X 10.1, CarbonLib 1.5, and later) --> kEventParamTabletPointRec typeTabletPointRec (if kEventParamTabletEventType is kEventTabletPoint) --> kEventParamTabletProximityRec typeTabletProximityRec (if kEventParamTabletEventType is kEventTabletProximity)
kEventMouseWheelMoved --> kEventParamMouseLocation typeHIPoint --> kEventParamKeyModifiers typeUInt32 --> kEventParamMouseWheelAxis typeMouseWheelAxis --> kEventParamMouseWheelDelta typeLongInteger EventMouseButton
| typedef UInt16 EventMouseWheelAxis |
EventMouseWheelAxis
| typedef SInt16 EventPriority |
EventPriority
Discussion: These values define the relative priority of an event, and are used when posting events with PostEventToQueue. In general events are pulled from the queue in order of first posted to last posted. These priorities are a way to alter that when posting events. You can post a standard priority event and then a high priority event and the high priority event will be pulled from the queue first.
| anonymous enum |
Discussion: The following are all errors which can be returned from the routines contained in this file.
| anonymous enum |
| anonymous enum |
Discussion: These are returned from calls to TrackMouseLocation and TrackMouseRegion. Those routines are designed as replacements to calls such as StillDown and WaitMouseUp. The advantage over those routines is that TrackMouseLocation and TrackMouseRegion will block if the user is not moving the mouse, whereas mouse tracking loops based on StillDown and WaitMouseUp will spin, chewing up valuable CPU time that could be better spent elsewhere. It is highly recommended that any tracking loops in your application stop using StillDown and WaitMouseUp and start using TrackMouseLocation/Region. See the notes on those routines for more information.
| anonymous enum |
Discussion: Event classes
| anonymous enum |
Discussion: Mouse events (kEventClassMouse)
| anonymous enum |
| anonymous enum |
| anonymous enum |
Summary: Text input events (kEventClassTextInput)
Discussion: The following TextInput events reimplement the AppleEvents defined in Inside Mac Text - Text Services Manager, and provide the benefits of Carbon Event targeting, dispatching and propagation to applications that have formerly handled the TSM suite of AppleEvents. TextInput handlers may be installed on controls, windows, or the application event target (equivalent to AppleEvent-based handling). In all cases, if a given TextInput handler is not installed, TSM will convert that TextInput to an AppleEvent and redispatch via AESend to the current process, making adoption as gradual as is desired.
| Enumerator | |
|---|---|
| kEventTextInputUpdateActiveInputArea | Tells the application/text engine to initiate/terminate or manage the content of inline input session. |
| kEventTextInputUnicodeForKeyEvent | Unicode text resulting from a key event originated by TSM (not by an input method). A client need not be fully TSM-aware to process or receive this event, which has become the standard way of getting Unicode text from key events. You can also get Mac encoding characters from the raw keyboard event contained in this event. If no UnicodeForKeyEvent handler is installed, and no kUnicodeNotFromInputMethod AppleEvent handler is installed (or the application has not created a Unicode TSMDocument), the Mac encoding charCodes (if these can be converted from the Unicodes) are provided to WaitNextEvent. |
| kEventTextInputOffsetToPos | Convert from inline session text offset to global QD Point. This event is typically be produced by an Input Method so that it can best position a palette "near" the text being operated on by the user. |
| kEventTextInputPosToOffset | Convert from global QD point to inline session text offset. This event is typically produced by an input method to perform proper cursor management as the cursor moves over various subranges, or clauses of text (or the boundaries between these) in the inline input session. |
| kEventTextInputShowHideBottomWindow | Show/Hide the bottom line input window. This event is produced by Input Methods to control the Text Services Manager bottom-line input window, and is not normally handled by an application. |
| kEventTextInputGetSelectedText | Get the text selected (or character before/after insertion point based on leadingEdge parameter) from the application's text engine. |
| anonymous enum |
Parameters for TextInput events:
kEventTextInputUpdateActiveInputArea Required parameters: --> kEventParamTextInputSendComponentInstance typeComponentInstance --> kEventParamTextInputSendRefCon typeLongInteger --> kEventParamTextInputSendSLRec typeIntlWritingCode --> kEventParamTextInputSendFixLen typeLongInteger --> kEventParamTextInputSendText typeUnicodeText, typeChar (data type depends on TSMDocument type created via NewTSMDocument... typeChar for kTextService document, typeUnicodeText for kUnicodeDocument)
Optional parameters: --> kEventParamTextInputSendUpdateRng typeTextRangeArray --> kEventParamTextInputSendHiliteRng typeTextRangeArray --> kEventParamTextInputSendClauseRng typeOffsetArray --> kEventParamTextInputSendPinRng typeTextRange --> kEventParamTextInputSendPinRng typeTextRange --> kEventParamTextInputSendTextServiceEncoding typeUInt32 --> kEventParamTextInputSendTextServiceMacEncoding typeUInt32
kEventTextInputUnicodeForKeyEvent Required parameters: --> kEventParamTextInputSendComponentInstance typeComponentInstance --> kEventParamTextInputSendRefCon typeLongInteger --> kEventParamTextInputSendSLRec typeIntlWritingCode --> kEventParamTextInputSendText typeUnicodeText --> kEventParamTextInputSendKeyboardEvent typeEventRef (This parameter is the original raw keyboard event that produced the text. It enables access to kEventParamKeyModifiers and kEventParamKeyCode parameters. You can also extract from this event either Unicodes or Mac encoding characters as follows: kEventParamKeyUnicodes typeUnicodeText kEventParamKeyMacCharCodes typeChar (if available) The kEventParamKeyUnicodes parameter of the raw keyboard event is identical to the TextInput event's kEventParamTextInputSendText parameter. Note that when contents of TSM's bottom-line input window (i.e. during typing Chinese, Korean, or Japanese) are confirmed, the raw keyboard event's keyCode and modifiers are set to default values.)
kEventTextInputOffsetToPos Required parameters: --> kEventParamTextInputSendComponentInstance typeComponentInstance --> kEventParamTextInputSendRefCon typeLongInteger --> kEventParamTextInputSendTextOffset typeLongInteger <– kEventParamTextInputReplyPoint typeQDPoint
Optional parameters: --> kEventParamTextInputSendSLRec typeIntlWritingCode --> kEventParamTextInputSendLeadingEdge typeBoolean <– kEventParamTextInputReplySLRec typeIntlWritingCode <– kEventParamTextInputReplyFont typeLongInteger <– kEventParamTextInputReplyFMFont typeUInt32 <– kEventParamTextInputReplyPointSize typeFixed <– kEventParamTextInputReplyLineHeight typeShortInteger <– kEventParamTextInputReplyLineAscent typeShortInteger <– kEventParamTextInputReplyTextAngle typeFixed
kEventTextInputPosToOffset Required parameters: --> kEventParamTextInputSendComponentInstance typeComponentInstance --> kEventParamTextInputSendRefCon typeLongInteger --> kEventParamTextInputSendCurrentPoint typeQDPoint <– kEventParamTextInputReplyRegionClass typeLongInteger <– kEventParamTextInputReplyTextOffset typeLongInteger (required if the position is inside the document's body)
Optional parameters: --> kEventParamTextInputSendDraggingMode typeBoolean <-- kEventParamTextInputReplyLeadingEdge typeBoolean <-- kEventParamTextInputReplySLRec typeIntlWritingCode
kEventTextInputShowHideBottomWindow Required parameters: --> kEventParamTextInputSendComponentInstance typeComponentInstance --> kEventParamTextInputSendRefCon typeLongInteger
Optional parameters: --> kEventParamTextInputSendShowHide typeBoolean <– kEventParamTextInputReplyShowHide typeBoolean
kEventTextInputGetSelectedText Required parameters: --> kEventParamTextInputSendComponentInstance typeComponentInstance --> kEventParamTextInputSendRefCon typeLongInteger
Optional parameters: --> kEventParamTextInputSendLeadingEdge typeBoolean --> kEventParamTextInputSendTextServiceEncoding typeUInt32 --> kEventParamTextInputSendTextServiceMacEncoding typeUInt32 <– kEventParamTextInputReplyText typeUnicodeText, typeChar (data type depends on TSMDocument. See kEventTextInputUpdateActiveInputArea Notes) <– kEventParamTextInputReplySLRec typeIntlWritingCode Summary: Keyboard events (kEventClassKeyboard)
Discussion: These events are the lowest-level keyboard events.
| anonymous enum |
| anonymous enum |
Parameters for keyboard events:
kEventRawKeyDown --> kEventParamKeyMacCharCodes typeChar --> kEventParamKeyCode typeUInt32 --> kEventParamKeyModifiers typeUInt32 --> kEventParamKeyboardType typeUInt32
kEventRawKeyRepeat --> kEventParamKeyMacCharCodes typeChar --> kEventParamKeyCode typeUInt32 --> kEventParamKeyModifiers typeUInt32 --> kEventParamKeyboardType typeUInt32
kEventRawKeyUp --> kEventParamKeyMacCharCodes typeChar --> kEventParamKeyCode typeUInt32 --> kEventParamKeyModifiers typeUInt32 --> kEventParamKeyboardType typeUInt32
kEventRawKeyModifiersChanged --> kEventParamKeyModifiers typeUInt32
kEventHotKeyPressed --> kEventParamDirectObject typeEventHotKeyID
kEventHotKeyReleased --> kEventParamDirectObject typeEventHotKeyID Summary: Application events (kEventClassApplication)
| anonymous enum |
Parameters for application events:
kEventAppActivated --> kEventParamWindowRef typeWindowRef
kEventAppDeactivated (no parameters)
kEventAppQuit (no parameters)
kEventAppLaunchNotification --> kEventParamProcessID typeProcessSerialNumber --> kEventParamLaunchRefCon typeUInt32 --> kEventParamLaunchErr typeOSStatus
kEventAppLaunched --> kEventParamProcessID typeProcessSerialNumber
kEventAppTerminated --> kEventParamProcessID typeProcessSerialNumber
kEventAppFrontSwitched --> kEventParamProcessID typeProcessSerialNumber
kEventAppGetDockTileMenu <– kEventParamMenuRef typeMenuRef Summary: Apple events (kEventClassAppleEvent)
| Enumerator | |
|---|---|
| kEventAppleEvent | Sent when a high-level event is received. The default handler will call AEProcessAppleEvent. |
| anonymous enum |
Parameters for Apple events:
kEventAppleEvent --> kEventParamAEEventClass typeType // the eventClass of the Apple event --> kEventParamAEEventID typeType // the eventID of the Apple event Summary: Window refresh events (kEventClassWindow)
Discussion: Events related to drawing a window's content.
| anonymous enum |
Parameters for window refresh events:
kEventWindowUpdate --> kEventParamDirectObject typeWindowRef
kEventWindowDrawContent --> kEventParamDirectObject typeWindowRef Summary: Window activation events (kEventClassWindow)
Discussion: Events related to activating and deactivating a window.
| anonymous enum |
Parameters for window activation events:
kEventWindowActivated --> kEventParamDirectObject typeWindowRef
kEventWindowDeactivated --> kEventParamDirectObject typeWindowRef
kEventWindowGetClickActivation --> kEventParamDirectObject typeWindowRef --> kEventParamMouseLocation typeQDPoint --> kEventParamKeyModifiers typeUInt32 --> kEventParamWindowDefPart typeWindowDefPartCode --> kEventParamControlRef typeControlRef (only present if the click was on a control) <– kEventParamClickActivation typeClickActivationResult Summary: Window state change events (kEventClassWindow)
Discussion: Events that notify of a change in the window's state. These events are sent to all windows, regardless of whether the window has the standard handler installed.
| anonymous enum |
Summary: Window bounds change event attributes
Discussion: When the toolbox sends out a kEventWindowBoundsChanging or kEventWindowBoundsChanged event, it also sends along a parameter containing attributes of the event. These attributes can be used to determine what aspect of the window changed (origin, size, or both), and whether or not some user action is driving the change (drag or resize).
| anonymous enum |
Parameters for window state change events:
kEventWindowShowing --> kEventParamDirectObject typeWindowRef
kEventWindowHiding --> kEventParamDirectObject typeWindowRef
kEventWindowShown --> kEventParamDirectObject typeWindowRef
kEventWindowHidden --> kEventParamDirectObject typeWindowRef
kEventWindowBoundsChanging --> kEventParamDirectObject typeWindowRef --> kEventParamAttributes typeUInt32 --> kEventParamOriginalBounds typeQDRectangle --> kEventParamPreviousBounds typeQDRectangle <-> kEventParamCurrentBounds typeQDRectangle
kEventWindowBoundsChanged --> kEventParamDirectObject typeWindowRef --> kEventParamAttributes typeUInt32 --> kEventParamOriginalBounds typeQDRectangle --> kEventParamPreviousBounds typeQDRectangle --> kEventParamCurrentBounds typeQDRectangle
kEventWindowResizeStarted --> kEventParamDirectObject typeWindowRef
kEventWindowResizeCompleted --> kEventParamDirectObject typeWindowRef
kEventWindowDragStarted --> kEventParamDirectObject typeWindowRef
kEventWindowDragCompleted --> kEventParamDirectObject typeWindowRef Summary: Window click events (kEventClassWindow)
Discussion: Low-level events which generate higher-level �action� events. These events are only generated for windows with the standard window handler installed. Most clients should allow the standard handler to implement these events. Window click events are generated from lower-level kEventMouseDown events by copying the mouse event and changing the class and kind, so window click events will have all of the parameters of the mouse down event, in addition to those parameters documented here that are specific to the window events.
| anonymous enum |
Summary: Window cursor change events (kEventClassWindow)
| anonymous enum |
Parameters for window cursor change events:
kEventWindowCursorChange --> kEventParamDirectObject typeWindowRef --> kEventParamMouseLocation typeQDPoint --> kEventParamKeyModifiers typeUInt32 Summary: Window action events
Discussion: Events which indicate that certain changes have been made to the window. These events have greater semantic meaning than the low-level window click events and are usually prefered for overriding.
| Enumerator | |
|---|---|
| kEventWindowCollapse | If the window is not collapsed, this event is sent by the standard window handler after it has received kEventWindowClickCollapseRgn and received true from a call to TrackBox. Standard window handler calls CollapseWindow and then sends kEventWindowCollapsed if no error is received from CollapseWindow. |
| kEventWindowCollapsed | Notification that the object has successfully collapsed. |
| kEventWindowCollapseAll | Sent by the standard window handler (when the option key is down) after it has received kEventWindowClickCollapseRgn and then received true from a call to TrackBox. The standard window handler's response is to send each window of the same class as the clicked window a kEventWindowCollapse event. |
| kEventWindowExpand | If the window is collapsed, this event is sent by the standard window handler after it has received kEventWindowClickCollapseRgn and received true from a call to TrackBox. The standard window handler's response is to call CollapseWindow, then send kEventWindowExpanded. Note that you will not receive this event before a window is expanded from the dock, since minimized windows in the dock don't uses collapse boxes to unminimize. |
| kEventWindowExpanded | Notification that the window has successfully expanded. |
| kEventWindowExpandAll | Sent by the standard window handler (when the option key is down) after it has received kEventWindowClickCollapseRgn and then received true from a call to TrackBox. The standard window handler's response is to send each window of the same class as the clicked window a kEventWindowExpand event. |
| kEventWindowClose | Sent by the standard window handler after it has received kEventWindowClickCloseRgn and successfully called TrackBox. Your application might intercept this event to check if the document is dirty, and display a Save/Don'tSave/Cancel alert. |
| kEventWindowClosed | Dispatched by DisposeWindow before the object is disposed. |
| kEventWindowCloseAll | Sent by the standard window handler (when the option key is down) after it has received kEventWindowClickCloseRgn and received true from a call to TrackGoAway. The standard window handler's response is to send each window with the same class as the clicked window a kEventWindowClose event. |
| kEventWindowZoom | Sent by the standard window handler upon receiving kEventWindowClickZoomRgn and then receiving true from a call to TrackBox. The standard window handler's response is to zoom the window using ZoomWindowIdeal. Upon successful zoom, kEventWindowZoomed is sent. |
| kEventWindowZoomed | Notification that the window has been successfully zoomed. |
| kEventWindowZoomAll | Sent by the standard window handler (when the option key is down) after it has received kEventObjectClickZoomRgn and received true from a call to TrackBox. The standard window handler's response is to send each window with the same class as the clicked window a kEventObjectZoom event and then to reposition all zoomed windows using the kWindowCascadeOnParentWindowScreen positioning method. |
| kEventWindowContextualMenuSelect | Sent when either the right mouse button is pressed, or the control key is held down and the left mouse button is pressed, or the left mouse button is held down for more than 1/4th of a second (and nothing else is handling the generated mouse tracking events). The standard window handler ignores this event. |
| kEventWindowPathSelect | Sent when IsWindowPathSelectClick would return true. Set the MenuRef in the event if you wish to customize the menu passed to WindowPathSelect. |
| kEventWindowGetIdealSize | Sent by the standard window handler to determine the standard state for zooming. |
| kEventWindowGetMinimumSize | Sent by the standard window handler to determine the minimum size of the window (used during window resizing). |
| kEventWindowGetMaximumSize | Sent by the standard window handler to determine the maximum size of the window (used during window resizing). |
| kEventWindowConstrain | Sent by the Window Manager to warn of a change in the available window positioning bounds on the window (i.e., screen resolution or Dock size change). Available only in Mac OS X. In Mac OS 10.0.x, the standard window handler always constrains the window to the rect returned by GetAvailableWindowPositioningBounds for the window's device. In Mac OS 10.1 and later, event handlers may change the rect in the kEventParamAvailableBounds parameter, and the standard window handler will constrain the window to that rectangle. In Mac OS X after 10.1, this event may optionally contain a kEventParamAttributes parameter; if present, this parameter should be formed from constants in the WindowConstrainOptions enumeration. The standard window handler will pass these attributes to ConstrainWindowToScreen. If this event parameter is not present, the standard window handler passes kWindowConstrainMoveRegardlessOfFit to ConstrainWindowToScreen in 10.0.x, and kWindowConstrainMoveRegardlessOfFit | kWindowConstrainAllowPartial in Mac OS 10.1 and later. In Mac OS X after 10.1, this event may optionally contain a kEventParamWindowRegionCode parameter; if present, this parameter should be a WindowRegionCode. The standard window handler will pass this code to ConstrainWindowToScreen. If this event parameter is not present, the standard window handler passes kWindowDragRgn to ContrainWindowToScreen. In Mac OS X after 10.1, this event may optionally contain a kEventParamRgnHandle parameter; if present, this parameter is a RgnHandle containing the GrayRgn before a GDevice configuration change. An event handler may compare this region with the current GrayRgn to more intelligently determine whether the window should be constrained to current GrayRgn. The standard window handler in Mac OS X after 10.1 will not constrain windows that were not onscreen before the device configuration change. |
| kEventWindowHandleContentClick | Sent by the standard window handler in response to kEventWindowClickContentRgn when a mouse click is in the content region but is not a contextual menu invocation or a click on a control. Available starting with Mac OS X and CarbonLib 1.3.1. |
| kEventWindowProxyBeginDrag | Sent before a proxy icon drag; you can attach data to the DragRef in the event. |
| kEventWindowProxyEndDrag | Sent after the proxy icon drag is complete, whether successful or not. |
| kEventWindowToolbarSwitchMode | Sent by the standard window handler in response to kEventWindowClickToolbarButtonRgn and then receiving true from a call to TrackBox. You actually DO NOT need to use the standard window event handler to receive this event. Any window with the toolbar button will receive this event if the toolbar button is clicked. The Toolbox does not track the state of the toolbar. We only report that the button was clicked. The application should react accordingly. (Mac OS X only) |
| anonymous enum |
Parameters for window action events:
kEventWindowCollapse --> kEventParamDirectObject typeWindowRef
kEventWindowCollapsed --> kEventParamDirectObject typeWindowRef
kEventWindowCollapseAll --> kEventParamDirectObject typeWindowRef
kEventWindowExpand --> kEventParamDirectObject typeWindowRef
kEventWindowExpanded --> kEventParamDirectObject typeWindowRef
kEventWindowExpandAll --> kEventParamDirectObject typeWindowRef
kEventWindowClose --> kEventParamDirectObject typeWindowRef
kEventWindowClosed --> kEventParamDirectObject typeWindowRef
kEventWindowCloseAll --> kEventParamDirectObject typeWindowRef
kEventWindowZoom --> kEventParamDirectObject typeWindowRef
kEventWindowZoomed --> kEventParamDirectObject typeWindowRef
kEventWindowZoomAll --> kEventParamDirectObject typeWindowRef
kEventWindowContextualMenuSelect --> kEventParamDirectObject typeWindowRef
kEventWindowPathSelect --> kEventParamDirectObject typeWindowRef
kEventWindowGetIdealSize --> kEventParamDirectObject typeWindowRef <– kEventParamDimensions typeQDPoint
kEventWindowGetMinimumSize --> kEventParamDirectObject typeWindowRef <– kEventParamDimensions typeQDPoint
kEventWindowGetMaximumSize --> kEventParamDirectObject typeWindowRef <– kEventParamDimensions typeQDPoint
kEventWindowConstrain --> kEventParamDirectObject typeWindowRef --> kEventParamAvailableBounds typeQDRectangle --> kEventParamAttributes typeUInt32 (optional; available in Mac OS X after 10.1) --> kEventParamWindowRegionCode typeWindowRegionCode (optional; available in Mac OS X after 10.1) --> kEventParamRgnHandle typeQDRgnHandle (optional; available in Mac OS X after 10.1)
kEventWindowHandleContentClick --> kEventParamDirectObject typeWindowRef --> [other parameters from kEventMouseDown]
kEventWindowProxyBeginDrag --> kEventParamDirectObject typeWindowRef
kEventWindowProxyEndDrag --> kEventParamDirectObject typeWindowRef Summary: Window focus events (kEventClassWindow)
Discussion: Events related to focus changes between windows. These events are generated by SetUserFocusWindow; since that API is only called by default by the standard window handler, these events are normally only sent to windows with the standard handler installed.
| anonymous enum |
Parameters for window focus events:
kEventWindowFocusAcquire --> kEventParamDirectObject typeWindowRef
kEventWindowFocusRelinquish --> kEventParamDirectObject typeWindowRef Summary: Window definition events (kEventClassWindow)
Discussion: Events that correspond to WDEF messages. Sent to all windows, regardless of whether they have the standard window handler installed.
| Enumerator | |
|---|---|
| kEventWindowDrawFrame | Sent by the Window Manager when it's time to draw a window's structure. This is the replacement to the old wDraw defProc message (though it is a special case of the 0 part code indicating to draw the entire window frame). |
| kEventWindowDrawPart | Sent by the Window Manager when it's time to draw a specific part of a window's structure, such as the close box. This is typically sent during window tracking. |
| kEventWindowGetRegion | Sent by the Window Manager when it needs to get a specific region from a window, or when the GetWindowRegion API is called. The region you should modify is sent in the kEventParamRgnHandle parameter. |
| kEventWindowHitTest | Sent when the Window Manager needs to determine what part of a window would be 'hit' with a given mouse location in global coordinates. If you handle this event, you should set the kEventParamWindowDefPart parameter to reflect the part code hit. |
| kEventWindowInit | Sent by the Window Manager when the window is being created. This is a hook to allow you to do any initialization you might need to do. |
| kEventWindowDispose | Sent by the Window Manager when the window is being disposed. |
| kEventWindowDragHilite | Sent by the Window Manager when it is time to draw/erase any drag hilite in the window structure. This is typically sent from within HiliteWindowFrameForDrag. |
| kEventWindowModified | Sent by the Window Manager when it is time to redraw window structure to account for a change in the document modified state. This is typically sent from within SetWindowModified. |
| kEventWindowSetupProxyDragImage | Sent by the Window Manager when it is time to generate a drag image for the window proxy. This is typically sent from within BeginWindowProxyDrag. |
| kEventWindowStateChanged | Sent by the Window Manager when a particular window state changes. See the state-change flags in MacWindows.h. |
| kEventWindowMeasureTitle | Sent when the Window Manager needs to know how much space the window's title area takes up. |
| kEventWindowDrawGrowBox | This is a compatibility event harkening back to the old days before Mac OS 8. Not very useful these days. When the DrawGrowIcon API is called, this event is sent to the window to tell it to draw the grow box. This is only really needed for windows that do not have the grow box integrated into the window frame. Scroll bar delimiter lines are also drawn. |
| kEventWindowGetGrowImageRegion | This is a special way for a window to override the standard resize outline for windows that do not do live resizing. As the user resizes the window, this event is sent with the current size the user has chosen expressed as a rectangle. You should calculate your window outline and modify the kEventParamRgnHandle parameter to reflect your desired outline. |
| kEventWindowPaint | When the Window Manager needs to paint a window (e.g, when a window is first displayed), the kEventWindowPaint event is sent to allow the window to control all aspect of painting, including the window frame. If a window does not respond to this event, the Window Manager ends up sending kEventWindowDrawFrame and then erasing the window to the window content color as usual. This is mostly used for specialty windows, such as help tags or appliance apps might have. (Mac OS X only) |
| anonymous enum |
Parameters for window definition events:
kEventWindowDrawFrame --> kEventParamDirectObject typeWindowRef the window
kEventWindowDrawPart --> kEventParamDirectObject typeWindowRef the window --> kEventParamWindowDefPart typeWindowDefPartCode the part to draw
kEventWindowGetRegion --> kEventParamDirectObject typeWindowRef the window --> kEventParamWindowRegionCode typeWindowRegionCode the region to get --> kEventParamRgnHandle typeQDRgnHandle the region to munge
kEventWindowHitTest --> kEventParamDirectObject typeWindowRef the window --> kEventParamMouseLocation typeQDPoint the mouse location <– kEventParamWindowDefPart typeWindowDefPartCode the part hit
kEventWindowInit --> kEventParamDirectObject typeWindowRef the window <– kEventParamWindowFeatures typeUInt32 the window features
kEventWindowDispose --> kEventParamDirectObject typeWindowRef the window
kEventWindowDragHilite --> kEventParamDirectObject typeWindowRef the window --> kEventParamWindowDragHiliteFlag typeBoolean whether to draw (true) or erase (false) the hilite
kEventWindowModified --> kEventParamDirectObject typeWindowRef the window --> kEventParamWindowModifiedFlag typeBoolean the new modified state
kEventWindowSetupProxyDragImage --> kEventParamDirectObject typeWindowRef the window --> kEventParamWindowProxyImageRgn typeQDRgnHandle the region you modify to contain the clip region for the GWorld. --> kEventParamWindowProxyOutlineRgn typeQDRgnHandle the region you modify to contain the drag outline used when the GWorld cannot be used. <– kEventParamWindowProxyGWorldPtr typeGWorldPtr a GWorld you allocate which contains the drag image.
kEventWindowStateChanged --> kEventParamDirectObject typeWindowRef the window --> kEventParamWindowStateChangedFlags typeUInt32 the state change flags
kEventWindowMeasureTitle --> kEventParamDirectObject typeWindowRef the window <– kEventParamWindowTitleFullWidth typeSInt16 the length of the whole title area <– kEventParamWindowTitleTextWidth typeSInt16 the length just the title text
kEventWindowDrawGrowBox --> kEventParamDirectObject typeWindowRef the window
kEventWindowGetGrowImageRegion --> kEventParamDirectObject typeWindowRef the window --> kEventParamWindowGrowRect typeQDRectangle the global rect --> kEventParamRgnHandle typeQDRgnHandle the region to modify
kEventWindowPaint --> kEventParamDirectObject typeWindowRef the window Summary: Menu events (kEventClassMenu)
| anonymous enum |
Discussion: Menu context flags indicate the context or usage of a menu-related Carbon event.
| anonymous enum |
Parameters for menu events:
kEventMenuBeginTracking --> kEventParamDirectObject typeMenuRef --> kEventParamCurrentMenuTrackingMode typeMenuTrackingMode --> kEventParamMenuContext typeUInt32 (on Mac OS X 10.1 and later, and CarbonLib 1.5 and later)
kEventMenuEndTracking --> kEventParamDirectObject typeMenuRef --> kEventParamMenuContext typeUInt32 (on Mac OS X 10.1 and later, and CarbonLib 1.5 and later)
kEventMenuChangeTrackingMode --> kEventParamCurrentMenuTrackingMode typeMenuTrackingMode --> kEventParamNewMenuTrackingMode typeMenuTrackingMode --> kEventParamMenuContext typeUInt32
kEventMenuOpening --> kEventParamDirectObject typeMenuRef --> kEventParamMenuFirstOpen typeBoolean --> kEventParamMenuContext typeUInt32 (in CarbonLib 1.5 and later)
kEventMenuClosed --> kEventParamDirectObject typeMenuRef --> kEventParamMenuContext typeUInt32 (on Mac OS X 10.1 and later, and CarbonLib 1.5 and later)
kEventMenuTargetItem --> kEventParamDirectObject typeMenuRef --> kEventParamMenuItemIndex typeMenuItemIndex --> kEventParamMenuCommand typeMenuCommand --> kEventParamMenuContext typeUInt32 (on Mac OS X 10.1 and later, and CarbonLib 1.5 and later)
kEventMenuMatchKey --> kEventParamDirectObject typeMenuRef --> kEventParamEventRef typeEventRef --> kEventParamMenuEventOptions typeMenuEventOptions --> kEventParamMenuContext typeUInt32 (on Mac OS X 10.1 and later, and CarbonLib 1.5 and later) <– kEventParamMenuItemIndex typeMenuItemIndex
kEventMenuEnableItems --> kEventParamDirectObject typeMenuRef --> kEventParamEnableMenuForKeyEvent typeBoolean --> kEventParamMenuContext typeUInt32 (in CarbonLib 1.3.1 and later)
kEventMenuPopulate (on Mac OS X 10.1 and later, and CarbonLib 1.5 and later) --> kEventParamDirectObject typeMenuRef --> kEventParamMenuContext typeUInt32
kEventMenuMeasureItemWidth (on Mac OS X 10.1 and later, and CarbonLib 1.5 and later) --> kEventParamDirectObject typeMenuRef --> kEventParamMenuItemIndex typeMenuItemIndex <– kEventParamMenuItemWidth typeShortInteger
kEventMenuMeasureItemHeight (on Mac OS X 10.1 and later, and CarbonLib 1.5 and later) --> kEventParamDirectObject typeMenuRef --> kEventParamMenuItemIndex typeMenuItemIndex <– kEventParamMenuItemHeight typeShortInteger
kEventMenuDrawItem (on Mac OS X 10.1 and later, and CarbonLib 1.5 and later) --> kEventParamDirectObject typeMenuRef --> kEventParamCurrentBounds typeQDRectangle --> kEventParamMenuItemIndex typeMenuItemIndex --> kEventParamMenuItemBounds typeQDRectangle --> kEventParamMenuVirtualTop typeLongInteger --> kEventParamMenuVirtualBottom typeLongInteger --> kEventParamMenuDrawState typeThemeMenuState --> kEventParamMenuItemType typeThemeMenuItemType --> kEventParamCGContextRef typeCGContextRef <– kEventParamMenuMarkBounds typeQDRectangle (added to event by the default event handler) <– kEventParamMenuIconBounds typeQDRectangle (added to event by the default event handler) <– kEventParamMenuTextBounds typeQDRectangle (added to event by the default event handler) <– kEventParamMenuTextBaseline typeShortInteger (added to event by the default event handler) <– kEventParamMenuCommandKeyBounds typeQDRectangle (added to event by the default event handler)
kEventMenuDrawItemContent (on Mac OS X 10.1 and later, and CarbonLib 1.5 and later) --> kEventParamDirectObject typeMenuRef --> kEventParamMenuItemIndex typeMenuItemIndex --> kEventParamMenuItemBounds typeQDRectangle --> kEventParamDeviceDepth typeShortInteger --> kEventParamDeviceColor typeBoolean --> kEventParamCGContextRef typeCGContextRef <– kEventParamMenuMarkBounds typeQDRectangle (added to event by the default event handler) <– kEventParamMenuIconBounds typeQDRectangle (added to event by the default event handler) <– kEventParamMenuTextBounds typeQDRectangle (added to event by the default event handler) <– kEventParamMenuTextBaseline typeShortInteger (added to event by the default event handler) <– kEventParamMenuCommandKeyBounds typeQDRectangle (added to event by the default event handler)
kEventMenuDispose --> kEventParamDirectObject typeMenuRef Summary: Command events (kEventClassCommand)
| anonymous enum |
Parameters for command events:
kEventCommandProcess --> kEventParamDirectObject typeHICommand --> kEventParamKeyModifiers typeUInt32 (optional)
kEventCommandUpdateStatus --> kEventParamDirectObject typeHICommand --> kEventParamMenuContext typeUInt32 Summary: Common command IDs
| anonymous enum |
Summary: Control events (kEventClassControl)
| anonymous enum |
Summary: Control bounds change event attributes
Discussion: When the toolbox sends out a kEventControlBoundsChanged event, it also sends along a parameter containing attributes of the event. These attributes can be used to determine what aspect of the control changed (position, size, or both).
| Enumerator | |
|---|---|
| kControlBoundsChangeSizeChanged | The dimensions of the control (width and height) changed. |
| kControlBoundsChangePositionChanged | The top left corner (position) changed. |
| anonymous enum |
Parameters for control events:
kEventControlInitialize --> kEventParamDirectObject typeControlRef --> kEventParamInitCollection typeCollection <– kEventParamControlFeatures typeUInt32
kEventControlDispose --> kEventParamDirectObject typeControlRef
kEventControlGetOptimalBounds Required parameters: --> kEventParamDirectObject typeControlRef <– kEventParamControlOptimalBounds typeQDRectangle
Optional parameters: <– kEventParamControlOptimalBaselineOffset typeShortInteger (optional)
kEventControlHit --> kEventParamDirectObject typeControlRef --> kEventParamControlPart typeControlPartCode --> kEventParamKeyModifiers typeUInt32
kEventControlSimulateHit --> kEventParamDirectObject typeControlRef
kEventControlHitTest --> kEventParamDirectObject typeControlRef --> kEventParamMouseLocation typeQDPoint <– kEventParamControlPart typeControlPartCode
kEventControlDraw Required parameters: --> kEventParamDirectObject typeControlRef
Optional parameters: --> kEventParamControlPart typeControlPartCode (draw the entire control if kEventParamControlPart is not present) --> kEventParamGrafPort typeGrafPtr (draw into the current port if kEventParamGrafPort is not present)
kEventControlApplyBackground Required parameters: --> kEventParamDirectObject typeControlRef --> kEventParamControlSubControl typeControlRef --> kEventParamControlDrawDepth typeShortInteger --> kEventParamControlDrawInColor typeBoolean
Optional parameters: --> kEventParamGrafPort typeGrafPtr (apply to the current port if kEventParamGrafPort is not present)
kEventControlApplyTextColor Required parameters: --> kEventParamDirectObject typeControlRef --> kEventParamControlSubControl typeControlRef --> kEventParamControlDrawDepth typeShortInteger --> kEventParamControlDrawInColor typeBoolean
Optional parameters: --> kEventParamCGContextRef typeCGContextRef --> kEventParamGrafPort typeGrafPtr (apply to the current port if kEventParamGrafPort is not present)
kEventControlSetFocusPart --> kEventParamDirectObject typeControlRef <-> kEventParamControlPart typeControlPartCode
kEventControlGetFocusPart --> kEventParamDirectObject typeControlRef <– kEventParamControlPart typeControlPartCode
kEventControlActivate --> kEventParamDirectObject typeControlRef
kEventControlDeactivate --> kEventParamDirectObject typeControlRef
kEventControlSetCursor --> kEventParamDirectObject typeControlRef --> kEventParamMouseLocation typeQDPoint --> kEventParamKeyModifiers typeUInt32
kEventControlContextualMenuClick --> kEventParamDirectObject typeControlRef --> kEventParamMouseLocation typeQDPoint
kEventControlClick --> kEventParamDirectObject typeControlRef --> [other parameters from kEventMouseDown]
kEventControlTrack --> kEventParamDirectObject typeControlRef --> kEventParamMouseLocation typeQDPoint <-> kEventParamKeyModifiers typeUInt32 --> kEventParamControlAction typeControlActionUPP <– kEventParamControlPart typeControlPartCode
kEventControlGetScrollToHereStartPoint --> kEventParamDirectObject typeControlRef <-> kEventParamMouseLocation typeQDPoint --> kEventParamKeyModifiers typeUInt32
kEventControlGetIndicatorDragConstraint --> kEventParamDirectObject typeControlRef --> kEventParamMouseLocation typeQDPoint --> kEventParamKeyModifiers typeUInt32 <– kEventParamControlIndicatorDragConstraint typeIndicatorDragConstraint
kEventControlIndicatorMoved --> kEventParamDirectObject typeControlRef --> kEventParamControlIndicatorRegion typeQDRgnHandle --> kEventParamControlIsGhosting typeBoolean
kEventControlGhostingFinished --> kEventParamDirectObject typeControlRef --> kEventParamControlIndicatorOffset typeQDPoint
kEventControlGetActionProcPart --> kEventParamDirectObject typeControlRef --> kEventParamKeyModifiers typeUInt32 <-> kEventParamControlPart typeControlPartCode
kEventControlGetPartRegion --> kEventParamDirectObject typeControlRef --> kEventParamControlPart typeControlPartCode --> kEventParamControlRegion typeQDRgnHandle
kEventControlGetPartBounds --> kEventParamDirectObject typeControlRef --> kEventParamControlPart typeControlPartCode <– kEventParamControlPartBounds typeQDRectangle
kEventControlSetData --> kEventParamDirectObject typeControlRef --> kEventParamControlPart typeControlPartCode --> kEventParamControlDataTag typeEnumeration --> kEventParamControlDataBuffer typePtr --> kEventParamControlDataBufferSize typeLongInteger
kEventControlGetData --> kEventParamDirectObject typeControlRef --> kEventParamControlPart typeControlPartCode --> kEventParamControlDataTag typeEnumeration --> kEventParamControlDataBuffer typePtr <-> kEventParamControlDataBufferSize typeLongInteger
kEventControlValueFieldChanged --> kEventParamDirectObject typeControlRef
kEventControlAddedSubControl --> kEventParamDirectObject typeControlRef --> kEventParamControlSubControl typeControlRef
kEventControlRemovingSubControl --> kEventParamDirectObject typeControlRef --> kEventParamControlSubControl typeControlRef
kEventControlBoundsChanged --> kEventParamDirectObject typeControlRef --> kEventParamAttributes typeUInt32 --> kEventParamOriginalBounds typeQDRectangle --> kEventParamPreviousBounds typeQDRectangle --> kEventParamCurrentBounds typeQDRectangle
kEventControlOwningWindowChanged --> kEventParamDirectObject typeControlRef --> kEventParamAttributes typeUInt32 --> kEventParamControlOriginalOwningWindow typeWindowRef --> kEventParamControlCurrentOwningWindow typeWindowRef
kEventControlArbitraryMessage --> kEventParamDirectObject typeControlRef --> kEventParamControlMessage typeShortInteger --> kEventParamControlParam typeLongInteger <– kEventParamControlResult typeLongInteger Summary: Tablet events (kEventClassTablet)
| anonymous enum |
Summary: Volume events (kEventClassVolume)
| anonymous enum |
Parameters for volume events:
kEventVolumeMounted --> kEventParamDirectObject typeFSVolumeRefNum
kEventVolumeUnmounted --> kEventParamDirectObject typeFSVolumeRefNum
| anonymous enum |
| anonymous enum |
Parameters for appearance events:
kEventAppearanceScrollBarVariantChanged --> kEventParamNewScrollBarVariant typeShortInteger Summary: Services events (kEventClassService)
Discussion: Services are a feature by which applications can communicate with one another to request and provide services. This communication happens through the Scrap Manager. When an event is sent that requires communication for processing or servicing a request, you will need to use the scrap that is given in the kEventParamScrapRef parameter of the event in order to communicate. When your app requests a service, it is usually acting on data that is currently selected or in focus. Therefore all of the Services events are sent to the UserFocus event target. Service events are available on Mac OS X 10.1 and later.
| Enumerator | |
|---|---|
| kEventServiceCopy | The user has invoked a service that requires the application to update the given scrap in the kEventParamScrapRef parameter with appropriate data from the focus. |
| kEventServicePaste | The user has invoked a service that requires the application to update the current focus with data from the scrap that is given in the kEventParamScrapRef parameter. |
| kEventServiceGetTypes | The Services Manager needs to know what types of data the application can copy and paste to and from the scrap in order to update the Services menu to enable items that the user can select. This event sends two CFMutableArrayRefs for the application to add the types to: the kEventParamServiceCopyTypes and the kEventParamServicePasteTypes parameters. The types that are added are CFStringRefs. There is a convenience function, CreateTypeStringWithOSType(), which takes an OSType and will create a CFStringRef that you can add to the array(s). |
| kEventServicePerform | If the application is a service provider, this event will get sent when a Service is requested of the app. The scrap that should be used to send and receive data from the requester is provided in the kEventParamScrapRef parameter. The kEventParamServiceMessageName parameter contains a CFStringRef that indicates which advertised service was invoked. |
| OSStatus AddEventTypesToHandler | ( | EventHandlerRef | inHandlerRef, |
| UInt32 | inNumTypes, | ||
| const EventTypeSpec * | inList | ||
| ) |
Discussion: Adds additional events to an event handler that has already been installed.
Parameters:
inHandlerRef: The event handler to add the additional events to.
inNumTypes: The number of events to add.
inList: A pointer to an array of EventTypeSpec entries.
Result: An operating system result code.
Availability:
| OSStatus BeginAppModalStateForWindow | ( | WindowRef | inWindow | ) |
Discussion: This routine is a lower level routine than RunAppModalLoopForWindow. It can be used if you wish to enter an app modal state for a window, but need to control the event loop yourself for whatever reason. In most cases, you would use RunAppModalLoopForWindow. Once you begin your app modal state, the menu bar will disable and prepare for the modal situation. The window must be visible when calling BeginAppModalStateForWindow; otherwise, windowWrongStateErr is returned. In Mac OS 10.0.x and CarbonLib 1.3.1, BeginAppModalStateForWindow can only be called on a window once; future calls will return an error. This bug is fixed in Mac OS 10.1 and CarbonLib 1.4.
Parameters:
inWindow: The window you wish to behave modally.
Result: An operating system status code.
Availability:
| typedef CALLBACK_API | ( | Boolean | , |
| EventComparatorProcPtr | |||
| ) |
EventComparatorProcPtr
Discussion: Type of a callback function used by queue searches.
Parameters:
inEvent: The event to compare.
inCompareData: The data used to compare the event.
Result: A boolean value indicating whether the event matches (true) or not (false).
| typedef CALLBACK_API | ( | OSStatus | , |
| EventHandlerProcPtr | |||
| ) |
EventHandlerProcPtr
Discussion: Callback for receiving events sent to a target this callback is installed on.
Parameters:
inHandlerCallRef: A reference to the current handler call chain. This is sent to your handler so that you can call CallNextEventHandler if you need to.
inEvent: The Event.
inUserData: The app-specified data you passed in a call to InstallEventHandler.
Result: An operating system result code. Returning noErr indicates you handled the event. Returning eventNotHandledErr indicates you did not handle the event and perhaps the toolbox should take other action.
| typedef CALLBACK_API | ( | void | , |
| EventLoopTimerProcPtr | |||
| ) |
EventLoopTimerProcPtr
Discussion: Called when a timer fires.
Parameters:
inTimer: The timer that fired.
inUserData: The data passed into InstallEventLoopTimer.
| OSStatus CallNextEventHandler | ( | EventHandlerCallRef | inCallRef, |
| EventRef | inEvent | ||
| ) |
Discussion: Calls thru to the event handlers below you in the event handler stack of the target to which your handler is bound. You might use this to call thru to the default toolbox handling in order to post-process the event. You can only call this routine from within an event handler.
Parameters:
inCallRef: The event handler call ref passed into your event handler.
inEvent: The event to pass thru.
Result: An operating system result code.
Availability:
| Boolean ConvertEventRefToEventRecord | ( | EventRef | inEvent, |
| EventRecord * | outEvent | ||
| ) |
ConvertEventRefToEventRecord()
Discussion: This is a convenience routine to help you if there are places in your application where you need an EventRecord and all you have is an EventRef. If the event can be converted, outEvent is filled in and the function returns true. If not, false is returned and outEvent will contain a nullEvent.
Parameters:
inEvent: The EventRef to convert into an EventRecord.
outEvent: The EventRecord to fill out.
Result: A boolean indicating if the conversion was successful (true) or not (false).
Availability:
Availability:
| CFStringRef CreateTypeStringWithOSType | ( | OSType | inType | ) |
Parameters for service events:
kEventServiceCopy --> kEventParamScrapRef typeScrapRef
kEventServicePaste --> kEventParamScrapRef typeScrapRef
kEventServiceGetTypes --> kEventParamServiceCopyTypes typeCFMutableArrayRef of CFStringRefs --> kEventParamServicePasteTypes typeCFMutableArrayRef of CFStringRefs
kEventServicePerform --> kEventParamScrapRef typeScrapRef --> kEventParamServiceMessageName typeCFStringRef --> kEventParamServiceUserData typeCFStringRef CreateTypeStringWithOSType()
Discussion: This routine is used to convert an OSType to a CFStringRef that Services will understand.
Parameters:
inType: The OSType that needs to be converted to a CFString.
Result: A CFStringRef that contains the string that corresponds to the given OSType. This follows CoreFoundation semantics in that it will return NULL for failure, and because it is a "Create" function you will need to CFRelease() this string when it is no longer needed.
Availability:
| void DisposeEventComparatorUPP | ( | EventComparatorUPP | userUPP | ) |
Availability:
| void DisposeEventHandlerUPP | ( | EventHandlerUPP | userUPP | ) |
Availability:
| void DisposeEventLoopTimerUPP | ( | EventLoopTimerUPP | userUPP | ) |
Availability:
| OSStatus EndAppModalStateForWindow | ( | WindowRef | inWindow | ) |
Discussion: This routine ends an app modal state started with BeginAppModalStateForWindow.
Parameters:
inWindow: The window you wish to stop acting as app modal.
Result: An operating system status code.
Availability:
| EventRef FindSpecificEventInQueue | ( | EventQueueRef | inQueue, |
| EventComparatorUPP | inComparator, | ||
| void * | inCompareData | ||
| ) |
Discussion: Returns the first event that matches a comparator function, or NULL if no events match.
Parameters:
inQueue: The event queue to search.
inComparator: The comparison function to invoke for each event in the queue.
inCompareData: The data you wish to pass to your comparison function.
Result: An event reference.
Availability:
| OSStatus FlushEventQueue | ( | EventQueueRef | inQueue | ) |
Discussion: Flushes all events from an event queue.
Parameters:
inQueue: The event queue to flush.
Result: An operating system result code.
Availability:
| OSStatus FlushEventsMatchingListFromQueue | ( | EventQueueRef | inQueue, |
| UInt32 | inNumTypes, | ||
| const EventTypeSpec * | inList | ||
| ) |
FlushEventsMatchingListFromQueue()
Discussion: Flushes events matching a specified list of classes and kinds from an event queue.
Parameters:
inQueue: The event queue to flush events from.
inNumTypes: The number of event kinds to flush.
inList: The list of event classes and kinds to flush from the queue.
Result: An operating system result code.
Availability:
| OSStatus FlushSpecificEventsFromQueue | ( | EventQueueRef | inQueue, |
| EventComparatorUPP | inComparator, | ||
| void * | inCompareData | ||
| ) |
FlushSpecificEventsFromQueue()
Discussion: Flushes events that match a comparator function.
Parameters:
inQueue: The event queue to flush events from.
inComparator: The comparison function to invoke for each event in the queue.
inCompareData: The data you wish to pass to your comparison function.
Result: An operating system result code.
Availability:
| EventTargetRef GetApplicationEventTarget | ( | void | ) |
Discussion: Returns the EventTargetRef for the application. Once you obtain this reference, you can send events to the target and install event handler on it.
Result: An EventTargetRef.
Availability:
| CFTypeRef GetCFRunLoopFromEventLoop | ( | EventLoopRef | inEventLoop | ) |
Discussion: Returns the corresponding CFRunLoopRef for the given EventLoop. This is not necessarily a one-to-one mapping, hence the need for this function. In Carbon, all cooperative threads use the same run loop under the covers, so using CFRunLoopGetCurrent might yield the wrong result. In general, you would only need to use this function if you wished to add your own sources to the run loop. If you don't know what I'm talking about, then you probably don't need to use this.
Parameters:
inEventLoop: The event loop to get the CFRunLoop for.
Result: The CFRunLoopRef for inEventLoop.
Availability:
| EventTargetRef GetControlEventTarget | ( | ControlRef | inControl | ) |
Discussion: Returns the EventTargetRef for the specified control. Once you obtain this reference, you can send events to the target and install event handler on it.
Parameters:
inControl: The control to return the target for.
Result: An EventTargetRef.
Availability:
| EventLoopRef GetCurrentEventLoop | ( | void | ) |
Discussion: Returns the current event loop for the current thread. If the current thread is a cooperative thread, the main event loop is returned.
Result: An event loop reference.
Availability:
| EventQueueRef GetCurrentEventQueue | ( | void | ) |
Discussion: Returns the current event queue for the current thread. If the current thread is a cooperative thread, the main event queue is returned.
Result: An event queue reference.
Availability:
| EventTime GetCurrentEventTime | ( | void | ) |
Discussion: Returns the current time since last system startup in seconds.
Result: EventTime.
Availability:
| UInt32 GetEventClass | ( | EventRef | inEvent | ) |
Discussion: Returns the class of the given event, such as mouse, keyboard, etc.
Parameters:
inEvent: The event in question.
Result: The class ID of the event.
Availability:
| EventTargetRef GetEventDispatcherTarget | ( | void | ) |
Discussion: Returns the EventTargetRef for the standard toolbox dispatcher. You typically would never need to use this, but there are some exotic apps that need to pick events off the event queue and call the dispatcher themselves. This allows you to do just that instead of calling RunApplicationEventLoop to handle it all.
Result: An EventTargetRef.
Availability:
| UInt32 GetEventKind | ( | EventRef | inEvent | ) |
Discussion: Returns the kind of the given event (mousedown, etc.). Event kinds overlap between event classes, e.g. kEventMouseDown and kEventAppActivated have the same value (1). The combination of class and kind is what determines an event signature.
Parameters:
inEvent: The event in question.
Result: The kind of the event.
Availability:
| OSStatus GetEventParameter | ( | EventRef | inEvent, |
| EventParamName | inName, | ||
| EventParamType | inDesiredType, | ||
| EventParamType * | outActualType, | ||
| UInt32 | inBufferSize, | ||
| UInt32 * | outActualSize, | ||
| void * | outData | ||
| ) |
Discussion: Gets a piece of data from the given event, if it exists.
Parameters:
inEvent: The event to get the parameter from.
inName: The symbolic name of the parameter.
inDesiredType: The desired type of the parameter. At present we do not support coercion, so this parameter must be the actual type of data stored in the event, or an error will be returned.
outActualType: The actual type of the parameter, can be NULL if you are not interested in receiving this information.
inBufferSize: The size of the output buffer specified by ioBuffer.
outActualSize: The actual size of the data, or NULL if you don't want this information.
outData: The pointer to the buffer which will receive the parameter data.
Result: An operating system result code.
Availability:
| UInt32 GetEventRetainCount | ( | EventRef | inEvent | ) |
Availability:
| EventTime GetEventTime | ( | EventRef | inEvent | ) |
Discussion: Returns the time the event specified occurred, specified in EventTime, which is a floating point number representing seconds since the last system startup.
Parameters:
inEvent: The event in question.
Result: The time the event occurred.
Availability:
| EventTime GetLastUserEventTime | ( | void | ) |
Availability:
| EventLoopRef GetMainEventLoop | ( | void | ) |
Discussion: Returns the event loop object for the main application thread.
Result: An event loop reference.
Availability:
| EventQueueRef GetMainEventQueue | ( | void | ) |
Discussion: Returns the event queue object for the main application thread.
Result: An event queue reference.
Availability:
| EventTargetRef GetMenuEventTarget | ( | MenuRef | inMenu | ) |
Discussion: Returns the EventTargetRef for the specified menu. Once you obtain this reference, you can send events to the target and install event handler on it.
Parameters:
inMenu: The menu to return the target for.
Result: An EventTargetRef.
Availability:
| UInt32 GetNumEventsInQueue | ( | EventQueueRef | inQueue | ) |
Discussion: Returns the number of events in an event queue.
Parameters:
inQueue: The event queue to query.
Result: The number of items in the queue.
Availability:
| EventTargetRef GetUserFocusEventTarget | ( | void | ) |
Discussion: Returns the EventTargetRef for the current user focus at the time of the call. Keyboard events are always sent to this target.
Result: An EventTargetRef.
Availability:
| WindowRef GetUserFocusWindow | ( | void | ) |
Availability:
| OSStatus GetWindowCancelButton | ( | WindowRef | inWindow, |
| ControlRef * | outControl | ||
| ) |
Availability:
| OSStatus GetWindowDefaultButton | ( | WindowRef | inWindow, |
| ControlRef * | outControl | ||
| ) |
Availability:
| EventTargetRef GetWindowEventTarget | ( | WindowRef | inWindow | ) |
Discussion: Returns the EventTargetRef for the specified window. Once you obtain this reference, you can send events to the target and install an event handler on it.
Parameters:
inWindow: The window to return the target for.
Result: An EventTargetRef.
Availability:
| OSStatus InstallEventHandler | ( | EventTargetRef | inTarget, |
| EventHandlerUPP | inHandler, | ||
| UInt32 | inNumTypes, | ||
| const EventTypeSpec * | inList, | ||
| void * | inUserData, | ||
| EventHandlerRef * | outRef | ||
| ) |
Discussion: Installs an event handler on a specified target. Your handler proc will be called with the events you registered with when an event of the corresponding type and class are send to the target you are installing your handler on.
Parameters:
inTarget: The target to register your handler with.
inHandler: A pointer to your handler function.
inNumTypes: The number of events you are registering for.
inList: A pointer to an array of EventTypeSpec entries representing the events you are interested in.
inUserData: The value passed in this parameter is passed on to your event handler proc when it is called.
outRef: Receives an EventHandlerRef, which you can use later to remove the handler. You can pass null if you don't want the reference
Result: An operating system result code.
Availability:
| OSStatus InstallEventLoopTimer | ( | EventLoopRef | inEventLoop, |
| EventTimerInterval | inFireDelay, | ||
| EventTimerInterval | inInterval, | ||
| EventLoopTimerUPP | inTimerProc, | ||
| void * | inTimerData, | ||
| EventLoopTimerRef * | outTimer | ||
| ) |
Discussion: Installs a timer onto the event loop specified. The timer can either fire once or repeatedly at a specified interval depending on the parameters passed to this function.
Parameters:
inEventLoop: The event loop to add the timer.
inFireDelay: The delay before first firing this timer (can be 0, to request that the timer be fired as soon as control returns to your event loop). In Mac OS X and CarbonLib 1.5 and later, you may pass kEventDurationForever to stop the timer from firing at all until SetEventLoopTimerNextFireTime is used to start it; in earlier CarbonLibs, to achieve the same effect, just pass zero and then immediately call SetEventLoopTimerNextFireTime( timer, kEventDurationForever ) before returning control to your event loop.
inInterval: The timer interval (pass 0 for a one-shot timer, which executes once but does not repeat). In Mac OS X and CarbonLib 1.5 and later, you may also pass kEventDurationForever to create a one-shot timer.
inTimerProc: The routine to call when the timer fires.
inTimerData: Data to pass to the timer proc when called.
outTimer: A reference to the newly installed timer.
Result: An operating system status code.
Availability:
| OSStatus InstallStandardEventHandler | ( | EventTargetRef | inTarget | ) |
Availability:
| Boolean InvokeEventComparatorUPP | ( | EventRef | inEvent, |
| void * | inCompareData, | ||
| EventComparatorUPP | userUPP | ||
| ) |
Availability:
| OSStatus InvokeEventHandlerUPP | ( | EventHandlerCallRef | inHandlerCallRef, |
| EventRef | inEvent, | ||
| void * | inUserData, | ||
| EventHandlerUPP | userUPP | ||
| ) |
Availability:
| void InvokeEventLoopTimerUPP | ( | EventLoopTimerRef | inTimer, |
| void * | inUserData, | ||
| EventLoopTimerUPP | userUPP | ||
| ) |
Availability:
Discussion: This is a companion function for ConvertEventRefToEventRecord, and is provided as a convenience routine to help you if there are places in your application where you want to check an EventRef to see if it matches a classic EventMask bitfield. If the event matches, the function returns true.
Parameters:
inEvent: The EventRef to convert into an EventRecord.
inMask: The mask to consider.
Result: A boolean indicating if the event was considered to be in the mask provided.
Availability:
Discussion: Returns true if the specified event is posted to a queue.
Parameters:
inQueue: The queue to check.
inEvent: The event in question.
Result: A boolean value.
Availability:
| Boolean IsMouseCoalescingEnabled | ( | void | ) |
Discussion: Returns true if mouse coalescing is current enabled. When enabled, we coalesce mouse moved and mouse dragged events. By default, coalescing is on, but you can use SetMouseCoalescingEnabled to disable it if you want finer-grained mouse movement events, which is useful for drawing with tablets.
Result: A boolean indicating if coalescing is enabled.
Availability:
Discussion: Tests the event given to see whether the event represents a 'user cancel' event. Currently this is defined to be either the escape key being pressed, or command-period being pressed.
Result: A boolean value indicating whether the event is a user cancel event.
Availability:
| OSStatus MacCreateEvent | ( | CFAllocatorRef | inAllocator, |
| UInt32 | inClassID, | ||
| UInt32 | kind, | ||
| EventTime | when, | ||
| EventAttributes | flags, | ||
| EventRef * | outEvent | ||
| ) |
[Mac]CreateEvent()
Availability:
| EventComparatorUPP NewEventComparatorUPP | ( | EventComparatorProcPtr | userRoutine | ) |
Availability:
| EventHandlerUPP NewEventHandlerUPP | ( | EventHandlerProcPtr | userRoutine | ) |
Availability:
| EventLoopTimerUPP NewEventLoopTimerUPP | ( | EventLoopTimerProcPtr | userRoutine | ) |
Availability:
| OSStatus PostEventToQueue | ( | EventQueueRef | inQueue, |
| EventRef | inEvent, | ||
| EventPriority | inPriority | ||
| ) |
Discussion: Posts an event to the queue specified. This automatically wakes up the event loop of the thread the queue belongs to. After posting the event, you should release the event. The event queue retains it.
Parameters:
inQueue: The event queue to post the event onto.
inEvent: The event to post.
inPriority: The priority of the event.
Result: An operating system result code.
Availability:
| OSStatus ProcessHICommand | ( | const HICommand * | inCommand | ) |
Availability:
| void QuitApplicationEventLoop | ( | void | ) |
Discussion: This routine is used to quit the RunApplicationEventLoop function. Typically, your application doesn't need to call this. If your application has the Quit menu item tagged with the kHICommandQuit Menu Command ID, the toolbox will automatically call this for your application, automatically terminating your event loop. If your application wants to do pre-processing before the event loop exits, it should intercept either the kHICommandQuit menu command, or the kEventApplicationQuit event.
Availability:
| OSStatus QuitAppModalLoopForWindow | ( | WindowRef | inWindow | ) |
Discussion: This routine is used to quit a currently running call to RunAppModalLoopForWindow, i.e. it terminates a modal loop. Typically this would be called from a handler you have installed on the modal window in question when the user clicks the appropriate button, etc.
Parameters:
inWindow: The window for which to quit the modal state.
Result: An operating system status code.
Availability:
| OSStatus QuitEventLoop | ( | EventLoopRef | inEventLoop | ) |
Discussion: Causes a specific event loop to terminate. Usage of this is similar to WakeUpProcess, in that it causes the eventloop specified to return immediately (as opposed to timing out). Typically this call is used in conjunction with RunCurrentEventLoop.
Parameters:
inEventLoop: The event loop to terminate.
Result: An operating system result code.
Availability:
| OSStatus ReceiveNextEvent | ( | UInt32 | inNumTypes, |
| const EventTypeSpec * | inList, | ||
| EventTimeout | inTimeout, | ||
| Boolean | inPullEvent, | ||
| EventRef * | outEvent | ||
| ) |
Discussion: This routine tries to fetch the next event of a specified type. If no events in the event queue match, this routine will run the current event loop until an event that matches arrives, or the timeout expires. Except for timers firing, your application is blocked waiting for events to arrive when inside this function.
Parameters:
inNumTypes: The number of event types we are waiting for (0 if any event should cause this routine to return).
inList: The list of event types we are waiting for (pass NULL if any event should cause this routine to return).
inTimeout: The time to wait (passing kEventDurationForever is preferred).
inPullEvent: Pass true for this parameter to actually remove the next matching event from the queue.
outEvent: The next event that matches the list passed in. If inPullEvent is true, the event is owned by you, and you will need to release it when done.
Result: A result indicating whether an event was received, the timeout expired, or the current event loop was quit.
Availability:
| OSStatus RegisterEventHotKey | ( | UInt32 | inHotKeyCode, |
| UInt32 | inHotKeyModifiers, | ||
| EventHotKeyID | inHotKeyID, | ||
| EventTargetRef | inTarget, | ||
| OptionBits | inOptions, | ||
| EventHotKeyRef * | outRef | ||
| ) |
Discussion: Registers a global hot key based on the virtual key code and modifiers you pass in. Only one such combination can exist for the current application, i.e. multiple entities in the same application cannot register for the same hot key combination. The same hot key can, however, be registered by multiple applications. This means that multiple applications can potentially be notified when a particular hot key is requested. This might not necessarily be desirable, but it is how it works at present.
Parameters:
inHotKeyCode: The virtual key code of the key to watch
inHotKeyModifiers: The keyboard modifiers to look for. There must be a modifier specified, or this function will return paramErr.
inHotKeyID: The application-specified hot key ID. You will receive this in the kEventHotKeyPressed event as the direct object parameter.
inTarget: The target to notify when the hot key is pressed.
inOptions: Currently unused. Pass 0 or face the consequences.
outRef: The EventHotKeyRef that represents your new, shiny hot key. You need this if you later wish to unregister it.
Result: An operating system status code.
Availability:
| OSStatus RegisterToolboxObjectClass | ( | CFStringRef | inClassID, |
| ToolboxObjectClassRef | inBaseClass, | ||
| UInt32 | inNumEvents, | ||
| const EventTypeSpec * | inEventList, | ||
| EventHandlerUPP | inEventHandler, | ||
| void * | inEventHandlerData, | ||
| ToolboxObjectClassRef * | outClassRef | ||
| ) |
Availability:
| void ReleaseEvent | ( | EventRef | inEvent | ) |
Availability:
| OSStatus RemoveEventFromQueue | ( | EventQueueRef | inQueue, |
| EventRef | inEvent | ||
| ) |
Discussion: Removes the given event from the queue which it was posted. When you call this function, the event ownership is transferred to you, the caller, at no charge. You must release the event when you are through with it.
Parameters:
inQueue: The queue to remove the event from.
inEvent: The event to remove.
Result: An operating system result code.
Availability:
| OSStatus RemoveEventHandler | ( | EventHandlerRef | inHandlerRef | ) |
Discussion: Removes an event handler from the target it was bound to.
Parameters:
inHandlerRef: The handler ref to remove (returned in a call to InstallEventHandler). After you call this function, the handler ref is considered to be invalid and can no longer be used.
Result: An operating system result code.
Availability:
| OSStatus RemoveEventLoopTimer | ( | EventLoopTimerRef | inTimer | ) |
Discussion: Removes a timer that was previously installed by a call to InstallEventLoopTimer. You call this function when you are done using a timer.
Parameters:
inTimer: The timer to remove.
Result: An operating system status code.
Availability:
| OSStatus RemoveEventTypesFromHandler | ( | EventHandlerRef | inHandlerRef, |
| UInt32 | inNumTypes, | ||
| const EventTypeSpec * | inList | ||
| ) |
Discussion: Removes events from an event handler that has already been installed.
Parameters:
inHandlerRef: The event handler to remove the events from.
inNumTypes: The number of events to remove.
inList: A pointer to an array of EventTypeSpec entries.
Result: An operating system status code.
Availability:
Availability:
| void RunApplicationEventLoop | ( | void | ) |
Discussion: This routine is used as the main event loop for a Carbon Event-based application. Once entered, this function waits for events to arrive and dispatches them to your event handlers automatically.
Availability:
| OSStatus RunAppModalLoopForWindow | ( | WindowRef | inWindow | ) |
Discussion: This routine is used as a replacement to ModalDialog to drive a Carbon Event-based modal dialog. Once called, this routine will not exit until QuitAppModalLoopForWindow is called. In Mac OS X 10.0.x, RunAppModalLoopForWindow will fail to re-enable the menubar before exiting if you dispose of the window during the modal loop (for example, from a Carbon event handler). You can work around this bug by retaining the window before calling RunAppModalLoopForWindow, and releasing it afterwards.
Parameters:
inWindow: The window you wish to behave modally.
Result: An operating system status code.
Availability:
| OSStatus RunCurrentEventLoop | ( | EventTimeout | inTimeout | ) |
Discussion: This routine 'runs' the event loop, returning only if aborted or the timeout specified is reached. The event loop is mostly blocked while in this function, occasionally waking up to fire timers or pick up events. The typical use of this function is to cause the current thread to wait for some operation to complete, most likely on another thread of execution.
Parameters:
inTimeout: The time to wait until returning (can be kEventDurationForever).
Availability:
| OSStatus SendEventToEventTarget | ( | EventRef | inEvent, |
| EventTargetRef | inTarget | ||
| ) |
Discussion: Sends an event to the specified event target.
Parameters:
inEvent: The event to send.
inTarget: The target to send it to.
Result: An operating system result code.
Availability:
| OSStatus SetEventLoopTimerNextFireTime | ( | EventLoopTimerRef | inTimer, |
| EventTimerInterval | inNextFire | ||
| ) |
SetEventLoopTimerNextFireTime()
Discussion: This routine is used to 'reset' a timer. It controls the next time the timer fires. This will override any interval you might have set. For example, if you have a timer that fires every second, and you call this function setting the next time to five seconds from now, the timer will sleep for five seconds, then fire. It will then resume its one-second interval after that. It is as if you removed the timer and reinstalled it with a new first-fire delay.
Parameters:
inTimer: The timer to adjust
inNextFire: The interval from the current time to wait until firing the timer again. You may pass kEventDurationForever to stop the timer from firing at all.
Result: An operating system status code.
Availability:
| OSStatus SetEventParameter | ( | EventRef | inEvent, |
| EventParamName | inName, | ||
| EventParamType | inType, | ||
| UInt32 | inSize, | ||
| const void * | inDataPtr | ||
| ) |
Discussion: Sets a piece of data for the given event.
Parameters:
inEvent: The event to set the data for.
inName: The symbolic name of the parameter.
inType: The symbolic type of the parameter.
inSize: The size of the parameter data.
inDataPtr: The pointer to the parameter data.
Result: An operating system result code.
Availability:
| OSStatus SetEventTime | ( | EventRef | inEvent, |
| EventTime | inTime | ||
| ) |
Discussion: This routine allows you to set the time of a given event, if you so desire. In general, you would never use this routine, except for those special cases where you reuse an event from time to time instead of creating a new event each time.
Parameters:
inEvent: The event in question.
inTime: The new time.
Result: An operating system result code.
Availability:
Discussion: Allows you to set mouse move/drag event coalescing on or off. By default, coalescing is on, but you can use this function to disable it if you want finer-grained mouse movement events, which is useful for drawing with tablets.
Parameters:
inNewState: A boolean indicating if coalescing should be enabled (true) or disabled (false).
outOldState: A boolean which receives the prior state of mouse coalescing for restoration later. You can pass NULL for this parameter if you don't care.
Result: An operating system status result.
Availability:
| OSStatus SetUserFocusWindow | ( | WindowRef | inWindow | ) |
Availability:
| OSStatus SetWindowCancelButton | ( | WindowRef | inWindow, |
| ControlRef | inControl | ||
| ) |
Availability:
| OSStatus SetWindowDefaultButton | ( | WindowRef | inWindow, |
| ControlRef | inControl | ||
| ) |
Availability:
Discussion: Once entered, this routine waits for certain mouse events (move, mouse down, mouse up). When one of these events occurs, the function returns and tells the caller what happened and where the mouse is currently located. While there is no activity, the current event loop is run, effectively blocking the current thread (save for any timers that fire). This helps to minimize CPU usage when there is nothing going on.
Parameters:
inPort: The grafport to consider for mouse coordinates. You can pass NULL for this parameter to indicate the current port. The mouse location is returned in terms of local coordinates of this port.
outPt: On exit, this parameter receives the mouse location from the last mouse event that caused this function to exit.
outResult: On exit, this parameter receives a value representing what kind of event was received that cause the function to exit, such as kMouseTrackingMouseReleased.
Result: An operating system result code.
Availability:
| OSStatus TrackMouseLocationWithOptions | ( | GrafPtr | inPort, |
| OptionBits | inOptions, | ||
| EventTimeout | inTimeout, | ||
| Point * | outPt, | ||
| UInt32 * | outModifiers, | ||
| MouseTrackingResult * | outResult | ||
| ) |
TrackMouseLocationWithOptions()
Discussion: Once entered, this routine waits for certain mouse events (move, mouse down, mouse up). When one of these events occurs, the function returns and tells the caller what happened and where the mouse is currently located. While there is no activity, the current event loop is run, effectively blocking the current thread (save for any timers that fire). This helps to minimize CPU usage when there is nothing going on.
Parameters:
inPort: The grafport to consider for mouse coordinates. You can pass NULL for this parameter to indicate the current port. The mouse location is returned in terms of local coordinates of this port.
inOptions: The only option supported by this routine at present is the option to have the toolbox leave mouse up events in the queue, rather than pulling them (which is the default).
inTimeout: The amount of time to wait for an event. If no events arrive within this time, kMouseTrackingTimedOut is returned in outResult.
outPt: On exit, this parameter receives the mouse location from the last mouse event that caused this function to exit. If a timeout or key modifiers changed event caused this function to exit, the current mouse position at the time is returned.
outModifiers: On exit, this parameter receives the most recent state of the keyboard modifiers.
outResult: On exit, this parameter receives a value representing what kind of event was received that cause the function to exit, such as kMouseTrackingMouseReleased.
Result: An operating system result code.
Availability:
| OSStatus TrackMouseRegion | ( | GrafPtr | inPort, |
| RgnHandle | inRegion, | ||
| Boolean * | ioWasInRgn, | ||
| MouseTrackingResult * | outResult | ||
| ) |
Discussion: This routine is largely identical to TrackMouseLocation. Please read the notes on that function as well. The difference between TrackMouseLocation and TrackMouseRegion is that TrackMouseRegion only returns when the mouse enters or exits a specified region that you pass in to the function, as opposed to whenever the mouse moves (it also returns for mouse up/down events). This is useful if you don't need to know intermediate mouse events, but rather just if the mouse enters or leaves an area.
Parameters:
inPort: The grafport to consider for mouse coordinates. You can pass NULL for this parameter to indicate the current port.
inRegion: The region to consider. This should be in the coordinates of the port you passed to inPort.
ioWasInRgn: On enter, this parameter should be set to true if the mouse is currently inside the region passed in inRegion, or false if the mouse is currently outside the region. On exit, this parameter is updated to reflect the current reality, e.g. if the outResult parameter returns kMouseTrackingMouseExited, ioWasInRgn will be set to false when this function exits. Because it is updated from within, you should only need to set this yourself before the first call to this function in your tracking loop.
outResult: On exit, this parameter receives a value representing what kind of event was received that cause the function to exit, such as kMouseTrackingMouseEntered.
Result: An operating system result code.
Availability:
| OSStatus UnregisterEventHotKey | ( | EventHotKeyRef | inHotKey | ) |
Discussion: Unregisters a global hot key that was previously registered with the RegisterEventHotKey API. You do not need to unregister a hot key when your application terminates, the system will take care of that for you. This would be used if the user changes a hot key for something in your application - you would unregister the previous key and register your new key.
Parameters:
inHotKey: The EventHotKeyRef to unregister.
Result: An operating system status code.
Availability:
| OSStatus UnregisterToolboxObjectClass | ( | ToolboxObjectClassRef | inClassRef | ) |
UnregisterToolboxObjectClass()
Availability: