mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 13:50:57 +00:00
Add new MacOSX 10.4 methods and constants to NSWindow. Requires
recompilation of all applications! git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25469 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9540819e1f
commit
1d293756e0
28 changed files with 1377 additions and 958 deletions
31
ChangeLog
31
ChangeLog
|
@ -1,3 +1,32 @@
|
|||
2007-09-08 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSBitmapImageRep.h,
|
||||
* Headers/AppKit/NSResponder.h: Correct conditional compilation.
|
||||
* Headers/AppKit/NSWindow.h: Add new MacOSX 10.4 methods and constants.
|
||||
* Source/NSWindow.m: Basic implementation of new methods.
|
||||
* Source/GSStandardWindowDecorationView.m
|
||||
(-initWithFrame:window:): Get buttons from NSWindow.
|
||||
* Source/NSClipView.m,
|
||||
* Source/NSColorPanel.m,
|
||||
* Source/NSColorWell.m,
|
||||
* Source/NSComboBoxCell.m,
|
||||
* Source/NSDataLinkPanel.m,
|
||||
* Source/NSMatrix.m,
|
||||
* Source/NSMenuItemCell.m,
|
||||
* Source/NSPopUpButton.m:
|
||||
* Source/NSPopUpButtonCell.m:
|
||||
* Source/NSPanel.m:
|
||||
* Source/NSSavePanel.m:
|
||||
* Source/NSScrollView.m,
|
||||
* Source/NSScroller.m,
|
||||
* Source/NSTabView.m,
|
||||
* Source/NSTextField.m,
|
||||
* Source/GSInfoPanel.m,
|
||||
* Source/GSDragView.m,
|
||||
* Source/GSTitleView.m,
|
||||
* Source/GSToolTips.m,
|
||||
* Source/NSButton.m: Clean up includes.
|
||||
|
||||
2007-09-07 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSFontManager.m (-convertFont:toHaveTrait:,
|
||||
|
@ -483,7 +512,7 @@
|
|||
2007-04-27 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSDragging.h: Added a few MacOSX 10.2 methods
|
||||
* Source/GSSlideView.m: (-_handleDrag:slidePoint:): Call new
|
||||
* Source/GSDragView.m: (-_handleDrag:slidePoint:): Call new
|
||||
MacOSX method on destionation when available.
|
||||
Patch by Yen-Ju Chen <yjchenx@gmail.com>
|
||||
|
||||
|
|
|
@ -133,7 +133,11 @@ APPKIT_EXPORT NSString *NSImageEXIFData; // No GNUstep support yet; for reading
|
|||
BOOL _isPlanar;
|
||||
unsigned char **_imagePlanes;
|
||||
NSMutableData *_imageData;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
NSBitmapFormat _format;
|
||||
#else
|
||||
unsigned int _format;
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -47,9 +47,9 @@
|
|||
@interface NSResponder : NSObject <NSCoding>
|
||||
{
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
int _interface_style;
|
||||
#else
|
||||
NSInterfaceStyle _interface_style;
|
||||
#else
|
||||
int _interface_style;
|
||||
#endif
|
||||
NSResponder *_next_responder;
|
||||
|
||||
|
|
|
@ -34,11 +34,8 @@
|
|||
#ifndef _GNUstep_H_NSWindow
|
||||
#define _GNUstep_H_NSWindow
|
||||
|
||||
#include <Foundation/NSDate.h>
|
||||
#include <AppKit/NSGraphicsContext.h>
|
||||
#include <AppKit/NSGraphics.h>
|
||||
#include <AppKit/NSResponder.h>
|
||||
#include <AppKit/NSEvent.h>
|
||||
|
||||
@class NSArray;
|
||||
@class NSData;
|
||||
|
@ -49,6 +46,7 @@
|
|||
@class NSString;
|
||||
@class NSUndoManager;
|
||||
|
||||
@class NSButton;
|
||||
@class NSButtonCell;
|
||||
@class NSColor;
|
||||
@class NSEvent;
|
||||
|
@ -69,19 +67,21 @@
|
|||
* NSDesktopWindowLevel is copied from Window maker and is intended to be
|
||||
* the level at which things on the desktop sit ... so you should be able
|
||||
* to put a desktop background just below it.
|
||||
* FIXME: The hardcoded values here don't match the ones in Cocoa.
|
||||
* But we cannot change them easily as the have to match the ones in Window maker.
|
||||
*/
|
||||
enum {
|
||||
NSDesktopWindowLevel = -1000, /* GNUstep addition */
|
||||
NSNormalWindowLevel = 0,
|
||||
NSFloatingWindowLevel = 3,
|
||||
NSSubmenuWindowLevel = 3,
|
||||
NSTornOffMenuWindowLevel = 3,
|
||||
NSMainMenuWindowLevel = 20,
|
||||
NSDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */
|
||||
NSStatusWindowLevel = 21,
|
||||
NSModalPanelWindowLevel = 100,
|
||||
NSPopUpMenuWindowLevel = 101,
|
||||
NSScreenSaverWindowLevel = 1000
|
||||
NSDesktopWindowLevel = -1000, /* GNUstep addition */ // 2
|
||||
NSNormalWindowLevel = 0, // 3
|
||||
NSFloatingWindowLevel = 3, // 4
|
||||
NSSubmenuWindowLevel = 3, // 5
|
||||
NSTornOffMenuWindowLevel = 3, // 5
|
||||
NSMainMenuWindowLevel = 20, // 7
|
||||
NSDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */ // 6
|
||||
NSStatusWindowLevel = 21, // 8
|
||||
NSModalPanelWindowLevel = 100, // 9
|
||||
NSPopUpMenuWindowLevel = 101, // 10
|
||||
NSScreenSaverWindowLevel = 1000 // 12
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -90,6 +90,13 @@ enum {
|
|||
NSClosableWindowMask = 2,
|
||||
NSMiniaturizableWindowMask = 4,
|
||||
NSResizableWindowMask = 8,
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
|
||||
NSTexturedBackgroundWindowMask = 256,
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
NSUnscaledWindowMask = 2048,
|
||||
NSUnifiedTitleAndToolbarWindowMask = 4096,
|
||||
#endif
|
||||
NSIconWindowMask = 64, /* GNUstep extension - app icon window */
|
||||
NSMiniWindowMask = 128 /* GNUstep extension - miniwindows */
|
||||
};
|
||||
|
@ -100,6 +107,17 @@ typedef enum _NSSelectionDirection {
|
|||
NSSelectingPrevious
|
||||
} NSSelectionDirection;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
|
||||
typedef enum _NSWindowButton
|
||||
{
|
||||
NSWindowCloseButton = 0,
|
||||
NSWindowMiniaturizeButton,
|
||||
NSWindowZoomButton,
|
||||
NSWindowToolbarButton,
|
||||
NSWindowDocumentIconButton
|
||||
} NSWindowButton;
|
||||
#endif
|
||||
|
||||
APPKIT_EXPORT NSSize NSIconSize;
|
||||
APPKIT_EXPORT NSSize NSTokenSize;
|
||||
|
||||
|
@ -157,7 +175,9 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
int _lastDragOperationMask;
|
||||
int _windowNum;
|
||||
int _gstate;
|
||||
void *_reserved_s;
|
||||
id _defaultButtonCell;
|
||||
NSGraphicsContext *_context;
|
||||
|
||||
NSScreen *_screen;
|
||||
NSColor *_backgroundColor;
|
||||
NSString *_representedFilename;
|
||||
|
@ -171,15 +191,14 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
NSRect _rectNeedingFlush;
|
||||
NSMutableArray *_rectsBeingDrawn;
|
||||
unsigned _disableFlushWindow;
|
||||
NSSelectionDirection _selectionDirection;
|
||||
|
||||
NSWindowDepth _depthLimit;
|
||||
NSWindowController *_windowController;
|
||||
int _counterpart;
|
||||
float _alphaValue;
|
||||
|
||||
NSToolbar *_toolbar; // Not used (see NSWindow+Toolbar now)
|
||||
id _toolbarView; // Not used (see NSWindow+Toolbar now)
|
||||
NSMutableArray *_children;
|
||||
NSWindow *_parent;
|
||||
NSCachedImageRep *_cachedImage;
|
||||
NSPoint _cachedImageOrigin;
|
||||
|
||||
|
@ -212,11 +231,20 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
unsigned subclass_bool_one: 1;
|
||||
unsigned subclass_bool_two: 1;
|
||||
unsigned subclass_bool_three: 1;
|
||||
|
||||
unsigned selectionDirection: 2;
|
||||
unsigned displays_when_screen_profile_changes: 1;
|
||||
unsigned is_movable_by_window_background: 1;
|
||||
unsigned allows_tooltips_when_inactive: 1;
|
||||
|
||||
// 4 used 28 available
|
||||
unsigned shows_toolbar_button: 1;
|
||||
unsigned autorecalculates_keyview_loop: 1;
|
||||
unsigned ignores_mouse_events: 1;
|
||||
unsigned preserves_content_during_live_resize: 1;
|
||||
} _f;
|
||||
|
||||
id _defaultButtonCell;
|
||||
NSGraphicsContext *_context;
|
||||
|
||||
void *_reserved_s;
|
||||
void *_reserved_1;
|
||||
}
|
||||
|
||||
|
@ -254,7 +282,10 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
+ (float) minFrameWidthWithTitle: (NSString *)aTitle
|
||||
styleMask: (unsigned int)aStyle;
|
||||
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
- (NSRect) contentRectForFrameRect: (NSRect)frameRect;
|
||||
- (NSRect) frameRectForContentRect: (NSRect)contentRect;
|
||||
#endif
|
||||
/*
|
||||
* Initializing and getting a new NSWindow object
|
||||
*/
|
||||
|
@ -347,6 +378,10 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
- (BOOL) showsResizeIndicator;
|
||||
- (void) setShowsResizeIndicator: (BOOL)show;
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
- (BOOL) preservesContentDuringLiveResize;
|
||||
- (void) setPreservesContentDuringLiveResize: (BOOL)flag;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Constraining size
|
||||
|
@ -363,6 +398,16 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
- (NSSize) resizeIncrements;
|
||||
- (void) setResizeIncrements: (NSSize)aSize;
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
- (NSSize) contentMaxSize;
|
||||
- (void) setContentMaxSize: (NSSize)size;
|
||||
- (NSSize) contentMinSize;
|
||||
- (void) setContentMinSize: (NSSize)size;
|
||||
- (NSSize) contentAspectRatio;
|
||||
- (void) setContentAspectRatio: (NSSize)ratio;
|
||||
- (NSSize) contentResizeIncrements;
|
||||
- (void) setContentResizeIncrements: (NSSize)increments;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Saving and restoring the frame
|
||||
|
@ -447,6 +492,7 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
- (void) setOneShot: (BOOL)flag;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
- (NSGraphicsContext*) graphicsContext;
|
||||
- (float) userSpaceScaleFactor;
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -502,6 +548,10 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
- (NSPoint) mouseLocationOutsideOfEventStream;
|
||||
- (BOOL) acceptsMouseMovedEvents;
|
||||
- (void) setAcceptsMouseMovedEvents: (BOOL)flag;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
|
||||
- (BOOL) ignoresMouseEvents;
|
||||
- (void) setIgnoresMouseEvents: (BOOL)flag;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The field editor
|
||||
|
@ -519,6 +569,11 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
- (void) selectPreviousKeyView: (id)sender;
|
||||
- (void) setInitialFirstResponder: (NSView*)aView;
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
- (BOOL) autorecalculatesKeyViewLoop;
|
||||
- (void) setAutorecalculatesKeyViewLoop: (BOOL)flag;
|
||||
- (void) recalculateKeyViewLoop;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Window graphics
|
||||
|
@ -613,6 +668,9 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
- (void) setOpaque: (BOOL)isOpaque;
|
||||
- (BOOL) isOpaque;
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
|
||||
- (void) invalidateShadow;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Services menu support
|
||||
|
@ -648,6 +706,44 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
- (void *)windowRef;
|
||||
- (void*) windowHandle;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Window butons
|
||||
*/
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
|
||||
+ (NSButton *) standardWindowButton: (NSWindowButton)button
|
||||
forStyleMask: (unsigned int) mask;
|
||||
- (NSButton *) standardWindowButton: (NSWindowButton)button;
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
- (BOOL) showsToolbarButton;
|
||||
- (void) setShowsToolbarButton: (BOOL)flag;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
|
||||
- (NSArray *) childWindows;
|
||||
- (void) addChildWindow: (NSWindow *)child
|
||||
ordered: (NSWindowOrderingMode)place;
|
||||
- (void) removeChildWindow: (NSWindow *)child;
|
||||
- (NSWindow *) parentWindow;
|
||||
- (void) setParentWindow: (NSWindow *)window;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
- (BOOL) allowsToolTipsWhenApplicationIsInactive;
|
||||
- (void) setAllowsToolTipsWhenApplicationIsInactive: (BOOL)flag;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
|
||||
- (BOOL) isMovableByWindowBackground;
|
||||
- (void) setMovableByWindowBackground: (BOOL)flag;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
- (BOOL) displaysWhenScreenProfileChanges;
|
||||
- (void) setDisplaysWhenScreenProfileChanges: (BOOL)flag;
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
|
||||
|
@ -694,18 +790,19 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
@interface NSObject (NSWindowDelegate)
|
||||
- (BOOL) windowShouldClose: (id)sender;
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
- (NSRect) window: (NSWindow*)window
|
||||
willPositionSheet: (NSWindow*)sheet
|
||||
usingRect: (NSRect)rect;
|
||||
- (void) windowDidChangeScreenProfile: (NSNotification*)aNotification;
|
||||
- (void) windowWillBeginSheet: (NSNotification*)aNotification;
|
||||
- (void) windowDidEndSheet: (NSNotification*)aNotification;
|
||||
- (BOOL) windowShouldZoom: (NSWindow*)sender
|
||||
toFrame: (NSRect)aFrame;
|
||||
- (void) windowWillBeginSheet: (NSNotification*)aNotification;
|
||||
- (NSUndoManager*) windowWillReturnUndoManager: (NSWindow*)sender;
|
||||
- (NSRect) windowWillUseStandardFrame: (NSWindow*)sender
|
||||
defaultFrame: (NSRect)aFrame;
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
- (NSRect) window: (NSWindow *)window
|
||||
willPositionSheet: (NSWindow *)sheet
|
||||
usingRect: (NSRect)rect;
|
||||
#endif
|
||||
- (NSSize) windowWillResize: (NSWindow*)sender
|
||||
toSize: (NSSize)frameSize;
|
||||
- (id) windowWillReturnFieldEditor: (NSWindow*)sender
|
||||
|
@ -713,6 +810,9 @@ willPositionSheet: (NSWindow*)sheet
|
|||
- (void) windowDidBecomeKey: (NSNotification*)aNotification;
|
||||
- (void) windowDidBecomeMain: (NSNotification*)aNotification;
|
||||
- (void) windowDidChangeScreen: (NSNotification*)aNotification;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
- (void) windowDidChangeScreenProfile: (NSNotification *)aNotification;
|
||||
#endif
|
||||
- (void) windowDidDeminiaturize: (NSNotification*)aNotification;
|
||||
- (void) windowDidExpose: (NSNotification*)aNotification;
|
||||
- (void) windowDidMiniaturize: (NSNotification*)aNotification;
|
||||
|
@ -731,7 +831,13 @@ willPositionSheet: (NSWindow*)sheet
|
|||
APPKIT_EXPORT NSString *NSWindowDidBecomeKeyNotification;
|
||||
APPKIT_EXPORT NSString *NSWindowDidBecomeMainNotification;
|
||||
APPKIT_EXPORT NSString *NSWindowDidChangeScreenNotification;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
APPKIT_EXPORT NSString *NSWindowDidChangeScreenProfileNotification;
|
||||
#endif
|
||||
APPKIT_EXPORT NSString *NSWindowDidDeminiaturizeNotification;
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
APPKIT_EXPORT NSString *NSWindowDidEndSheetNotification;
|
||||
#endif
|
||||
APPKIT_EXPORT NSString *NSWindowDidExposeNotification;
|
||||
APPKIT_EXPORT NSString *NSWindowDidMiniaturizeNotification;
|
||||
APPKIT_EXPORT NSString *NSWindowDidMoveNotification;
|
||||
|
@ -739,6 +845,9 @@ APPKIT_EXPORT NSString *NSWindowDidResignKeyNotification;
|
|||
APPKIT_EXPORT NSString *NSWindowDidResignMainNotification;
|
||||
APPKIT_EXPORT NSString *NSWindowDidResizeNotification;
|
||||
APPKIT_EXPORT NSString *NSWindowDidUpdateNotification;
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
APPKIT_EXPORT NSString *NSWindowWillBeginSheetNotification;
|
||||
#endif
|
||||
APPKIT_EXPORT NSString *NSWindowWillCloseNotification;
|
||||
APPKIT_EXPORT NSString *NSWindowWillMiniaturizeNotification;
|
||||
APPKIT_EXPORT NSString *NSWindowWillMoveNotification;
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSCell.h>
|
||||
#include <AppKit/NSCursor.h>
|
||||
#include <AppKit/NSEvent.h>
|
||||
#include <AppKit/NSGraphics.h>
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <AppKit/NSPasteboard.h>
|
||||
#include <AppKit/NSView.h>
|
||||
|
|
|
@ -25,15 +25,17 @@
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSButton.h"
|
||||
#include "AppKit/NSFont.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSTextField.h"
|
||||
#include <Foundation/NSBundle.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSProcessInfo.h>
|
||||
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSButton.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSFont.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSTextField.h"
|
||||
#include "GNUstepGUI/GSInfoPanel.h"
|
||||
#include "GNUstepGUI/GSTheme.h"
|
||||
|
||||
|
|
|
@ -23,13 +23,12 @@
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "GSWindowDecorationView.h"
|
||||
|
||||
#include <Foundation/NSException.h>
|
||||
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSAttributedString.h"
|
||||
#include "AppKit/NSButton.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSParagraphStyle.h"
|
||||
#include "AppKit/NSScreen.h"
|
||||
|
@ -37,7 +36,7 @@
|
|||
#include "AppKit/NSWindow.h"
|
||||
#include "AppKit/PSOperators.h"
|
||||
#include "GNUstepGUI/GSDisplayServer.h"
|
||||
|
||||
#include "GSWindowDecorationView.h"
|
||||
|
||||
@implementation GSStandardWindowDecorationView
|
||||
|
||||
|
@ -169,40 +168,19 @@ static NSColor *titleColor[3];
|
|||
{
|
||||
hasCloseButton = YES;
|
||||
|
||||
closeButton = [[NSButton alloc] init];
|
||||
[closeButton setRefusesFirstResponder: YES];
|
||||
[closeButton setButtonType: NSMomentaryChangeButton];
|
||||
[closeButton setImagePosition: NSImageOnly];
|
||||
[closeButton setBordered: YES];
|
||||
[closeButton setImage: [NSImage imageNamed: @"common_Close"]];
|
||||
[closeButton setAlternateImage: [NSImage imageNamed: @"common_CloseH"]];
|
||||
closeButton = [NSWindow standardWindowButton: NSWindowCloseButton
|
||||
forStyleMask: [w styleMask]];
|
||||
[closeButton setTarget: window];
|
||||
/* TODO: -performClose: should (but doesn't currently) highlight the
|
||||
button, which is wrong here. When -performClose: is fixed, we'll need a
|
||||
different method here. */
|
||||
[closeButton setAction: @selector(performClose:)];
|
||||
[self addSubview: closeButton];
|
||||
RELEASE(closeButton);
|
||||
}
|
||||
if ([w styleMask] & NSMiniaturizableWindowMask)
|
||||
{
|
||||
hasMiniaturizeButton = YES;
|
||||
|
||||
miniaturizeButton = [[NSButton alloc] init];
|
||||
[miniaturizeButton setRefusesFirstResponder: YES];
|
||||
[miniaturizeButton setButtonType: NSMomentaryChangeButton];
|
||||
[miniaturizeButton setImagePosition: NSImageOnly];
|
||||
[miniaturizeButton setBordered: YES];
|
||||
[miniaturizeButton setImage:
|
||||
[NSImage imageNamed: @"common_Miniaturize"]];
|
||||
[miniaturizeButton setAlternateImage:
|
||||
[NSImage imageNamed: @"common_MiniaturizeH"]];
|
||||
miniaturizeButton = [NSWindow standardWindowButton: NSWindowMiniaturizeButton
|
||||
forStyleMask: [w styleMask]];
|
||||
[miniaturizeButton setTarget: window];
|
||||
/* TODO: -performMiniaturize: should (but doesn't currently) highlight
|
||||
the button, which is wrong here, just like -performClose: above. */
|
||||
[miniaturizeButton setAction: @selector(performMiniaturize:)];
|
||||
[self addSubview: miniaturizeButton];
|
||||
RELEASE(miniaturizeButton);
|
||||
}
|
||||
if ([w styleMask] & NSResizableWindowMask)
|
||||
{
|
||||
|
|
|
@ -26,15 +26,16 @@
|
|||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSRunLoop.h>
|
||||
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include "AppKit/NSAttributedString.h"
|
||||
#include <AppKit/NSView.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <AppKit/NSPanel.h>
|
||||
#include <AppKit/NSButton.h>
|
||||
#include <AppKit/NSEvent.h>
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <AppKit/NSMenu.h>
|
||||
#include <AppKit/NSMenuView.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSPanel.h>
|
||||
#include <AppKit/NSView.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
|
||||
#include <GNUstepGUI/GSTitleView.h>
|
||||
#include "GNUstepGUI/GSTheme.h"
|
||||
|
|
|
@ -25,11 +25,13 @@
|
|||
*/
|
||||
|
||||
#include <Foundation/Foundation.h>
|
||||
|
||||
#include "AppKit/NSAttributedString.h"
|
||||
#include "AppKit/NSBezierPath.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSScreen.h"
|
||||
#include "AppKit/NSView.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
#include "AppKit/NSScreen.h"
|
||||
#include "GNUstepGUI/GSTrackingRect.h"
|
||||
#include "GSToolTips.h"
|
||||
|
||||
|
|
|
@ -28,10 +28,11 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include "AppKit/NSButton.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
#include "AppKit/NSButtonCell.h"
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSButton.h"
|
||||
#include "AppKit/NSButtonCell.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
|
||||
//
|
||||
// class variables
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "AppKit/NSClipView.h"
|
||||
#include "AppKit/NSCursor.h"
|
||||
#include "AppKit/NSColor.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSTableView.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
#include "AppKit/NSColorPicker.h"
|
||||
#include "AppKit/NSColorPicking.h"
|
||||
#include "AppKit/NSColorWell.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSPasteboard.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "AppKit/NSColorWell.h"
|
||||
#include "AppKit/NSColor.h"
|
||||
#include "AppKit/NSDragging.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSPasteboard.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "AppKit/NSButtonCell.h"
|
||||
#include "AppKit/NSComboBox.h"
|
||||
#include "AppKit/NSComboBoxCell.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSGraphicsContext.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSMatrix.h"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "AppKit/NSDataLinkPanel.h"
|
||||
#include "AppKit/NSDataLinkManager.h"
|
||||
#include "AppKit/NSDataLink.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSView.h"
|
||||
#include "AppKit/NSNibLoading.h"
|
||||
#include "GSGuiPrivate.h"
|
||||
|
|
|
@ -62,12 +62,14 @@
|
|||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSZone.h>
|
||||
|
||||
#include "AppKit/NSActionCell.h"
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSColor.h"
|
||||
#include "AppKit/NSCursor.h"
|
||||
#include "AppKit/NSActionCell.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSMatrix.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "AppKit/NSAttributedString.h"
|
||||
#include "AppKit/NSColor.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSFont.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
|
|
|
@ -28,10 +28,11 @@
|
|||
#include "config.h"
|
||||
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include "AppKit/NSPanel.h"
|
||||
#include "AppKit/NSButton.h"
|
||||
#include "AppKit/NSTextField.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSPanel.h"
|
||||
#include "AppKit/NSTextField.h"
|
||||
|
||||
@implementation NSPanel
|
||||
|
||||
|
|
|
@ -28,9 +28,10 @@
|
|||
*/
|
||||
|
||||
#include <Foundation/Foundation.h>
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSPopUpButton.h"
|
||||
#include "AppKit/NSPopUpButtonCell.h"
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSMenu.h"
|
||||
#include "AppKit/NSMenuItem.h"
|
||||
#include "AppKit/NSMenuView.h"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "config.h"
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSMenu.h"
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "AppKit/NSBrowser.h"
|
||||
#include "AppKit/NSBrowserCell.h"
|
||||
#include "AppKit/NSButton.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSFont.h"
|
||||
#include "AppKit/NSForm.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
|
|
|
@ -32,13 +32,16 @@
|
|||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
#include "AppKit/NSScroller.h"
|
||||
|
||||
#include "AppKit/NSColor.h"
|
||||
#include "AppKit/NSCell.h"
|
||||
#include "AppKit/NSClipView.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSInterfaceStyle.h"
|
||||
#include "AppKit/NSScrollView.h"
|
||||
#include "AppKit/NSRulerView.h"
|
||||
#include "AppKit/NSScroller.h"
|
||||
#include "AppKit/NSScrollView.h"
|
||||
#include "AppKit/NSTableHeaderView.h"
|
||||
#include "AppKit/NSTableView.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
|
|
|
@ -33,14 +33,15 @@
|
|||
#include <Foundation/NSRunLoop.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSButtonCell.h"
|
||||
#include "AppKit/NSColor.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSScroller.h"
|
||||
#include "AppKit/NSScrollView.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
#include "AppKit/NSButtonCell.h"
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSColor.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
|
||||
/**<p>TODO Description</p>
|
||||
*/
|
||||
|
|
|
@ -26,14 +26,15 @@
|
|||
*/
|
||||
|
||||
#include "AppKit/NSColor.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSFont.h"
|
||||
#include "AppKit/NSForm.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSForm.h"
|
||||
#include "AppKit/NSMatrix.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
#include "AppKit/NSTabView.h"
|
||||
#include "AppKit/NSTabViewItem.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
#include "AppKit/PSOperators.h"
|
||||
#include "GNUstepGUI/GSTheme.h"
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSCursor.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSTextField.h"
|
||||
#include "AppKit/NSTextFieldCell.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
#include "AppKit/NSDragging.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSFileWrapper.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSLayoutManager.h"
|
||||
#include "AppKit/NSParagraphStyle.h"
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
#include "AppKit/NSDocumentController.h"
|
||||
#include "AppKit/NSDocument.h"
|
||||
#include "AppKit/NSDragging.h"
|
||||
#include "AppKit/NSEvent.h"
|
||||
#include "AppKit/NSFont.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "AppKit/NSHelpManager.h"
|
||||
|
@ -743,7 +744,7 @@ many times.
|
|||
TEST_RELEASE(_initialFirstResponder);
|
||||
TEST_RELEASE(_defaultButtonCell);
|
||||
TEST_RELEASE(_cachedImage);
|
||||
TEST_RELEASE(_toolbar);
|
||||
TEST_RELEASE(_children);
|
||||
DESTROY(_lastView);
|
||||
DESTROY(_lastDragView);
|
||||
RELEASE(_screen);
|
||||
|
@ -1045,6 +1046,18 @@ many times.
|
|||
}
|
||||
}
|
||||
|
||||
- (NSRect) contentRectForFrameRect: (NSRect)frameRect
|
||||
{
|
||||
// FIXME
|
||||
return [isa contentRectForFrameRect: frameRect styleMask: _styleMask];
|
||||
}
|
||||
|
||||
- (NSRect) frameRectForContentRect: (NSRect)contentRect
|
||||
{
|
||||
// FIXME
|
||||
return [isa frameRectForContentRect: contentRect styleMask: _styleMask];
|
||||
}
|
||||
|
||||
/*
|
||||
* Accessing the content view
|
||||
*/
|
||||
|
@ -1162,6 +1175,11 @@ many times.
|
|||
return _f.has_shadow;
|
||||
}
|
||||
|
||||
- (void) invalidateShadow
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
|
||||
- (void) setAlphaValue: (float)windowAlpha
|
||||
{
|
||||
_alphaValue = windowAlpha;
|
||||
|
@ -1205,6 +1223,18 @@ many times.
|
|||
return _context;
|
||||
}
|
||||
|
||||
- (float) userSpaceScaleFactor
|
||||
{
|
||||
if (_styleMask & NSUnscaledWindowMask)
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return [_screen userSpaceScaleFactor];
|
||||
}
|
||||
}
|
||||
|
||||
- (int) gState
|
||||
{
|
||||
if (_gstate <= 0)
|
||||
|
@ -1761,6 +1791,16 @@ many times.
|
|||
"setShowsResizeIndicator:", "NSWindow");
|
||||
}
|
||||
|
||||
- (BOOL) preservesContentDuringLiveResize
|
||||
{
|
||||
return _f.preserves_content_during_live_resize;
|
||||
}
|
||||
|
||||
- (void) setPreservesContentDuringLiveResize: (BOOL)flag
|
||||
{
|
||||
_f.preserves_content_during_live_resize = flag;
|
||||
}
|
||||
|
||||
- (void) setFrame: (NSRect)frameRect
|
||||
display: (BOOL)displayFlag
|
||||
animate: (BOOL)animationFlag
|
||||
|
@ -2053,13 +2093,82 @@ many times.
|
|||
// FIXME: This method is missing
|
||||
}
|
||||
|
||||
- (NSSize) contentMaxSize
|
||||
{
|
||||
// FIXME
|
||||
NSRect rect;
|
||||
|
||||
rect.origin = NSMakePoint(0, 0);
|
||||
rect.size = [self maxSize];
|
||||
rect = [self contentRectForFrameRect: rect];
|
||||
return rect.size;
|
||||
}
|
||||
|
||||
- (void) setContentMaxSize: (NSSize)size
|
||||
{
|
||||
// FIXME
|
||||
NSRect rect;
|
||||
|
||||
rect.origin = NSMakePoint(0, 0);
|
||||
rect.size = size;
|
||||
rect = [self frameRectForContentRect: rect];
|
||||
[self setMaxSize: rect.size];
|
||||
}
|
||||
|
||||
- (NSSize) contentMinSize
|
||||
{
|
||||
// FIXME
|
||||
NSRect rect;
|
||||
|
||||
rect.origin = NSMakePoint(0, 0);
|
||||
rect.size = [self minSize];
|
||||
rect = [self contentRectForFrameRect: rect];
|
||||
return rect.size;
|
||||
}
|
||||
|
||||
- (void) setContentMinSize: (NSSize)size
|
||||
{
|
||||
// FIXME
|
||||
NSRect rect;
|
||||
|
||||
rect.origin = NSMakePoint(0, 0);
|
||||
rect.size = size;
|
||||
rect = [self frameRectForContentRect: rect];
|
||||
[self setMinSize: rect.size];
|
||||
}
|
||||
|
||||
- (NSSize) contentAspectRatio
|
||||
{
|
||||
// FIXME
|
||||
return NSMakeSize(1, 1);
|
||||
}
|
||||
|
||||
- (void) setContentAspectRatio: (NSSize)ratio
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
|
||||
- (NSSize) contentResizeIncrements
|
||||
{
|
||||
// FIXME
|
||||
return [self resizeIncrements];
|
||||
}
|
||||
|
||||
- (void) setContentResizeIncrements: (NSSize)increments
|
||||
{
|
||||
// FIXME
|
||||
[self setResizeIncrements: increments];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert from a point in the base coordinate system for the window
|
||||
* to a point in the screen coordinate system.
|
||||
*/
|
||||
- (NSPoint) convertBaseToScreen: (NSPoint)aPoint
|
||||
{
|
||||
// FIXME: Apply userSpaceScaleFactor?
|
||||
NSPoint screenPoint;
|
||||
|
||||
screenPoint.x = _frame.origin.x + aPoint.x;
|
||||
screenPoint.y = _frame.origin.y + aPoint.y;
|
||||
return screenPoint;
|
||||
|
@ -2071,7 +2180,9 @@ many times.
|
|||
*/
|
||||
- (NSPoint) convertScreenToBase: (NSPoint)aPoint
|
||||
{
|
||||
// FIXME: Apply userSpaceScaleFactor?
|
||||
NSPoint basePoint;
|
||||
|
||||
basePoint.x = aPoint.x - _frame.origin.x;
|
||||
basePoint.y = aPoint.y - _frame.origin.y;
|
||||
return basePoint;
|
||||
|
@ -2691,6 +2802,65 @@ resetCursorRectsForView(NSView *theView)
|
|||
[self miniaturize: sender];
|
||||
}
|
||||
|
||||
+ (NSButton *) standardWindowButton: (NSWindowButton)button
|
||||
forStyleMask: (unsigned int) mask
|
||||
{
|
||||
NSButton *newButton;
|
||||
|
||||
newButton = [[NSButton alloc] init];
|
||||
[newButton setRefusesFirstResponder: YES];
|
||||
[newButton setButtonType: NSMomentaryChangeButton];
|
||||
[newButton setImagePosition: NSImageOnly];
|
||||
[newButton setBordered: YES];
|
||||
[newButton setTag: button];
|
||||
|
||||
switch (button)
|
||||
{
|
||||
case NSWindowCloseButton:
|
||||
[newButton setImage: [NSImage imageNamed: @"common_Close"]];
|
||||
[newButton setAlternateImage: [NSImage imageNamed: @"common_CloseH"]];
|
||||
/* TODO: -performClose: should (but doesn't currently) highlight the
|
||||
button, which is wrong here. When -performClose: is fixed, we'll need a
|
||||
different method here. */
|
||||
[newButton setAction: @selector(performClose:)];
|
||||
break;
|
||||
|
||||
case NSWindowMiniaturizeButton:
|
||||
[newButton setImage: [NSImage imageNamed: @"common_Miniaturize"]];
|
||||
[newButton setAlternateImage: [NSImage imageNamed: @"common_MiniaturizeH"]];
|
||||
[newButton setAction: @selector(miniaturize:)];
|
||||
break;
|
||||
|
||||
case NSWindowZoomButton:
|
||||
// FIXME
|
||||
[newButton setAction: @selector(zoom:)];
|
||||
break;
|
||||
|
||||
case NSWindowToolbarButton:
|
||||
case NSWindowDocumentIconButton:
|
||||
default:
|
||||
// FIXME
|
||||
break;
|
||||
}
|
||||
|
||||
return AUTORELEASE(newButton);
|
||||
}
|
||||
|
||||
- (NSButton *) standardWindowButton: (NSWindowButton)button
|
||||
{
|
||||
return [_wv viewWithTag: button];
|
||||
}
|
||||
|
||||
- (BOOL) showsToolbarButton
|
||||
{
|
||||
return _f.shows_toolbar_button;
|
||||
}
|
||||
|
||||
- (void) setShowsToolbarButton: (BOOL)flag
|
||||
{
|
||||
_f.shows_toolbar_button = flag;
|
||||
}
|
||||
|
||||
- (int) resizeFlags
|
||||
{
|
||||
// FIXME: The implementation is missing
|
||||
|
@ -2761,6 +2931,21 @@ resetCursorRectsForView(NSView *theView)
|
|||
return _f.accepts_mouse_moved;
|
||||
}
|
||||
|
||||
- (void) setAcceptsMouseMovedEvents: (BOOL)flag
|
||||
{
|
||||
_f.accepts_mouse_moved = flag;
|
||||
}
|
||||
|
||||
- (BOOL) ignoresMouseEvents
|
||||
{
|
||||
return _f.ignores_mouse_events;
|
||||
}
|
||||
|
||||
- (void) setIgnoresMouseEvents: (BOOL)flag
|
||||
{
|
||||
_f.ignores_mouse_events = flag;
|
||||
}
|
||||
|
||||
- (NSEvent*) currentEvent
|
||||
{
|
||||
return [NSApp currentEvent];
|
||||
|
@ -2991,11 +3176,6 @@ resetCursorRectsForView(NSView *theView)
|
|||
[NSApp postEvent: event atStart: flag];
|
||||
}
|
||||
|
||||
- (void) setAcceptsMouseMovedEvents: (BOOL)flag
|
||||
{
|
||||
_f.accepts_mouse_moved = flag;
|
||||
}
|
||||
|
||||
- (void) _checkTrackingRectangles: (NSView*)theView
|
||||
forEvent: (NSEvent*)theEvent
|
||||
{
|
||||
|
@ -3247,6 +3427,12 @@ resetCursorRectsForView(NSView *theView)
|
|||
}
|
||||
|
||||
type = [theEvent type];
|
||||
if ([self ignoresMouseEvents]
|
||||
&& GSMouseEventMask == NSEventMaskFromType(type))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case NSLeftMouseDown:
|
||||
|
@ -3857,9 +4043,9 @@ resetCursorRectsForView(NSView *theView)
|
|||
}
|
||||
if ([theView respondsToSelector:@selector(selectText:)])
|
||||
{
|
||||
_selectionDirection = NSSelectingNext;
|
||||
_f.selectionDirection = NSSelectingNext;
|
||||
[(id)theView selectText: self];
|
||||
_selectionDirection = NSDirectSelection;
|
||||
_f.selectionDirection = NSDirectSelection;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3881,9 +4067,9 @@ resetCursorRectsForView(NSView *theView)
|
|||
}
|
||||
if ([theView respondsToSelector:@selector(selectText:)])
|
||||
{
|
||||
_selectionDirection = NSSelectingPrevious;
|
||||
_f.selectionDirection = NSSelectingPrevious;
|
||||
[(id)theView selectText: self];
|
||||
_selectionDirection = NSDirectSelection;
|
||||
_f.selectionDirection = NSDirectSelection;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3920,9 +4106,9 @@ resetCursorRectsForView(NSView *theView)
|
|||
}
|
||||
if ([theView respondsToSelector:@selector(selectText:)])
|
||||
{
|
||||
_selectionDirection = NSSelectingNext;
|
||||
_f.selectionDirection = NSSelectingNext;
|
||||
[(id)theView selectText: self];
|
||||
_selectionDirection = NSDirectSelection;
|
||||
_f.selectionDirection = NSDirectSelection;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3959,9 +4145,9 @@ resetCursorRectsForView(NSView *theView)
|
|||
}
|
||||
if ([theView respondsToSelector:@selector(selectText:)])
|
||||
{
|
||||
_selectionDirection = NSSelectingPrevious;
|
||||
_f.selectionDirection = NSSelectingPrevious;
|
||||
[(id)theView selectText: self];
|
||||
_selectionDirection = NSDirectSelection;
|
||||
_f.selectionDirection = NSDirectSelection;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3982,9 +4168,26 @@ current key view.<br />
|
|||
*/
|
||||
- (NSSelectionDirection) keyViewSelectionDirection
|
||||
{
|
||||
return _selectionDirection;
|
||||
return _f.selectionDirection;
|
||||
}
|
||||
|
||||
- (BOOL) autorecalculatesKeyViewLoop
|
||||
{
|
||||
return _f.autorecalculates_keyview_loop;
|
||||
}
|
||||
|
||||
- (void) setAutorecalculatesKeyViewLoop: (BOOL)flag
|
||||
{
|
||||
_f.autorecalculates_keyview_loop = flag;
|
||||
}
|
||||
|
||||
- (void) recalculateKeyViewLoop
|
||||
{
|
||||
// FIXME
|
||||
// Should be called from NSView viewWillMoveToWindow
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Dragging
|
||||
*/
|
||||
|
@ -4413,6 +4616,69 @@ current key view.<br />
|
|||
_f.default_button_cell_key_disabled = NO;
|
||||
}
|
||||
|
||||
- (NSArray *) childWindows
|
||||
{
|
||||
return _children;
|
||||
}
|
||||
|
||||
- (void) addChildWindow: (NSWindow *)child
|
||||
ordered: (NSWindowOrderingMode)place
|
||||
{
|
||||
if (_children == nil)
|
||||
{
|
||||
_children = [[NSMutableArray alloc] init];
|
||||
}
|
||||
[_children addObject: child];
|
||||
[child setParentWindow: self];
|
||||
}
|
||||
|
||||
- (void) removeChildWindow: (NSWindow *)child
|
||||
{
|
||||
[_children removeObject: child];
|
||||
[child setParentWindow: nil];
|
||||
}
|
||||
|
||||
- (NSWindow *) parentWindow
|
||||
{
|
||||
return _parent;
|
||||
}
|
||||
|
||||
- (void) setParentWindow: (NSWindow *)window
|
||||
{
|
||||
// FIXME
|
||||
_parent = window;
|
||||
}
|
||||
|
||||
- (BOOL) allowsToolTipsWhenApplicationIsInactive
|
||||
{
|
||||
return _f.allows_tooltips_when_inactive;
|
||||
}
|
||||
|
||||
- (void) setAllowsToolTipsWhenApplicationIsInactive: (BOOL)flag
|
||||
{
|
||||
_f.allows_tooltips_when_inactive = flag;
|
||||
}
|
||||
|
||||
- (BOOL) isMovableByWindowBackground
|
||||
{
|
||||
return _f.is_movable_by_window_background;
|
||||
}
|
||||
|
||||
- (void) setMovableByWindowBackground: (BOOL)flag
|
||||
{
|
||||
_f.is_movable_by_window_background = flag;
|
||||
}
|
||||
|
||||
- (BOOL) displaysWhenScreenProfileChanges
|
||||
{
|
||||
return _f.displays_when_screen_profile_changes;
|
||||
}
|
||||
|
||||
- (void) setDisplaysWhenScreenProfileChanges: (BOOL)flag
|
||||
{
|
||||
_f.displays_when_screen_profile_changes = flag;
|
||||
}
|
||||
|
||||
/*
|
||||
* Assigning a delegate
|
||||
*/
|
||||
|
@ -4465,7 +4731,6 @@ current key view.<br />
|
|||
{
|
||||
BOOL flag;
|
||||
|
||||
|
||||
// If were're being initialized from a keyed coder...
|
||||
if ([aCoder allowsKeyedCoding])
|
||||
{
|
||||
|
@ -4477,7 +4742,6 @@ current key view.<br />
|
|||
NSStringFromClass([self class])];
|
||||
}
|
||||
|
||||
|
||||
[super encodeWithCoder: aCoder];
|
||||
|
||||
[aCoder encodeRect: [[self contentView] frame]];
|
||||
|
@ -4524,7 +4788,6 @@ current key view.<br />
|
|||
id oldself = self;
|
||||
BOOL flag;
|
||||
|
||||
|
||||
// If were're being initialized from a keyed coder...
|
||||
if ([aDecoder allowsKeyedCoding])
|
||||
{
|
||||
|
@ -4678,11 +4941,10 @@ current key view.<br />
|
|||
- (void) _initDefaults
|
||||
{
|
||||
_firstResponder = self;
|
||||
_initialFirstResponder = nil;
|
||||
_selectionDirection = NSDirectSelection;
|
||||
_delegate = nil;
|
||||
_windowNum = 0;
|
||||
_gstate = 0;
|
||||
// _initialFirstResponder = nil;
|
||||
// _delegate = nil;
|
||||
// _windowNum = 0;
|
||||
// _gstate = 0;
|
||||
_backgroundColor = RETAIN([NSColor windowBackgroundColor]);
|
||||
_representedFilename = @"Window";
|
||||
_miniaturizedTitle = @"Window";
|
||||
|
@ -4695,26 +4957,31 @@ current key view.<br />
|
|||
_disableFlushWindow = 0;
|
||||
_alphaValue = 1.0;
|
||||
|
||||
_f.is_one_shot = NO;
|
||||
// _f.accepts_drag = NO;
|
||||
// _f.is_one_shot = NO;
|
||||
// _f.needs_flush = NO;
|
||||
_f.is_autodisplay = YES;
|
||||
_f.optimize_drawing = NO;
|
||||
// _f.optimize_drawing = NO;
|
||||
_f.dynamic_depth_limit = YES;
|
||||
_f.cursor_rects_enabled = NO;
|
||||
_f.visible = NO;
|
||||
_f.is_key = NO;
|
||||
_f.is_main = NO;
|
||||
_f.is_edited = NO;
|
||||
// _f.cursor_rects_enabled = NO;
|
||||
// _f.cursor_rects_valid = NO;
|
||||
// _f.visible = NO;
|
||||
// _f.is_key = NO;
|
||||
// _f.is_main = NO;
|
||||
// _f.is_edited = NO;
|
||||
_f.is_released_when_closed = YES;
|
||||
_f.is_miniaturized = NO;
|
||||
_f.menu_exclude = NO;
|
||||
_f.hides_on_deactivate = NO;
|
||||
_f.accepts_mouse_moved = NO;
|
||||
_f.has_opened = NO;
|
||||
_f.has_closed = NO;
|
||||
// _f.is_miniaturized = NO;
|
||||
// _f.menu_exclude = NO;
|
||||
// _f.hides_on_deactivate = NO;
|
||||
// _f.accepts_mouse_moved = NO;
|
||||
// _f.has_opened = NO;
|
||||
// _f.has_closed = NO;
|
||||
// _f.default_button_cell_key_disabled = NO;
|
||||
_f.can_hide = YES;
|
||||
_f.has_shadow = NO;
|
||||
// _f.has_shadow = NO;
|
||||
_f.is_opaque = YES;
|
||||
_f.views_need_display = YES;
|
||||
_f.selectionDirection = NSDirectSelection;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -4743,6 +5010,7 @@ void NSWindowList(int size, int list[])
|
|||
{
|
||||
NSArray *windowList = [GSCurrentServer() windowlist];
|
||||
unsigned i, c;
|
||||
|
||||
for (i = 0, c = [windowList count]; i < size && i < c; i++)
|
||||
{
|
||||
list[i] = [[windowList objectAtIndex:i] intValue];
|
||||
|
|
|
@ -410,7 +410,9 @@ NSString *NSOutlineViewItemWillCollapseNotification = @"OutlineViewItemWillColla
|
|||
NSString *NSWindowDidBecomeKeyNotification = @"WindowDidBecomeKey";
|
||||
NSString *NSWindowDidBecomeMainNotification = @"WindowDidBecomeMain";
|
||||
NSString *NSWindowDidChangeScreenNotification = @"WindowDidChangeScreen";
|
||||
NSString *NSWindowDidChangeScreenProfileNotification = @"NSWindowDidChangeScreenProfile";
|
||||
NSString *NSWindowDidDeminiaturizeNotification = @"WindowDidDeminiaturize";
|
||||
NSString *NSWindowDidEndSheetNotification = @"NSWindowDidEndSheet";
|
||||
NSString *NSWindowDidExposeNotification = @"WindowDidExpose";
|
||||
NSString *NSWindowDidMiniaturizeNotification = @"WindowDidMiniaturize";
|
||||
NSString *NSWindowDidMoveNotification = @"WindowDidMove";
|
||||
|
@ -418,6 +420,7 @@ NSString *NSWindowDidResignKeyNotification = @"WindowDidResignKey";
|
|||
NSString *NSWindowDidResignMainNotification = @"WindowDidResignMain";
|
||||
NSString *NSWindowDidResizeNotification = @"WindowDidResize";
|
||||
NSString *NSWindowDidUpdateNotification = @"WindowDidUpdate";
|
||||
NSString *NSWindowWillBeginSheetNotification = @"NSWindowWillBeginSheet";
|
||||
NSString *NSWindowWillCloseNotification = @"WindowWillClose";
|
||||
NSString *NSWindowWillMiniaturizeNotification = @"WindowWillMiniaturize";
|
||||
NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
||||
|
|
Loading…
Reference in a new issue