More Infos on CFRunLoopSourceRef

From Apache OpenOffice Wiki
Jump to: navigation, search

Parameters queryOrder A CFIndex value that specifies the priority of the query relative to other queries. ATS sends font queries to each run loop in priority order, from highest to lowest, with normal priority equal to 0.

sourceOrder A CFIndex value that specifies the order of the run loop source.

callout A pointer to your callback for processing a font query. See ATSFontQueryCallback for more information on the callback you can supply.

context A pointer to font query source context that ATS passes to your callback function. You can pass NULL if your callback function does not need any data passed to it.

Return Value A CFRunLoopSourceRef. When you want to stop receiving queries, you must invalidate this reference.

Discussion When an application needs a font, ATS sends a query to those font utility applications who have signed up to handle queries by calling the function ATSCreateFontQueryRunLoopSource. When a font utility application receives a query, it iterates through its available fonts to look for the requested font. If the font utility application finds the font, it obtains the file specification for the font and sends the file specification to ATS. ATS activates the font and sends notification of the activation to each application who subscribes to notifications.

The function ATSCreateFontQueryRunLoopSource creates a Core Foundation run loop source reference (CFRunLoopSourceRef) to convey font queries from ATS to your font utility application. If your application does not have a CFRunLoop (for example, a faceless server application), you must explicitly set up a CFRunLoop before you can receive queries.

Personal tools