\fs88 \pard \s7 \li2116 \fi0 \ri1007 \ql \tx2494 \tx2872 \tx3250 \i0 \fs28 \fs16 \fs28 This document describes the application programming interface (API) of OpenStep\f3 \fs18 \up6 \'e4\f1 \fs28 \up0. OpenStep is an operating system independent, object-oriented application layer, based on NeXT\'27s advanced object technology. OpenStep contains these major components:\
\fs28 \s21 \li2116 \fi-3024 \fi0 \ri1007 \fs16 \fs28 \f0 \b \fs28 Figure 1\b0 \fs28 \f1 . Major Components of OpenStep\
\fs16 \
\
\
\fs28 \pard \s37 \li6148 \fi-3654 \ri1007 \ql \tx6148 \tx10432 \b Application Kit\b0 The Application Kit\f3 \fs18 \up6 \'e4\f1 \fs28 \up0 provides the basic software for writing interactive applications\'d0applications that use windows, draw on the screen, and respond to user actions on the keyboard and mouse. The Application Kit contains the components that define the OpenStep user interface.\
\fs16 \
\fs28 \b Foundation Kit\b0 The Foundation Kit\f3 \fs18 \up6 \'e4\f1 \fs28 \up0 provides the fundamental building blocks that applications use to manage data and resources. It defines facilities for handling multibyte character sets, object persistency and distribution, and provides an interface to common operating system facilities. \
\fs16 \
\fs28 \b Display PostScript System\b0 The Display PostScript\f3 \fs18 \up6 \'e2\f1 \fs28 \up0 system provides OpenStep with its device-independent imaging model.\
\fs52 \pard \s7 \li2116 \fi0 \ri1007 \ql \tx2494 \tx2872 \tx3250 \f1 \b0 \fs28 \fs16 \fs28 The three components of OpenStep are described in the three chapters of this document, starting with Chapter 1, \'aaThe Application Kit\'ba. Each chapter is organized in the same way, having these standard sections:\
\fs16 \
\fs28 \s3 \f0 \b \fs48 \fs16 \
\
\
\
\fs48 Classes\
\fs16 \
\fs48 \pard \s7 \li2116 \fi0 \ri1007 \ql \tx2494 \tx2872 \tx3250 \f1 \b0 \fs28 \fs16 \fs28 This section lists the API for each class defined in the component. For each class, these sections may appear:\
\fs16 \
\fs28 \pard \s37 \li6148 \fi-3654 \ri1007 \ql \tx6148 \tx10432 \fi-3655 \f0 \b \fs28 Inherits From:\f1 \b0 \fs28 The inheritance hierarchy for the class. For example:\
\fs28 \pard \s37 \li6148 \fi-3654 \ri1007 \ql \tx6148 \tx10432 The first class listed (NSPanel, in this example) is the class\'27s superclass. The last class listed is generally NSObject, the root of almost all OpenStep inheritance hierarchies. The classes between show the chain of inheritance from NSObject to the superclass. (This particular example shows the inheritance hierarchy for the NSMenu class of the Application Kit.)\
\fs16 \
\fs28 \fi-3655 \f0 \b \fs28 Conforms To:\f1 \b0 \fs28 The formal protocols that the class conforms to. These include both protocols the class adopts and those it inherits from other adopting classes. If inherited, the name of the adopting class in given in parentheses. For example:\
\fs28 \pard \s37 \li6148 \fi-3654 \ri1007 \ql \tx6148 \tx10432 (This example is from the NSString class, which is declared in the \b foundation\b0 subdirectory of \b /OpenStep/Headers\b0 .) \
\fs16 \
\fs28 \pard \s7 \li2116 \fi0 \ri1007 \ql \tx2494 \tx2872 \tx3250 \fs16 \fs28 Next, the methods the class declares and implements are listed by name and grouped by type. For example, methods used to draw are listed separately from methods used to handle events. This listing includes all the methods declared in the class. It also may include a method declared in a protocol the class conforms to, if there is something extraordinary about the class\'27s implementation of the method. Each method is accompanied by a brief description which states what the method does and mentions the arguments and return value, if any.\
\fs16 \
\fs28 \fs16 \fs28 If a class lets you define another object\'d0a delegate\'d0that can intercede on behalf of instances of the class, the methods that the delegate can implement are described in a separate section. These are not methods defined in the class; rather, they\'27re methods that you can define to respond to messages sent from instances of the class. In essence, this section documents an informal protocol. But because these methods are so closely tied to the behavior of a particular class, they\'27re documented with the class rather than in the \'aaProtocols\'ba section. \
\fs16 \
\fs28 \fs16 \fs28 Some class specifications have separate sections with titles such as \'aaMethods Implemented by the Superview\'ba, \'aaMethods Implemented by Observers\'ba, or \'aaMethods Implemented by the Owner.\'ba These are also informal protocols. They document methods that can or must be implemented to receive messages on behalf of instances of the class.\
\fs48 \pard \s7 \li2116 \fi0 \ri1007 \ql \tx2494 \tx2872 \tx3250 \f1 \b0 \fs28 \fs16 \fs28 The protocols section documents both formal and informal protocols. Formal protocols are those that are declared using the \b @protocol\b0 compiler directive. They can be formally adopted and implemented by a class and tested by sending an object a \b conformsToProtocol:\b0 message.\
\fs16 \
\fs28 \fs16 \fs28 Some formal protocols are adopted and implemented by OpenStep classes. However, many formal protocols are declared by a kit, but not implemented by it. They list methods that you can implement to respond to kit-generated messages.\
\fs16 \
\fs28 \fs16 \fs28 A few formal protocols are implemented by a kit, but not by a class that\'27s part of the documented API. Rather, the protocol is implemented by an anonymous object that the kit supplies. The protocol lets you know what messages you can send to the object.\
\fs16 \
\fs28 \fs16 \fs28 Like formal protocols, informal protocols declare a list of methods that others are invited to implement. If an informal protocol is closely associated with one particular class\'d0for example, the list of methods implemented by the delegate\'d0it\'27s documented in the class description. Informal protocols associated with more than one class, or not associated with any particular class, are documented with the formal protocols in this section.\
\fs16 \
\fs28 \fs16 \fs28 Protocol information is organized into many of the same sections as described above for a class specification. But protocols are not classes and therefore differ somewhat in the kind of information provided. The sections of a protocol specification are shown in bold below:\
\fs16 \
\fs28 \pard \s37 \li6148 \fi-3654 \ri1007 \ql \tx6148 \tx10432 \fi-3655 \f0 \b \fs28 Adopted By:\f1 \b0 \fs28 A list of the OpenStep classes that adopt the protocol. Many protocols declare methods that applications must implement and so are not adopted by any OpenStep classes.\
\fs16 \
\fs28 \pard \s37 \li6148 \fi-3654 \ri1007 \ql \tx6148 \tx10432 \fi-3655 Some protocols are implemented by anonymous objects (instances of an unknown class); the protocol is the only information available about what messages the object can respond to. Protocols that have an implementation available through an anonymous object generally don\'27t have to be reimplemented by other classes.\
\fs16 \
\fs28 \pard \s37 \li6148 \fi-3654 \ri1007 \ql \tx6148 \tx10432 \fi-3655 \f0 \b \fs28 Incorporates:\f1 \b0 \fs28 Other protocols that the protocol being described incorporates by reference. One protocol incorporates others by listing them within angle brackets:\
\fs28 The protocol specification doesn\'27t describe methods declared in incorporated protocols. See the specification for the incorporated protocol for a description of its methods.\
\fs16 \
\fs28 \pard \s7 \li2116 \fi0 \ri1007 \ql \tx2494 \tx2872 \tx3250 \fs16 \fs28 An informal protocol can\'27t be formally adopted by a class and it can\'27t formally incorporate another protocol. So its description begins with information about the category where it\'27s declared:\
\fs16 \
\fs28 \pard \s37 \li6148 \fi-3654 \ri1007 \ql \tx6148 \tx10432 \f0 \b \fs28 Category Of:\f1 \b0 \fs28 The class that the category belongs to. Informal protocols are typically declared as categories of the NSObject class. This gives them the widest possible scope.\
\fs16 \
\fs28 \pard \s7 \li2116 \fi0 \ri1007 \ql \tx2494 \tx2872 \tx3250 \fs16 \fs28 Both formal and informal protocols include a cross reference to a header file in \b /OpenStep/Headers\b0 : \
\fs16 \
\fs28 \pard \s37 \li6148 \fi-3654 \ri1007 \ql \tx6148 \tx10432 \f0 \b \fs28 Declared In:\f1 \b0 \fs28 The header file where the protocol is declared.\
\fs16 \
\fs28 \pard \s7 \li2116 \fi0 \ri1007 \ql \tx2494 \tx2872 \tx3250 \fs16 \fs28 If the protocol includes enough methods to warrant it, they\'27re divided by type and presented just as the methods of a class are.\
\fs48 \pard \s7 \li2116 \fi0 \ri1007 \ql \tx2494 \tx2872 \tx3250 \f1 \b0 \fs28 \fs16 \fs28 Related functions are grouped together under a heading that describes the common purpose. Each function, its arguments, and its return value are briefly described in an accompanying comment. \
\fs48 \pard \s7 \li2116 \fi0 \ri1007 \ql \tx2494 \tx2872 \tx3250 \f1 \b0 \fs28 \fs16 \fs28 Related defined types, enumeration constants, symbolic constants, structures, and global variables are grouped together under a heading that describes the common purpose. A short description accompanies each group.\