Up

Functions

Authors

Generated by doko

Contents -

  1. NSApplication functions
  2. NSCell functions
  3. NSDataLinkManager functions
  4. NSEvent functions
  5. NSFont functions
  6. NSGraphicsContext functions
  7. NSInterfaceStyle functions
  8. NSPanel functions
  9. NSPasteboard functions
  10. NSView functions

NSApplication functions

GSContactApplication

id GSContactApplication(NSString* appName, NSString* port, NSDate* expire);

Establishes an NSConnection to the application listening at port (by convention usually the application name), launching appName if necessary. Returns the proxy to the remote application, or nil on failure.

The value of port specifies the name of the distributed objects service to which the connection is to be made. If this is nil it will be inferred from appName... by convention, applications use their own name (minus any path or extension) for this.

The value of expire provides a timeout in case the application cannot be contacted promptly. If it is omitted, a thirty second timeout is used.


NSApplicationMain

int NSApplicationMain(int argc, const char** argv);

Description forthcoming.


NSPerformService

BOOL NSPerformService(NSString* serviceItem, NSPasteboard* pboard);

Given the name of a serviceItem, and some data in a pasteboard this function sends the data to the service provider (launching another application if necessary) and retrieves the result of the service in the pastebaord.

Returns YES on success, NO otherwise.


NSRegisterServicesProvider

void NSRegisterServicesProvider(id provider, NSString* name);

Registers a services providing object using the specified port name.
Applications should not need to use this, as they can use the [NSApplication -setServicesProvider:] method instead. The NSApplication method will use the name of the application rather than an other port name.


NSSetShowsServicesMenuItem

int NSSetShowsServicesMenuItem(NSString* name, BOOL enabled);

Controls whether the item name should be included in the services menu.

If enabled is YES then the services menu for each application will include the named item, if enabled is NO then the service will not be shown in application services menus.

Returns 0 if the setting is successfuly changed. Non-zero otherwise.


NSShowSystemInfoPanel

void NSShowSystemInfoPanel(NSDictionary* options);

Description forthcoming.


NSShowsServicesMenuItem

BOOL NSShowsServicesMenuItem(NSString* name);

Returns a flag indicating whether the named service is supposed to be displayed in application services menus.


NSUnRegisterServicesProvider

void NSUnRegisterServicesProvider(NSString* name);

Description forthcoming.


NSUpdateDynamicServices

void NSUpdateDynamicServices();

A services providing application may use this to update the list of services it provides.
In order to update the services advertised, the application must create a .service bundle and place it in ~/Library/Services before invoking this function.


NSCell functions

_sizeForBorderType

NSSize _sizeForBorderType(NSBorderType aType);

Description forthcoming.


NSDataLinkManager functions

NSFrameLinkRect

void NSFrameLinkRect(NSRect aRect, BOOL isDestination);

Description forthcoming.


NSLinkFrameThickness

float NSLinkFrameThickness();

Description forthcoming.


NSEvent functions

NSEventMaskFromType

unsigned int NSEventMaskFromType(NSEventType type);

Description forthcoming.


NSFont functions

NSConvertGlyphsToPackedGlyphs

int NSConvertGlyphsToPackedGlyphs(NSGlyph* glBuf, int count, NSMultibyteGlyphPacking packing, char* packedGlyphs);

Description forthcoming.


NSGraphicsContext functions

GSCurrentContext

NSGraphicsContext* GSCurrentContext();

Description forthcoming.


NSInterfaceStyle functions

NSInterfaceStyleForKey

NSInterfaceStyle NSInterfaceStyleForKey(NSString* key, NSResponder* responder);

Returns the interface style the responder should use, which affects how a UI element (such as a button or menu) is displayed. If the responder has an interface style set, the key is ignored and the responder's interface style is returned. Otherwise the style associated with the key is returned (if set), otherwise the default style is returned. In no case will the style NSNoInterfaceStyle be returned.

Styles can be set using the user defaults system. Currently available styles are

You can set a default style for all UI elements using the NSInterfaceStyleDefault key:

   defaults write NSGlobalDomain NSInterfaceStyleDefault GSWindowMakerInterfaceStyle 
   


