Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions
NativeScrollbarView Class Reference

List of all members.

Public Member Functions

(id- initWithFrame:geckoChild: [implementation]
(id- initWithFrame: [implementation]
(NSWindow *) - getNativeWindow [implementation]
(void- setNativeWindow: [implementation]
(BOOL- isFlipped [implementation]
(nsIWidget *) - widget [implementation]
(void- setNeedsPendingDisplay [implementation]
(void- setNeedsPendingDisplayInRect: [implementation]
(void- scrollRect:by: [implementation]
(void- mouseMoved: [implementation]
(void- widgetDestroyed [implementation]
(NSMenu *) - getContextMenu [implementation]
(IBAction) - scroll: [implementation]
(void- trackKnob: [implementation]
(void- trackScrollButtons: [implementation]
(void- trackPagingArea: [implementation]

Private Member Functions

(void- processPendingRedraws [implementation]

Detailed Description

Definition at line 541 of file nsNativeScrollbar.mm.


Member Function Documentation

- (NSMenu *) getContextMenu [implementation]

Definition at line 703 of file nsNativeScrollbar.mm.

{
  return nil;
}
- (NSWindow *) getNativeWindow [implementation]

Definition at line 580 of file nsNativeScrollbar.mm.

{
  NSWindow* currWin = [self window];
  if (currWin)
     return currWin;
  else
     return mWindow;
}
- (id) initWithFrame: (NSRect)  frameRect [implementation]

Definition at line 570 of file nsNativeScrollbar.mm.

                   :(NSRect)frameRect
{
  NS_WARNING("You're calling the wrong initializer. You really want -initWithFrame:geckoChild");
  if ((self = [self initWithFrame:frameRect geckoChild:nsnull]))
  {
  }
  return self;
}
- (id) initWithFrame: (NSRect)  frameRect
geckoChild: (nsNativeScrollbar*)  inChild 
[implementation]

Definition at line 550 of file nsNativeScrollbar.mm.

                   :(NSRect)frameRect geckoChild:(nsNativeScrollbar*)inChild
{
  if ((self = [super initWithFrame:frameRect]))
  {
    NS_ASSERTION(inChild, "Need to provide a tether between this and a nsChildView class");
    mGeckoChild = inChild;
    
    // make ourselves the target of the scroll and set the action message
    [self setTarget:self];
    [self setAction:@selector(scroll:)];
  }
  return self;
}
- (BOOL) isFlipped [implementation]

Definition at line 595 of file nsNativeScrollbar.mm.

{
  return YES;
}
- (void) mouseMoved: (NSEvent*)  theEvent [implementation]

Definition at line 669 of file nsNativeScrollbar.mm.

                  :(NSEvent*)theEvent
{
  // do nothing
}
- (void) processPendingRedraws [implementation]

Definition at line 630 of file nsNativeScrollbar.mm.

{
  if (mPendingFullDisplay) {
    [self setNeedsDisplay:YES];
  }
  else {
    unsigned int count = [mPendingDirtyRects count];
    for (unsigned int i = 0; i < count; ++i) {
      [self setNeedsDisplayInRect:[[mPendingDirtyRects objectAtIndex:i] rectValue]];
    }
  }
  mPendingFullDisplay = NO;
  [mPendingDirtyRects release];
  mPendingDirtyRects = nil;
}
- (IBAction) scroll: (NSScroller*)  sender [implementation]

Definition at line 715 of file nsNativeScrollbar.mm.

                  :(NSScroller*)sender
{
  if ( mGeckoChild )
    mGeckoChild->DoScroll([sender hitPart]);
}
- (void) scrollRect: (NSRect)  aRect
by: (NSSize)  offset 
[implementation]

Definition at line 646 of file nsNativeScrollbar.mm.

                  :(NSRect)aRect by:(NSSize)offset
{
  // Update any pending dirty rects to reflect the new scroll position
  if (mPendingDirtyRects) {
    unsigned int count = [mPendingDirtyRects count];
    for (unsigned int i = 0; i < count; ++i) {
      NSRect oldRect = [[mPendingDirtyRects objectAtIndex:i] rectValue];
      NSRect newRect = NSOffsetRect(oldRect, offset.width, offset.height);
      [mPendingDirtyRects replaceObjectAtIndex:i
                                    withObject:[NSValue valueWithRect:newRect]];
    }
  }
  [super scrollRect:aRect by:offset];
}
- (void) setNativeWindow: (NSWindow*)  aWindow [implementation]

Definition at line 589 of file nsNativeScrollbar.mm.

                        : (NSWindow*)aWindow
{
  mWindow = aWindow;
}
- (void) setNeedsPendingDisplay [implementation]

Definition at line 611 of file nsNativeScrollbar.mm.

{
  mPendingFullDisplay = YES;
  [self performSelector:@selector(processPendingRedraws) withObject:nil afterDelay:0];
}
- (void) setNeedsPendingDisplayInRect: (NSRect)  invalidRect [implementation]

Definition at line 617 of file nsNativeScrollbar.mm.

                                    :(NSRect)invalidRect
{
  if (!mPendingDirtyRects)
    mPendingDirtyRects = [[NSMutableArray alloc] initWithCapacity:1];
  [mPendingDirtyRects addObject:[NSValue valueWithRect:invalidRect]];
  [self performSelector:@selector(processPendingRedraws) withObject:nil afterDelay:0];
}
- (void) trackKnob: (NSEvent *)  theEvent [implementation]

Definition at line 727 of file nsNativeScrollbar.mm.

                 :(NSEvent *)theEvent
{
  mInTracking = YES;
  NS_DURING   // be sure we always turn mInTracking off.
    [super trackKnob:theEvent];
  NS_HANDLER
  NS_ENDHANDLER
  mInTracking = NO;
}
- (void) trackPagingArea: (id theEvent [implementation]

Definition at line 758 of file nsNativeScrollbar.mm.

                       :(id)theEvent
{
  mInTracking = YES;
  NS_DURING   // be sure we always turn mInTracking off.
    [super trackPagingArea:theEvent];
  NS_HANDLER
  NS_ENDHANDLER
  mInTracking = NO;
}
- (void) trackScrollButtons: (NSEvent *)  theEvent [implementation]

Definition at line 742 of file nsNativeScrollbar.mm.

                          :(NSEvent *)theEvent
{
  mInTracking = YES;
  NS_DURING   // be sure we always turn mInTracking off.
    [super trackScrollButtons:theEvent];
  NS_HANDLER
  NS_ENDHANDLER
  mInTracking = NO;
}
- (nsIWidget *) widget [implementation]

Definition at line 606 of file nsNativeScrollbar.mm.

{
  return NS_STATIC_CAST(nsIWidget*, mGeckoChild);
}
- (void) widgetDestroyed [implementation]

Definition at line 679 of file nsNativeScrollbar.mm.

{
  mGeckoChild = nsnull;

  if (mInTracking)
  {
    // To get out of the NSScroller tracking loop, we post a fake mouseup event.
    // We have to do this here, before we are ripped out of the view hierarchy.
    [NSApp postEvent:[NSEvent mouseEventWithType:NSLeftMouseUp
                                        location:[NSEvent mouseLocation]
                                   modifierFlags:0
                                       timestamp:[[NSApp currentEvent] timestamp]
                                    windowNumber:[[self window] windowNumber]
                                         context:NULL
                                     eventNumber:0
                                      clickCount:0
                                        pressure:1.0]
             atStart:YES];

    mInTracking = NO;
  }
}

The documentation for this class was generated from the following file: