1 /** <title>NSView</title> 2 3 <abstract>Encapsulates all drawing functionality</abstract> 4 5 Copyright <copy>(C) 1996-2015 Free Software Foundation, Inc.</copy> 6 7 Author: Scott Christley <scottc@net-community.com> 8 Date: 1996 9 Heavily changed and extended by Ovidiu Predescu <ovidiu@net-community.com>. 10 Date: 1997 11 Author: Felipe A. Rodriguez <far@ix.netcom.com> 12 Date: August 1998 13 14 This file is part of the GNUstep GUI Library. 15 16 This library is free software; you can redistribute it and/or 17 modify it under the terms of the GNU Lesser General Public 18 License as published by the Free Software Foundation; either 19 version 2 of the License, or (at your option) any later version. 20 21 This library is distributed in the hope that it will be useful, 22 but WITHOUT ANY WARRANTY; without even the implied warranty of 23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 24 Lesser General Public License for more details. 25 26 You should have received a copy of the GNU Lesser General Public 27 License along with this library; see the file COPYING.LIB. 28 If not, see <http://www.gnu.org/licenses/> or write to the 29 Free Software Foundation, 51 Franklin Street, Fifth Floor, 30 Boston, MA 02110-1301, USA. 31 */ 32 33 #ifndef _GNUstep_H_NSView 34 #define _GNUstep_H_NSView 35 #import <GNUstepBase/GSVersionMacros.h> 36 37 #import <AppKit/NSGraphicsContext.h> 38 #import <AppKit/NSResponder.h> 39 #import <AppKit/NSUserInterfaceLayout.h> 40 41 @class NSArray; 42 @class NSAttributedString; 43 @class NSData; 44 @class NSMutableArray; 45 @class NSString; 46 47 @class NSBitmapImageRep; 48 @class NSClipView; 49 @class NSCursor; 50 @class NSImage; 51 @class NSMenu; 52 @class NSPasteboard; 53 @class NSScrollView; 54 @class NSView; 55 @class NSWindow; 56 57 typedef NSInteger NSTrackingRectTag; 58 typedef NSInteger NSToolTipTag; 59 60 /** Describes the type of border used by an NSView. 61 <list> 62 <item>NSNoBorder</item> 63 <item>NSLineBorder</item> 64 <item>NSBezelBorder</item> 65 <item>NSGrooveBorder</item> 66 </list> 67 */ 68 enum _NSBorderType { 69 NSNoBorder, 70 NSLineBorder, 71 NSBezelBorder, 72 NSGrooveBorder 73 }; 74 typedef NSUInteger NSBorderType; 75 76 typedef NSInteger NSViewLayerContentsRedrawPolicy; 77 enum { 78 NSViewLayerContentsRedrawNever = 0, 79 NSViewLayerContentsRedrawOnSetNeedsDisplay = 1, 80 NSViewLayerContentsRedrawDuringViewResize = 2, 81 NSViewLayerContentsRedrawBeforeViewResize = 3, 82 NSViewLayerContentsRedrawCrossfade = 4 83 }; 84 85 typedef NSInteger NSViewLayerContentsPlacement; 86 enum { 87 NSViewLayerContentsPlacementScaleAxesIndependently = 0, 88 NSViewLayerContentsPlacementScaleProportionallyToFit = 1, 89 NSViewLayerContentsPlacementScaleProportionallyToFill = 2, 90 NSViewLayerContentsPlacementCenter = 3, 91 NSViewLayerContentsPlacementTop = 4, 92 NSViewLayerContentsPlacementTopRight = 5, 93 NSViewLayerContentsPlacementRight = 6, 94 NSViewLayerContentsPlacementBottomRight = 7, 95 NSViewLayerContentsPlacementBottom = 8, 96 NSViewLayerContentsPlacementBottomLeft = 9, 97 NSViewLayerContentsPlacementLeft = 10, 98 NSViewLayerContentsPlacementTopLeft = 11 99 }; 100 101 /* 102 * autoresize constants which NSView uses in 103 * determining the parts of a view which are 104 * resized when the view's superview is resized 105 */ 106 enum { 107 NSViewNotSizable = 0, // view does not resize with its superview 108 NSViewMinXMargin = 1, // left margin between views can stretch 109 NSViewWidthSizable = 2, // view's width can stretch 110 NSViewMaxXMargin = 4, // right margin between views can stretch 111 NSViewMinYMargin = 8, // bottom margin between views can stretch 112 NSViewHeightSizable = 16, // view's height can stretch 113 NSViewMaxYMargin = 32 // top margin between views can stretch 114 }; 115 116 /* 117 * constants defining if and how a view (or cell) should draw a focus ring 118 */ 119 typedef enum _NSFocusRingType { 120 NSFocusRingTypeDefault = 0, 121 NSFocusRingTypeNone = 1, 122 NSFocusRingTypeExterior = 2 123 } NSFocusRingType; 124 125 @interface NSView : NSResponder 126 { 127 NSRect _frame; 128 NSRect _bounds; 129 id _frameMatrix; 130 id _boundsMatrix; 131 id _matrixToWindow; 132 id _matrixFromWindow; 133 id _coreAnimationData; 134 135 NSView* _super_view; 136 PACKAGE_SCOPE 137 NSMutableArray *_sub_views; 138 @protected 139 NSWindow *_window; 140 PACKAGE_SCOPE 141 NSMutableArray *_tracking_rects; 142 NSMutableArray *_cursor_rects; 143 @protected 144 NSRect _invalidRect; 145 NSRect _visibleRect; 146 NSInteger _gstate; 147 void *_nextKeyView; 148 void *_previousKeyView; 149 CGFloat _alphaValue; 150 151 @public 152 /* 153 * Flags for internal use by NSView and it's subclasses. 154 */ 155 struct _rFlagsType { 156 unsigned flipped_view:1; /* Flipped state the last time we checked. */ 157 unsigned has_subviews:1; /* The view has subviews. */ 158 unsigned has_currects:1; /* The view has cursor rects. */ 159 unsigned has_trkrects:1; /* The view has tracking rects. */ 160 unsigned has_draginfo:1; /* View has drag types. */ 161 unsigned opaque_view:1; /* For views whose opacity may */ 162 /* change to keep track of it. */ 163 unsigned valid_rects:1; /* Some cursor rects may be ok. */ 164 unsigned needs_display:1; /* view needs display. */ 165 unsigned has_tooltips:1; /* The view has tooltips set. */ 166 unsigned ignores_backing:1; /* The view does not trigger */ 167 /* backing flush when drawn */ 168 } _rFlags; 169 170 BOOL _is_rotated_from_base; 171 BOOL _is_rotated_or_scaled_from_base; 172 BOOL _post_frame_changes; 173 BOOL _post_bounds_changes; 174 BOOL _autoresizes_subviews; 175 BOOL _coordinates_valid; 176 BOOL _allocate_gstate; 177 BOOL _renew_gstate; 178 BOOL _is_hidden; 179 BOOL _in_live_resize; 180 181 NSUInteger _autoresizingMask; 182 NSFocusRingType _focusRingType; 183 NSRect _autoresizingFrameError; 184 } 185 186 /* 187 * Initializing NSView Objects 188 */ 189 - (id) initWithFrame: (NSRect)frameRect; 190 191 /* 192 * Managing the NSView Hierarchy 193 */ 194 - (void) addSubview: (NSView*)aView; 195 - (void) addSubview: (NSView*)aView 196 positioned: (NSWindowOrderingMode)place 197 relativeTo: (NSView*)otherView; 198 - (NSView*) ancestorSharedWithView: (NSView*)aView; 199 - (BOOL) isDescendantOf: (NSView*)aView; 200 - (NSView*) opaqueAncestor; 201 - (void) removeFromSuperviewWithoutNeedingDisplay; 202 - (void) removeFromSuperview; 203 #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) 204 - (void) removeSubview: (NSView*)aView; 205 #endif 206 - (void) replaceSubview: (NSView*)oldView 207 with: (NSView*)newView; 208 - (void) sortSubviewsUsingFunction: (NSComparisonResult (*)(id ,id ,void*))compare 209 context: (void*)context; 210 - (NSArray*) subviews; 211 #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) 212 - (void) setSubviews: (NSArray *)newSubviews; 213 #endif 214 - (NSView*) superview; 215 - (NSWindow*) window; 216 - (void) viewWillMoveToSuperview: (NSView*)newSuper; 217 - (void) viewWillMoveToWindow: (NSWindow*)newWindow; 218 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 219 - (void) didAddSubview: (NSView *)subview; 220 - (void) viewDidMoveToSuperview; 221 - (void) viewDidMoveToWindow; 222 - (void) willRemoveSubview: (NSView *)subview; 223 #endif 224 225 /* 226 * Assigning a Tag 227 */ 228 - (NSInteger) tag; 229 - (id) viewWithTag: (NSInteger)aTag; 230 231 /* 232 * Modifying the Frame Rectangle 233 */ 234 - (CGFloat) frameRotation; 235 - (NSRect) frame; 236 - (void) setFrame: (NSRect)frameRect; 237 - (void) setFrameOrigin: (NSPoint)newOrigin; 238 - (void) setFrameRotation: (CGFloat)angle; 239 - (void) setFrameSize: (NSSize)newSize; 240 241 /* 242 * Modifying the Coordinate System 243 */ 244 - (CGFloat) boundsRotation; 245 - (NSRect) bounds; 246 - (void) setBounds: (NSRect)aRect; 247 - (void) setBoundsOrigin: (NSPoint)newOrigin; 248 - (void) setBoundsRotation: (CGFloat)angle; 249 - (void) setBoundsSize: (NSSize)newSize; 250 251 - (void) translateOriginToPoint: (NSPoint)point; 252 - (void) scaleUnitSquareToSize: (NSSize)newSize; 253 - (void) rotateByAngle: (CGFloat)angle; 254 255 - (BOOL) isFlipped; 256 - (BOOL) isRotatedFromBase; 257 - (BOOL) isRotatedOrScaledFromBase; 258 259 /* 260 * View Layers 261 */ 262 263 #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) 264 - (CGFloat) alphaValue; 265 - (void) setAlphaValue: (CGFloat)alpha; 266 - (CGFloat) frameCenterRotation; 267 - (void) setFrameCenterRotation:(CGFloat)rot; 268 #endif 269 270 /* 271 * Converting Coordinates 272 */ 273 - (NSRect) centerScanRect: (NSRect)aRect; 274 - (NSPoint) convertPoint: (NSPoint)aPoint 275 fromView: (NSView*)aView; 276 - (NSPoint) convertPoint: (NSPoint)aPoint 277 toView: (NSView*)aView; 278 - (NSRect) convertRect: (NSRect)aRect 279 fromView: (NSView*)aView; 280 - (NSRect) convertRect: (NSRect)aRect 281 toView: (NSView*)aView; 282 - (NSSize) convertSize: (NSSize)aSize 283 fromView: (NSView*)aView; 284 - (NSSize) convertSize: (NSSize)aSize 285 toView: (NSView*)aView; 286 #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) 287 - (NSPoint) convertPointFromBase: (NSPoint)aPoint; 288 - (NSPoint) convertPointToBase: (NSPoint)aPoint; 289 - (NSRect) convertRectFromBase: (NSRect)aRect; 290 - (NSRect) convertRectToBase: (NSRect)aRect; 291 - (NSSize) convertSizeFromBase: (NSSize)aSize; 292 - (NSSize) convertSizeToBase: (NSSize)aSize; 293 #endif 294 295 /* 296 * Notifying Ancestor Views 297 */ 298 - (void) setPostsFrameChangedNotifications: (BOOL)flag; 299 - (BOOL) postsFrameChangedNotifications; 300 - (void) setPostsBoundsChangedNotifications: (BOOL)flag; 301 - (BOOL) postsBoundsChangedNotifications; 302 303 /* 304 * Resizing Subviews 305 */ 306 - (void) resizeSubviewsWithOldSize: (NSSize)oldSize; 307 - (void) setAutoresizesSubviews: (BOOL)flag; 308 - (BOOL) autoresizesSubviews; 309 - (void) setAutoresizingMask: (NSUInteger)mask; 310 - (NSUInteger) autoresizingMask; 311 - (void) resizeWithOldSuperviewSize: (NSSize)oldSize; 312 313 /* 314 * Focusing 315 */ 316 + (NSView*) focusView; 317 - (void) lockFocus; 318 - (void) unlockFocus; 319 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 320 - (BOOL) lockFocusIfCanDraw; 321 - (void) lockFocusInRect: (NSRect)rect; 322 #endif 323 #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) 324 - (BOOL) lockFocusIfCanDrawInContext: (NSGraphicsContext *)context; 325 #endif 326 327 /* 328 * Displaying 329 */ 330 - (void) display; 331 - (void) displayIfNeeded; 332 - (void) displayIfNeededIgnoringOpacity; 333 - (void) displayIfNeededInRect: (NSRect)aRect; 334 - (void) displayIfNeededInRectIgnoringOpacity: (NSRect)aRect; 335 - (void) displayRect: (NSRect)aRect; 336 - (void) displayRectIgnoringOpacity: (NSRect)aRect; 337 #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) 338 - (void) displayRectIgnoringOpacity: (NSRect)aRect 339 inContext: (NSGraphicsContext *)context; 340 #endif 341 - (BOOL) needsDisplay; 342 - (void) setNeedsDisplay: (BOOL)flag; 343 - (void) setNeedsDisplayInRect: (NSRect)invalidRect; 344 - (BOOL) isOpaque; 345 #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) 346 + (NSFocusRingType) defaultFocusRingType; 347 - (void) setKeyboardFocusRingNeedsDisplayInRect: (NSRect)rect; 348 - (void) setFocusRingType: (NSFocusRingType)focusRingType; 349 - (NSFocusRingType) focusRingType; 350 351 /* 352 * Hidding Views 353 */ 354 - (void) setHidden: (BOOL)flag; 355 - (BOOL) isHidden; 356 - (BOOL) isHiddenOrHasHiddenAncestor; 357 #endif 358 359 - (void) drawRect: (NSRect)rect; 360 - (NSRect) visibleRect; 361 - (BOOL) canDraw; 362 - (BOOL) shouldDrawColor; 363 #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) 364 - (NSBitmapImageRep *) bitmapImageRepForCachingDisplayInRect: (NSRect)rect; 365 - (void) cacheDisplayInRect: (NSRect)rect 366 toBitmapImageRep: (NSBitmapImageRep *)bitmap; 367 #endif 368 #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) 369 - (BOOL) wantsDefaultClipping; 370 - (BOOL) needsToDrawRect: (NSRect)aRect; 371 - (void) getRectsBeingDrawn: (const NSRect **)rects count: (NSInteger *)count; 372 373 /* 374 * Live resize support 375 */ 376 - (BOOL) inLiveResize; 377 - (void) viewWillStartLiveResize; 378 - (void) viewDidEndLiveResize; 379 #endif 380 #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) 381 - (BOOL) preservesContentDuringLiveResize; 382 - (void) getRectsExposedDuringLiveResize: (NSRect[4])exposedRects count: (NSInteger *)count; 383 - (NSRect) rectPreservedDuringLiveResize; 384 #endif 385 386 387 /* 388 * Graphics State Objects 389 */ 390 - (void) allocateGState; 391 - (void) releaseGState; 392 - (NSInteger) gState; 393 - (void) renewGState; 394 - (void) setUpGState; 395 396 - (BOOL) acceptsFirstMouse: (NSEvent*)theEvent; 397 - (NSView*) hitTest: (NSPoint)aPoint; 398 - (BOOL) mouse: (NSPoint)aPoint 399 inRect: (NSRect)aRect; 400 - (BOOL) performKeyEquivalent: (NSEvent*)theEvent; 401 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 402 - (BOOL) performMnemonic: (NSString *)aString; 403 - (BOOL) mouseDownCanMoveWindow; 404 #endif 405 406 /* 407 * Dragging 408 */ 409 - (BOOL) dragFile: (NSString*)filename 410 fromRect: (NSRect)rect 411 slideBack: (BOOL)slideFlag 412 event: (NSEvent*)event; 413 - (void) dragImage: (NSImage*)anImage 414 at: (NSPoint)viewLocation 415 offset: (NSSize)initialOffset 416 event: (NSEvent*)event 417 pasteboard: (NSPasteboard*)pboard 418 source: (id)sourceObject 419 slideBack: (BOOL)slideFlag; 420 - (void) registerForDraggedTypes: (NSArray*)newTypes; 421 - (void) unregisterDraggedTypes; 422 - (BOOL) shouldDelayWindowOrderingForEvent: (NSEvent*)anEvent; 423 #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) 424 - (BOOL) dragPromisedFilesOfTypes: (NSArray *)typeArray 425 fromRect: (NSRect)aRect 426 source: (id)sourceObject 427 slideBack: (BOOL)slideBack 428 event: (NSEvent *)theEvent; 429 #endif 430 #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) 431 - (NSArray *) registeredDraggedTypes; 432 #endif 433 434 /** 435 * Adds a cursor rectangle. This provides for automatic update of the 436 * cursor to be anObject while the mouse is in aRect.<br /> 437 * The cursor (anObject) is retained until the cursor rectangle is 438 * removed or discarded.<br /> 439 * Generally your subviews should call this in their implementation of 440 * the -resetCursorRects method.<br /> 441 * It is your responsibility to ensure that aRect lies within your veiw's 442 * visible rectangle. 443 */ 444 - (void) addCursorRect: (NSRect)aRect 445 cursor: (NSCursor*)anObject; 446 447 /** 448 * Removes all the cursor rectancles which have been set up for the 449 * receiver. This is equivalent to calling -removeCursorRect:cursor: 450 * for all cursor rectangles which have been set up.<br /> 451 * This is called automatically before the system calls -resetCursorRects 452 * so you never need to call it. 453 */ 454 - (void) discardCursorRects; 455 456 /** 457 * Removes the cursor rectangle which was set up for the specified 458 * rectangle and cursor. 459 */ 460 - (void) removeCursorRect: (NSRect)aRect 461 cursor: (NSCursor*)anObject; 462 463 /** <override-subclass/> 464 * This is called to establish a new set of cursor rectangles whenever 465 * the receiver needs to do so (eg the view has been resized). The default 466 * implementation does nothing, but subclasses should use it to make 467 * calls to -addCursorRect:cursor: to establish their new cursor rectangles. 468 */ 469 - (void) resetCursorRects; 470 471 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 472 /* 473 * Tool Tips 474 */ 475 - (NSToolTipTag) addToolTipRect: (NSRect)aRect 476 owner: (id)anObject 477 userData: (void *)data; 478 - (void) removeAllToolTips; 479 - (void) removeToolTip: (NSToolTipTag)tag; 480 - (void) setToolTip: (NSString *)string; 481 - (NSString *) toolTip; 482 #endif 483 484 /** 485 * Removes a tracking rectangle which was previously established using the 486 * -addTrackingRect:owner:userData:assumeInside: method.<br /> 487 * The value of tag must be the value returned by the method used to add 488 * the rectangle. 489 */ 490 - (void) removeTrackingRect: (NSTrackingRectTag)tag; 491 492 /** 493 * Adds a tracking rectangle to monitor mouse movement and generate 494 * mouse-entered and mouse-exited events.<br /> 495 * The event messages are sent to anObject, which is <em>not</em> 496 * retained and must therefore be sure to remove any tracking rectangles 497 * using it before it is deallocated.<br /> 498 * The value of data is supplied as the user data in the event objects 499 * generated.<br /> 500 * If flag is YES then the mouse is assumed to be inside the tracking 501 * rectangle and the first event generated will therefore be a mouse exit, 502 * if it is NO then the first event generated will be a mouse entry. 503 */ 504 - (NSTrackingRectTag) addTrackingRect: (NSRect)aRect 505 owner: (id)anObject 506 userData: (void*)data 507 assumeInside: (BOOL)flag; 508 509 /* 510 * Scrolling 511 */ 512 - (NSRect) adjustScroll: (NSRect)newVisible; 513 - (BOOL) autoscroll: (NSEvent*)theEvent; 514 - (NSScrollView*) enclosingScrollView; 515 - (void) scrollPoint: (NSPoint)aPoint; 516 - (void) scrollRect: (NSRect)aRect 517 by: (NSSize)delta; 518 - (BOOL) scrollRectToVisible: (NSRect)aRect; 519 520 - (void) reflectScrolledClipView: (NSClipView*)aClipView; 521 - (void) scrollClipView: (NSClipView*)aClipView 522 toPoint: (NSPoint)aPoint; 523 524 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 525 /* 526 * Menu operations 527 */ 528 + (NSMenu *) defaultMenu; 529 - (NSMenu *) menuForEvent: (NSEvent *)theEvent; 530 #endif 531 532 /* 533 * Aiding Event Handling 534 */ 535 - (BOOL) needsPanelToBecomeKey; 536 - (void) setNextKeyView: (NSView*)aView; 537 - (NSView*) nextKeyView; 538 - (NSView*) nextValidKeyView; 539 - (void) setPreviousKeyView: (NSView*)aView; 540 - (NSView*) previousKeyView; 541 - (NSView*) previousValidKeyView; 542 #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) 543 - (BOOL) canBecomeKeyView; 544 #endif 545 546 /* 547 * Printing 548 */ 549 - (void) fax: (id)sender; 550 - (void) print: (id)sender; 551 - (NSData*) dataWithEPSInsideRect: (NSRect)aRect; 552 - (void) writeEPSInsideRect: (NSRect)rect 553 toPasteboard: (NSPasteboard*)pasteboard; 554 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 555 - (NSData *) dataWithPDFInsideRect: (NSRect)aRect; 556 - (void) writePDFInsideRect: (NSRect)aRect 557 toPasteboard: (NSPasteboard *)pboard; 558 - (NSString *) printJobTitle; 559 #endif 560 561 /* 562 * Pagination 563 */ 564 - (void) adjustPageHeightNew: (CGFloat*)newBottom 565 top: (CGFloat)oldTop 566 bottom: (CGFloat)oldBottom 567 limit: (CGFloat)bottomLimit; 568 - (void) adjustPageWidthNew: (CGFloat*)newRight 569 left: (CGFloat)oldLeft 570 right: (CGFloat)oldRight 571 limit: (CGFloat)rightLimit; 572 - (CGFloat) heightAdjustLimit; 573 - (BOOL) knowsPagesFirst: (int*)firstPageNum 574 last: (int*)lastPageNum; 575 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 576 - (BOOL) knowsPageRange: (NSRange*)range; 577 #endif 578 - (NSPoint) locationOfPrintRect: (NSRect)aRect; 579 - (NSRect) rectForPage: (NSInteger)page; 580 - (CGFloat) widthAdjustLimit; 581 582 /* 583 * Writing Conforming PostScript 584 */ 585 - (void) addToPageSetup; 586 - (void) beginPage: (int)ordinalNum 587 label: (NSString*)aString 588 bBox: (NSRect)pageRect 589 fonts: (NSString*)fontNames; 590 - (void) beginPageSetupRect: (NSRect)aRect 591 placement: (NSPoint)location; 592 - (void) beginPrologueBBox: (NSRect)boundingBox 593 creationDate: (NSString*)dateCreated 594 createdBy: (NSString*)anApplication 595 fonts: (NSString*)fontNames 596 forWhom: (NSString*)user 597 pages: (int)numPages 598 title: (NSString*)aTitle; 599 - (void) beginSetup; 600 - (void) beginTrailer; 601 - (void) drawPageBorderWithSize: (NSSize)borderSize; 602 - (void) drawSheetBorderWithSize: (NSSize)borderSize; 603 - (void) endHeaderComments; 604 - (void) endPrologue; 605 - (void) endSetup; 606 - (void) endPageSetup; 607 - (void) endPage; 608 - (void) endTrailer; 609 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 610 - (void)beginDocument; 611 - (void)beginPageInRect:(NSRect)aRect 612 atPlacement:(NSPoint)location; 613 - (void)endDocument; 614 #endif 615 #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) 616 - (NSAttributedString *)pageFooter; 617 - (NSAttributedString *)pageHeader; 618 #endif 619 620 #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) 621 #if GS_HAS_DECLARED_PROPERTIES 622 @property (nonatomic) NSViewLayerContentsPlacement layerContentsPlacement; 623 @property (nonatomic) NSViewLayerContentsRedrawPolicy layerContentsRedrawPolicy; 624 #else 625 - (NSViewLayerContentsPlacement) layerContentsPlacement; 626 - (void) setLayerContentsPlacement: (NSViewLayerContentsPlacement)placement; 627 628 - (NSViewLayerContentsRedrawPolicy) layerContentsRedrawPolicy; 629 - (void) setLayerContentsRedrawPolicy: (NSViewLayerContentsRedrawPolicy) pol; 630 #endif 631 #endif 632 633 #if OS_API_VERSION(MAC_OS_X_VERSION_10_8, GS_API_LATEST) 634 #if GS_HAS_DECLARED_PROPERTIES 635 @property NSUserInterfaceLayoutDirection userInterfaceLayoutDirection; 636 #else 637 - (NSUserInterfaceLayoutDirection) userInterfaceLayoutDirection; 638 - (void) setUserInterfaceLayoutDirection: (NSUserInterfaceLayoutDirection)dir; 639 #endif 640 #endif 641 642 @end 643 644 645 @class NSAffineTransform; 646 647 /* 648 * GNUstep extensions 649 * Methods whose names begin with an underscore must NOT be overridden. 650 */ 651 #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) 652 @interface NSView (PrivateMethods) 653 654 /* 655 * The [-_invalidateCoordinates] method marks the cached visible rectangles 656 * of the view and it's subview as being invalid. NSViews methods call this 657 * whenever the coordinate system of the view is changed in any way - thus 658 * forcing recalculation of cached values next time they are needed. 659 */ 660 - (void) _invalidateCoordinates; 661 - (void) _rebuildCoordinates; 662 663 - (NSAffineTransform*) _matrixToWindow; 664 - (NSAffineTransform*) _matrixFromWindow; 665 666 - (void) _setIgnoresBacking: (BOOL) flag; 667 - (BOOL) _ignoresBacking; 668 669 @end 670 #endif 671 672 /* 673 * GNUstep specific function to determine the drag types registered for a view. 674 */ 675 APPKIT_EXPORT NSArray *GSGetDragTypes(NSView* aView); 676 677 /* Notifications */ 678 APPKIT_EXPORT NSString *NSViewFrameDidChangeNotification; 679 APPKIT_EXPORT NSString *NSViewBoundsDidChangeNotification; 680 APPKIT_EXPORT NSString *NSViewFocusDidChangeNotification; 681 APPKIT_EXPORT NSString *NSViewGlobalFrameDidChangeNotification; 682 683 #endif // _GNUstep_H_NSView 684