NSPanel functions

NSBeginAlertSheet

void NSBeginAlertSheet(NSString* title, NSString* defaultButton, NSString* alternateButton, NSString* otherButton, NSWindow* docWindow, id modalDelegate, SEL willEndSelector, SEL didEndSelector, void* contextInfo, NSString* msg,...);

Description forthcoming.


NSBeginCriticalAlertSheet

void NSBeginCriticalAlertSheet(NSString* title, NSString* defaultButton, NSString* alternateButton, NSString* otherButton, NSWindow* docWindow, id modalDelegate, SEL willEndSelector, SEL didEndSelector, void* contextInfo, NSString* msg,...);

Description forthcoming.


NSBeginInformationalAlertSheet

void NSBeginInformationalAlertSheet(NSString* title, NSString* defaultButton, NSString* alternateButton, NSString* otherButton, NSWindow* docWindow, id modalDelegate, SEL willEndSelector, SEL didEndSelector, void* contextInfo, NSString* msg,...);

Description forthcoming.


NSGetAlertPanel

id NSGetAlertPanel(NSString* title, NSString* msg, NSString* defaultButton, NSString* alternateButton, NSString* otherButton,...);

Description forthcoming.


NSGetCriticalAlertPanel

id NSGetCriticalAlertPanel(NSString* title, NSString* msg, NSString* defaultButton, NSString* alternateButton, NSString* otherButton,...);

Description forthcoming.


NSGetInformationalAlertPanel

id NSGetInformationalAlertPanel(NSString* title, NSString* msg, NSString* defaultButton, NSString* alternateButton, NSString* otherButton,...);

Description forthcoming.


NSReleaseAlertPanel

void NSReleaseAlertPanel(id panel);

Description forthcoming.


NSRunAlertPanel

int NSRunAlertPanel(NSString* title, NSString* msg, NSString* defaultButton, NSString* alternateButton, NSString* otherButton,...);

Description forthcoming.


NSRunCriticalAlertPanel

int NSRunCriticalAlertPanel(NSString* title, NSString* msg, NSString* defaultButton, NSString* alternateButton, NSString* otherButton,...);

Description forthcoming.


NSRunInformationalAlertPanel

int NSRunInformationalAlertPanel(NSString* title, NSString* msg, NSString* defaultButton, NSString* alternateButton, NSString* otherButton,...);

Description forthcoming.


NSRunLocalizedAlertPanel

int NSRunLocalizedAlertPanel(NSString* table, NSString* title, NSString* msg, NSString* defaultButton, NSString* alternateButton, NSString* otherButton,...);

Description forthcoming.


NSPasteboard functions

NSCreateFileContentsPboardType

NSString* NSCreateFileContentsPboardType(NSString* fileType);

Returns a standardised pasteboard type for file contents, formed from the supplied file extension.

Data written to a pasteboard with a file contents type should be written using the [NSPasteboard -writeFileContents:] or [NSPasteboard -writeFileWrapper:] method. Similarly, the data should be read using the [NSPasteboard -readFileContentsType:toFile:] or [NSPasteboard -readFileWrapper] method.


NSCreateFilenamePboardType

NSString* NSCreateFilenamePboardType(NSString* fileType);

Returns a standardised pasteboard type for file names, formed from the supplied file extension.

Data written to a pasteboard with a file names type should be a single name written using [NSPasteboard -setString:forType:] or an array of strings written using [NSPasteboard -setPropertyList:forType:] .
Similarly, the data should be read using the [NSPasteboard -stringForType:] or [NSPasteboard -propertyListForType:] method.

See also the NSGetFileType() and NSGetFileTypes() functions.


NSGetFileType

NSString* NSGetFileType(NSString* pboardType);

Returns the file type (fileType extension) corresponding to the pasteboard type given.
This is a counterpart to the NSCreateFilenamePboardType() function.


NSGetFileTypes

NSArray* NSGetFileTypes(NSArray* pboardTypes);

Returns the file types (filename extensions) corresponding to the pasteboard types given.


NSView functions

GSGetDragTypes

NSArray* GSGetDragTypes(NSView* aView);

Description forthcoming.



Up