mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 19:50:38 +00:00
Synchronised with trunk at revision 23586
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/themes@23587 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7955334e4d
commit
a50e814e6d
66 changed files with 3847 additions and 1439 deletions
|
@ -616,26 +616,6 @@ static NSNotificationCenter *nc = nil;
|
|||
styleMask: aStyle];
|
||||
}
|
||||
|
||||
+ (NSRect) screenRectForFrameRect: (NSRect)aRect
|
||||
styleMask: (unsigned int)aStyle
|
||||
{
|
||||
if (!windowDecorator)
|
||||
windowDecorator = [GSWindowDecorationView windowDecorator];
|
||||
|
||||
return [windowDecorator screenRectForFrameRect: aRect
|
||||
styleMask: aStyle];
|
||||
}
|
||||
|
||||
+ (NSRect) frameRectForScreenRect: (NSRect)aRect
|
||||
styleMask: (unsigned int)aStyle
|
||||
{
|
||||
if (!windowDecorator)
|
||||
windowDecorator = [GSWindowDecorationView windowDecorator];
|
||||
|
||||
return [windowDecorator frameRectForScreenRect: aRect
|
||||
styleMask: aStyle];
|
||||
}
|
||||
|
||||
+ (float) minFrameWidthWithTitle: (NSString *)aTitle
|
||||
styleMask: (unsigned int)aStyle
|
||||
{
|
||||
|
@ -1706,16 +1686,20 @@ many times.
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Moving and resizing the window
|
||||
*/
|
||||
- (NSPoint) cascadeTopLeftFromPoint: (NSPoint)topLeftPoint
|
||||
{
|
||||
// FIXME: As we know nothing about the other window we can only guess
|
||||
topLeftPoint.x += 20;
|
||||
topLeftPoint.y += 20;
|
||||
NSRect cRect;
|
||||
|
||||
if (NSEqualPoints(topLeftPoint, NSZeroPoint) == YES)
|
||||
{
|
||||
topLeftPoint.x = _frame.origin.x;
|
||||
topLeftPoint.y = _frame.origin.y + _frame.size.height;
|
||||
}
|
||||
[self setFrameTopLeftPoint: topLeftPoint];
|
||||
cRect = [isa contentRectForFrameRect: _frame styleMask: _styleMask];
|
||||
topLeftPoint.x = cRect.origin.x;
|
||||
topLeftPoint.y = cRect.origin.y + cRect.size.height;
|
||||
|
||||
return topLeftPoint;
|
||||
}
|
||||
|
||||
|
@ -2490,11 +2474,18 @@ resetCursorRectsForView(NSView *theView)
|
|||
[self _didDeminiaturize: sender];
|
||||
}
|
||||
|
||||
/**
|
||||
Returns YES, if the document has been changed.
|
||||
*/
|
||||
- (BOOL) isDocumentEdited
|
||||
{
|
||||
return _f.is_edited;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Returns YES, if the window is released when it is closed.
|
||||
*/
|
||||
- (BOOL) isReleasedWhenClosed
|
||||
{
|
||||
return _f.is_released_when_closed;
|
||||
|
@ -2564,6 +2555,11 @@ resetCursorRectsForView(NSView *theView)
|
|||
object: self];
|
||||
}
|
||||
|
||||
/**
|
||||
Causes the window to close. Calls the windowShouldClose: method
|
||||
on the delegate to determine if it should close and calls
|
||||
shouldCloseWindowController on the controller for the receiver.
|
||||
*/
|
||||
- (void) performClose: (id)sender
|
||||
{
|
||||
/* Don't close if a modal session is running and we are not the
|
||||
|
@ -2620,6 +2616,9 @@ resetCursorRectsForView(NSView *theView)
|
|||
[self close];
|
||||
}
|
||||
|
||||
/**
|
||||
Performs the key equivalent represented by theEvent.
|
||||
*/
|
||||
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
|
||||
{
|
||||
if (_contentView)
|
||||
|
@ -2654,6 +2653,11 @@ resetCursorRectsForView(NSView *theView)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Set document edit status. If YES, then, if the receiver has a close
|
||||
button, the close button will show a broken X. If NO, then, if the reciever
|
||||
has a close button, the close button will show a solid X.
|
||||
*/
|
||||
- (void) setDocumentEdited: (BOOL)flag
|
||||
{
|
||||
if (_f.is_edited != flag)
|
||||
|
@ -2667,6 +2671,9 @@ resetCursorRectsForView(NSView *theView)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
If YES, then the window is released when the close method is called.
|
||||
*/
|
||||
- (void) setReleasedWhenClosed: (BOOL)flag
|
||||
{
|
||||
_f.is_released_when_closed = flag;
|
||||
|
@ -2691,16 +2698,26 @@ resetCursorRectsForView(NSView *theView)
|
|||
[NSApp discardEventsMatchingMask: mask beforeEvent: lastEvent];
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the first responder of the window.
|
||||
*/
|
||||
- (NSResponder*) firstResponder
|
||||
{
|
||||
return _firstResponder;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns YES, if the window can accept first responder. The default
|
||||
implementation of this method returns YES.
|
||||
*/
|
||||
- (BOOL) acceptsFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
/**
|
||||
Makes aResponder the first responder within the receiver.
|
||||
*/
|
||||
- (BOOL) makeFirstResponder: (NSResponder*)aResponder
|
||||
{
|
||||
if (_firstResponder == aResponder)
|
||||
|
@ -2738,6 +2755,9 @@ resetCursorRectsForView(NSView *theView)
|
|||
return YES;
|
||||
}
|
||||
|
||||
/**
|
||||
Sets the initial first responder of the receiver.
|
||||
*/
|
||||
- (void) setInitialFirstResponder: (NSView*)aView
|
||||
{
|
||||
if ([aView isKindOfClass: viewClass])
|
||||
|
@ -2746,11 +2766,18 @@ resetCursorRectsForView(NSView *theView)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
returns the initial first responder of the receiver.
|
||||
*/
|
||||
- (NSView*) initialFirstResponder
|
||||
{
|
||||
return _initialFirstResponder;
|
||||
}
|
||||
|
||||
/**
|
||||
Processes theEvent when a key is pressed while within
|
||||
the window.
|
||||
*/
|
||||
- (void) keyDown: (NSEvent*)theEvent
|
||||
{
|
||||
NSString *characters = [theEvent characters];
|
||||
|
@ -4018,17 +4045,25 @@ resetCursorRectsForView(NSView *theView)
|
|||
[_wv convertRect: rect fromView: nil]];
|
||||
}
|
||||
|
||||
- (NSData *)dataWithPDFInsideRect:(NSRect)aRect
|
||||
- (NSData *) dataWithPDFInsideRect:(NSRect)aRect
|
||||
{
|
||||
return [_wv dataWithPDFInsideRect:
|
||||
[_wv convertRect: aRect fromView: nil]];
|
||||
}
|
||||
|
||||
/**
|
||||
Opens the fax panel to allow the user to fax the contents of
|
||||
the window view.
|
||||
*/
|
||||
- (void) fax: (id)sender
|
||||
{
|
||||
[_wv fax: sender];
|
||||
}
|
||||
|
||||
/**
|
||||
Opens the print panel to allow the user to print the contents of
|
||||
the window view.
|
||||
*/
|
||||
- (void) print: (id)sender
|
||||
{
|
||||
[_wv print: sender];
|
||||
|
@ -4038,12 +4073,18 @@ resetCursorRectsForView(NSView *theView)
|
|||
* Zooming
|
||||
*/
|
||||
|
||||
/**
|
||||
Returns yes, if the receiver is zoomed.
|
||||
*/
|
||||
- (BOOL) isZoomed
|
||||
{
|
||||
// FIXME: Method is missing
|
||||
return NO;
|
||||
}
|
||||
|
||||
/**
|
||||
Performs the zoom method on the receiver.
|
||||
*/
|
||||
- (void) performZoom: (id)sender
|
||||
{
|
||||
// FIXME: We should check for the style and highlight the button
|
||||
|
@ -4052,6 +4093,11 @@ resetCursorRectsForView(NSView *theView)
|
|||
|
||||
#define DIST 3
|
||||
|
||||
/**
|
||||
Zooms the receiver. This method calls the delegate method
|
||||
windowShouldZoom:toFrame: to determine if the window should
|
||||
be allowed to zoom to full screen.
|
||||
*/
|
||||
- (void) zoom: (id)sender
|
||||
{
|
||||
NSRect maxRect = [[self screen] visibleFrame];
|
||||
|
@ -4132,11 +4178,18 @@ resetCursorRectsForView(NSView *theView)
|
|||
/*
|
||||
* Assigning a delegate
|
||||
*/
|
||||
|
||||
/**
|
||||
Returns the delegate.
|
||||
*/
|
||||
- (id) delegate
|
||||
{
|
||||
return _delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
Sets the delegate to anObject.
|
||||
*/
|
||||
- (void) setDelegate: (id)anObject
|
||||
{
|
||||
if (_delegate)
|
||||
|
@ -4327,6 +4380,9 @@ resetCursorRectsForView(NSView *theView)
|
|||
return self;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns all drawers associated with this window.
|
||||
*/
|
||||
- (NSArray *) drawers
|
||||
{
|
||||
// TODO
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue