On Mac OS X, applications are automatically registered with the Appearance Manager, so you do not need to call RegisterAppearanceClient before calling Appearance Manager functions (but there is no penalty if you do).
Latest Updates: carbon RSS
-
Praveen Matanam
-
Praveen Matanam
You can also pass information to your event handler using the userData parameter when you install your event handler. For example, when installing a window handler, you could store the window reference as user data. For events that don’t store the window reference in the event structure, this may be the only way to determine in which window an event occured.
-
Praveen Matanam
When the user clicks the control, the plug-in’s mouse-down handler is called first. If it chooses not to handle the event, the application’s control handler then has the opportunity to take it.
-
Praveen Matanam
universal procedure pointer (UPP) is a pointer to a routine descriptor, which is a structure that occupies memory ( and hence must be allocated and disposed of). On Carbon, the UPP data type is opaque and might or might not require memory allocation. So we need to use a new creation and deletion function for each specific type of UPP we want to use.
In a sense, universal procedure pointers are a piece of historical baggage dragged into Carbon by Mac OS8/9. They was first introduced with the so-called Universal Headers which, in turn, were introduced withthe Power Macintosh. They had to with the ability of the Power Macintosh to run applications that use theinstruction set of the Motorola 680×0 microprocessor (used in 680×0-based Macintoshes) as well asapplications that use the native instruction set of the Power Macintosh’s PowerPC microprocessor.
In the Chapter 7 demonstration programs, the system software function which takes a universal procedurepointer is TrackControl . This function is called by your application when a mouse-down event occurs in acontrol, such as a scroll bar. Prior to the introduction of the Power Macintosh and the associatedintroduction of the Universal Headers, the TrackControl prototype looked like this:
Sint16 TrackControl(TrackControl(ControlHandle theControl,Point localPoint,ProcPtr actionProc);
The actionProc a parameter is simply the address of an application-defined function, called a callbackprocedure (or, in C terminology, a callback function) that is called repeatedly while the mouse buttonremains down. In other words, the TrackControl function used to take a procedure pointer (or, in Cterminology, a function pointer) in its actionProc parameter.The Universal Headers, which, amongst other things, allow you to write Classic API source code capableof being compiled as either 680×0 code or native PowerPC code, changed the prototype for TrackControl to:
ControlPartCode TrackControl(ControlHandle theControl,Point startPoint,ControlActionUPP actionProc);
Notice that the third parameter is now of type ControlActionUPP . This means that the actionProc parameternow takes a universal procedure pointer. This prototype has been carried through to Carbon, hence thenecessity to gain a basic understanding of universal procedure pointers. -
Praveen Matanam
Code Fragment Manager. Written to allow the system and applications to prepare and execute Preferred Executable Format (PEF) binaries, the native executable file format for Classic Mac OS PowerPC applications. While Mac OS X supports PEF binaries, the native executable file format is called Mach-O.