* move DPSOperators.h to XDPS.

* move GPS headers into a new backend.
	* define GSContext.h/GSContext.m as abstract super for all drawing
		destinations (eliminates the need for DPS, GPS, DGS at the root of
		the AppKit) add appropriate defintion to various classes.
	* NSMatrix.m add abstract backend code from xraw (eliminate backend).
	* NSSlider.m add abstract backend code from xraw (eliminate backend).
	* NSSliderCell.m add abstract backend code from xraw (eliminate backend).
	* NSSplitView.m add abstract backend code from xraw (eliminate backend).
		replace private divider highlight method with NSHighlightRect()
	* NSWindow.m add class method to create backend specific window view.
	* NSTextField.m add abstract backend code from xraw (eliminate backend).
	* NSForm.m add abstract backend code from xraw (eliminate backend).
	* NSFormCell.m add abstract backend code from xraw (eliminate backend).
	* NSColorWell.m add abstract backend code from xraw (eliminate backend).
	* NSButton.m add abstract backend code from xraw (eliminate backend).
	* NSControl.m add abstract backend code from xraw (eliminate backend).
	* NSBox.m add abstract backend code from xraw (eliminate backend).
	* NSBrowser.m add abstract backend code from xraw (eliminate backend).
	* NSBrowserCell.m add abstract backend code from xraw (eliminate backend).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3321 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Felipe A. Rodriguez 1998-11-25 17:16:48 +00:00
parent fb25d335f4
commit 4dd58372f6
53 changed files with 2429 additions and 5144 deletions

View file

@ -1,3 +1,26 @@
Wed Nov 25 1998 Felipe A. Rodriguez <far@ix.netcom.com>
* move DPSOperators.h to XDPS.
* move GPS headers into a new backend.
* define GSContext.h/GSContext.m as abstract super for all drawing
destinations (eliminates the need for DPS, GPS, DGS at the root of
the AppKit) add appropriate defintion to various classes.
* NSMatrix.m add abstract backend code from xraw (eliminate backend).
* NSSlider.m add abstract backend code from xraw (eliminate backend).
* NSSliderCell.m add abstract backend code from xraw (eliminate backend).
* NSSplitView.m add abstract backend code from xraw (eliminate backend).
replace private divider highlight method with NSHighlightRect()
* NSWindow.m add class method to create backend specific window view.
* NSTextField.m add abstract backend code from xraw (eliminate backend).
* NSForm.m add abstract backend code from xraw (eliminate backend).
* NSFormCell.m add abstract backend code from xraw (eliminate backend).
* NSColorWell.m add abstract backend code from xraw (eliminate backend).
* NSButton.m add abstract backend code from xraw (eliminate backend).
* NSControl.m add abstract backend code from xraw (eliminate backend).
* NSBox.m add abstract backend code from xraw (eliminate backend).
* NSBrowser.m add abstract backend code from xraw (eliminate backend).
* NSBrowserCell.m add abstract backend code from xraw (eliminate backend).
Tue Nov 24 15:40:001998 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* NSApplication.h: updates for services

View file

@ -29,14 +29,6 @@
#ifndef _GNUstep_H_AppKit
#define _GNUstep_H_AppKit
//
// Display Postscript System
//
#ifndef NO_GNUSTEP
#include <AppKit/GPSOperators.h>
#else
#include <AppKit/DPSOperators.h>
#endif
//
// Foundation
@ -146,7 +138,6 @@
#include <AppKit/NSTextView.h>
#include <AppKit/NSView.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSWindowView.h>
#include <AppKit/NSWorkspace.h>
#endif _GNUstep_H_AppKit

View file

@ -1,35 +0,0 @@
/*
DPSOperators.h
Display Postscript operators and functions
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: September 1995
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _GNUstep_H_DPSOperators
#define _GNUstep_H_DPSOperators
#include <DPS/dpsclient.h>
#include <DPS/psops.h>
#endif /* _GNUstep_H_DPSOperators */

View file

@ -1,96 +0,0 @@
/* GPSDefinitions - definitions for GNUstep drawing
Copyright (C) 1998 Free Software Foundation, Inc.
Author: Adam Fedor <fedor@gnu.org>
Date: Nov 1998
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _GPSDefinitions_h_INCLUDE
#define _GPSDefinitions_h_INCLUDE
//
// Backing Store Types
//
typedef enum _NSBackingStoreType {
NSBackingStoreRetained,
NSBackingStoreNonretained,
NSBackingStoreBuffered
} NSBackingStoreType;
//
// Compositing operators
//
typedef enum _NSCompositingOperation {
NSCompositeClear,
NSCompositeCopy,
NSCompositeSourceOver,
NSCompositeSourceIn,
NSCompositeSourceOut,
NSCompositeSourceAtop,
NSCompositeDataOver,
NSCompositeDataIn,
NSCompositeDataOut,
NSCompositeDataAtop,
NSCompositeXOR,
NSCompositePlusDarker,
NSCompositeHighlight,
NSCompositePlusLighter
} NSCompositingOperation;
//
// Window ordering
//
typedef enum _NSWindowOrderingMode {
NSWindowAbove,
NSWindowBelow,
NSWindowOut
} NSWindowOrderingMode;
//
// NSDPSContextNotification
// Circular dependency between protocol and class
//
@class NSDPSContext;
@protocol NSDPSContextNotification
//
// Synchronizing Application and Display Postscript Server Execution
//
- (void)contextFinishedExecuting:(NSDPSContext *)context;
@end
extern NSString *DPSPostscriptErrorException;
extern NSString *DPSNameTooLongException;
extern NSString *DPSResultTagCheckException;
extern NSString *DPSResultTypeCheckException;
extern NSString *DPSInvalidContextException;
extern NSString *DPSSelectException;
extern NSString *DPSConnectionClosedException;
extern NSString *DPSReadException;
extern NSString *DPSWriteException;
extern NSString *DPSInvalidFDException;
extern NSString *DPSInvalidTEException;
extern NSString *DPSInvalidPortException;
extern NSString *DPSOutOfMemoryException;
extern NSString *DPSCantConnectException;
#endif /* _GPSDefinitions_h_INCLUDE */

View file

@ -1,101 +0,0 @@
/* GPSDrawContext - Generic drawing DrawContext class.
Copyright (C) 1998 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@gnu.org>
Date: Nov 1998
This file is part of the GNU Objective C User interface library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _GPSDrawContext_h_INCLUDE
#define _GPSDrawContext_h_INCLUDE
#include <Foundation/NSObject.h>
#include <AppKit/GPSOperators.h>
#include <AppKit/GPSDefinitions.h>
@class NSMutableData;
@class NSDictionary;
@interface GPSDrawContext : NSObject
{
NSDictionary *context_info;
NSMutableData *context_data;
}
+ (void) setDefaultContextClass: (Class)defaultContextClass;
+ defaultContextWithInfo: (NSDictionary *)info;
+ streamContextWithPath: (NSString *)path;
- initWithContextInfo: (NSDictionary *)info;
- (BOOL) isDrawingToScreen;
- (NSMutableData *) mutableData;
+ (GPSDrawContext *) currentContext;
+ (void)setCurrentContext: (GPSDrawContext *)context;
- (void) destroyContext;
@end
#include "GPSDrawContextOps.h"
extern GPSDrawContext *_currentGPSContext;
/* If NO_GNUSTEP defined, leave out GPSDrawContext definition. This
requires the xdps backend to be used. */
#ifdef NO_GNUSTEP
#define GPSDrawContext NSDPSContext
#endif
/* Current keys used for the info dictionary:
Key: Value:
DisplayName -- (NSString)name of X server
ScreenNumber -- (NSNumber)screen number
ContextData -- (NSData)context data
DebugContext -- (NSNumber)YES or NO
*/
extern NSString *DPSconfigurationerror;
extern NSString *DPSinvalidaccess;
extern NSString *DPSinvalidcontext;
extern NSString *DPSinvalidexit;
extern NSString *DPSinvalidfileaccess;
extern NSString *DPSinvalidfont;
extern NSString *DPSinvalidid;
extern NSString *DPSinvalidrestore;
extern NSString *DPSinvalidparam;
extern NSString *DPSioerror;
extern NSString *DPSlimitcheck;
extern NSString *DPSnocurrentpoint;
extern NSString *DPSnulloutput;
extern NSString *DPSrangecheck;
extern NSString *DPSstackoverflow;
extern NSString *DPSstackunderflow;
extern NSString *DPStypecheck;
extern NSString *DPSundefined;
extern NSString *DPSundefinedfilename;
extern NSString *DPSundefinedresource;
extern NSString *DPSundefinedresult;
extern NSString *DPSunmatchedmark;
extern NSString *DPSunregistered;
extern NSString *DPSVMerror;
#endif /* _GPSDrawContext_h_INCLUDE */

View file

@ -1,354 +0,0 @@
/* GPSDrawContextOps - Generic drawing DrawContext class ops.
Copyright (C) 1995 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@boulder.colorado.edu>
Date: Nov 1995
This file is part of the GNU Objective C User interface library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _GPSDrawContextOps_h_INCLUDE
#define _GPSDrawContextOps_h_INCLUDE
@interface GPSDrawContext (ColorOps)
- (void) DPScolorimage;
- (void) DPScurrentblackgeneration;
- (void) DPScurrentcmykcolor: (float *)c : (float *)m : (float *)y : (float *)k;
- (void) DPScurrentcolorscreen;
- (void) DPScurrentcolortransfer;
- (void) DPScurrentundercolorremoval;
- (void) DPSsetblackgeneration;
- (void) DPSsetcmykcolor: (float)c : (float)m : (float)y : (float)k;
- (void) DPSsetcolorscreen;
- (void) DPSsetcolortransfer;
- (void) DPSsetundercolorremoval;
@end
@interface GPSDrawContext (FontOps)
- (void) DPSFontDirectory;
- (void) DPSISOLatin1Encoding;
- (void) DPSSharedFontDirectory;
- (void) DPSStandardEncoding;
- (void) DPScachestatus: (int *)bsize : (int *)bmax : (int *)msize;
- (void) DPScurrentcacheparams;
- (void) DPScurrentfont;
- (void) DPSdefinefont;
- (void) DPSfindfont: (const char *)name;
- (void) DPSmakefont;
- (void) DPSscalefont: (float)size;
- (void) DPSselectfont: (const char *)name : (float)scale;
- (void) DPSsetcachedevice: (float)wx : (float)wy : (float)llx : (float)lly : (float)urx : (float)ury;
- (void) DPSsetcachelimit: (float)n;
- (void) DPSsetcacheparams;
- (void) DPSsetcharwidth: (float)wx : (float)wy;
- (void) DPSsetfont: (int)f;
- (void) DPSundefinefont: (const char *)name;
@end
@interface GPSDrawContext (GStateOps)
- (void) DPSconcat: (const float *)m;
- (void) DPScurrentdash;
- (void) DPScurrentflat: (float *)flatness;
- (void) DPScurrentgray: (float *)gray;
- (void) DPScurrentgstate: (int)gst;
- (void) DPScurrenthalftone;
- (void) DPScurrenthalftonephase: (float *)x : (float *)y;
- (void) DPScurrenthsbcolor: (float *)h : (float *)s : (float *)b;
- (void) DPScurrentlinecap: (int *)linecap;
- (void) DPScurrentlinejoin: (int *)linejoin;
- (void) DPScurrentlinewidth: (float *)width;
- (void) DPScurrentmatrix;
- (void) DPScurrentmiterlimit: (float *)limit;
- (void) DPScurrentpoint: (float *)x : (float *)y;
- (void) DPScurrentrgbcolor: (float *)r : (float *)g : (float *)b;
- (void) DPScurrentscreen;
- (void) DPScurrentstrokeadjust: (int *)b;
- (void) DPScurrenttransfer;
- (void) DPSdefaultmatrix;
- (void) DPSgrestore;
- (void) DPSgrestoreall;
- (void) DPSgsave;
- (void) DPSgstate;
- (void) DPSinitgraphics;
- (void) DPSinitmatrix;
- (void) DPSrotate: (float)angle;
- (void) DPSscale: (float)x : (float)y;
- (void) DPSsetdash: (const float *)pat : (int)size : (float)offset;
- (void) DPSsetflat: (float)flatness;
- (void) DPSsetgray: (float)gray;
- (void) DPSsetgstate: (int)gst;
- (void) DPSsethalftone;
- (void) DPSsethalftonephase: (float)x : (float)y;
- (void) DPSsethsbcolor: (float)h : (float)s : (float)b;
- (void) DPSsetlinecap: (int)linecap;
- (void) DPSsetlinejoin: (int)linejoin;
- (void) DPSsetlinewidth: (float)width;
- (void) DPSsetmatrix;
- (void) DPSsetmiterlimit: (float)limit;
- (void) DPSsetrgbcolor: (float)r : (float)g : (float)b;
- (void) DPSsetscreen;
- (void) DPSsetstrokeadjust: (int)b;
- (void) DPSsettransfer;
- (void) DPStranslate: (float)x : (float)y;
@end
@interface GPSDrawContext (IOOps)
- (void) DPSflush;
@end
@interface GPSDrawContext (MatrixOps)
- (void) DPSconcatmatrix;
- (void) DPSdtransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2;
- (void) DPSidentmatrix;
- (void) DPSidtransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2;
- (void) DPSinvertmatrix;
- (void) DPSitransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2;
- (void) DPStransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2;
@end
@interface GPSDrawContext (PaintOps)
- (void) DPSashow: (float)x : (float)y : (const char *)s;
- (void) DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay : (const char *)s;
- (void) DPScopypage;
- (void) DPSeofill;
- (void) DPSerasepage;
- (void) DPSfill;
- (void) DPSimage;
- (void) DPSimagemask;
- (void) DPSkshow: (const char *)s;
- (void) DPSrectfill: (float)x : (float)y : (float)w : (float)h;
- (void) DPSrectstroke: (float)x : (float)y : (float)w : (float)h;
- (void) DPSshow: (const char *)s;
- (void) DPSshowpage;
- (void) DPSstroke;
- (void) DPSstrokepath;
- (void) DPSueofill: (const char *)nums : (int)n : (const char *)ops : (int)l;
- (void) DPSufill: (const char *)nums : (int)n : (const char *)ops : (int)l;
- (void) DPSustroke: (const char *)nums : (int)n : (const char *)ops : (int)l;
- (void) DPSustrokepath: (const char *)nums : (int)n : (const char *)ops : (int)l;
- (void) DPSwidthshow: (float)x : (float)y : (int)c : (const char *)s;
- (void) DPSxshow: (const char *)s : (const float *)numarray : (int)size;
- (void) DPSxyshow: (const char *)s : (const float *)numarray : (int)size;
- (void) DPSyshow: (const char *)s : (const float *)numarray : (int)size;
@end
@interface GPSDrawContext (PathOps)
- (void) DPSarc: (float)x : (float)y : (float)r : (float)angle1 : (float)angle2;
- (void) DPSarcn: (float)x : (float)y : (float)r : (float)angle1 : (float)angle2;
- (void) DPSarct: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r;
- (void) DPSarcto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r : (float *)xt1 : (float *)yt1 : (float *)xt2 : (float *)yt2;
- (void) DPScharpath: (const char *)s : (int)b;
- (void) DPSclip;
- (void) DPSclippath;
- (void) DPSclosepath;
- (void) DPScurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)x3 : (float)y3;
- (void) DPSeoclip;
- (void) DPSeoviewclip;
- (void) DPSflattenpath;
- (void) DPSinitclip;
- (void) DPSinitviewclip;
- (void) DPSlineto: (float)x : (float)y;
- (void) DPSmoveto: (float)x : (float)y;
- (void) DPSnewpath;
- (void) DPSpathbbox: (float *)llx : (float *)lly : (float *)urx : (float *)ury;
- (void) DPSpathforall;
- (void) DPSrcurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)x3 : (float)y3;
- (void) DPSrectclip: (float)x : (float)y : (float)w : (float)h;
- (void) DPSrectviewclip: (float)x : (float)y : (float)w : (float)h;
- (void) DPSreversepath;
- (void) DPSrlineto: (float)x : (float)y;
- (void) DPSrmoveto: (float)x : (float)y;
- (void) DPSsetbbox: (float)llx : (float)lly : (float)urx : (float)ury;
- (void) DPSsetucacheparams;
- (void) DPSuappend: (const char *)nums : (int)n : (const char *)ops : (int)l;
- (void) DPSucache;
- (void) DPSucachestatus;
- (void) DPSupath: (int)b;
- (void) DPSviewclip;
- (void) DPSviewclippath;
@end
@interface GPSDrawContext (X11Ops)
- (void) DPScurrentXdrawingfunction: (int *)function;
- (void) DPScurrentXgcdrawable: (int *)gc : (int *)draw : (int *)x : (int *)y;
- (void) DPScurrentXgcdrawablecolor: (int *)gc : (int *)draw : (int *)x
: (int *)y : (int *)colorInfo;
- (void) DPScurrentXoffset: (int *)x : (int *)y;
- (void) DPSsetXdrawingfunction: (int) function;
- (void) DPSsetXgcdrawable: (int)gc : (int)draw : (int)x : (int)y;
- (void) DPSsetXgcdrawablecolor: (int)gc : (int)draw : (int)x : (int)y
: (const int *)colorInfo;
- (void) DPSsetXoffset: (short int)x : (short int)y;
- (void) DPSsetXrgbactual: (double)r : (double)g : (double)b : (int *)success;
@end
#endif /* _GPSDrawContext_h_INCLUDE */

View file

@ -1,35 +0,0 @@
/*
GPSOperators.h
GNUstep device-independant operators and functions
Copyright (C) 1998 Free Software Foundation, Inc.
Author: Adam Fedor <fedor@gnu.org>
Date: Nov 1998
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _GNUstep_H_GPSOperators
#define _GNUstep_H_GPSOperators
#include <AppKit/gpsdefs.h>
#include <AppKit/gpsops.h>
#endif /* _GNUstep_H_GPSOperators */

View file

@ -0,0 +1,125 @@
/*
GSContext.h
Abstract superclass for all types of Contexts (drawing destinations).
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Adam Fedor <fedor@gnu.org>
Date: Nov 1998
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: Nov 1998
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _GSContext_h_INCLUDE
#define _GSContext_h_INCLUDE
#include <Foundation/NSObject.h>
#include <stdarg.h>
@class NSMutableData;
@class NSDictionary;
//
// Backing Store Types
//
typedef enum _NSBackingStoreType {
NSBackingStoreRetained,
NSBackingStoreNonretained,
NSBackingStoreBuffered
} NSBackingStoreType;
//
// Compositing operators
//
typedef enum _NSCompositingOperation {
NSCompositeClear,
NSCompositeCopy,
NSCompositeSourceOver,
NSCompositeSourceIn,
NSCompositeSourceOut,
NSCompositeSourceAtop,
NSCompositeDataOver,
NSCompositeDataIn,
NSCompositeDataOut,
NSCompositeDataAtop,
NSCompositeXOR,
NSCompositePlusDarker,
NSCompositeHighlight,
NSCompositePlusLighter
} NSCompositingOperation;
//
// Window ordering
//
typedef enum _NSWindowOrderingMode {
NSWindowAbove,
NSWindowBelow,
NSWindowOut
} NSWindowOrderingMode;
@interface GSContext : NSObject
{
NSDictionary *context_info;
NSMutableData *context_data;
// Reserverd for back-end use
void *be_context_reserved;
}
//
// Setting and Identifying the concrete class
//
+ (void) setConcreteClass: (Class)c;
+ (Class) concreteClass;
//
// Setting and Identifying the Current Context
//
+ (GSContext *)currentContext;
+ (void)setCurrentContext:(GSContext *)context;
+ contextWithInfo: (NSDictionary *)info;
- initWithContextInfo: (NSDictionary *)info;
//
// Testing the Drawing Destination
//
- (BOOL)isDrawingToScreen;
//
// Accessing Context Data
//
- (NSMutableData *)mutableData;
//
// Destroy the Context
//
+ (void) destroyContext:(GSContext *) context;
- (void) destroy;
@end
#endif /* _GSContext_h_INCLUDE */

View file

@ -45,10 +45,7 @@
@class NSMenuItem;
@class NSImage;
@class NSWindow;
#ifdef NO_GNUSTEP
#define GPSDrawContext NSDPSContext
#endif
@class GPSDrawContext;
@class GSContext;
typedef struct _NSModalSession *NSModalSession;
@ -218,9 +215,9 @@ extern NSString *NSEventTrackingRunLoopMode;
returnType:(NSString *)returnType;
//
// Getting the display postscript context
// Getting the display context
//
- (GPSDrawContext *)context;
- (GSContext *)context;
//
// Reporting an exception
@ -312,7 +309,7 @@ extern NSString *NSApplicationDidUnhideNotification;
extern NSString *NSApplicationDidUpdateNotification;
extern NSString *NSApplicationWillBecomeActiveNotification;
extern NSString *NSApplicationWillFinishLaunchingNotification;
extern NSString* NSApplicationWillTerminateNotification;
extern NSString *NSApplicationWillTerminateNotification;
extern NSString *NSApplicationWillHideNotification;
extern NSString *NSApplicationWillResignActiveNotification;
extern NSString *NSApplicationWillUnhideNotification;

View file

@ -86,13 +86,18 @@ typedef enum _NSCellAttribute {
} NSCellAttribute;
enum {
NSNoCellMask = 0,
NSContentsCellMask = 1,
NSPushInCellMask = 2,
NSChangeGrayCellMask = 4,
NSNoCellMask = 0,
NSContentsCellMask = 1,
NSPushInCellMask = 2,
NSChangeGrayCellMask = 4,
NSChangeBackgroundCellMask = 8
};
enum {
xDist = 2, // horizontal distance between the text and image rects.
yDist = 2 // vertical distance between the text and image rects.
};
@interface NSCell : NSObject <NSCopying, NSCoding>
{
// Attributes

View file

@ -1,155 +0,0 @@
/*
NSDPSContext.h
Encapsulation of Display Postscript contexts
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _GNUstep_H_NSDPSContext
#define _GNUstep_H_NSDPSContext
/* Define this to avoid including redefinitions of ps functions introduced
by GPSDrawContext (and gpsdefs.h) */
#define _gpsdefs_h_INCLUDE
#include <Foundation/NSObject.h>
#include <AppKit/DPSOperators.h>
#include <AppKit/GPSDrawContext.h>
#include <stdarg.h>
@class NSData;
@class NSMutableData;
//
// NSDPSContext class interface
//
@interface NSDPSContext : GPSDrawContext
{
// Attributes
// NSMutableData *context_data; /* Defined in GPSDrawContext */
BOOL is_screen_context;
DPSErrorProc error_proc;
DPSTextProc text_proc;
NSDPSContext *chained_parent;
NSDPSContext *chained_child;
BOOL is_output_traced;
BOOL is_synchronized;
// Reserverd for back-end use
void *be_context_reserved;
}
//
// Initializing a Context
//
- initWithMutableData:(NSMutableData *)data
forDebugging:(BOOL)debug
languageEncoding:(DPSProgramEncoding)langEnc
nameEncoding:(DPSNameEncoding)nameEnc
textProc:(DPSTextProc)tProc
errorProc:(DPSErrorProc)errorProc;
//
// Testing the Drawing Destination
//
- (BOOL)isDrawingToScreen;
//
// Accessing Context Data
//
- (NSMutableData *)mutableData;
//
// Setting and Identifying the Current Context
//
+ (NSDPSContext *)currentContext;
+ (void)setCurrentContext:(NSDPSContext *)context;
- (NSDPSContext *)DPSContext;
//
// Controlling the Context
//
- (void)flush;
- (void)interruptExecution;
- (void)notifyObjectWhenFinishedExecuting:(id <NSDPSContextNotification>)obj;
- (void)resetCommunication;
- (void)wait;
//
// Managing Returned Text and Errors
//
+ (NSString *)stringForDPSError:(const DPSBinObjSeqRec *)error;
- (DPSErrorProc)errorProc;
- (void)setErrorProc:(DPSErrorProc)proc;
- (void)setTextProc:(DPSTextProc)proc;
- (DPSTextProc)textProc;
//
// Sending Raw Data
//
- (void)printFormat:(NSString *)format,...;
- (void)printFormat:(NSString *)format arguments:(va_list)argList;
- (void)writeData:(NSData *)buf;
- (void)writePostScriptWithLanguageEncodingConversion:(NSData *)buf;
//
// Managing Binary Object Sequences
//
- (void)awaitReturnValues;
- (void)writeBOSArray:(const void *)data
count:(unsigned int)items
ofType:(DPSDefinedType)type;
- (void)writeBOSNumString:(const void *)data
length:(unsigned int)count
ofType:(DPSDefinedType)type
scale:(int)scale;
- (void)writeBOSString:(const void *)data
length:(unsigned int)bytes;
- (void)writeBinaryObjectSequence:(const void *)data
length:(unsigned int)bytes;
- (void)updateNameMap;
//
// Managing Chained Contexts
//
- (void)chainChildContext:(NSDPSContext *)child;
- (NSDPSContext *)childContext;
- (NSDPSContext *)parentContext;
- (void)unchainContext;
//
// Debugging Aids
//
+ (BOOL)areAllContextsOutputTraced;
+ (BOOL)areAllContextsSynchronized;
+ (void)setAllContextsOutputTraced:(BOOL)flag;
+ (void)setAllContextsSynchronized:(BOOL)flag;
- (BOOL)isOutputTraced;
- (BOOL)isSynchronized;
- (void)setOutputTraced:(BOOL)flag;
- (void)setSynchronized:(BOOL)flag;
@end
#endif /* _GNUstep_H_NSDPSContext */

View file

@ -34,12 +34,8 @@
#include <Foundation/NSDate.h>
@class NSString;
@class NSWindow;
#ifdef NO_GNUSTEP
#define GPSDrawContext NSDPSContext
#endif
@class GPSDrawContext;
@class GSContext;
typedef enum _NSEventType {
NSLeftMouseDown,
@ -96,7 +92,7 @@ enum {
unsigned int modifier_flags;
NSTimeInterval event_time;
int window_num;
GPSDrawContext *event_context;
GSContext *event_context;
union _MB_event_data
{
struct
@ -136,7 +132,7 @@ enum {
modifierFlags:(unsigned int)flags
timestamp:(NSTimeInterval)time
windowNumber:(int)windowNum
context:(GPSDrawContext *)context
context:(GSContext *)context
eventNumber:(int)eventNum
trackingNumber:(int)trackingNum
userData:(void *)userData;
@ -146,7 +142,7 @@ enum {
modifierFlags:(unsigned int)flags
timestamp:(NSTimeInterval)time
windowNumber:(int)windowNum
context:(GPSDrawContext *)context
context:(GSContext *)context
characters:(NSString *)keys
charactersIgnoringModifiers:(NSString *)ukeys
isARepeat:(BOOL)repeatKey
@ -157,7 +153,7 @@ enum {
modifierFlags:(unsigned int)flags
timestamp:(NSTimeInterval)time
windowNumber:(int)windowNum
context:(GPSDrawContext *)context
context:(GSContext *)context
eventNumber:(int)eventNum
clickCount:(int)clickNum
pressure:(float)pressureValue;
@ -167,7 +163,7 @@ enum {
modifierFlags:(unsigned int)flags
timestamp:(NSTimeInterval)time
windowNumber:(int)windowNum
context:(GPSDrawContext *)context
context:(GSContext *)context
subtype:(short)subType
data1:(int)data1
data2:(int)data2;
@ -175,7 +171,7 @@ enum {
//
// Getting General Event Information
//
- (GPSDrawContext *)context;
- (GSContext *)context;
- (NSPoint)locationInWindow;
- (unsigned int)modifierFlags;
- (NSTimeInterval)timestamp;

View file

@ -29,7 +29,6 @@
#ifndef _GNUstep_H_NSFontPanel
#define _GNUstep_H_NSFontPanel
#include <AppKit/GPSDrawContext.h>
#include <AppKit/NSPanel.h>
@class NSFont;

View file

@ -29,7 +29,7 @@
#ifndef _GNUstep_H_NSImage
#define _GNUstep_H_NSImage
#include <AppKit/GPSDrawContext.h>
#include <AppKit/GSContext.h>
#include <Foundation/NSBundle.h>
#include <Foundation/NSCoder.h>
#include <AppKit/NSBitmapImageRep.h>

View file

@ -39,10 +39,7 @@
@class NSView;
@class NSPrintInfo;
@class NSPrintPanel;
#ifdef NO_GNUSTEP
#define GPSDrawContext NSDPSContext
#endif
@class GPSDrawContext;
@class GSContext;
typedef enum _NSPrintingPageOrder {
NSDescendingPageOrder,
@ -102,8 +99,8 @@ typedef enum _NSPrintingPageOrder {
//
// Managing the DPS Context
//
- (GPSDrawContext *)createContext;
- (GPSDrawContext *)context;
- (GSContext *)createContext;
- (GSContext *)context;
- (void)destroyContext;
//

View file

@ -90,17 +90,13 @@ typedef enum _NSScrollerArrow {
//
// Setting the NSScroller's Values
//
- (float)knobProportion;
- (void)setFloatValue:(float)aFloat
knobProportion:(float)ratio;
- (void)setFloatValue:(float)aFloat knobProportion:(float)ratio;
//
// Displaying
//
- (void)drawArrow:(NSScrollerArrow)whichButton
highlight:(BOOL)flag;
- (void)drawArrow:(NSScrollerArrow)whichButton highlight:(BOOL)flag;
- (void)drawKnobSlot;
- (void)drawKnob;
- (void)drawParts;
@ -113,7 +109,7 @@ typedef enum _NSScrollerArrow {
- (void)trackKnob:(NSEvent *)theEvent;
- (void)trackScrollButtons:(NSEvent *)theEvent;
/* Other methods */
// Other methods
- (void)setFrameSize:(NSSize)size;
- (void)setEnabled:(BOOL)flag;

View file

@ -58,7 +58,7 @@
/* Displaying the cell */
- (NSRect)knobRectFlipped:(BOOL)flipped;
- (void)drawBarInside:(NSRect)aRect flipped:(BOOL)flipped;
- (void)drawBarInside:(NSRect)rect flipped:(BOOL)flipped;
- (void)drawKnob;
- (void)drawKnob:(NSRect)knobRect;

View file

@ -33,7 +33,7 @@
#ifndef _GNUstep_H_NSView
#define _GNUstep_H_NSView
#include <AppKit/GPSDrawContext.h>
#include <AppKit/GSContext.h>
#include <AppKit/NSResponder.h>
@class NSString;

View file

@ -31,7 +31,7 @@
#ifndef _GNUstep_H_NSWindow
#define _GNUstep_H_NSWindow
#include <AppKit/GPSDrawContext.h>
#include <AppKit/GSContext.h>
#include <AppKit/NSGraphics.h>
#include <AppKit/NSResponder.h>
#include <AppKit/NSEvent.h>
@ -400,11 +400,6 @@ extern NSSize NSTokenSize;
- (void)encodeWithCoder:aCoder;
- initWithCoder:aDecoder;
//
// Private methods
//
- (void)_collectFlushRectangles;
@end
//

View file

@ -1,41 +0,0 @@
/*
NSWindowView.h
View which handles drawing the window decorations and filling
the window with the background color.
Copyright (C) 1997 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: November 1997
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _GNUstep_H_NSWindowView
#define _GNUstep_H_NSWindowView
#include <AppKit/NSView.h>
@interface NSWindowView : NSView
{
}
@end
#endif /* _GNUstep_H_NSWindowView */

View file

@ -1,213 +0,0 @@
/* gpsdefs - Rename PS functions to GS functions avoiding name clashing
Copyright (C) 1995 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@gnu.org>
Date: Nov 1998
Generated autmatically by gpsformat
*/
#ifndef _gpsdefs_h_INCLUDE
#define _gpsdefs_h_INCLUDE
/* ----------------------------------------------------------------------- */
/* Color operations */
/* ----------------------------------------------------------------------- */
#define PScolorimage GScolorimage
#define PScurrentblackgeneration GScurrentblackgeneration
#define PScurrentcmykcolor GScurrentcmykcolor
#define PScurrentcolorscreen GScurrentcolorscreen
#define PScurrentcolortransfer GScurrentcolortransfer
#define PScurrentundercolorremoval GScurrentundercolorremoval
#define PSsetblackgeneration GSsetblackgeneration
#define PSsetcmykcolor GSsetcmykcolor
#define PSsetcolorscreen GSsetcolorscreen
#define PSsetcolortransfer GSsetcolortransfer
#define PSsetundercolorremoval GSsetundercolorremoval
/* ----------------------------------------------------------------------- */
/* Font operations */
/* ----------------------------------------------------------------------- */
#define PSFontDirectory GSFontDirectory
#define PSISOLatin1Encoding GSISOLatin1Encoding
#define PSSharedFontDirectory GSSharedFontDirectory
#define PSStandardEncoding GSStandardEncoding
#define PScachestatus GScachestatus
#define PScurrentcacheparams GScurrentcacheparams
#define PScurrentfont GScurrentfont
#define PSdefinefont GSdefinefont
#define PSfindfont GSfindfont
#define PSmakefont GSmakefont
#define PSscalefont GSscalefont
#define PSselectfont GSselectfont
#define PSsetcachedevice GSsetcachedevice
#define PSsetcachelimit GSsetcachelimit
#define PSsetcacheparams GSsetcacheparams
#define PSsetcharwidth GSsetcharwidth
#define PSsetfont GSsetfont
#define PSundefinefont GSundefinefont
/* ----------------------------------------------------------------------- */
/* Gstate operations */
/* ----------------------------------------------------------------------- */
#define PSconcat GSconcat
#define PScurrentdash GScurrentdash
#define PScurrentflat GScurrentflat
#define PScurrentgray GScurrentgray
#define PScurrentgstate GScurrentgstate
#define PScurrenthalftone GScurrenthalftone
#define PScurrenthalftonephase GScurrenthalftonephase
#define PScurrenthsbcolor GScurrenthsbcolor
#define PScurrentlinecap GScurrentlinecap
#define PScurrentlinejoin GScurrentlinejoin
#define PScurrentlinewidth GScurrentlinewidth
#define PScurrentmatrix GScurrentmatrix
#define PScurrentmiterlimit GScurrentmiterlimit
#define PScurrentpoint GScurrentpoint
#define PScurrentrgbcolor GScurrentrgbcolor
#define PScurrentscreen GScurrentscreen
#define PScurrentstrokeadjust GScurrentstrokeadjust
#define PScurrenttransfer GScurrenttransfer
#define PSdefaultmatrix GSdefaultmatrix
#define PSgrestore GSgrestore
#define PSgrestoreall GSgrestoreall
#define PSgsave GSgsave
#define PSgstate GSgstate
#define PSinitgraphics GSinitgraphics
#define PSinitmatrix GSinitmatrix
#define PSrotate GSrotate
#define PSscale GSscale
#define PSsetdash GSsetdash
#define PSsetflat GSsetflat
#define PSsetgray GSsetgray
#define PSsetgstate GSsetgstate
#define PSsethalftone GSsethalftone
#define PSsethalftonephase GSsethalftonephase
#define PSsethsbcolor GSsethsbcolor
#define PSsetlinecap GSsetlinecap
#define PSsetlinejoin GSsetlinejoin
#define PSsetlinewidth GSsetlinewidth
#define PSsetmatrix GSsetmatrix
#define PSsetmiterlimit GSsetmiterlimit
#define PSsetrgbcolor GSsetrgbcolor
#define PSsetscreen GSsetscreen
#define PSsetstrokeadjust GSsetstrokeadjust
#define PSsettransfer GSsettransfer
#define PStranslate GStranslate
/* ----------------------------------------------------------------------- */
/* I/O operations */
/* ----------------------------------------------------------------------- */
#define PSequals GSequals
#define PSequalsequals GSequalsequals
#define PSbytesavailable GSbytesavailable
#define PSclosefile GSclosefile
#define PScurrentfile GScurrentfile
#define PSdeletefile GSdeletefile
#define PSecho GSecho
#define PSfile GSfile
#define PSfilenameforall GSfilenameforall
#define PSfileposition GSfileposition
#define PSflush GSflush
#define PSflushfile GSflushfile
#define PSprint GSprint
#define PSprintobject GSprintobject
#define PSpstack GSpstack
#define PSread GSread
#define PSreadhexstring GSreadhexstring
#define PSreadline GSreadline
#define PSreadstring GSreadstring
#define PSrenamefile GSrenamefile
#define PSresetfile GSresetfile
#define PSsetfileposition GSsetfileposition
#define PSstack GSstack
#define PSstatus GSstatus
#define PStoken GStoken
#define PSwrite GSwrite
#define PSwritehexstring GSwritehexstring
#define PSwriteobject GSwriteobject
#define PSwritestring GSwritestring
/* ----------------------------------------------------------------------- */
/* Matrix operations */
/* ----------------------------------------------------------------------- */
#define PSconcatmatrix GSconcatmatrix
#define PSdtransform GSdtransform
#define PSidentmatrix GSidentmatrix
#define PSidtransform GSidtransform
#define PSinvertmatrix GSinvertmatrix
#define PSitransform GSitransform
#define PStransform GStransform
/* ----------------------------------------------------------------------- */
/* Paint operations */
/* ----------------------------------------------------------------------- */
#define PSashow GSashow
#define PSawidthshow GSawidthshow
#define PScopypage GScopypage
#define PSeofill GSeofill
#define PSerasepage GSerasepage
#define PSfill GSfill
#define PSimage GSimage
#define PSimagemask GSimagemask
#define PSkshow GSkshow
#define PSrectfill GSrectfill
#define PSrectstroke GSrectstroke
#define PSshow GSshow
#define PSshowpage GSshowpage
#define PSstroke GSstroke
#define PSstrokepath GSstrokepath
#define PSueofill GSueofill
#define PSufill GSufill
#define PSustroke GSustroke
#define PSustrokepath GSustrokepath
#define PSwidthshow GSwidthshow
#define PSxshow GSxshow
#define PSxyshow GSxyshow
#define PSyshow GSyshow
/* ----------------------------------------------------------------------- */
/* Path operations */
/* ----------------------------------------------------------------------- */
#define PSarc GSarc
#define PSarcn GSarcn
#define PSarct GSarct
#define PSarcto GSarcto
#define PScharpath GScharpath
#define PSclip GSclip
#define PSclippath GSclippath
#define PSclosepath GSclosepath
#define PScurveto GScurveto
#define PSeoclip GSeoclip
#define PSeoviewclip GSeoviewclip
#define PSflattenpath GSflattenpath
#define PSinitclip GSinitclip
#define PSinitviewclip GSinitviewclip
#define PSlineto GSlineto
#define PSmoveto GSmoveto
#define PSnewpath GSnewpath
#define PSpathbbox GSpathbbox
#define PSpathforall GSpathforall
#define PSrcurveto GSrcurveto
#define PSrectclip GSrectclip
#define PSrectviewclip GSrectviewclip
#define PSreversepath GSreversepath
#define PSrlineto GSrlineto
#define PSrmoveto GSrmoveto
#define PSsetbbox GSsetbbox
#define PSsetucacheparams GSsetucacheparams
#define PSuappend GSuappend
#define PSucache GSucache
#define PSucachestatus GSucachestatus
#define PSupath GSupath
#define PSviewclip GSviewclip
#define PSviewclippath GSviewclippath
/* ----------------------------------------------------------------------- */
/* X operations */
/* ----------------------------------------------------------------------- */
#define PScurrentXdrawingfunction GScurrentXdrawingfunction
#define PScurrentXgcdrawable GScurrentXgcdrawable
#define PScurrentXgcdrawablecolor GScurrentXgcdrawablecolor
#define PScurrentXoffset GScurrentXoffset
#define PSsetXdrawingfunction GSsetXdrawingfunction
#define PSsetXgcdrawable GSsetXgcdrawable
#define PSsetXgcdrawablecolor GSsetXgcdrawablecolor
#define PSsetXoffset GSsetXoffset
#define PSsetXrgbactual GSsetXrgbactual
#endif

View file

@ -1,448 +0,0 @@
/* PostScript operators.
Copyright (C) 1995 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@boulder.colorado.edu>
Date: Nov 1995
This file is part of the GNU Objective C User Interface library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* (c) Copyright 1988-1994 Adobe Systems Incorporated.
* All rights reserved.
*
* Permission to use, copy, modify, distribute, and sublicense this software
* and its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notices appear in all copies and that
* both those copyright notices and this permission notice appear in
* supporting documentation and that the name of Adobe Systems Incorporated
* not be used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission. No trademark license
* to use the Adobe trademarks is hereby granted. If the Adobe trademark
* "Display PostScript"(tm) is used to describe this software, its
* functionality or for any other purpose, such use shall be limited to a
* statement that this software works in conjunction with the Display
* PostScript system. Proper trademark attribution to reflect Adobe's
* ownership of the trademark shall be given whenever any such reference to
* the Display PostScript system is made.
*
* ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
* ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE
* TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT
* PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE.
*
* Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
* Incorporated which may be registered in certain jurisdictions
*
* Author: Adobe Systems Incorporated
*/
#ifndef _GSOPS_H_
#define _GSOPS_H_
/* ----------------------------------------------------------------------- */
/* Color operations */
/* ----------------------------------------------------------------------- */
extern void GScolorimage( void );
//extern void GScurrentblackgeneration( void );
extern void GScurrentcmykcolor(float *c, float *m, float *y, float *k);
//extern void GScurrentcolorscreen( void );
//extern void GScurrentcolortransfer( void );
//extern void GScurrentundercolorremoval( void );
//extern void GSsetblackgeneration( void );
extern void GSsetcmykcolor(float c, float m, float y, float k);
//extern void GSsetcolorscreen( void );
//extern void GSsetcolortransfer( void );
//extern void GSsetundercolorremoval( void );
/* ----------------------------------------------------------------------- */
/* Font operations */
/* ----------------------------------------------------------------------- */
//extern void GSFontDirectory( void );
//extern void GSISOLatin1Encoding( void );
//extern void GSSharedFontDirectory( void );
//extern void GSStandardEncoding( void );
//extern void GScachestatus(int *bsize, int *bmax, int *msize);
//extern void GScurrentcacheparams( void );
//extern void GScurrentfont( void );
//extern void GSdefinefont( void );
extern void GSfindfont(const char *name);
extern void GSmakefont( void );
extern void GSscalefont(float size);
extern void GSselectfont(const char *name, float scale);
//extern void GSsetcachedevice(float wx, float wy, float llx, float lly, float urx, float ury);
//extern void GSsetcachelimit(float n);
//extern void GSsetcacheparams( void );
//extern void GSsetcharwidth(float wx, float wy);
extern void GSsetfont(int f);
extern void GSundefinefont(const char *name);
/* ----------------------------------------------------------------------- */
/* Gstate operations */
/* ----------------------------------------------------------------------- */
extern void GSconcat(const float m[]);
//extern void GScurrentdash( void );
extern void GScurrentflat(float *flatness);
extern void GScurrentgray(float *gray);
extern void GScurrentgstate(int gst);
//extern void GScurrenthalftone( void );
extern void GScurrenthalftonephase(float *x, float *y);
extern void GScurrenthsbcolor(float *h, float *s, float *b);
extern void GScurrentlinecap(int *linecap);
extern void GScurrentlinejoin(int *linejoin);
extern void GScurrentlinewidth(float *width);
//extern void GScurrentmatrix( void );
extern void GScurrentmiterlimit(float *limit);
extern void GScurrentpoint(float *x, float *y);
extern void GScurrentrgbcolor(float *r, float *g, float *b);
//extern void GScurrentscreen( void );
extern void GScurrentstrokeadjust(int *b);
//extern void GScurrenttransfer( void );
extern void GSdefaultmatrix( void );
extern void GSgrestore( void );
extern void GSgrestoreall( void );
extern void GSgsave( void );
//extern void GSgstate( void );
extern void GSinitgraphics( void );
extern void GSinitmatrix( void );
extern void GSrotate(float angle);
extern void GSscale(float x, float y);
extern void GSsetdash(const float pat[], int size, float offset);
extern void GSsetflat(float flatness);
extern void GSsetgray(float gray);
extern void GSsetgstate(int gst);
extern void GSsethalftone( void );
extern void GSsethalftonephase(float x, float y);
extern void GSsethsbcolor(float h, float s, float b);
extern void GSsetlinecap(int linecap);
extern void GSsetlinejoin(int linejoin);
extern void GSsetlinewidth(float width);
extern void GSsetmatrix( void );
extern void GSsetmiterlimit(float limit);
extern void GSsetrgbcolor(float r, float g, float b);
extern void GSsetscreen( void );
extern void GSsetstrokeadjust(int b);
extern void GSsettransfer( void );
extern void GStranslate(float x, float y);
/* ----------------------------------------------------------------------- */
/* I/O operations */
/* ----------------------------------------------------------------------- */
//extern void GSequals( void );
//extern void GSequalsequals( void );
//extern void GSbytesavailable(int *n);
//extern void GSclosefile( void );
//extern void GScurrentfile( void );
//extern void GSdeletefile(const char *filename);
//extern void GSecho(int b);
//extern void GSfile(const char *name, const char *access);
//extern void GSfilenameforall( void );
//extern void GSfileposition(int *pos);
extern void GSflush( void );
//extern void GSflushfile( void );
//extern void GSprint( void );
//extern void GSprintobject(int tag);
//extern void GSpstack( void );
//extern void GSread(int *b);
//extern void GSreadhexstring(int *b);
//extern void GSreadline(int *b);
//extern void GSreadstring(int *b);
//extern void GSrenamefile(const char *old, const char *new);
//extern void GSresetfile( void );
//extern void GSsetfileposition(int pos);
//extern void GSstack( void );
//extern void GSstatus(int *b);
//extern void GStoken(int *b);
//extern void GSwrite( void );
//extern void GSwritehexstring( void );
//extern void GSwriteobject(int tag);
//extern void GSwritestring( void );
/* ----------------------------------------------------------------------- */
/* Matrix operations */
/* ----------------------------------------------------------------------- */
extern void GSconcatmatrix( void );
extern void GSdtransform(float x1, float y1, float *x2, float *y2);
extern void GSidentmatrix( void );
extern void GSidtransform(float x1, float y1, float *x2, float *y2);
extern void GSinvertmatrix( void );
extern void GSitransform(float x1, float y1, float *x2, float *y2);
extern void GStransform(float x1, float y1, float *x2, float *y2);
/* ----------------------------------------------------------------------- */
/* Paint operations */
/* ----------------------------------------------------------------------- */
extern void GSashow(float x, float y, const char *s);
extern void GSawidthshow(float cx, float cy, int c, float ax, float ay, const char *s);
//extern void GScopypage( void );
extern void GSeofill( void );
extern void GSerasepage( void );
extern void GSfill( void );
//extern void GSimage( void );
//extern void GSimagemask( void );
extern void GSkshow(const char *s);
extern void GSrectfill(float x, float y, float w, float h);
extern void GSrectstroke(float x, float y, float w, float h);
extern void GSshow(const char *s);
extern void GSshowpage( void );
extern void GSstroke( void );
extern void GSstrokepath( void );
extern void GSueofill(const char nums[], int n, const char ops[], int l);
extern void GSufill(const char nums[], int n, const char ops[], int l);
extern void GSustroke(const char nums[], int n, const char ops[], int l);
extern void GSustrokepath(const char nums[], int n, const char ops[], int l);
extern void GSwidthshow(float x, float y, int c, const char *s);
extern void GSxshow(const char *s, const float numarray[], int size);
extern void GSxyshow(const char *s, const float numarray[], int size);
extern void GSyshow(const char *s, const float numarray[], int size);
/* ----------------------------------------------------------------------- */
/* Path operations */
/* ----------------------------------------------------------------------- */
extern void GSarc(float x, float y, float r, float angle1, float angle2);
extern void GSarcn(float x, float y, float r, float angle1, float angle2);
extern void GSarct(float x1, float y1, float x2, float y2, float r);
extern void GSarcto(float x1, float y1, float x2, float y2, float r, float *xt1, float *yt1, float *xt2, float *yt2);
extern void GScharpath(const char *s, int b);
extern void GSclip( void );
extern void GSclippath( void );
extern void GSclosepath( void );
extern void GScurveto(float x1, float y1, float x2, float y2, float x3, float y3);
extern void GSeoclip( void );
extern void GSeoviewclip( void );
extern void GSflattenpath( void );
extern void GSinitclip( void );
extern void GSinitviewclip( void );
extern void GSlineto(float x, float y);
extern void GSmoveto(float x, float y);
extern void GSnewpath( void );
extern void GSpathbbox(float *llx, float *lly, float *urx, float *ury);
extern void GSpathforall( void );
extern void GSrcurveto(float x1, float y1, float x2, float y2, float x3, float y3);
extern void GSrectclip(float x, float y, float w, float h);
extern void GSrectviewclip(float x, float y, float w, float h);
extern void GSreversepath( void );
extern void GSrlineto(float x, float y);
extern void GSrmoveto(float x, float y);
extern void GSsetbbox(float llx, float lly, float urx, float ury);
extern void GSsetucacheparams( void );
extern void GSuappend(const char nums[], int n, const char ops[], int l);
extern void GSucache( void );
extern void GSucachestatus( void );
extern void GSupath(int b);
extern void GSviewclip( void );
extern void GSviewclippath( void );
/* ----------------------------------------------------------------------- */
/* X operations */
/* ----------------------------------------------------------------------- */
extern void GScurrentXdrawingfunction(int *function);
extern void GScurrentXgcdrawable(int *gc, int *draw, int *x, int *y);
extern void GScurrentXgcdrawablecolor(int *gc, int *draw, int *x, int *y,
int colorInfo[]);
extern void GScurrentXoffset(int *x, int *y);
extern void GSsetXdrawingfunction(int function);
extern void GSsetXgcdrawable(int gc, int draw, int x, int y);
extern void GSsetXgcdrawablecolor(int gc, int draw, int x, int y,
const int colorInfo[]);
extern void GSsetXoffset(short int x, short int y);
extern void GSsetXrgbactual(double r, double g, double b, int *success);
#endif /* _GSOPS_H_ */

View file

@ -790,8 +790,7 @@ void __dummy_GMAppKit_functionForLinking() {}
[self orderFront:nil];
#if GNU_GUI_LIBRARY
//[[[self contentView] superview] _unconditionallyResetNeedsDisplayInAllViews];
[[self contentView] setNeedsDisplay:YES];
[[self contentView] setNeedsDisplay:YES];
#endif
return self;
@ -878,8 +877,7 @@ void __dummy_GMAppKit_functionForLinking() {}
[unarchiver decodeBOOLWithName:@"setWorksWhenModal"]];
#if GNU_GUI_LIBRARY
//[[[self contentView] superview] _unconditionallyResetNeedsDisplayInAllViews];
[[self contentView] setNeedsDisplay:YES];
[[self contentView] setNeedsDisplay:YES];
#endif
return self;
}
@ -990,8 +988,7 @@ void __dummy_GMAppKit_functionForLinking() {}
[unarchiver decodeStringWithName:@"directory"]];
#if GNU_GUI_LIBRARY
//[[[self contentView] superview] _unconditionallyResetNeedsDisplayInAllViews];
[[self contentView] setNeedsDisplay:YES];
[[self contentView] setNeedsDisplay:YES];
#endif
return self;
}

View file

@ -43,7 +43,7 @@ NSProcessInfo* processInfo;
}
#endif
[[NSDPSContext currentContext] wait];
[[GSContext currentContext] wait];
[[NSApplication sharedApplication] run];
printf ("exiting...\n");

View file

@ -37,7 +37,7 @@ LIBRARY_NAME=libgnustep-gui
# The Objective-C source files to be compiled
libgnustep-gui_OBJC_FILES = libgnustep-gui.m \
GPSDrawContext.m \
GSContext.m \
NSActionCell.m \
NSApplication.m \
NSAttributedString.m \
@ -105,11 +105,9 @@ NSTextFieldCell.m \
NSTextView.m \
NSView.m \
NSWindow.m \
NSWindowView.m \
NSWorkspace.m \
TrackingRectangle.m \
PSMatrix.m \
gpsops.m \
tiff.m \
externs.m
@ -122,10 +120,7 @@ libgnustep-gui_HEADER_FILES_INSTALL_DIR = /gnustep/gui
libgnustep-gui_HEADER_FILES = \
AppKit/AppKit.h \
AppKit/GPSDrawContext.h \
AppKit/GPSDrawContextOps.h \
AppKit/GPSDefinitions.h \
AppKit/GPSOperators.h \
AppKit/GSContext.h \
AppKit/NSActionCell.h \
AppKit/NSApplication.h \
AppKit/NSAttributedString.h \
@ -203,15 +198,10 @@ AppKit/NSTextStorage.h \
AppKit/NSTextView.h \
AppKit/NSView.h \
AppKit/NSWindow.h \
AppKit/NSWindowView.h \
AppKit/NSWorkspace.h \
AppKit/TrackingRectangle.h \
AppKit/PSMatrix.h \
AppKit/NSDPSContext.h \
AppKit/DPSOperators.h \
AppKit/nsimage-tiff.h \
AppKit/gpsdefs.h \
AppKit/gpsops.h
-include GNUmakefile.preamble

View file

@ -1,965 +0,0 @@
/* GPSDrawContext - GNUstep drawing context class.
Copyright (C) 1998 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@gnu.org>
Date: Nov 1998
This file is part of the GNU Objective C User : (int *)erface library.
This library is free software { } you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation { } either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY { } without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library { } if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <Foundation/NSString.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSException.h>
#include <Foundation/NSData.h>
#include "AppKit/GPSDrawContext.h"
/* The memory zone where all global objects are allocated from (Contexts
are also allocated from this zone) */
NSZone *_globalGPSZone = NULL;
/* It's odd that we should have to control the list of contexts. Maybe
we should have a class ContextServer for this role */
static NSMutableArray *ctxtList;
/* The current context */
GPSDrawContext *_currentGPSContext = nil;
static Class defaultGPSContextClass = NULL;
@implementation GPSDrawContext
+ (void) initialize
{
if (self == [GPSDrawContext class])
{
ctxtList = [[NSMutableArray arrayWithCapacity:2] retain];
//_globalGPSZone = NSCreateZone(4096, 4096, YES);
}
}
+ (void) setDefaultContextClass: (Class)defaultContextClass
{
defaultGPSContextClass = defaultContextClass;
}
+ defaultContextWithInfo: (NSDictionary *)info;
{
GPSDrawContext *ctxt;
NSAssert(defaultGPSContextClass,
@"Internal Error: No default GPSContext set\n");
ctxt = [[defaultGPSContextClass allocWithZone: _globalGPSZone]
initWithContextInfo: info];
[ctxt autorelease];
return ctxt;
}
+ streamContextWithPath: (NSString *)path;
{
return [self notImplemented: _cmd];
}
+ (void) setCurrentContext: (GPSDrawContext *)context
{
_currentGPSContext = context;
}
+ (GPSDrawContext *) currentContext
{
return _currentGPSContext;
}
- init
{
return [self initWithContextInfo: NULL];
}
/* designated initializer for the GPSDrawContext class */
- initWithContextInfo: (NSDictionary *)info
{
[super init];
[ctxtList addObject: self];
[GPSDrawContext setCurrentContext: self];
context_info = [info retain];
return self;
}
- (BOOL)isDrawingToScreen
{
return NO;
}
- (NSMutableData *)mutableData
{
return context_data;
}
/* Just remove ourselves from the context list so we will be dealloced on
the next autorelease pool end */
- (void) destroyContext;
{
[ctxtList removeObject: self];
}
- (void) dealloc
{
DESTROY(context_data);
[super dealloc];
}
@end
@implementation GPSDrawContext (ColorOps)
- (void)DPScolorimage { }
- (void)DPScurrentblackgeneration { }
- (void)DPScurrentcmykcolor: (float *)c : (float *)m : (float *)y : (float *)k { }
- (void)DPScurrentcolorscreen { }
- (void)DPScurrentcolortransfer { }
- (void)DPScurrentundercolorremoval { }
- (void)DPSsetblackgeneration { }
- (void)DPSsetcmykcolor: (float)c : (float)m : (float)y : (float)k { }
- (void)DPSsetcolorscreen { }
- (void)DPSsetcolortransfer { }
- (void)DPSsetundercolorremoval { }
@end
@implementation GPSDrawContext (ControlOps)
- (void)DPSeq { }
- (void)DPSexit { }
- (void)DPSfalse { }
- (void)DPSfor { }
- (void)DPSforall { }
- (void)DPSge { }
- (void)DPSgt { }
- (void)DPSif { }
- (void)DPSifelse { }
- (void)DPSle { }
- (void)DPSloop { }
- (void)DPSlt { }
- (void)DPSne { }
- (void)DPSnot { }
- (void)DPSor { }
- (void)DPSrepeat { }
- (void)DPSstop { }
- (void)DPSstopped { }
- (void)DPStrue { }
@end
@implementation GPSDrawContext (CtxOps)
- (void)DPScondition { }
- (void)DPScurrentcontext: (int *)cid { }
- (void)DPScurrentobjectformat: (int *)code { }
- (void)DPSdefineusername: (int)i : (const char *)username { }
- (void)DPSdefineuserobject { }
- (void)DPSdetach { }
- (void)DPSexecuserobject: (int)index { }
- (void)DPSfork { }
- (void)DPSjoin { }
- (void)DPSlock { }
- (void)DPSmonitor { }
- (void)DPSnotify { }
- (void)DPSsetobjectformat: (int)code { }
- (void)DPSsetvmthreshold: (int)i { }
- (void)DPSundefineuserobject: (int)index { }
- (void)DPSuserobject { }
- (void)DPSwait { }
- (void)DPSyield { }
@end
@implementation GPSDrawContext (DataOps)
- (void)DPSaload { }
- (void)DPSanchorsearch: (int *)truth { }
- (void)DPSarray: (int)len { }
- (void)DPSastore { }
- (void)DPSbegin { }
- (void)DPSclear { }
- (void)DPScleartomark { }
- (void)DPScopy: (int)n { }
- (void)DPScount: (int *)n { }
- (void)DPScounttomark: (int *)n { }
- (void)DPScvi { }
- (void)DPScvlit { }
- (void)DPScvn { }
- (void)DPScvr { }
- (void)DPScvrs { }
- (void)DPScvs { }
- (void)DPScvx { }
- (void)DPSdef { }
- (void)DPSdict: (int)len { }
- (void)DPSdictstack { }
- (void)DPSdup { }
- (void)DPSend { }
- (void)DPSexch { }
- (void)DPSexecstack { }
- (void)DPSexecuteonly { }
- (void)DPSget { }
- (void)DPSgetinterval { }
- (void)DPSindex: (int)i { }
- (void)DPSknown: (int *)b { }
- (void)DPSlength: (int *)len { }
- (void)DPSload { }
- (void)DPSmark { }
- (void)DPSmatrix { }
- (void)DPSmaxlength: (int *)len { }
- (void)DPSnoaccess { }
- (void)DPSnull { }
- (void)DPSpackedarray { }
- (void)DPSpop { }
- (void)DPSput { }
- (void)DPSputinterval { }
- (void)DPSrcheck: (int *)b { }
- (void)DPSreadonly { }
- (void)DPSroll: (int)n : (int)j { }
- (void)DPSscheck: (int *)b { }
- (void)DPSsearch: (int *)b { }
- (void)DPSshareddict { }
- (void)DPSstatusdict { }
- (void)DPSstore { }
- (void)DPSstring: (int)len { }
- (void)DPSstringwidth: (const char *)s : (float *)xp : (float *)yp { }
- (void)DPSsystemdict { }
- (void)DPSuserdict { }
- (void)DPSwcheck: (int *)b { }
- (void)DPSwhere: (int *)b { }
- (void)DPSxcheck: (int *)b { }
@end
@implementation GPSDrawContext (FontOps)
- (void)DPSFontDirectory { }
- (void)DPSISOLatin1Encoding { }
- (void)DPSSharedFontDirectory { }
- (void)DPSStandardEncoding { }
- (void)DPScachestatus: (int *)bsize : (int *)bmax : (int *)msize { }
- (void)DPScurrentcacheparams { }
- (void)DPScurrentfont { }
- (void)DPSdefinefont { }
- (void)DPSfindfont: (const char *)name { }
- (void)DPSmakefont { }
- (void)DPSscalefont: (float)size { }
- (void)DPSselectfont: (const char *)name : (float)scale { }
- (void)DPSsetcachedevice: (float)wx : (float)wy : (float)llx : (float)lly : (float)urx : (float)ury { }
- (void)DPSsetcachelimit: (float)n { }
- (void)DPSsetcacheparams { }
- (void)DPSsetcharwidth: (float)wx : (float)wy { }
- (void)DPSsetfont: (int)f { }
- (void)DPSundefinefont: (const char *)name { }
@end
@implementation GPSDrawContext (GStateOps)
- (void)DPSconcat: (const float *)m { }
- (void)DPScurrentdash { }
- (void)DPScurrentflat: (float *)flatness { }
- (void)DPScurrentgray: (float *)gray { }
- (void)DPScurrentgstate: (int)gst { }
- (void)DPScurrenthalftone { }
- (void)DPScurrenthalftonephase: (float *)x : (float *)y { }
- (void)DPScurrenthsbcolor: (float *)h : (float *)s : (float *)b { }
- (void)DPScurrentlinecap: (int *)linecap { }
- (void)DPScurrentlinejoin: (int *)linejoin { }
- (void)DPScurrentlinewidth: (float *)width { }
- (void)DPScurrentmatrix { }
- (void)DPScurrentmiterlimit: (float *)limit { }
- (void)DPScurrentpoint: (float *)x : (float *)y { }
- (void)DPScurrentrgbcolor: (float *)r : (float *)g : (float *)b { }
- (void)DPScurrentscreen { }
- (void)DPScurrentstrokeadjust: (int *)b { }
- (void)DPScurrenttransfer { }
- (void)DPSdefaultmatrix { }
- (void)DPSgrestore { }
- (void)DPSgrestoreall { }
- (void)DPSgsave { }
- (void)DPSgstate { }
- (void)DPSinitgraphics { }
- (void)DPSinitmatrix { }
- (void)DPSrotate: (float)angle { }
- (void)DPSscale: (float)x : (float)y { }
- (void)DPSsetdash: (const float *)pat : (int)size : (float)offset { }
- (void)DPSsetflat: (float)flatness { }
- (void)DPSsetgray: (float)gray { }
- (void)DPSsetgstate: (int)gst { }
- (void)DPSsethalftone { }
- (void)DPSsethalftonephase: (float)x : (float)y { }
- (void)DPSsethsbcolor: (float)h : (float)s : (float)b { }
- (void)DPSsetlinecap: (int)linecap { }
- (void)DPSsetlinejoin: (int)linejoin { }
- (void)DPSsetlinewidth: (float)width { }
- (void)DPSsetmatrix { }
- (void)DPSsetmiterlimit: (float)limit { }
- (void)DPSsetrgbcolor: (float)r : (float)g : (float)b { }
- (void)DPSsetscreen { }
- (void)DPSsetstrokeadjust: (int)b { }
- (void)DPSsettransfer { }
- (void)DPStranslate: (float)x : (float)y { }
@end
@implementation GPSDrawContext (IOOps)
- (void)DPSequals { }
- (void)DPSequalsequals { }
- (void)DPSbytesavailable: (int *)n { }
- (void)DPSclosefile { }
- (void)DPScurrentfile { }
- (void)DPSdeletefile: (const char *)filename { }
- (void)DPSecho: (int)b { }
- (void)DPSfile: (const char *)name : (const char *)access { }
- (void)DPSfilenameforall { }
- (void)DPSfileposition: (int *)pos { }
- (void)DPSflush { }
- (void)DPSflushfile { }
- (void)DPSprint { }
- (void)DPSprintobject: (int)tag { }
- (void)DPSpstack { }
- (void)DPSread: (int *)b { }
- (void)DPSreadhexstring: (int *)b { }
- (void)DPSreadline: (int *)b { }
- (void)DPSreadstring: (int *)b { }
- (void)DPSrenamefile: (const char *)old : (const char *)new { }
- (void)DPSresetfile { }
- (void)DPSsetfileposition: (int)pos { }
- (void)DPSstack { }
- (void)DPSstatus: (int *)b { }
- (void)DPStoken: (int *)b { }
- (void)DPSwrite { }
- (void)DPSwritehexstring { }
- (void)DPSwriteobject: (int)tag { }
- (void)DPSwritestring { }
@end
@implementation GPSDrawContext (MathOps)
- (void)DPSabs { }
- (void)DPSadd { }
- (void)DPSand { }
- (void)DPSatan { }
- (void)DPSbitshift: (int)shift { }
- (void)DPSceiling { }
- (void)DPScos { }
- (void)DPSdiv { }
- (void)DPSexp { }
- (void)DPSfloor { }
- (void)DPSidiv { }
- (void)DPSln { }
- (void)DPSlog { }
- (void)DPSmod { }
- (void)DPSmul { }
- (void)DPSneg { }
- (void)DPSround { }
- (void)DPSsin { }
- (void)DPSsqrt { }
- (void)DPSsub { }
- (void)DPStruncate { }
- (void)DPSxor { }
@end
@implementation GPSDrawContext (MatrixOps)
- (void)DPSconcatmatrix { }
- (void)DPSdtransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2 { }
- (void)DPSidentmatrix { }
- (void)DPSidtransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2 { }
- (void)DPSinvertmatrix { }
- (void)DPSitransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2 { }
- (void)DPStransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2 { }
@end
@implementation GPSDrawContext (MiscOps)
- (void)DPSbanddevice { }
- (void)DPSframedevice { }
- (void)DPSnulldevice { }
- (void)DPSrenderbands { }
@end
@implementation GPSDrawContext (Opstack)
- (void)DPSgetboolean: (int *)it { }
- (void)DPSgetchararray: (int)size : (char *)s { }
- (void)DPSgetfloat: (float *)it { }
- (void)DPSgetfloatarray: (int)size : (float *)a { }
- (void)DPSgetint: (int *)it { }
- (void)DPSgetintarray: (int)size : (int *)a { }
- (void)DPSgetstring: (char *)s { }
- (void)DPSsendboolean: (int)it { }
- (void)DPSsendchararray: (const char *)s : (int)size { }
- (void)DPSsendfloat: (float)it { }
- (void)DPSsendfloatarray: (const float *)a : (int)size { }
- (void)DPSsendint: (int)it { }
- (void)DPSsendintarray: (const int *)a : (int)size { }
- (void)DPSsendstring: (const char *)s { }
@end
@implementation GPSDrawContext (PaintOps)
- (void)DPSashow: (float)x : (float)y : (const char *)s { }
- (void)DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay : (const char *)s { }
- (void)DPScopypage { }
- (void)DPSeofill { }
- (void)DPSerasepage { }
- (void)DPSfill { }
- (void)DPSimage { }
- (void)DPSimagemask { }
- (void)DPSkshow: (const char *)s { }
- (void)DPSrectfill: (float)x : (float)y : (float)w : (float)h { }
- (void)DPSrectstroke: (float)x : (float)y : (float)w : (float)h { }
- (void)DPSshow: (const char *)s { }
- (void)DPSshowpage { }
- (void)DPSstroke { }
- (void)DPSstrokepath { }
- (void)DPSueofill: (const char *)nums : (int)n : (const char *)ops : (int)l { }
- (void)DPSufill: (const char *)nums : (int)n : (const char *)ops : (int)l { }
- (void)DPSustroke: (const char *)nums : (int)n : (const char *)ops : (int)l { }
- (void)DPSustrokepath: (const char *)nums : (int)n : (const char *)ops : (int)l { }
- (void)DPSwidthshow: (float)x : (float)y : (int)c : (const char *)s { }
- (void)DPSxshow: (const char *)s : (const float *)numarray : (int)size { }
- (void)DPSxyshow: (const char *)s : (const float *)numarray : (int)size { }
- (void)DPSyshow: (const char *)s : (const float *)numarray : (int)size { }
@end
@implementation GPSDrawContext (PathOps)
- (void)DPSarc: (float)x : (float)y : (float)r : (float)angle1 : (float)angle2 { }
- (void)DPSarcn: (float)x : (float)y : (float)r : (float)angle1 : (float)angle2 { }
- (void)DPSarct: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r { }
- (void)DPSarcto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r : (float *)xt1 : (float *)yt1 : (float *)xt2 : (float *)yt2 { }
- (void)DPScharpath: (const char *)s : (int)b { }
- (void)DPSclip { }
- (void)DPSclippath { }
- (void)DPSclosepath { }
- (void)DPScurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)x3 : (float)y3 { }
- (void)DPSeoclip { }
- (void)DPSeoviewclip { }
- (void)DPSflattenpath { }
- (void)DPSinitclip { }
- (void)DPSinitviewclip { }
- (void)DPSlineto: (float)x : (float)y { }
- (void)DPSmoveto: (float)x : (float)y { }
- (void)DPSnewpath { }
- (void)DPSpathbbox: (float *)llx : (float *)lly : (float *)urx : (float *)ury { }
- (void)DPSpathforall { }
- (void)DPSrcurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)x3 : (float)y3 { }
- (void)DPSrectclip: (float)x : (float)y : (float)w : (float)h { }
- (void)DPSrectviewclip: (float)x : (float)y : (float)w : (float)h { }
- (void)DPSreversepath { }
- (void)DPSrlineto: (float)x : (float)y { }
- (void)DPSrmoveto: (float)x : (float)y { }
- (void)DPSsetbbox: (float)llx : (float)lly : (float)urx : (float)ury { }
- (void)DPSsetucacheparams { }
- (void)DPSuappend: (const char *)nums : (int)n : (const char *)ops : (int)l { }
- (void)DPSucache { }
- (void)DPSucachestatus { }
- (void)DPSupath: (int)b { }
- (void)DPSviewclip { }
- (void)DPSviewclippath { }
@end
@implementation GPSDrawContext (SysOps)
- (void)DPSbind { }
- (void)DPScountdictstack: (int *)n { }
- (void)DPScountexecstack: (int *)n { }
- (void)DPScurrentdict { }
- (void)DPScurrentpacking: (int *)b { }
- (void)DPScurrentshared: (int *)b { }
- (void)DPSdeviceinfo { }
- (void)DPSerrordict { }
- (void)DPSexec { }
- (void)DPSprompt { }
- (void)DPSquit { }
- (void)DPSrand { }
- (void)DPSrealtime: (int *)i { }
- (void)DPSrestore { }
- (void)DPSrrand { }
- (void)DPSrun: (const char *)filename { }
- (void)DPSsave { }
- (void)DPSsetpacking: (int)b { }
- (void)DPSsetshared: (int)b { }
- (void)DPSsrand { }
- (void)DPSstart { }
- (void)DPStype { }
- (void)DPSundef: (const char *)name { }
- (void)DPSusertime: (int *)milliseconds { }
- (void)DPSversion: (int)bufsize : (char *)buf { }
- (void)DPSvmreclaim: (int)code { }
- (void)DPSvmstatus: (int *)level : (int *)used : (int *)maximum { }
@end
@implementation GPSDrawContext (WinOps)
- (void)DPSineofill: (float)x : (float)y : (int *)b { }
- (void)DPSinfill: (float)x : (float)y : (int *)b { }
- (void)DPSinstroke: (float)x : (float)y : (int *)b { }
- (void)DPSinueofill: (float)x : (float)y : (const char *)nums : (int)n : (const char *)ops : (int)l : (int *)b { }
- (void)DPSinufill: (float)x : (float)y : (const char *)nums : (int)n : (const char *)ops : (int)l : (int *)b { }
- (void)DPSinustroke: (float)x : (float)y : (const char *)nums : (int)n : (const char *)ops : (int)l : (int *)b { }
- (void)DPSwtranslation: (float *)x : (float *)y { }
@end
@implementation GPSDrawContext (L2Ops)
- (void)DPSleftbracket { }
- (void)DPSrightbracket { }
- (void)DPSleftleft { }
- (void)DPSrightright { }
- (void)DPScshow: (const char *)s { }
- (void)DPScurrentcolor { }
- (void)DPScurrentcolorrendering { }
- (void)DPScurrentcolorspace { }
- (void)DPScurrentdevparams: (const char *)dev { }
- (void)DPScurrentglobal: (int *)b { }
- (void)DPScurrentoverprint: (int *)b { }
- (void)DPScurrentpagedevice { }
- (void)DPScurrentsystemparams { }
- (void)DPScurrentuserparams { }
- (void)DPSdefineresource: (const char *)category { }
- (void)DPSexecform { }
- (void)DPSfilter { }
- (void)DPSfindencoding: (const char *)key { }
- (void)DPSfindresource: (const char *)key : (const char *)category { }
- (void)DPSgcheck: (int *)b { }
- (void)DPSglobaldict { }
- (void)DPSGlobalFontDirectory { }
- (void)DPSglyphshow: (const char *)name { }
- (void)DPSlanguagelevel: (int *)n { }
- (void)DPSmakepattern { }
- (void)DPSproduct { }
- (void)DPSresourceforall: (const char *)category { }
- (void)DPSresourcestatus: (const char *)key : (const char *)category : (int *)b { }
- (void)DPSrevision: (int *)n { }
- (void)DPSrootfont { }
- (void)DPSserialnumber: (int *)n { }
- (void)DPSsetcolor { }
- (void)DPSsetcolorrendering { }
- (void)DPSsetcolorspace { }
- (void)DPSsetdevparams { }
- (void)DPSsetglobal: (int)b { }
- (void)DPSsetoverprint: (int)b { }
- (void)DPSsetpagedevice { }
- (void)DPSsetpattern: (int)patternDict { }
- (void)DPSsetsystemparams { }
- (void)DPSsetuserparams { }
- (void)DPSstartjob: (int)b : (const char *)password { }
- (void)DPSundefineresource: (const char *)key : (const char *)category { }
@end
@implementation GPSDrawContext (X11Ops)
- (void) DPScurrentXdrawingfunction: (int *)function { }
- (void) DPScurrentXgcdrawable: (int *)gc : (int *)draw : (int *)x : (int *)y { }
- (void) DPScurrentXgcdrawablecolor: (int *)gc : (int *)draw : (int *)x
: (int *)y : (int *)colorInfo { }
- (void) DPScurrentXoffset: (int *)x : (int *)y { }
- (void) DPSsetXdrawingfunction: (int) function { }
- (void) DPSsetXgcdrawable: (int)gc : (int)draw : (int)x : (int)y { }
- (void) DPSsetXgcdrawablecolor: (int)gc : (int)draw : (int)x : (int)y
: (const int *)colorInfo { }
- (void) DPSsetXoffset: (short int)x : (short int)y { }
- (void) DPSsetXrgbactual: (double)r : (double)g : (double)b : (int *)success { }
@end

144
Source/GSContext.m Normal file
View file

@ -0,0 +1,144 @@
/*
GSContext.m
Abstract superclass for all types of Contexts (drawing destinations).
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Adam Fedor <fedor@gnu.org>
Date: Nov 1998
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: Nov 1998
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <gnustep/gui/config.h>
#include <Foundation/NSString.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSException.h>
#include <Foundation/NSData.h>
#include "AppKit/GSContext.h"
NSZone *_globalGSZone = NULL; // The memory zone where all
// global objects are allocated
// from (Contexts are also
// allocated from this zone)
//
// Class variables
//
static Class contextConcreteClass; // actual class of GSContext's
static NSMutableArray *contextList; // list of drawing destinations
static GSContext *_currentGSContext = nil; // the current context
@implementation GSContext
//
// Class methods
//
+ (void)initialize
{
if (self == (contextConcreteClass = [GSContext class]))
{
contextList = [[NSMutableArray arrayWithCapacity:2] retain];
NSDebugLog(@"Initialize GSContext class\n");
[self setVersion:1]; // Initial version
}
}
+ (void) setConcreteClass: (Class)c { contextConcreteClass = c; }
+ (Class) concreteClass { return contextConcreteClass; }
+ allocWithZone: (NSZone*)z
{
return NSAllocateObject(contextConcreteClass, 0, z);
}
+ contextWithInfo: (NSDictionary *)info;
{
GSContext *context;
NSAssert(contextConcreteClass, @"Error: No default GSContext is set\n");
context = [[contextConcreteClass allocWithZone: _globalGSZone]
initWithContextInfo: info];
[context autorelease];
return context;
}
+ (GSContext *) currentContext { return _currentGSContext; }
+ (void) setCurrentContext: (GSContext *)context
{
_currentGSContext = context;
}
+ (void) destroyContext:(GSContext *) context // remove context from the
{ // list so that it gets
[contextList removeObject: context]; // deallocated with the
} // next autorelease pool
//
// Instance methods
//
- init
{
return [self initWithContextInfo: nil];
}
- initWithContextInfo: (NSDictionary *)info
{ // designated initializer
[super init]; // for GSContext class
[contextList addObject: self];
[GSContext setCurrentContext: self];
if(info)
context_info = [info retain];
return self;
}
- (BOOL)isDrawingToScreen
{
return NO;
}
- (NSMutableData *)mutableData
{
return context_data;
}
- (void) destroy // remove self from context
{ // list so that self gets
[GSContext destroyContext: self]; // deallocated with the
} // next autorelease pool
- (void) dealloc
{
DESTROY(context_data);
[super dealloc];
}
@end

File diff suppressed because it is too large Load diff

View file

@ -240,6 +240,41 @@
//
- (void)drawRect:(NSRect)rect
{
// Fill inside
[[window backgroundColor] set];
NSRectFill(bounds);
// Draw border
switch(border_type)
{
case NSNoBorder:
break;
case NSLineBorder:
NSFrameRect(border_rect);
break;
case NSBezelBorder:
NSDrawGrayBezel(border_rect, bounds);
break;
case NSGrooveBorder:
NSDrawGroove(border_rect, bounds);
break;
}
// Draw title
switch(title_position)
{
case NSNoTitle:
// Nothing to do
break;
case NSAboveTop:
case NSAtTop:
case NSBelowTop:
case NSAboveBottom:
case NSAtBottom:
case NSBelowBottom:
[cell setBackgroundColor: [window backgroundColor]];
[cell drawWithFrame: title_rect inView: self];
}
}
//

View file

@ -7,6 +7,8 @@
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: August 1998
This file is part of the GNUstep GUI Library.
@ -993,7 +995,9 @@
[_horizontalScroller setEnabled: YES];
}
return;
[self display]; // should probably be a setNeedsDisplay FIX ME?
return;
}
//
@ -1083,6 +1087,8 @@
// Send the action to target
[self sendAction];
[self display]; // should probably be a setNeedsDisplay FIX ME?
}
- (void)doDoubleClick:(id)sender
@ -1357,40 +1363,35 @@
- (void)_adjustMatrixOfColumn:(int)column
{
NSBrowserColumn *bc;
NSScrollView *sc;
id matrix;
NSSize cs, ms;
NSRect mr;
NSBrowserColumn *bc;
NSScrollView *sc;
id matrix;
NSSize cs, ms;
NSRect mr;
if (column >= (int)[_browserColumns count])
return;
if (column >= (int)[_browserColumns count])
return;
bc = [_browserColumns objectAtIndex: column];
sc = [bc columnScrollView];
matrix = [bc columnMatrix];
// Adjust matrix to fit in scrollview
if (sc && matrix && [bc isLoaded]) // do it only if column has been loaded
{
cs = [sc contentSize];
ms = [matrix cellSize];
ms.width = cs.width;
[matrix setCellSize: ms];
mr = [matrix frame];
if (mr.size.height < cs.height) // matrix smaller than
{ // scrollview's content
mr.origin.y = cs.height; // view requires origin
[matrix setFrame: mr]; // adjustment for it to
} // appear at top
bc = [_browserColumns objectAtIndex: column];
sc = [bc columnScrollView];
matrix = [bc columnMatrix];
// Adjust matrixes to fit in the scrollview
// Only set if column has been loaded
if (sc && matrix && [bc isLoaded])
{
cs = [sc contentSize];
[matrix sizeToCells];
ms = [matrix cellSize];
ms.width = cs.width;
[matrix setCellSize: ms];
mr = [matrix frame];
#if 0
// Adjust because NSMatrix has incorrect origin
if (mr.size.height < cs.height)
{
mr.origin.y = cs.height - mr.size.height;
[matrix setFrame: mr];
}
#endif
[sc setDocumentView: matrix];
}
[sc setDocumentView: matrix];
}
}
- (void)_adjustScrollerFrameOfColumn:(int)column force:(BOOL)flag
@ -1555,4 +1556,12 @@
}
}
- (void)setFrame:(NSRect)frameRect
{
NSLog (@"NSBrowser setFrame ");
[super setFrame:frameRect];
[self tile]; // recalc browser's elements
[self _adjustScrollerFrames:YES]; // adjust browser's matrix
}
@end

View file

@ -7,6 +7,8 @@
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: October 1998
This file is part of the GNUstep GUI Library.
@ -27,9 +29,12 @@
*/
#include <gnustep/gui/config.h>
#include <AppKit/NSBrowserCell.h>
#include <AppKit/NSTextFieldCell.h>
#include <AppKit/NSImage.h>
#include <AppKit/NSEvent.h>
// Class variables
static NSImage *branch_image;
@ -44,20 +49,9 @@ static NSImage *highlight_image;
@implementation NSBrowserCell (Private)
- (void)setBranchImageCell:aCell
{
_branchImage = aCell;
}
- (void)setHighlightBranchImageCell:aCell
{
_highlightBranchImage = aCell;
}
- (void)setTextFieldCell:aCell
{
_browserText = aCell;
}
- (void)setBranchImageCell:aCell { _branchImage = aCell; }
- (void)setHighlightBranchImageCell:aCell { _highlightBranchImage = aCell; }
- (void)setTextFieldCell:aCell { _browserText = aCell; }
@end
@ -71,192 +65,247 @@ static NSImage *highlight_image;
//
+ (void)initialize
{
if (self == [NSBrowserCell class])
{
// Initial version
[self setVersion:1];
// The default images
branch_image = [NSImage imageNamed: @"common_ArrowRight"];
highlight_image = [NSImage imageNamed: @"common_ArrowRightH"];
}
if (self == [NSBrowserCell class])
{
[self setVersion:1];
// The default images
branch_image = [NSImage imageNamed: @"common_ArrowRight"];
highlight_image = [NSImage imageNamed: @"common_ArrowRightH"];
}
}
//
// Accessing Graphic Attributes
//
+ (NSImage *)branchImage
{
return branch_image;
}
+ (NSImage *)highlightedBranchImage
{
return highlight_image;
}
+ (NSImage *)branchImage { return branch_image; }
+ (NSImage *)highlightedBranchImage { return highlight_image; }
//
// Instance methods
//
- init
{
return [self initTextCell: @"aTitle"];
- init
{
return [self initTextCell: @"aTitle"];
}
- initTextCell:(NSString *)aString
{
[super initTextCell: aString];
[super initTextCell: aString];
// create image cells
_branchImage = [[NSCell alloc] initImageCell: [NSBrowserCell branchImage]];
_highlightBranchImage = [[NSCell alloc] initImageCell:
[NSBrowserCell highlightedBranchImage]];
// create the text cell
_browserText = [[NSTextFieldCell alloc] initTextCell: aString];
[_browserText setEditable: NO];
[_browserText setBordered: NO];
[_browserText setDrawsBackground: YES];
_alternateImage = nil;
_isLeaf = NO;
_isLoaded = NO;
// Our image cells
_branchImage = [[NSCell alloc] initImageCell: [NSBrowserCell branchImage]];
_highlightBranchImage = [[NSCell alloc] initImageCell:
[NSBrowserCell highlightedBranchImage]];
[self setEditable: YES];
// Our text cell
_browserText = [[NSTextFieldCell alloc] initTextCell: aString];
[_browserText setEditable: NO];
[_browserText setBordered: NO];
[_browserText setDrawsBackground: YES];
_alternateImage = nil;
_isLeaf = NO;
_isLoaded = NO;
return self;
return self;
}
- (void)dealloc
{
[_branchImage release];
[_highlightBranchImage release];
[_alternateImage release];
[_browserText release];
[super dealloc];
[_branchImage release];
[_highlightBranchImage release];
[_alternateImage release];
[_browserText release];
[super dealloc];
}
- (id)copyWithZone:(NSZone*)zone
{
NSBrowserCell* c = [super copyWithZone:zone];
// Copy the image cells
[c setBranchImageCell: [_branchImage copy]];
[c setHighlightBranchImageCell: [_branchImage copy]];
[c setAlternateImage: _alternateImage];
// Copy the text cell
[c setTextFieldCell: [_browserText copy]];
[c setLeaf: _isLeaf];
[c setLoaded: NO];
return c;
NSBrowserCell* c = [super copyWithZone:zone];
// Copy the image cells
[c setBranchImageCell: [_branchImage copy]];
[c setHighlightBranchImageCell: [_branchImage copy]];
[c setAlternateImage: _alternateImage];
[c setTextFieldCell: [_browserText copy]]; // Copy the text cell
[c setLeaf: _isLeaf];
[c setLoaded: NO];
return c;
}
//
// Accessing Graphic Attributes
//
- (NSImage *)alternateImage
{
return _alternateImage;
}
- (NSImage *)alternateImage { return _alternateImage; }
- (void)setAlternateImage:(NSImage *)anImage
{
[anImage retain];
[_alternateImage release];
_alternateImage = anImage;
// Set the image in our highlight cell
if (_alternateImage)
[_highlightBranchImage setImage: _alternateImage];
else
[_highlightBranchImage setImage: [NSBrowserCell highlightedBranchImage]];
[anImage retain];
[_alternateImage release];
_alternateImage = anImage;
// Set the image in our
if (_alternateImage) // highlight cell
[_highlightBranchImage setImage: _alternateImage];
else
[_highlightBranchImage setImage:[NSBrowserCell highlightedBranchImage]];
}
//
// Placing in the Browser Hierarchy
//
- (BOOL)isLeaf
{
return _isLeaf;
}
- (void)setLeaf:(BOOL)flag
{
_isLeaf = flag;
}
- (BOOL)isLeaf { return _isLeaf; }
- (void)setLeaf:(BOOL)flag { _isLeaf = flag; }
//
// Determining Loaded Status
//
- (BOOL)isLoaded
{
return _isLoaded;
}
- (void)setLoaded:(BOOL)flag
{
_isLoaded = flag;
}
- (BOOL)isLoaded { return _isLoaded; }
- (void)setLoaded:(BOOL)flag { _isLoaded = flag; }
//
// Setting State
//
- (void)reset
{
cell_highlighted = NO;
cell_state = NO;
cell_highlighted = NO;
cell_state = NO;
}
- (void)set
{
cell_highlighted = YES;
cell_state = YES;
cell_highlighted = YES;
cell_state = YES;
}
//
// Setting the NSCell's Value
// Setting and accessing the NSCell's Value
//
- (double)doubleValue
{
return [_browserText doubleValue];
}
- (double)doubleValue { return [_browserText doubleValue]; }
- (float)floatValue; { return [_browserText floatValue]; }
- (int)intValue { return [_browserText intValue]; }
- (NSString *)stringValue { return [_browserText stringValue]; }
- (void)setIntValue:(int)anInt { [_browserText setIntValue: anInt]; }
- (float)floatValue;
{
return [_browserText floatValue];
}
- (int)intValue
{
return [_browserText intValue];
}
- (NSString *)stringValue
{
return [_browserText stringValue];
}
- (void)setDoubleValue:(double)aDouble
{
[_browserText setDoubleValue: aDouble];
- (void)setDoubleValue:(double)aDouble
{
[_browserText setDoubleValue:aDouble];
}
- (void)setFloatValue:(float)aFloat
{
[_browserText setFloatValue: aFloat];
[_browserText setFloatValue: aFloat];
}
- (void)setIntValue:(int)anInt
{
[_browserText setIntValue: anInt];
- (void)setStringValue:(NSString *)aString
{
[_browserText setStringValue: aString];
}
- (void)setStringValue:(NSString *)aString
//
// Displaying
//
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
[_browserText setStringValue: aString];
NSRect title_rect = cellFrame;
NSRect image_rect = cellFrame;
NSImage *image = nil;
control_view = controlView; // remember last view
// cell was drawn in
if (cell_highlighted || cell_state) // temporary hack FAR FIX ME?
{
NSColor *white = [NSColor whiteColor];
[white set];
[_browserText setBackgroundColor: white];
if (!_isLeaf)
{
image = [_highlightBranchImage image];
image_rect.size.height = cellFrame.size.height;
image_rect.size.width = image_rect.size.height;
// Right justify
image_rect.origin.x += cellFrame.size.width- image_rect.size.width;
}
else
image_rect = NSZeroRect;
}
else
{
NSColor *backColor = [[controlView window] backgroundColor];
[backColor set];
[_browserText setBackgroundColor:backColor];
if (!_isLeaf)
{
image = [_branchImage image];
image_rect.size.height = cellFrame.size.height;
image_rect.size.width = image_rect.size.height;
// Right justify
image_rect.origin.x += cellFrame.size.width- image_rect.size.width;
}
else
image_rect = NSZeroRect;
}
NSRectFill(cellFrame); // Clear the background
title_rect.size.width -= image_rect.size.width + 4; // draw the title cell
[_browserText drawWithFrame:title_rect inView: controlView];
if (image) // Draw the image
[self _displayImage:image inFrame:image_rect];
}
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{ // no border so just
// draw the interior
[self drawInteriorWithFrame: cellFrame inView: controlView];
}
- (void)highlight:(BOOL)lit withFrame:(NSRect)cellFrame // may not be per
inView:(NSView *)controlView // spec FIX ME?
{
[super highlight: lit withFrame: cellFrame inView: controlView];
[self drawInteriorWithFrame: cellFrame inView: controlView];
}
//
// Editing Text
//
- (void)editWithFrame:(NSRect)aRect
inView:(NSView *)controlView
editor:(NSText *)textObject
delegate:(id)anObject
event:(NSEvent *)theEvent
{
NSPoint location = [controlView convertPoint:[theEvent locationInWindow]
fromView:nil];
fprintf(stderr, " NSBrowserCell: editWithFrame --- ");
[_browserText _setCursorLocation:location];
[_browserText _setCursorVisibility: YES];
if ([[controlView window] makeFirstResponder:controlView])
fprintf(stderr, " XRBrowserCell: we are now first responder --- ");
[self drawInteriorWithFrame: aRect inView: controlView];
}
- (void)endEditing:(NSText *)textObject
{
[_browserText _setCursorVisibility: NO];
}
- (void)_handleKeyEvent:(NSEvent*)keyEvent
{
fprintf(stderr, " NSBrowserCell: _handleKeyEvent --- ");
[_browserText _handleKeyEvent:keyEvent];
// [self drawInteriorWithFrame: aRect inView: controlView];
}
//
@ -264,26 +313,26 @@ static NSImage *highlight_image;
//
- (void)encodeWithCoder:aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeObject: _browserText];
[aCoder encodeObject: _branchImage];
[aCoder encodeObject: _highlightBranchImage];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isLeaf];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isLoaded];
[super encodeWithCoder:aCoder];
[aCoder encodeObject: _browserText];
[aCoder encodeObject: _branchImage];
[aCoder encodeObject: _highlightBranchImage];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isLeaf];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isLoaded];
}
- initWithCoder:aDecoder
{
[super initWithCoder:aDecoder];
_browserText = [aDecoder decodeObject];
_branchImage = [aDecoder decodeObject];
_highlightBranchImage = [aDecoder decodeObject];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isLeaf];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isLoaded];
return self;
[super initWithCoder:aDecoder];
_browserText = [aDecoder decodeObject];
_branchImage = [aDecoder decodeObject];
_highlightBranchImage = [aDecoder decodeObject];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isLeaf];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isLoaded];
return self;
}
@end

View file

@ -28,6 +28,7 @@
*/
#include <gnustep/gui/config.h>
#include <AppKit/NSButton.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSButtonCell.h>
@ -48,14 +49,11 @@ id gnustep_gui_nsbutton_class = nil;
//
+ (void)initialize
{
if (self == [NSButton class])
{
// Initial version
[self setVersion:1];
// Set our cell class to NSButtonCell
[self setCellClass:[NSButtonCell class]];
}
if (self == [NSButton class])
{
[self setVersion:1];
[self setCellClass:[NSButtonCell class]];
}
}
//
@ -284,81 +282,6 @@ id gnustep_gui_nsbutton_class = nil;
//
// Handling Events and Action Messages
//
- (void)mouseDown:(NSEvent *)theEvent
{
NSApplication *theApp = [NSApplication sharedApplication];
BOOL mouseUp, done;
NSEvent *e;
unsigned int event_mask = NSLeftMouseDownMask | NSLeftMouseUpMask |
NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDraggedMask;
int oldActionMask;
NSDebugLog(@"NSButton mouseDown\n");
// If we are not enabled then ignore the mouse
if (![self isEnabled])
return;
// Have NSCell send action only if we are continuous
if ([cell isContinuous])
oldActionMask = [cell sendActionOn:0];
else
oldActionMask = [cell sendActionOn: NSPeriodicMask];
// capture mouse
[[self window] captureMouse: self];
[self lockFocus];
done = NO;
e = theEvent;
while (!done)
{
[cell highlight: YES withFrame: bounds inView: self]; // highlight cell
[self setNeedsDisplayInRect:bounds];
mouseUp = [cell trackMouse: e inRect: bounds
ofView:self untilMouseUp:YES];
e = [theApp currentEvent];
// If mouse went up then we are done
if ((mouseUp) || ([e type] == NSLeftMouseUp))
done = YES;
else
{
NSDebugLog(@"NSButton process another event\n");
e = [theApp nextEventMatchingMask:event_mask untilDate:nil
inMode:NSEventTrackingRunLoopMode dequeue:YES];
}
}
// Release mouse
[[self window] releaseMouse: self];
// If the mouse went up in the button
if (mouseUp)
{
// Unhighlight the button
[cell highlight: NO withFrame: bounds
inView: self];
[cell setState:![self state]];
#if 1
[self setNeedsDisplayInRect:bounds];
#else
[cell drawWithFrame:bounds inView:self];
[[self window] flushWindow];
#endif
}
[self unlockFocus];
/* Restore the old action mask */
[cell sendActionOn:oldActionMask];
// Have the target perform the action
if (mouseUp)
[self sendAction:[self action] to:[self target]];
}
- (void)performClick:(id)sender
{
[cell performClick:sender];

View file

@ -6,7 +6,7 @@
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Ovidiu Predescu <ovidiu@net-community.com>
Ovidiu Predescu <ovidiu@net-community.com>
Date: 1996
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: August 1998
@ -42,9 +42,8 @@
#include <AppKit/NSFont.h>
#include <AppKit/NSImage.h>
//
// NSButtonCell implementation
//
@implementation NSButtonCell
//
@ -52,8 +51,8 @@
//
+ (void)initialize
{
if (self == [NSButtonCell class])
[self setVersion:1]; // Initial version
if (self == [NSButtonCell class])
[self setVersion:1]; // Initial version
}
//
@ -61,202 +60,149 @@
//
- _init
{
cell_enabled = YES;
transparent = NO;
cell_bordered = YES;
showAltStateMask = NSNoCellMask; // configure as a NSMomentaryPushButton
highlightsByMask = NSPushInCellMask | NSChangeGrayCellMask;
delayInterval = 0.4;
repeatInterval = 0.075;
altContents = nil;
cell_enabled = YES;
transparent = NO;
cell_bordered = YES;
showAltStateMask = NSNoCellMask; // configure as a NSMomentaryPushButton
highlightsByMask = NSPushInCellMask | NSChangeGrayCellMask;
delayInterval = 0.4;
repeatInterval = 0.075;
altContents = nil;
return self;
return self;
}
- init
{
[self initTextCell:@"Button"];
[self initTextCell:@"Button"];
return self;
return self;
}
- initImageCell:(NSImage *)anImage
{
[super initImageCell:anImage];
[super initImageCell:anImage];
contents = nil;
contents = nil;
return [self _init];
return [self _init];
}
- initTextCell:(NSString *)aString
{
[super initTextCell:aString];
[super initTextCell:aString];
return [self _init];
return [self _init];
}
- (void)dealloc
{
[altContents release];
[altImage release];
[keyEquivalent release];
[keyEquivalentFont release];
[super dealloc];
[altContents release];
[altImage release];
[keyEquivalent release];
[keyEquivalentFont release];
[super dealloc];
}
//
// Setting the Titles
//
- (NSString *)alternateTitle
- (NSString *)title { return [self stringValue]; }
- (NSString *)alternateTitle { return altContents; }
- (void)setFont:(NSFont *)fontObject { [super setFont:fontObject]; }
- (void)setTitle:(NSString *)aString
{
return altContents;
[self setStringValue:aString];
[self setState:[self state]]; // update our state
}
- (void)setAlternateTitle:(NSString *)aString
{
NSString* _string = [aString copy];
ASSIGN(altContents, _string);
[self setState:[self state]]; // update our state
}
- (void)setFont:(NSFont *)fontObject
{
[super setFont:fontObject];
}
- (void)setTitle:(NSString *)aString
{
[self setStringValue:aString];
[self setState:[self state]]; // update our state
}
- (NSString *)title
{
return [self stringValue];
ASSIGN(altContents, _string);
[self setState:[self state]]; // update our state
}
//
// Setting the Images
//
- (NSImage *)alternateImage
{
return altImage;
}
- (NSCellImagePosition)imagePosition
{
return image_position;
}
- (void)setAlternateImage:(NSImage *)anImage
{
ASSIGN(altImage, anImage);
}
- (NSImage *)alternateImage { return altImage; }
- (NSCellImagePosition)imagePosition { return image_position; }
- (void)setAlternateImage:(NSImage *)anImage { ASSIGN(altImage, anImage); }
- (void)setImagePosition:(NSCellImagePosition)aPosition
{
image_position = aPosition;
image_position = aPosition;
}
//
// Setting the Repeat Interval
//
- (void)getPeriodicDelay:(float *)delay
interval:(float *)interval
- (void)getPeriodicDelay:(float *)delay interval:(float *)interval
{
*delay = delayInterval;
*interval = repeatInterval;
*delay = delayInterval;
*interval = repeatInterval;
}
- (void)setPeriodicDelay:(float)delay
interval:(float)interval
- (void)setPeriodicDelay:(float)delay interval:(float)interval
{
delayInterval = delay;
repeatInterval = interval;
[self setContinuous:YES];
delayInterval = delay;
repeatInterval = interval;
[self setContinuous:YES];
}
//
// Setting the Key Equivalent
//
- (NSString *)keyEquivalent
{
return keyEquivalent;
}
- (NSString *)keyEquivalent { return keyEquivalent; }
- (NSFont *)keyEquivalentFont { return keyEquivalentFont; }
- (NSFont *)keyEquivalentFont
{
return keyEquivalentFont;
}
- (unsigned int)keyEquivalentModifierMask
{
return keyEquivalentModifierMask;
- (unsigned int)keyEquivalentModifierMask
{
return keyEquivalentModifierMask;
}
- (void)setKeyEquivalent:(NSString *)key
{
NSString* _string = [key copy];
ASSIGN(keyEquivalent, _string);
ASSIGN(keyEquivalent, [key copy]);
}
- (void)setKeyEquivalentModifierMask:(unsigned int)mask
{
keyEquivalentModifierMask = mask;
keyEquivalentModifierMask = mask;
}
- (void)setKeyEquivalentFont:(NSFont *)fontObj
{
ASSIGN(keyEquivalentFont, fontObj);
ASSIGN(keyEquivalentFont, fontObj);
}
- (void)setKeyEquivalentFont:(NSString *)fontName
size:(float)fontSize
- (void)setKeyEquivalentFont:(NSString *)fontName size:(float)fontSize
{
NSFont* font = [NSFont fontWithName:fontName size:fontSize];
ASSIGN(keyEquivalentFont, font);
ASSIGN(keyEquivalentFont, [NSFont fontWithName:fontName size:fontSize]);
}
//
// Modifying Graphic Attributes
//
- (BOOL)isTransparent
{
return transparent;
}
- (BOOL)isTransparent { return transparent; }
- (void)setTransparent:(BOOL)flag { transparent = flag; }
- (void)setTransparent:(BOOL)flag
{
transparent = flag;
}
- (BOOL)isOpaque
{
return !transparent && [self isBordered];
- (BOOL)isOpaque
{
return !transparent && [self isBordered];
}
//
// Modifying Graphic Attributes
//
- (int)highlightsBy
{
return highlightsByMask;
}
- (int)highlightsBy { return highlightsByMask; }
- (void)setHighlightsBy:(int)mask { highlightsByMask = mask; }
- (void)setShowsStateBy:(int)mask { showAltStateMask = mask; }
- (void)setHighlightsBy:(int)mask
{
highlightsByMask = mask;
}
- (void)setShowsStateBy:(int)mask
{
showAltStateMask = mask;
}
- (void)setButtonType:(NSButtonType)buttonType
{
@ -309,37 +255,20 @@ NSFont* font = [NSFont fontWithName:fontName size:fontSize];
[self setState:[self state]];
}
- (int)showsStateBy
{
return showAltStateMask;
}
- (void)setIntValue:(int)anInt
{
[self setState:(anInt != 0)];
}
- (void)setFloatValue:(float)aFloat
{
[self setState:(aFloat != 0)];
}
- (void)setDoubleValue:(double)aDouble
{
[self setState:(aDouble != 0)];
}
- (int)intValue { return [self state]; }
- (float)floatValue { return [self state]; }
- (double)doubleValue { return [self state]; }
- (int)showsStateBy { return showAltStateMask; }
- (void)setIntValue:(int)anInt { [self setState:(anInt != 0)]; }
- (void)setFloatValue:(float)aFloat { [self setState:(aFloat != 0)]; }
- (void)setDoubleValue:(double)aDouble { [self setState:(aDouble != 0)]; }
- (int)intValue { return [self state]; }
- (float)floatValue { return [self state]; }
- (double)doubleValue { return [self state]; }
//
// Displaying
//
- (void)drawWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
control_view = controlView; // Save last view cell was drawn to
control_view = controlView; // Save last view cell was drawn to
}
//

View file

@ -406,127 +406,96 @@ NSString* _string;
//
// Validating Input
//
- (int)entryType
{
return entry_type;
}
- (BOOL)isEntryAcceptable:(NSString *)aString
{
return YES;
}
- (void)setEntryType:(int)aType
{
entry_type = aType;
}
- (int)entryType { return entry_type; }
- (BOOL)isEntryAcceptable:(NSString *)aString { return YES; }
- (void)setEntryType:(int)aType { entry_type = aType; }
//
// Formatting Data
//
- (void)setFloatingPointFormat:(BOOL)autoRange
left:(unsigned int)leftDigits
right:(unsigned int)rightDigits
left:(unsigned int)leftDigits
right:(unsigned int)rightDigits
{
cell_float_autorange = autoRange;
cell_float_left = leftDigits;
cell_float_right = rightDigits;
cell_float_autorange = autoRange;
cell_float_left = leftDigits;
cell_float_right = rightDigits;
}
//
// Modifying Graphic Attributes
//
- (BOOL)isBezeled
{
return cell_bezeled;
}
- (BOOL)isBordered
{
return cell_bordered;
}
- (BOOL)isOpaque
{
return cell_bezeled;
}
- (void)setBezeled:(BOOL)flag
{
cell_bezeled = flag;
}
- (void)setBordered:(BOOL)flag
{
cell_bordered = flag;
}
- (BOOL)isBezeled { return cell_bezeled; }
- (BOOL)isBordered { return cell_bordered; }
- (BOOL)isOpaque { return cell_bezeled; }
- (void)setBezeled:(BOOL)flag { cell_bezeled = flag; }
- (void)setBordered:(BOOL)flag { cell_bordered = flag; }
//
// Setting Parameters
//
- (int)cellAttribute:(NSCellAttribute)aParameter
{
return 0;
return 0;
}
- (void)setCellAttribute:(NSCellAttribute)aParameter
to:(int)value
{}
- (void)setCellAttribute:(NSCellAttribute)aParameter to:(int)value
{
}
//
// Displaying
//
- (NSView *)controlView
- (NSView *)controlView { return control_view; }
- (void)setControlView:(NSView*)view { control_view = view; }
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView
{
return control_view;
switch ([self type])
{
case NSTextCellType:
{
float titleGray = [self isEnabled] ? NSBlack : NSDarkGray;
[self _displayTitle:[self stringValue]
inFrame:cellFrame
titleGray:titleGray];
break;
}
case NSImageCellType:
[self _displayImage:[self image] inFrame:cellFrame];
break;
case NSNullCellType:
break;
}
}
- (void)setControlView:(NSView*)view
{
control_view = view;
}
- (void)drawInteriorWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{ // implemented in back end
}
- (void)drawWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView
{ // implemented in back end
}
- (BOOL)isHighlighted { return cell_highlighted; }
- (void)highlight:(BOOL)lit
withFrame:(NSRect)cellFrame
inView:(NSView *)controlView
{ // implemented in back end
- (void)highlight:(BOOL)lit withFrame:(NSRect)cellFrame // Not per OS spec
inView:(NSView *)controlView // FIX ME
{
cell_highlighted = lit;
[self drawWithFrame:cellFrame inView:controlView]; // draw cell
}
- (BOOL)isHighlighted
{
return cell_highlighted;
}
//
// Target and Action
//
- (SEL)action
{
return NULL;
}
- (BOOL)isContinuous
{
return cell_continuous;
}
- (SEL)action { return NULL; }
- (BOOL)isContinuous { return cell_continuous; }
- (int)sendActionOn:(int)mask
{
unsigned int previousMask = action_mask;
unsigned int previousMask = action_mask;
action_mask = mask;
action_mask = mask;
return previousMask;
return previousMask;
}
- (void)setAction:(SEL)aSelector
@ -573,32 +542,30 @@ NSString* _string;
// Tracking the Mouse
//
- (BOOL)continueTracking:(NSPoint)lastPoint
at:(NSPoint)currentPoint
inView:(NSView *)controlView
at:(NSPoint)currentPoint
inView:(NSView *)controlView
{
return YES;
}
- (int)mouseDownFlags
{
return 0;
return 0;
}
- (void)getPeriodicDelay:(float *)delay
interval:(float *)interval
- (void)getPeriodicDelay:(float *)delay interval:(float *)interval
{
*delay = 0.05;
*interval = 0.05;
*delay = 0.05;
*interval = 0.05;
}
- (BOOL)startTrackingAt:(NSPoint)startPoint
inView:(NSView *)controlView
{
// If the point is in the view then yes start tracking
if ([controlView mouse: startPoint inRect: [controlView bounds]])
return YES;
- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView
{ // If the point is in the view
// then yes start tracking
if ([controlView mouse: startPoint inRect: [controlView bounds]])
return YES;
else
return NO;
return NO;
}
- (void)stopTracking:(NSPoint)lastPoint
@ -609,21 +576,21 @@ NSString* _string;
}
- (BOOL)trackMouse:(NSEvent *)theEvent
inRect:(NSRect)cellFrame
ofView:(NSView *)controlView
untilMouseUp:(BOOL)flag
inRect:(NSRect)cellFrame
ofView:(NSView *)controlView
untilMouseUp:(BOOL)flag
{
NSApplication *theApp = [NSApplication sharedApplication];
unsigned int event_mask = NSLeftMouseDownMask | NSLeftMouseUpMask |
NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDraggedMask;
NSPoint location = [theEvent locationInWindow];
NSPoint point = [controlView convertPoint: location fromView: nil];
float delay, interval;
id target = [self target];
SEL action = [self action];
NSPoint last_point;
BOOL done;
BOOL mouseWentUp;
NSApplication *theApp = [NSApplication sharedApplication];
unsigned int event_mask = NSLeftMouseDownMask | NSLeftMouseUpMask |
NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDraggedMask;
NSPoint location = [theEvent locationInWindow];
NSPoint point = [controlView convertPoint: location fromView: nil];
float delay, interval;
id target = [self target];
SEL action = [self action];
NSPoint last_point;
BOOL done;
BOOL mouseWentUp;
NSDebugLog(@"NSCell start tracking\n");
NSDebugLog(@"NSCell tracking in rect %f %f %f %f\n",

View file

@ -436,7 +436,8 @@ static NSColorList *systemColors = nil;
+ (NSColor*) selectedTextColor
{
return [systemColors colorWithKey: @"selectedTextColor"];
// return [systemColors colorWithKey: @"selectedTextColor"]; // FIX ME
return [self colorWithCalibratedRed:.12 green:.12 blue:0 alpha:1.0];
}
+ (NSColor*) selectedKnobColor

View file

@ -7,6 +7,8 @@
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: May 1998
This file is part of the GNUstep GUI Library.
@ -30,6 +32,10 @@
#include <AppKit/NSColorWell.h>
#include <AppKit/NSColor.h>
#define XRBW 1.0 // half the width of the bevel
#define XRHW 5.0 // width of border/handle
@implementation NSColorWell
//
@ -37,11 +43,8 @@
//
+ (void)initialize
{
if (self == [NSColorWell class])
{
// Initial version
[self setVersion:1];
}
if (self == [NSColorWell class])
[self setVersion:1]; // Initial version
}
//
@ -69,20 +72,22 @@
//
- (void)drawRect:(NSRect)rect
{
NSDebugLog(@"NSColorWell drawRect: %f %f %f %f\n", rect.origin.x,
rect.origin.y,
rect.size.width, rect.size.height);
NSRect inside = rect;
if (is_bordered) // if well has a
[self drawBorderRect: rect]; // border draw it
// Draw border
if (is_bordered)
[self drawBorderRect: rect];
// Draw the color inside
[self drawWellInside: rect];
inside.origin.x += XRBW + XRHW + XRBW + XRBW; // calc interior
inside.origin.y += XRBW + XRHW + XRBW; // rect
inside.size.width -= (4*XRBW + XRHW + XRHW) + XRBW;
inside.size.height -= (4*XRBW + XRHW + XRHW) + XRBW;
[self drawWellInside: inside]; // draw interior
}
- (void)drawWellInside:(NSRect)insideRect
{
[the_color set];
NSRectFill(insideRect); // fill interior
}
//
@ -166,6 +171,19 @@
- (void)drawBorderRect:(NSRect)aRect
{
NSRect inside;
[[NSColor lightGrayColor] set];
NSRectFill(bounds); // fill the area with
// gray first
NSDrawButton(aRect, aRect); // draw outer border
inside = aRect; // calc inner border
inside.origin.x += XRBW + XRHW; // rect
inside.origin.y += XRBW + XRHW;
inside.size.width -= (XRBW + XRBW + XRHW + XRHW);
inside.size.height -= (XRBW + XRBW + XRHW + XRHW);
NSDrawGrayBezel(inside, inside); // draw inner border
}
@end

View file

@ -7,6 +7,8 @@
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: August 1998
This file is part of the GNUstep GUI Library.
@ -27,7 +29,10 @@
*/
#include <gnustep/gui/config.h>
#include <AppKit/NSControl.h>
#include <AppKit/NSEvent.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSCell.h>
@ -406,10 +411,80 @@ static id MB_NSCONTROL_CELL_CLASS = nil;
//
- (void)mouseDown:(NSEvent *)theEvent
{
//NSRect f;
NSApplication *theApp = [NSApplication sharedApplication];
BOOL mouseUp = NO, done = NO;
NSEvent *e;
int oldActionMask;
NSPoint location;
unsigned int event_mask = NSLeftMouseDownMask | NSLeftMouseUpMask |
NSMouseMovedMask | NSLeftMouseDraggedMask |
NSRightMouseDraggedMask;
//f = MBConvertRectToWindow(bounds);
//[cell trackMouse:theEvent inRect:f ofView:self untilMouseUp:YES];
NSDebugLog(@"NSControl mouseDown\n");
if (![self isEnabled]) // If we are not enabled
return; // then ignore the mouse
if ([cell isContinuous]) // Have NSCell send action
oldActionMask = [cell sendActionOn:0]; // only if we're continuous
else
oldActionMask = [cell sendActionOn: NSPeriodicMask];
[[self window] captureMouse: self]; // capture mouse
[self lockFocus];
e = theEvent;
while (!done) // loop until mouse goes up
{
location = [e locationInWindow];
location = [self convertPoint:location fromView:nil];
// ask the cell to track the mouse only
// if the mouse is within the cell
if ((location.x >= 0) && (location.x < bounds.size.width) &&
(location.y >= 0 && location.y < bounds.size.height))
{ // highlight the cell
[cell highlight: YES withFrame: bounds inView: self];
[window flushWindow];
if([cell trackMouse:e inRect:bounds ofView:self untilMouseUp:YES])
done = mouseUp = YES; // YES if the mouse
else // goes up in the cell
{
[cell highlight: NO withFrame: bounds inView: self];
[window flushWindow];
}
}
if (done) // if done break
break; // out of the loop
NSDebugLog(@"NSControl process another event\n");
e = [theApp nextEventMatchingMask:event_mask // get next event
untilDate:nil
inMode:NSEventTrackingRunLoopMode
dequeue:YES];
if ([e type] == NSLeftMouseUp) // If mouse went up
done = YES; // then we are done
}
[[self window] releaseMouse: self]; // Release mouse
if (mouseUp) // the mouse went up in the button
{
[self lockFocus]; // lockFocus gets released when button is
// drawn presseddown (NSView's displayRect)
// so we call it again, one of these needs
// to be optimized out FAR FIX ME
[cell setState:![cell state]];
[cell highlight: NO withFrame: bounds inView: self]; // Unhighlight
[window flushWindow];
}
[self unlockFocus];
// Restore the old
[cell sendActionOn:oldActionMask]; // action mask
if (mouseUp) // Have the target
[self sendAction:[self action] to:[self target]]; // perform action
}
- (BOOL)ignoresMultiClick
@ -423,14 +498,14 @@ static id MB_NSCONTROL_CELL_CLASS = nil;
//
// Methods Implemented by the Delegate
//
- (BOOL)control:(NSControl *)control
textShouldBeginEditing:(NSText *)fieldEditor
- (BOOL)control:(NSControl *)control
textShouldBeginEditing:(NSText *)fieldEditor
{
return NO;
}
- (BOOL)control:(NSControl *)control
textShouldEndEditing:(NSText *)fieldEditor
textShouldEndEditing:(NSText *)fieldEditor
{
return NO;
}

View file

@ -41,7 +41,7 @@
#include <AppKit/NSEvent.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSWindow.h>
#include <AppKit/GPSDrawContext.h>
#include <AppKit/GSContext.h>
@implementation NSEvent
@ -68,7 +68,7 @@ static NSString *timerKey = @"NSEventTimersKey";
modifierFlags:(unsigned int)flags
timestamp:(NSTimeInterval)time
windowNumber:(int)windowNum
context:(GPSDrawContext *)context
context:(GSContext *)context
eventNumber:(int)eventNum
trackingNumber:(int)trackingNum
userData:(void *)userData
@ -97,7 +97,7 @@ NSEvent *e = [[[NSEvent alloc] init] autorelease];
modifierFlags:(unsigned int)flags
timestamp:(NSTimeInterval)time
windowNumber:(int)windowNum
context:(GPSDrawContext *)context
context:(GSContext *)context
characters:(NSString *)keys
charactersIgnoringModifiers:(NSString *)ukeys
isARepeat:(BOOL)repeatKey
@ -129,7 +129,7 @@ NSEvent *e = [[[NSEvent alloc] init] autorelease];
modifierFlags:(unsigned int)flags
timestamp:(NSTimeInterval)time
windowNumber:(int)windowNum
context:(GPSDrawContext *)context
context:(GSContext *)context
eventNumber:(int)eventNum
clickCount:(int)clickNum
pressure:(float)pressureValue
@ -160,7 +160,7 @@ NSEvent *e = [[[NSEvent alloc] init] autorelease]; // do nothing if
modifierFlags:(unsigned int)flags
timestamp:(NSTimeInterval)time
windowNumber:(int)windowNum
context:(GPSDrawContext *)context
context:(GSContext *)context
subtype:(short)subType
data1:(int)data1
data2:(int)data2
@ -284,7 +284,7 @@ NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
//
// Getting General Event Information
//
- (GPSDrawContext *)context
- (GSContext *)context
{
return event_context;
}
@ -374,10 +374,10 @@ NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
// Make sure it is one of the right event types
if ((event_type != NSLeftMouseDown) && (event_type != NSLeftMouseUp) &&
(event_type != NSRightMouseDown) && (event_type != NSRightMouseUp) &&
(event_type != NSLeftMouseDragged) && (event_type != NSRightMouseDragged) &&
(event_type != NSMouseMoved) &&
(event_type != NSMouseEntered) && (event_type != NSMouseExited))
return 0;
(event_type != NSLeftMouseDragged) && (event_type != NSRightMouseDragged)
&& (event_type != NSMouseMoved) && (event_type != NSMouseEntered) &&
(event_type != NSMouseExited))
return 0;
if ((event_type == NSMouseEntered) || (event_type == NSMouseExited))
return event_data.tracking.event_num;
@ -390,9 +390,9 @@ NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
// Make sure it is one of the right event types
if ((event_type != NSLeftMouseDown) && (event_type != NSLeftMouseUp) &&
(event_type != NSRightMouseDown) && (event_type != NSRightMouseUp) &&
(event_type != NSLeftMouseDragged) && (event_type != NSRightMouseDragged) &&
(event_type != NSMouseMoved))
return 0;
(event_type != NSLeftMouseDragged) && (event_type != NSRightMouseDragged)
&& (event_type != NSMouseMoved))
return 0;
return event_data.mouse.pressure;
}

View file

@ -44,6 +44,8 @@
#include <AppKit/NSApplication.h>
#include <AppKit/NSMatrix.h>
/* Define the following symbol when NSView will support flipped views */
//#define HAS_FLIPPED_VIEWS 1
@ -995,6 +997,12 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
NSRect intRect, upperLeftRect;
NSArray* row;
if(drawsBackground)
{
[backgroundColor set];
NSRectFill(rect); // draw the background
}
[self _getRow:&row1 column:&col1
#if HAS_FLIPPED_VIEWS
forPoint:rect.origin
@ -1039,28 +1047,28 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
}
}
- (void)drawCellAtRow:(int)row
column:(int)column
- (void)drawCellAtRow:(int)row column:(int)column
{
NSCell *aCell = [self cellAtRow:row column:column];
NSRect cellFrame = [self cellFrameAtRow:row column:column];
NSCell *aCell = [self cellAtRow:row column:column];
NSRect cellFrame = [self cellFrameAtRow:row column:column];
[aCell drawWithFrame:cellFrame inView:self];
[aCell drawWithFrame:cellFrame inView:self];
}
- (void)highlightCell:(BOOL)flag
atRow:(int)row
column:(int)column
atRow:(int)row
column:(int)column
{
NSCell *aCell = [self cellAtRow:row column:column];
NSRect cellFrame;
NSCell *aCell = [self cellAtRow:row column:column];
NSRect cellFrame;
if (aCell) {
cellFrame = [self cellFrameAtRow:row column:column];
[aCell highlight:flag
withFrame:[self cellFrameAtRow:row column:column]
inView:self];
}
if (aCell)
{
cellFrame = [self cellFrameAtRow:row column:column];
[aCell highlight:flag
withFrame:[self cellFrameAtRow:row column:column]
inView:self];
}
}
- (BOOL)sendAction
@ -1129,7 +1137,7 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent
{
return mode == NSListModeMatrix ? NO : YES;
return mode == NSListModeMatrix ? NO : YES;
}
- (void)mouseDown:(NSEvent*)theEvent
@ -1453,6 +1461,70 @@ static MPoint anchor = {0, 0};
- (BOOL)isFlipped { return YES; }
#endif
//
// Methods that may not be needed FIX ME
//
/*
* Get characters until you encounter
* a carriage return, return number of characters.
* Deal with backspaces, etc. Deal with Expose events
* on all windows associated with this application.
* Deal with keyboard remapping.
*/
- (void)keyDown:(NSEvent *)theEvent;
{
unsigned int flags = [theEvent modifierFlags];
unsigned int key_code = [theEvent keyCode];
NSRect rect = [self cellFrameAtRow:selectedRow column:selectedColumn];
fprintf(stderr, " NSMatrix: keyDown --- ");
// If not editable then don't recognize the key down
if (![selectedCell isEditable]) return;
[self lockFocus];
// If RETURN key then make the next text the first responder
if (key_code == 0x0d)
{
[selectedCell endEditing:nil];
[selectedCell drawInteriorWithFrame: rect inView: self];
return;
}
// Hide the cursor during typing
[NSCursor hide];
[selectedCell _handleKeyEvent:theEvent];
[selectedCell drawInteriorWithFrame: rect inView: self];
[self unlockFocus];
}
- (BOOL)acceptsFirstResponder
{
if ([selectedCell isSelectable])
return YES;
else
return NO;
}
- (BOOL)becomeFirstResponder
{
if ([selectedCell isSelectable])
{
// [selectedCell selectText:self];
return YES;
}
else
{
return NO;
}
}
@end

View file

@ -139,14 +139,14 @@ toData:(NSMutableData *)data
{}
//
// Managing the DPS Context
// Managing the drawing Context
//
- (GPSDrawContext *)createContext
- (GSContext *)createContext
{
return nil;
}
- (GPSDrawContext *)context
- (GSContext *)context
{
return nil;
}

View file

@ -196,8 +196,7 @@
if (eventSelector != @selector(keyDown:))
return;
/* Commented out to be able to create shared libraries on OS 4.1 */
// NSBeep();
NSBeep();
}
- (void)rightMouseDown:(NSEvent *)theEvent

View file

@ -30,18 +30,22 @@
#include <Foundation/NSDictionary.h>
#include <AppKit/NSScreen.h>
@implementation NSScreen
//
// Class variables
//
NSScreen *mainScreen = nil;
//
// Class methods
//
+ (void)initialize
{
if (self == [NSScreen class])
{
// Initial version
[self setVersion:1];
}
if (self == [NSScreen class])
[self setVersion:1];
}
//
@ -49,17 +53,20 @@
//
+ (NSScreen *)mainScreen
{
return nil;
if (!mainScreen)
mainScreen = [[NSScreen alloc] init];
return mainScreen;
}
+ (NSScreen *)deepestScreen
{
return nil;
return nil;
}
+ (NSArray *)screens
{
return nil;
return nil;
}
//
@ -67,13 +74,11 @@
//
- init
{
[super init];
[super init]; // Create our device description dictionary
// The backend will have to fill the dictionary
device_desc = [NSMutableDictionary dictionary];
// Create our device description dictionary
// The backend will have to fill the dictionary
device_desc = [NSMutableDictionary dictionary];
return self;
return self;
}
//
@ -81,19 +86,19 @@
//
- (NSWindowDepth)depth
{
return 0;
return 0;
}
- (NSRect)frame
{
return NSZeroRect;
return NSZeroRect;
}
// Make a copy of our dictionary and return it
- (NSDictionary *)deviceDescription
{
NSDictionary *d = [[NSDictionary alloc] initWithDictionary: device_desc];
return d;
- (NSDictionary *)deviceDescription // Make a copy of device
{ // dictionary and return it
NSDictionary *d = [[NSDictionary alloc] initWithDictionary: device_desc];
return d;
}
@end

View file

@ -36,28 +36,46 @@
#include <AppKit/NSButtonCell.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSImage.h>
#include <AppKit/PSMatrix.h>
@implementation NSScroller
/* Class variables */
/* These button cells are used by all scroller instances to draw the scroller
buttons and the knob. */
static NSButtonCell* upCell = nil;
static NSButtonCell* downCell = nil;
static NSButtonCell* leftCell = nil;
static NSButtonCell* rightCell = nil;
//
// Class variables
//
static NSButtonCell* upCell = nil; // button cells used by
static NSButtonCell* downCell = nil; // scroller instances
static NSButtonCell* leftCell = nil; // to draw scroller
static NSButtonCell* rightCell = nil; // buttons and knob.
static NSButtonCell* knobCell = nil;
static const float scrollerWidth = 17;
static const float buttonsWidth = 16;
static const float buttonsDistance = 1;
static float halfKnobRectHeight;
static float slotOriginPlusKnobHeight;
static float slotOriginPlusSlotHeightMinusKnobHeight;
static float slotHeightMinusKnobHeight;
static float halfKnobRectWidth;
static float slotOriginPlusKnobWidth;
static float slotOriginPlusSlotWidthMinusHalfKnobWidth;
static float slotWidthMinusKnobWidth;
static NSRect slotRect = {{0,0},{0,0}};
static BOOL preCalcValues = NO;
//
// Class methods
//
+ (void)initialize
{
if (self == [NSScroller class]) {
/* The current version */
[self setVersion:1];
}
if (self == [NSScroller class])
[self setVersion:1];
}
+ (float)scrollerWidth { return 18; }
+ (float)scrollerWidth { return scrollerWidth; }
- (NSScrollArrowPosition)arrowsPosition { return _arrowsPosition; }
- (NSUsableScrollerParts)usableParts { return _usableParts; }
- (float)knobProportion { return _knobProportion; }
@ -303,139 +321,233 @@ static NSButtonCell* knobCell = nil;
- (float)_floatValueForMousePoint:(NSPoint)point
{
NSRect knobRect = [self rectForPart:NSScrollerKnob];
NSRect slotRect = [self rectForPart:NSScrollerKnobSlot];
float floatValue = 0;
float position;
NSRect knobRect = [self rectForPart:NSScrollerKnob];
NSRect slotRect = [self rectForPart:NSScrollerKnobSlot];
float floatValue = 0;
float position;
if (_isHorizontal) {
float halfKnobWidth = knobRect.size.width / 2;
if (_isHorizontal) // Adjust point to lie
{ // within the knob slot
float halfKnobRectWidth = knobRect.size.width / 2;
/* Adjust the point to lie inside the knob slot */
if (point.x < slotRect.origin.x + halfKnobWidth)
position = slotRect.origin.x + halfKnobWidth;
else if (point.x > slotRect.origin.x + slotRect.size.width
- halfKnobWidth)
position = slotRect.origin.x + slotRect.size.width
- halfKnobWidth;
else
position = point.x;
if (point.x < slotRect.origin.x + halfKnobRectWidth)
position = slotRect.origin.x + halfKnobRectWidth;
else
{
if (point.x > slotRect.origin.x + slotRect.size.width -
halfKnobRectWidth)
position = slotRect.origin.x + slotRect.size.width -
halfKnobRectWidth;
else
position = point.x;
} // Compute float value
// given the knob size
floatValue = (position - (slotRect.origin.x + halfKnobRectWidth))
/ (slotRect.size.width - knobRect.size.width);
}
else // Adjust point to lie
{ // within the knob slot
float halfKnobRectHeight = knobRect.size.height / 2;
/* Compute the float value considering the knob size */
floatValue = (position - (slotRect.origin.x + halfKnobWidth))
/ (slotRect.size.width - knobRect.size.width);
}
else {
float halfKnobHeight = knobRect.size.height / 2;
if (point.y < slotRect.origin.y + halfKnobRectHeight)
position = slotRect.origin.y + halfKnobRectHeight;
else
{
if (point.y > slotRect.origin.y + slotRect.size.height -
halfKnobRectHeight)
position = slotRect.origin.y + slotRect.size.height -
halfKnobRectHeight;
else
position = point.y;
}
// Compute float value
floatValue = (position - (slotRect.origin.y + halfKnobRectHeight)) /
(slotRect.size.height - knobRect.size.height);
floatValue = 1 - floatValue;
}
/* Adjust the point to lie inside the knob slot */
if (point.y < slotRect.origin.y + halfKnobHeight)
position = slotRect.origin.y + halfKnobHeight;
else if (point.y > slotRect.origin.y + slotRect.size.height
- halfKnobHeight)
position = slotRect.origin.y + slotRect.size.height
- halfKnobHeight;
else
position = point.y;
return floatValue;
}
/* Compute the float value */
floatValue = (position - (slotRect.origin.y + halfKnobHeight))
/ (slotRect.size.height - knobRect.size.height);
floatValue = 1 - floatValue;
}
- (void)_preCalcParts
{
NSRect knobRect = [self rectForPart:NSScrollerKnob];
return floatValue;
slotRect = [self rectForPart:NSScrollerKnobSlot];
halfKnobRectWidth = knobRect.size.width / 2;
slotOriginPlusKnobWidth = slotRect.origin.x + halfKnobRectWidth;
slotOriginPlusSlotWidthMinusHalfKnobWidth = slotRect.origin.x +
slotRect.size.width - halfKnobRectWidth;
slotWidthMinusKnobWidth = slotRect.size.width - knobRect.size.width;
halfKnobRectHeight = knobRect.size.height / 2;
slotOriginPlusKnobHeight = slotRect.origin.y + halfKnobRectHeight;
slotOriginPlusSlotHeightMinusKnobHeight = slotRect.origin.y +
slotRect.size.height - halfKnobRectHeight;
slotHeightMinusKnobHeight = slotRect.size.height - knobRect.size.height;
}
- (float)_floatValueForMousePointFromPreCalc:(NSPoint)point
{
float floatValue = 0;
float position;
if (_isHorizontal) // Adjust point to lie
{ // within the knob slot
if (point.x < slotOriginPlusKnobWidth)
position = slotOriginPlusKnobWidth;
else
{
if (point.x > slotOriginPlusSlotWidthMinusHalfKnobWidth)
position = slotOriginPlusSlotWidthMinusHalfKnobWidth;
else
position = point.x;
} // Compute float value
// given the knob size
floatValue = (position - slotOriginPlusKnobWidth) /
slotWidthMinusKnobWidth;
}
else // Adjust point to lie
{ // within the knob slot
if (point.y < slotOriginPlusKnobHeight)
position = slotOriginPlusKnobHeight;
else
{
if (point.y > slotOriginPlusSlotHeightMinusKnobHeight)
position = slotOriginPlusSlotHeightMinusKnobHeight;
else
position = point.y;
}
// Compute float value
floatValue = (position - slotOriginPlusKnobHeight) /
slotHeightMinusKnobHeight;
floatValue = 1 - floatValue;
}
return floatValue;
}
- (void)mouseDown:(NSEvent*)theEvent
{
NSPoint location = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
NSPoint location = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
[self lockFocus];
_hitPart = [self testPart:location];
[self _setTargetAndActionToCells];
switch (_hitPart) {
case NSScrollerIncrementLine:
case NSScrollerDecrementLine:
case NSScrollerIncrementPage:
case NSScrollerDecrementPage:
[self trackScrollButtons:theEvent];
break;
case NSScrollerKnob:
[self trackKnob:theEvent];
break;
case NSScrollerKnobSlot: {
float floatValue = [self _floatValueForMousePoint:location];
[self setFloatValue:floatValue];
[self sendAction:_action to:_target];
#if 0
[self drawKnobSlot];
[self drawKnob];
[[self window] flushWindow];
#endif
[self trackKnob:theEvent];
break;
}
case NSScrollerNoPart:
break;
}
_hitPart = NSScrollerNoPart;
[self unlockFocus];
[self lockFocus];
_hitPart = [self testPart:location];
[self _setTargetAndActionToCells];
switch (_hitPart)
{
case NSScrollerIncrementLine:
case NSScrollerDecrementLine:
case NSScrollerIncrementPage:
case NSScrollerDecrementPage:
[self trackScrollButtons:theEvent];
break;
case NSScrollerKnob:
[self trackKnob:theEvent];
break;
case NSScrollerKnobSlot:
{
float floatValue = [self _floatValueForMousePoint:location];
[self setFloatValue:floatValue];
[self sendAction:_action to:_target];
[self drawKnobSlot];
[self drawKnob];
[window flushWindow];
[self trackKnob:theEvent];
break;
}
case NSScrollerNoPart:
break;
}
_hitPart = NSScrollerNoPart;
[self unlockFocus];
}
- (void)trackKnob:(NSEvent*)theEvent
{
unsigned int eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask
| NSLeftMouseDraggedMask | NSMouseMovedMask
| NSPeriodicMask;
NSPoint point = [self convertPoint:[theEvent locationInWindow] fromView:nil];
NSRect knobRect = [self rectForPart:NSScrollerKnob];
NSEventType eventType = [theEvent type];
float oldFloatValue = _floatValue;
NSApplication *theApp = [NSApplication sharedApplication];
unsigned int eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask
| NSLeftMouseDraggedMask | NSMouseMovedMask
| NSPeriodicMask;
NSApplication *app = [NSApplication sharedApplication];
NSPoint point, apoint;
float oldFloatValue = _floatValue;
float floatValue;
NSDate *theDistantFuture = [NSDate distantFuture];
PSMatrix* matrix;
NSEventType eventType;
NSRect knobRect = {{0,0},{0,0}};
NSArray* path = [self _pathBetweenSubview:self
toSuperview:[window contentView]];
_hitPart = NSScrollerKnob;
[NSEvent startPeriodicEventsAfterDelay:0.05 withPeriod:0.05];
[[NSRunLoop currentRunLoop] limitDateForMode:NSEventTrackingRunLoopMode];
matrix = [self _concatenateMatricesInReverseOrderFromPath:path];
[matrix inverse];
while (eventType != NSLeftMouseUp) {
theEvent = [theApp
nextEventMatchingMask:eventMask
untilDate:[NSDate distantFuture]
inMode:NSEventTrackingRunLoopMode
dequeue:YES];
eventType = [theEvent type];
//fprintf(stderr, " trackKnob \n");
if (eventType != NSPeriodic)
point = [self convertPoint:[theEvent locationInWindow] fromView:nil];
else if (point.x != knobRect.origin.x || point.y != knobRect.origin.y) {
float floatValue = [self _floatValueForMousePoint:point];
[self _preCalcParts]; // pre calc scroller parts
preCalcValues = YES;
if (floatValue != oldFloatValue) {
[self setFloatValue:floatValue];
#if 1
[self setNeedsDisplayInRect:[self rectForPart:NSScrollerKnobSlot]];
#else
[self drawKnobSlot];
[self drawKnob];
[self setNeedsDisplayInRect:[self rectForPart:NSScrollerKnobSlot]];
[[self window] flushWindow];
#endif
[self sendAction:_action to:_target];
oldFloatValue = floatValue;
}
knobRect.origin = point;
}
}
_hitPart = NSScrollerKnob; // set periodic events rate
// to achieve max of 30fps
[NSEvent startPeriodicEventsAfterDelay:0.02 withPeriod:0.03];
[[NSRunLoop currentRunLoop] limitDateForMode:NSEventTrackingRunLoopMode];
[NSEvent stopPeriodicEvents];
while ((eventType = [theEvent type]) != NSLeftMouseUp)
{ // user is moving scroller
if (eventType != NSPeriodic) // loop until left mouse up
apoint = [theEvent locationInWindow];
else
{
point = [matrix pointInMatrixSpace:apoint];
if (point.x != knobRect.origin.x || point.y != knobRect.origin.y)
{
floatValue = [self _floatValueForMousePointFromPreCalc:point];
if (floatValue != oldFloatValue)
{
if (floatValue < 0)
_floatValue = 0;
else
{
if (floatValue > 1)
_floatValue = 1;
else
_floatValue = floatValue;
}
[self drawKnobSlot]; // draw scroller slot
[self drawKnob]; // draw scroller knob
[_target performSelector:_action withObject:self];
[window flushWindow];
oldFloatValue = floatValue;
}
knobRect.origin = point;
}
}
theEvent = [app nextEventMatchingMask:eventMask
untilDate:theDistantFuture
inMode:NSEventTrackingRunLoopMode
dequeue:YES];
}
[NSEvent stopPeriodicEvents];
// scrolling has stopped
if([_target respondsToSelector:@selector(contentView)])
{
if([_target respondsToSelector:@selector(_freeMatrix)])
[[_target contentView] _freeMatrix];
}
preCalcValues = NO;
}
- (void)trackScrollButtons:(NSEvent*)theEvent
@ -486,8 +598,10 @@ NSRect rect;
if([_target isKindOf:[NSScrollView class]]) // a hack for XRAW
{ // FIX ME
if([[_target contentView] respondsTo:@selector(_freeMatrix)])
[[_target contentView] _freeMatrix];
NSObject *targetCV = (NSObject *)[_target contentView];
if([targetCV respondsToSelector:@selector(_freeMatrix)])
[targetCV _freeMatrix];
}
[theCell highlight:NO withFrame:rect inView:self];
@ -528,6 +642,9 @@ BOOL ret = [super sendAction:theAction to:theTarget]; // the target on
return self;
}
//
// draw the scroller
//
- (void)drawRect:(NSRect)rect
{
NSDebugLog (@"NSScroller drawRect: ((%f, %f), (%f, %f))",
@ -540,8 +657,7 @@ BOOL ret = [super sendAction:theAction to:theTarget]; // the target on
[self drawKnob];
}
- (void)drawArrow:(NSScrollerArrow)whichButton
highlight:(BOOL)flag
- (void)drawArrow:(NSScrollerArrow)whichButton highlight:(BOOL)flag
{
NSRect rect = [self rectForPart:(whichButton == NSScrollerIncrementArrow
? NSScrollerIncrementLine
@ -566,18 +682,168 @@ BOOL ret = [super sendAction:theAction to:theTarget]; // the target on
- (void)drawKnob
{
[knobCell drawWithFrame:[self rectForPart:NSScrollerKnob] inView:self];
}
/* The following methods should be implemented in the backend */
- (NSRect)rectForPart:(NSScrollerPart)partCode
{
return NSZeroRect;
[knobCell drawWithFrame:[self rectForPart:NSScrollerKnob] inView:self];
}
- (void)drawKnobSlot
{
NSRect rect;
if(preCalcValues) // in a modal loop we
rect = slotRect; // have already pre
else // calc'd our parts
rect = [self rectForPart:NSScrollerKnobSlot];
[[NSColor darkGrayColor] set];
NSRectFill(rect); // draw the bar slot
}
- (NSRect)rectForPart:(NSScrollerPart)partCode
{
NSRect scrollerFrame = frame;
float x = 1, y = 1, width = 0, height = 0, floatValue;
NSScrollArrowPosition arrowsPosition;
NSUsableScrollerParts usableParts;
// If the scroller is disabled then
if (!_isEnabled) // the scroller buttons and the
usableParts = NSNoScrollerParts; // knob are not displayed at all.
else
usableParts = _usableParts;
// Since we haven't yet flipped views we have
if (!_isHorizontal) // to swap the meaning of the arrows position
{ // if the scroller's orientation is vertical.
if (_arrowsPosition == NSScrollerArrowsMaxEnd)
arrowsPosition = NSScrollerArrowsMinEnd;
else
{
if (_arrowsPosition == NSScrollerArrowsMinEnd)
arrowsPosition = NSScrollerArrowsMaxEnd;
else
arrowsPosition = NSScrollerArrowsNone;
}
}
else
arrowsPosition = _arrowsPosition;
// Assign to `width' and `height' values describing
// the width and height of the scroller regardless
// of its orientation. Also compute the `floatValue'
if (_isHorizontal) // which is essentially the same width as _floatValue
{ // but keeps track of the scroller's orientation.
width = scrollerFrame.size.height;
height = scrollerFrame.size.width;
floatValue = _floatValue;
}
else
{
width = scrollerFrame.size.width;
height = scrollerFrame.size.height;
floatValue = 1 - _floatValue;
} // The x, y, width and height values
// are computed below for the vertical
switch (partCode) // scroller. The height of the scroll
{ // buttons is assumed to be equal to
case NSScrollerKnob: // the width.
{
float knobHeight, knobPosition, slotHeight;
// If the scroller does not have parts
// or a knob return a zero rect.
if (usableParts == NSNoScrollerParts ||
usableParts == NSOnlyScrollerArrows)
return NSZeroRect;
// calc the slot Height
slotHeight = height - (arrowsPosition == NSScrollerArrowsNone ?
0 : 2 * (buttonsWidth + buttonsDistance));
if (_isHorizontal)
slotHeight -= 2;
knobHeight = _knobProportion * slotHeight;
if (knobHeight < buttonsWidth)
knobHeight = buttonsWidth;
// calc knob's position
knobPosition = floatValue * (slotHeight - knobHeight);
knobPosition = (float)floor(knobPosition); // avoid rounding error
// calc actual position
y = knobPosition + (arrowsPosition == NSScrollerArrowsMaxEnd
|| arrowsPosition == NSScrollerArrowsNone ?
0 : 2 * (buttonsWidth + buttonsDistance));
height = knobHeight;
width = buttonsWidth;
if (_isHorizontal) // keeps horiz knob off
y++; // of the buttons
break;
}
case NSScrollerKnobSlot:
x = 0; // if the scroller does
width = scrollerWidth + 1; // not have buttons the
// slot completely
if (usableParts == NSNoScrollerParts) // fills the scroller.
{
y = 0; // `height' unchanged
break;
}
if (arrowsPosition == NSScrollerArrowsMaxEnd)
{
y = 0;
height -= 2 * (buttonsWidth + buttonsDistance) + 1;
}
else
{
if (arrowsPosition == NSScrollerArrowsMinEnd)
{
y = 2 * (buttonsWidth + buttonsDistance) + 1;
height -= y;
}
else
y = 0; // `height' unchanged
}
break;
case NSScrollerDecrementLine:
case NSScrollerDecrementPage:
if (usableParts == NSNoScrollerParts) // if scroller has no
return NSZeroRect; // parts or knob then
// return a zero rect
width = buttonsWidth;
if (arrowsPosition == NSScrollerArrowsMaxEnd)
y = height - 2 * (buttonsWidth + buttonsDistance);
else
{
if (arrowsPosition == NSScrollerArrowsMinEnd)
y = 1;
else
return NSZeroRect;
}
height = buttonsWidth;
break;
case NSScrollerIncrementLine:
case NSScrollerIncrementPage:
if (usableParts == NSNoScrollerParts) // if scroller has no
return NSZeroRect; // parts or knob then
// return a zero rect
width = buttonsWidth;
if (arrowsPosition == NSScrollerArrowsMaxEnd)
y = height - (buttonsWidth + buttonsDistance);
else
{
if (arrowsPosition == NSScrollerArrowsMinEnd)
y = buttonsWidth + buttonsDistance + 1;
else
return NSZeroRect;
}
height = buttonsWidth;
break;
case NSScrollerNoPart:
return NSZeroRect;
}
if (_isHorizontal)
return NSMakeRect (y, x, height, width);
else
return NSMakeRect (x, y, width, height);
}
@end

View file

@ -5,6 +5,8 @@
Author: Ovidiu Predescu <ovidiu@net-community.com>
Date: September 1997
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: August 1998
This file is part of the GNUstep GUI Library.
@ -48,7 +50,7 @@ static Class cellClass;
}
+ (void)setCellClass:(Class)class { cellClass = class; }
+ (Class)cellClass { return cellClass; }
+ (Class)cellClass { return cellClass; }
- initWithFrame:(NSRect)frameRect
{
@ -159,129 +161,130 @@ static Class cellClass;
- (float)_floatValueForMousePoint:(NSPoint)point knobRect:(NSRect)knobRect
{
NSSliderCell* theCell = [self cell];
NSRect slotRect = [theCell trackRect];
BOOL isVertical = [theCell isVertical];
float minValue = [theCell minValue];
float maxValue = [theCell maxValue];
float floatValue = 0;
float position;
NSSliderCell* theCell = [self cell];
NSRect slotRect = [theCell trackRect];
BOOL isVertical = [theCell isVertical];
float minValue = [theCell minValue];
float maxValue = [theCell maxValue];
float floatValue = 0;
float position;
if (isVertical) {
/* Adjust the point to lie inside the knob slot. We don't have to worry
if the view is flipped or not. */
if (point.y < slotRect.origin.y + knobRect.size.height / 2)
position = slotRect.origin.y + knobRect.size.height / 2;
else if (point.y > slotRect.origin.y + slotRect.size.height
- knobRect.size.height / 2)
position = slotRect.origin.y + slotRect.size.height
- knobRect.size.height / 2;
else
position = point.y;
if (isVertical)
{ // Adjust the point to lie inside the knob slot. We don't
// have to worry whether the view is flipped or not.
if (point.y < slotRect.origin.y + knobRect.size.height / 2)
position = slotRect.origin.y + knobRect.size.height / 2;
else
if (point.y > slotRect.origin.y + slotRect.size.height
- knobRect.size.height / 2)
position = slotRect.origin.y + slotRect.size.height
- knobRect.size.height / 2;
else
position = point.y;
// Compute the float value
floatValue = (position - (slotRect.origin.y + knobRect.size.height/2))
/ (slotRect.size.height - knobRect.size.height);
if ([self isFlipped])
floatValue = 1 - floatValue;
}
else
{ // Adjust the point to lie inside the knob slot
if (point.x < slotRect.origin.x + knobRect.size.width / 2)
position = slotRect.origin.x + knobRect.size.width / 2;
else
if (point.x > slotRect.origin.x + slotRect.size.width
- knobRect.size.width / 2)
position = slotRect.origin.x + slotRect.size.width
- knobRect.size.width / 2;
else
position = point.x;
// Compute the float value
// given the knob size
floatValue = (position - (slotRect.origin.x + knobRect.size.width / 2))
/ (slotRect.size.width - knobRect.size.width);
}
/* Compute the float value */
floatValue = (position - (slotRect.origin.y + knobRect.size.height/2))
/ (slotRect.size.height - knobRect.size.height);
if ([self isFlipped])
floatValue = 1 - floatValue;
}
else {
/* Adjust the point to lie inside the knob slot */
if (point.x < slotRect.origin.x + knobRect.size.width / 2)
position = slotRect.origin.x + knobRect.size.width / 2;
else if (point.x > slotRect.origin.x + slotRect.size.width
- knobRect.size.width / 2)
position = slotRect.origin.x + slotRect.size.width
- knobRect.size.width / 2;
else
position = point.x;
/* Compute the float value considering the knob size */
floatValue = (position - (slotRect.origin.x + knobRect.size.width / 2))
/ (slotRect.size.width - knobRect.size.width);
}
return floatValue * (maxValue - minValue) + minValue;
return floatValue * (maxValue - minValue) + minValue;
}
- (void)trackKnob:(NSEvent*)theEvent knobRect:(NSRect)knobRect
{
unsigned int eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask
| NSLeftMouseDraggedMask | NSMouseMovedMask
| NSPeriodicMask;
NSPoint point = [self convertPoint:[theEvent locationInWindow] fromView:nil];
NSEventType eventType = [theEvent type];
BOOL isContinuous = [self isContinuous];
NSSliderCell* theCell = [self cell];
float oldFloatValue = [theCell floatValue];
id target = [theCell target];
SEL action = [theCell action];
NSApplication *app = [NSApplication sharedApplication];
unsigned int eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask
| NSLeftMouseDraggedMask | NSMouseMovedMask
| NSPeriodicMask;
NSPoint point = [self convertPoint:[theEvent locationInWindow] fromView:nil];
NSEventType eventType = [theEvent type];
BOOL isContinuous = [self isContinuous];
NSSliderCell* theCell = [self cell];
float oldFloatValue = [theCell floatValue];
id target = [theCell target];
SEL action = [theCell action];
[NSEvent startPeriodicEventsAfterDelay:0.05 withPeriod:0.05];
[[NSRunLoop currentRunLoop] limitDateForMode:NSEventTrackingRunLoopMode];
[NSEvent startPeriodicEventsAfterDelay:0.05 withPeriod:0.05];
[[NSRunLoop currentRunLoop] limitDateForMode:NSEventTrackingRunLoopMode];
while (eventType != NSLeftMouseUp) {
theEvent = [[NSApplication sharedApplication]
nextEventMatchingMask:eventMask
untilDate:[NSDate distantFuture]
inMode:NSEventTrackingRunLoopMode
dequeue:YES];
eventType = [theEvent type];
while (eventType != NSLeftMouseUp)
{
theEvent = [app nextEventMatchingMask:eventMask
untilDate:[NSDate distantFuture]
inMode:NSEventTrackingRunLoopMode
dequeue:YES];
eventType = [theEvent type];
if (eventType != NSPeriodic)
point = [self convertPoint:[theEvent locationInWindow] fromView:nil];
else if (point.x != knobRect.origin.x || point.y != knobRect.origin.y) {
float floatValue = [self _floatValueForMousePoint:point
knobRect:knobRect];
if (eventType != NSPeriodic)
point = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
else
{
if (point.x != knobRect.origin.x || point.y != knobRect.origin.y)
{
float floatValue = [self _floatValueForMousePoint:point
knobRect:knobRect];
if (floatValue != oldFloatValue) {
[theCell setFloatValue:floatValue];
#if 0
[theCell drawWithFrame:[self bounds] inView:self];
[[self window] flushWindow];
#else
[self setNeedsDisplay:YES];
#endif
if (isContinuous)
[target performSelector:action withObject:self];
oldFloatValue = floatValue;
}
knobRect.origin = point;
}
}
/* If the control is not continuous send the action at the end of the drag */
if (!isContinuous)
[target performSelector:action withObject:self];
[NSEvent stopPeriodicEvents];
if (floatValue != oldFloatValue)
{
[theCell setFloatValue:floatValue];
[theCell drawWithFrame:[self bounds] inView:self];
[window flushWindow];
if (isContinuous)
[target performSelector:action withObject:self];
oldFloatValue = floatValue;
}
knobRect.origin = point;
}
}
}
// If the control is not continuous send
if (!isContinuous) // the action at the end of the drag
[target performSelector:action withObject:self];
[NSEvent stopPeriodicEvents];
}
- (void)mouseDown:(NSEvent *)theEvent
{
NSPoint location = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
NSSliderCell* theCell = [self cell];
NSRect rect;
NSPoint location = [self convertPoint:[theEvent locationInWindow]fromView:nil];
NSSliderCell* theCell = [self cell];
NSRect rect;
[self lockFocus];
rect = [theCell knobRectFlipped:[self isFlipped]];
if (![self mouse:location inRect:rect]) {
/* Mouse is not on the knob, move the knob to the mouse position */
float floatValue = [self _floatValueForMousePoint:location knobRect:rect];
[theCell setFloatValue:floatValue];
if ([self isContinuous])
[[theCell target] performSelector:[theCell action] withObject:self];
#if 0
[theCell drawWithFrame:[self bounds] inView:self];
[[self window] flushWindow];
#else
[self setNeedsDisplay:YES];
#endif
}
[self trackKnob:theEvent knobRect:rect];
[self lockFocus];
rect = [theCell knobRectFlipped:[self isFlipped]];
if (![self mouse:location inRect:rect])
{ // Mouse is not on the knob, move
// the knob to the mouse position
float floatValue = [self _floatValueForMousePoint:location
knobRect:rect];
[theCell setFloatValue:floatValue];
if ([self isContinuous])
[[theCell target] performSelector:[theCell action]
withObject:self];
[theCell drawWithFrame:[self bounds] inView:self];
[window flushWindow];
}
[self trackKnob:theEvent knobRect:rect];
}
@end

View file

@ -23,13 +23,16 @@
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <Foundation/NSString.h>
#include "gnustep/gui/config.h"
#include <Foundation/NSString.h>
#include <AppKit/NSSliderCell.h>
#include <AppKit/NSControl.h>
#include <AppKit/NSImage.h>
#include <AppKit/NSTextFieldCell.h>
@implementation NSSliderCell
- init
@ -65,13 +68,13 @@
_floatValue = aFloat;
}
- (void)drawBarInside:(NSRect)aRect flipped:(BOOL)flipped
{
if ([self image])
return;
- (void)drawBarInside:(NSRect)rect flipped:(BOOL)flipped
{ // not per spec FIX ME
if ([self image])
return;
/* We should now draw the bar. Since this code depends on backend this method
should be overwritten in backend. */
[[NSColor darkGrayColor] set];
NSRectFill(rect); // draw the bar
}
- (NSRect)knobRectFlipped:(BOOL)flipped

View file

@ -7,6 +7,8 @@
Author: Robert Vasvari <vrobi@ddrummer.com>
Date: Jul 1998
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: November 1998
This file is part of the GNUstep GUI Library.
@ -27,18 +29,15 @@
*/
#include <gnustep/gui/config.h>
#import <Foundation/Foundation.h>
#import <Foundation/NSRunLoop.h>
#import <AppKit/AppKit.h>
#include <string.h>
#include <math.h>
#import <Foundation/Foundation.h>
#import <Foundation/NSRunLoop.h>
#import <AppKit/AppKit.h>
/* Backend protocol - methods that must be implemented by the backend to
complete the class */
@protocol NSSplitViewBackend
- (void) _fillRect: (NSRect)rect;
@end
@implementation NSSplitView
@ -46,6 +45,7 @@
- (void)mouseDown:(NSEvent *)theEvent
{
NSApplication *app = [NSApplication sharedApplication];
static NSRect oldRect; //only one can be dragged at a time
NSPoint p;
NSEvent *e;
@ -173,42 +173,48 @@
[divColor set];
r.size.width = divHorizontal;
r.size.height = divVertical;
e=[[NSApplication sharedApplication]
nextEventMatchingMask:eventMask
untilDate:farAway inMode:NSEventTrackingRunLoopMode dequeue:YES];
e = [app nextEventMatchingMask:eventMask
untilDate:farAway
inMode:NSEventTrackingRunLoopMode
dequeue:YES];
while([e type] != NSLeftMouseUp)
{
[self displayRect:oldRect];
if ([e type] != NSPeriodic)
{
p=[e locationInWindow];
p = [self convertPoint:p fromView:nil];
}
if([self isVertical])
{
if(p.y<minCoord) p.y=minCoord;
if(p.y>maxCoord) p.y=maxCoord;
r.origin.y = p.y-(divVertical/2.);
r.origin.x = NSMinX(vis);
}
else
{
if(p.x<minCoord) p.x=minCoord;
if(p.x>maxCoord) p.x=maxCoord;
r.origin.x = p.x-(divHorizontal/2.);
r.origin.y = NSMinY(vis);
}
NSDebugLog(@"drawing divider at x:%d, y:%d, w:%d, h:%d\n",
(int)NSMinX(r),(int)NSMinY(r),(int)NSWidth(r),
(int)NSHeight(r));
[self _fillRect: r];
[[GPSDrawContext currentContext] flush];
oldRect=r;
e=[[NSApplication sharedApplication]
nextEventMatchingMask:eventMask
untilDate:farAway inMode:NSEventTrackingRunLoopMode dequeue:YES];
}
while([e type] != NSLeftMouseUp) // user is moving the knob
{ // loop until left mouse up
// [self displayRect:oldRect];
if ([e type] != NSPeriodic)
p = [self convertPoint:[e locationInWindow] fromView:nil];
if([self isVertical])
{
if(p.y<minCoord)
p.y=minCoord;
if(p.y>maxCoord)
p.y=maxCoord;
r.origin.y = p.y-(divVertical/2.);
r.origin.x = NSMinX(vis);
}
else
{
if(p.x<minCoord)
p.x=minCoord;
if(p.x>maxCoord)
p.x=maxCoord;
r.origin.x = p.x-(divHorizontal/2.);
r.origin.y = NSMinY(vis);
}
NSDebugLog(@"drawing divider at x:%d, y:%d, w:%d, h:%d\n",
(int)NSMinX(r),(int)NSMinY(r),(int)NSWidth(r),
(int)NSHeight(r));
[dividerColor set]; // draw the divider
NSHighlightRect(r);
// [[NSDrawContext currentContext] flush];
oldRect=r;
e = [app nextEventMatchingMask:eventMask
untilDate:farAway
inMode:NSEventTrackingRunLoopMode
dequeue:YES];
[dividerColor set]; // draw the divider
NSHighlightRect(oldRect);
}
[self unlockFocus];
[NSEvent stopPeriodicEvents];
@ -254,6 +260,8 @@
RETURN_LABEL:
[[self window] setAcceptsMouseMovedEvents:NO];
[self setNeedsDisplay:YES];
[self display];
}
- (void)adjustSubviews
@ -263,6 +271,7 @@ RETURN_LABEL:
NSPoint newPoint;
float total=0.;
NSLog (@"XRSplitView adjustSubviews");
if(delegate && [delegate respondsToSelector:@selector(splitView:resizeSubviewsWithOldSize:)])
{
[delegate splitView:self resizeSubviewsWithOldSize:fr.size];
@ -315,6 +324,15 @@ RETURN_LABEL:
}
[v setFrameSize: newSize];
[v setFrameOrigin: newPoint];
if(!i == 0) // Fix me FAR
{
[v setFrameOrigin:NSMakePoint(0, bounds.size.height - ([v bounds].size.height -
[self dividerThickness] - 20))];
//NSLog (@"XRSplitView: bounds.size.height %f, [v bounds].size.height %f ", //bounds.size.height, [v bounds].size.height);
//NSLog (@"XRSplitView: newPoint %f ", newPoint);
}
}
}
[[NSNotificationCenter defaultCenter]
@ -413,6 +431,12 @@ NSPoint centerRectInRect(NSRect innerRect, NSRect outerRect)
}
}
- (void)displayRect:(NSRect)rect
{ // should not be needed FIX ME
[super displayRect:rect];
[window flushWindow];
}
- (void)drawRect:(NSRect)r
{
NSArray *subs=[self subviews];
@ -423,7 +447,7 @@ NSPoint centerRectInRect(NSRect innerRect, NSRect outerRect)
if([self isOpaque])
{
[[self backgroundColor] set];
[self _fillRect: [self bounds]];
NSRectFill(r);
}
/* draw the dimples */

View file

@ -7,6 +7,8 @@
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: August 1998
This file is part of the GNUstep GUI Library.
@ -27,33 +29,34 @@
*/
#include <gnustep/gui/config.h>
#include <Foundation/NSString.h>
#include <AppKit/NSTextField.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSTextFieldCell.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSCursor.h>
@implementation NSTextField
//
// class variables
//
id gnustep_gui_nstextfield_cell_class = nil;
@implementation NSTextField
//
// Class methods
//
+ (void)initialize
{
if (self == [NSTextField class])
{
// Initial version
[self setVersion:1];
// Set our cell class to NSTextFieldCell
[self setCellClass:[NSTextFieldCell class]];
}
if (self == [NSTextField class])
{
[self setVersion:1]; // Set cell class to
[self setCellClass:[NSTextFieldCell class]]; // NSTextFieldCell
}
}
//
@ -61,12 +64,12 @@ id gnustep_gui_nstextfield_cell_class = nil;
//
+ (Class)cellClass
{
return gnustep_gui_nstextfield_cell_class;
return gnustep_gui_nstextfield_cell_class;
}
+ (void)setCellClass:(Class)classId
{
gnustep_gui_nstextfield_cell_class = classId;
gnustep_gui_nstextfield_cell_class = classId;
}
//
@ -74,25 +77,24 @@ id gnustep_gui_nstextfield_cell_class = nil;
//
- init
{
return [self initWithFrame:NSZeroRect];
return [self initWithFrame:NSZeroRect];
}
- initWithFrame:(NSRect)frameRect
{
[super initWithFrame:frameRect];
[super initWithFrame:frameRect];
// set our cell
[self setCell:[[gnustep_gui_nstextfield_cell_class new] autorelease]];
[cell setState:1];
text_cursor = [[NSCursor IBeamCursor] retain];
// set our cell
[self setCell:[[gnustep_gui_nstextfield_cell_class new] autorelease]];
[cell setState:1];
text_cursor = [[NSCursor IBeamCursor] retain];
return self;
return self;
}
- (void)dealloc
{
[text_cursor release];
[super dealloc];
[text_cursor release];
[super dealloc];
}
//
@ -100,185 +102,116 @@ id gnustep_gui_nstextfield_cell_class = nil;
//
- (void)setTextCursor:(NSCursor *)aCursor
{
[aCursor retain];
[text_cursor release];
text_cursor = aCursor;
[aCursor retain];
[text_cursor release];
text_cursor = aCursor;
}
- copyWithZone:(NSZone *)zone
{
id c;
id c;
c = [super copyWithZone: zone];
c = [super copyWithZone: zone];
[c setTextCursor: [NSCursor IBeamCursor]];
[c setTextCursor: [NSCursor IBeamCursor]];
return c;
return c;
}
//
// Setting User Access to Text
//
- (BOOL)isEditable
{
return [cell isEditable];
}
- (BOOL)isSelectable
{
return [cell isSelectable];
}
- (void)setEditable:(BOOL)flag
{
[cell setEditable:flag];
}
- (void)setSelectable:(BOOL)flag
{
[cell setSelectable:flag];
}
- (BOOL)isEditable { return [cell isEditable]; }
- (BOOL)isSelectable { return [cell isSelectable]; }
- (void)setEditable:(BOOL)flag { [cell setEditable:flag]; }
- (void)setSelectable:(BOOL)flag { [cell setSelectable:flag]; }
//
// Editing Text
//
- (void)selectText:(id)sender
{
if ([[self window] makeFirstResponder:self])
[cell selectText:sender];
if ([[self window] makeFirstResponder:self])
[cell selectText:sender];
[self setNeedsDisplay:YES];
}
//
// Setting Tab Key Behavior
//
- (id)nextText
{
return next_text;
}
- (id)previousText
{
return previous_text;
}
- (id)nextText { return next_text; }
- (id)previousText { return previous_text; }
- (void)setNextText:(id)anObject
{
id t;
next_text = anObject;
// Tell the object that we are the previous text
// Unless it already knows that
if ([anObject respondsToSelector:@selector(setPreviousText:)])
{
t = [anObject previousText];
if (t != self)
[anObject setPreviousText:self];
}
id t;
// Tell the object that we
next_text = anObject; // are the previous text
// Unless it already is
if ([anObject respondsToSelector:@selector(setPreviousText:)])
{
t = [anObject previousText];
if (t != self)
[anObject setPreviousText:self];
}
}
- (void)setPreviousText:(id)anObject
{
id t;
previous_text = anObject;
// Tell the object that we are the next text
// Unless it already knows that
if ([anObject respondsToSelector:@selector(setNextText:)])
{
t = [anObject nextText];
if (t != self)
[anObject setNextText:self];
}
id t;
// Tell the object that we
previous_text = anObject; // are the next text
// Unless it already knows
if ([anObject respondsToSelector:@selector(setNextText:)])
{
t = [anObject nextText];
if (t != self)
[anObject setNextText:self];
}
}
//
// Assigning a Delegate
//
- (void)setDelegate:(id)anObject
{
text_delegate = anObject;
}
- (id)delegate
{
return text_delegate;
}
- (void)setDelegate:(id)anObject { text_delegate = anObject; }
- (id)delegate { return text_delegate; }
//
// Drawing
//
- (void)drawRect:(NSRect)rect
{
[cell drawWithFrame:rect inView:self];
- (void)drawRect:(NSRect)rect
{
[cell drawWithFrame:rect inView:self];
}
//
// Modifying Graphic Attributes
//
- (NSColor *)backgroundColor
{
return [cell backgroundColor];
}
- (BOOL)drawsBackground
{
return [cell drawsBackground];
}
- (BOOL)isBezeled
{
return [cell isBezeled];
}
- (BOOL)isBordered
{
return [cell isBordered];
}
- (void)setBackgroundColor:(NSColor *)aColor
{
[cell setBackgroundColor:aColor];
[cell setBackgroundColor:aColor];
}
- (void)setBezeled:(BOOL)flag
{
[cell setBezeled:flag];
}
- (void)setBordered:(BOOL)flag
{
[cell setBordered:flag];
}
- (void)setDrawsBackground:(BOOL)flag
{
[cell setDrawsBackground:flag];
}
- (void)setTextColor:(NSColor *)aColor
{
[cell setTextColor:aColor];
}
- (NSColor *)textColor
{
return [cell textColor];
}
- (id)selectedCell { return cell; }
- (NSColor *)backgroundColor { return [cell backgroundColor]; }
- (BOOL)drawsBackground { return [cell drawsBackground]; }
- (BOOL)isBezeled { return [cell isBezeled]; }
- (BOOL)isBordered { return [cell isBordered]; }
- (void)setBezeled:(BOOL)flag { [cell setBezeled:flag]; }
- (void)setBordered:(BOOL)flag { [cell setBordered:flag]; }
- (void)setDrawsBackground:(BOOL)flag { [cell setDrawsBackground:flag]; }
- (void)setTextColor:(NSColor *)aColor { [cell setTextColor:aColor]; }
- (NSColor *)textColor { return [cell textColor]; }
- (id)selectedCell { return cell; }
//
// Target and Action
//
- (SEL)errorAction
{
return error_action;
}
- (SEL)errorAction { return error_action; }
- (void)setErrorAction:(SEL)aSelector { error_action = aSelector; }
- (void)setErrorAction:(SEL)aSelector
- (void)displayRect:(NSRect)rect // not per OS spec FIX ME
{
error_action = aSelector;
[super displayRect:rect];
[window flushWindow];
}
//
@ -286,79 +219,84 @@ id gnustep_gui_nstextfield_cell_class = nil;
//
- (void)mouseDown:(NSEvent *)theEvent
{
// If not selectable then don't recognize the mouse down
if (![self isSelectable]) return;
NSPoint location;
// If not selectable then
if (![self isSelectable]) // don't recognize the
return; // mouse down
[[self window] makeFirstResponder:self];
fprintf(stderr, " TextField mouseDown --- ");
location = [self convertPoint:[theEvent locationInWindow] fromView:nil];
[self lockFocus];
[[self cell] _setCursorLocation:location];
[[self cell] _setCursorVisibility: YES];
[cell drawWithFrame:bounds inView:self];
[window flushWindow];
[self unlockFocus];
if ([[self window] makeFirstResponder:self])
[self setNeedsDisplay:YES];
}
- (void)mouseUp:(NSEvent *)theEvent
{
// If not selectable then don't recognize the mouse up
if (![self isSelectable]) return;
}
if (![self isSelectable]) // If not selectable then
return; // don't recognize the
} // mouse up
- (void)mouseMoved:(NSEvent *)theEvent
{
// If not selectable then don't recognize the mouse moved
if (![self isSelectable]) return;
}
if (![self isSelectable]) // If not selectable then
return; // don't recognize the
} // mouse moved
/*
* Get characters until you encounter
* a carriage return, return number of characters.
* Deal with backspaces, etc. Deal with Expose events
* on all windows associated with this application.
* Deal with keyboard remapping.
*/
- (void)keyDown:(NSEvent *)theEvent
{
unsigned int flags = [theEvent modifierFlags];
unsigned int key_code = [theEvent keyCode];
unsigned int flags = [theEvent modifierFlags];
unsigned int key_code = [theEvent keyCode];
id nextResponder;
// If SHIFT-TAB key then make the previous text the first responder
if ((key_code == 0x09) && (flags & NSShiftKeyMask))
{
if ([previous_text respondsToSelector:@selector(selectText:)])
// Either select the previous' text
[previous_text selectText:self];
else
// Or select ourself
[self selectText:self];
NSDebugLog(@"NSTextField: -keyDown %s\n", [[theEvent characters] cString]);
// Have the target perform the action
[self sendAction:[self action] to:[self target]];
// If TAB, SHIFT-TAB or RETURN key then make another text the first
// responder. This depends on key.
if (key_code == 0x09 || key_code == 0x0d) {
if (key_code == 0x09 && (flags & NSShiftKeyMask))
nextResponder = previous_text;
else
nextResponder = next_text;
return;
}
if ([nextResponder respondsToSelector:@selector(selectText:)])
// Either select the previous' text
[nextResponder selectText:self];
else
// Or select ourself
[self selectText:self];
// If TAB key then make the next text the first responder
if (key_code == 0x09)
{
if ([next_text respondsToSelector:@selector(selectText:)])
// Either select the next's text
[next_text selectText:self];
else
// Or select ourself
[self selectText:self];
// Have the target perform the action
[self sendAction:[self action] to:[self target]];
return;
}
// If RETURN key then make the next text the first responder
if (key_code == 0x0d)
{
if ([next_text respondsToSelector:@selector(selectText:)])
// Either select the next's text
[next_text selectText:self];
else
// Or select ourself
[self selectText:self];
// Have the target perform the action
[self sendAction:[self action] to:[self target]];
return;
}
// Have the target perform the action
[self sendAction:[self action] to:[self target]];
return;
}
// If not editable then don't recognize the key down
if (![self isEditable]) return;
// Hide the cursor during typing
[NSCursor hide];
[self lockFocus];
[[self cell] _handleKeyEvent:theEvent];
[cell drawWithFrame:bounds inView:self];
[window flushWindow];
[self unlockFocus];
// [self setNeedsDisplay:YES];
}
- (void)keyUp:(NSEvent *)theEvent

View file

@ -46,11 +46,18 @@
#include <AppKit/TrackingRectangle.h>
#include <AppKit/PSMatrix.h>
@implementation NSView
/* Class variables */
static NSString *nsview_thread_key = @"NSViewThreadKey";
//
// Class variables
//
static NSString *viewThreadKey = @"NSViewThreadKey";
//
// Class methods
//
+ (void)initialize
{
if (self == [NSView class])
@ -63,13 +70,13 @@ static NSString *nsview_thread_key = @"NSViewThreadKey";
+ (NSView *)focusView
{
NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
NSMutableArray *stack = [dict objectForKey: nsview_thread_key];
NSMutableArray *stack = [dict objectForKey: viewThreadKey];
NSView *current_view = nil;
if (stack)
{
unsigned count = [stack count];
// return the view at
if (stack) // the top of thread's
{ // focus stack or nil
unsigned count = [stack count]; // if none is focused
if (count > 0)
current_view = [stack objectAtIndex: --count];
}
@ -77,6 +84,9 @@ NSView *current_view = nil;
return current_view;
}
//
// Instance methods
//
- init
{
return [self initWithFrame:NSZeroRect];
@ -123,17 +133,17 @@ NSView *current_view = nil;
}
- (void)addSubview:(NSView *)aView
{ // make sure we aren't making
if ([self isDescendantOf:aView]) // self a subview of self
{
{ // make sure we are not
if ([self isDescendantOf:aView]) // making self a subview of
{ // self
NSLog(@"Operation addSubview: creates a loop in the views tree!\n");
return;
}
[aView viewWillMoveToWindow:window]; // Add to our subview
[aView setSuperview:self]; // list
[aView viewWillMoveToWindow:window];
[aView setSuperview:self];
[aView setNextResponder:self];
[sub_views addObject:(id)aView];
[sub_views addObject:(id)aView]; // Add to our subview list
}
- (void)addSubview:(NSView *)aView // may not be per OS spec
@ -273,7 +283,7 @@ NSSize old_size = bounds.size;
bounds.size = frame.size;
[frameMatrix setFrameOrigin:frame.origin];
[self resizeSubviewsWithOldSize: old_size]; // Resize subviews
[self resizeSubviewsWithOldSize: old_size]; // Resize the subviews
if (post_frame_changes)
[[NSNotificationCenter defaultCenter]
postNotificationName:NSViewFrameDidChangeNotification
@ -297,7 +307,7 @@ NSSize old_size = bounds.size;
frame.size = bounds.size = newSize;
[self resizeSubviewsWithOldSize: old_size]; // Resize subviews
[self resizeSubviewsWithOldSize: old_size]; // Resize the subviews
if (post_frame_changes)
[[NSNotificationCenter defaultCenter]
postNotificationName:NSViewFrameDidChangeNotification
@ -657,13 +667,13 @@ id e, o;
oldSize.width, oldSize.height);
}
- (void)allocateGState {} // implemented by the
- (void)releaseGState {} // back end
- (int)gState { return 0; }
- (void)renewGState {}
- (void)setUpGState {}
- (void)lockFocus {}
- (void)unlockFocus {}
- (void)allocateGState {} // implemented by the
- (void)releaseGState {} // back end
- (int)gState { return 0; }
- (void)renewGState {}
- (void)setUpGState {}
- (void)lockFocus { [self subclassResponsibility:_cmd]; }
- (void)unlockFocus { [self subclassResponsibility:_cmd]; }
- (BOOL)canDraw
{ // not implemented per

View file

@ -49,7 +49,8 @@
#include <AppKit/NSScreen.h>
#include <AppKit/NSCursor.h>
#include <AppKit/PSMatrix.h>
#include <AppKit/NSWindowView.h>
//*****************************************************************************
//
@ -67,13 +68,18 @@
if (self == [NSWindow class])
{
NSDebugLog(@"Initialize NSWindow class\n");
[self setVersion:2]; // Initial version
[self setVersion:2];
}
}
+ (NSView *)_windowViewWithFrame:(NSRect)frameRect // create the top view
{ // view in the view's
return nil; // heirarchy (backend)
}
+ (void)removeFrameUsingName:(NSString *)name
{ // Saving and restoring
} // the frame
} // the window's frame
+ (NSRect)contentRectForFrameRect:(NSRect)aRect
styleMask:(unsigned int)aStyle
@ -101,9 +107,6 @@
//
// Instance methods
//
//
// Initialization
//
- init
{
int style;
@ -213,7 +216,7 @@ NSView *wv;
// been created, create it
if ((!content_view) || ([content_view superview] == nil))
{
wv = [[NSWindowView alloc] initWithFrame: frame];
wv = [NSWindow _windowViewWithFrame: frame];
[wv viewWillMoveToWindow: self];
}
else
@ -611,14 +614,17 @@ NSView *v;
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
// Notify delegate
[nc postNotificationName: NSWindowWillCloseNotification object: self];
[self orderOut:self];
[self orderOut:self];
visible = NO;
// if app has no
if(![[NSApplication sharedApplication] mainMenu]) // menu terminate
[[NSApplication sharedApplication] terminate:self];
else if (is_released_when_closed) // otherwise just
[self autorelease]; // release self
}
else
{ // else if should
if (is_released_when_closed) // release do so
[self autorelease]; // default is YES
} // for windows and
} // NO for panels
- (void)deminiaturize:sender
{
@ -1022,17 +1028,17 @@ NSView *v;
- validRequestorForSendType:(NSString *)sendType
returnType:(NSString *)returnType
{
id result = nil;
id result = nil;
if (delegate && [delegate respondsToSelector: _cmd])
result = [delegate validRequestorForSendType: sendType
returnType: returnType];
if (delegate && [delegate respondsToSelector: _cmd])
result = [delegate validRequestorForSendType: sendType
returnType: returnType];
if (result == nil)
result = [[NSApplication sharedApplication]
validRequestorForSendType: sendType
returnType: returnType];
return result;
if (result == nil)
result = [[NSApplication sharedApplication]
validRequestorForSendType: sendType
returnType: returnType];
return result;
}
//

View file

@ -1,42 +0,0 @@
/*
NSWindowView.m
View which handles drawing the window decorations and filling
the window with the background color.
Copyright (C) 1997 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: November 1997
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: November 1998
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <AppKit/NSWindowView.h>
@implementation NSWindowView
//
// The backend will have to fill in the implementation
//
- (BOOL)isOpaque { return YES; }
@end

View file

@ -321,7 +321,7 @@ NSString *NSBaselineOffsetAttributeName = @"NSBaselineOffsetAttributeName";
NSString *NSKernAttributeName = @"NSKernAttributeName";
/* Drawing engine externs */
GPSDrawContext *_currentGPSContext;
GSContext *_currentGSContext;
NSString *DPSconfigurationerror = @"DPSconfigurationerror";
NSString *DPSinvalidaccess = @"DPSinvalidaccess";

View file

@ -1,794 +0,0 @@
/* gpsops - PostScript operators and mappings to current context
Copyright (C) 1995 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@gnu.org>
Date: Nov 1998
This file is part of the GNU Objective C User Interface library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "AppKit/GPSDrawContext.h"
/* ----------------------------------------------------------------------- */
/* Color operations */
/* ----------------------------------------------------------------------- */
void GScolorimage( void )
{
[_currentGPSContext DPScolorimage];
}
void GScurrentblackgeneration( void )
{
[_currentGPSContext DPScurrentblackgeneration];
}
void GScurrentcmykcolor(float *c, float *m, float *y, float *k)
{
[_currentGPSContext DPScurrentcmykcolor:c :m :y :k];
}
void GScurrentcolorscreen( void )
{
[_currentGPSContext DPScurrentcolorscreen];
}
void GScurrentcolortransfer( void )
{
[_currentGPSContext DPScurrentcolortransfer];
}
void GScurrentundercolorremoval( void )
{
[_currentGPSContext DPScurrentundercolorremoval];
}
void GSsetblackgeneration( void )
{
[_currentGPSContext DPSsetblackgeneration];
}
void GSsetcmykcolor(float c, float m, float y, float k)
{
[_currentGPSContext DPSsetcmykcolor: c : m : y : k];
}
void GSsetcolorscreen( void )
{
[_currentGPSContext DPSsetcolorscreen];
}
void GSsetcolortransfer( void )
{
[_currentGPSContext DPSsetcolortransfer];
}
void GSsetundercolorremoval( void )
{
[_currentGPSContext DPSsetundercolorremoval];
}
/* ----------------------------------------------------------------------- */
/* Font operations */
/* ----------------------------------------------------------------------- */
void GSFontDirectory( void )
{
[_currentGPSContext DPSFontDirectory];
}
void GSISOLatin1Encoding( void )
{
[_currentGPSContext DPSISOLatin1Encoding];
}
void GSSharedFontDirectory( void )
{
[_currentGPSContext DPSSharedFontDirectory];
}
void GSStandardEncoding( void )
{
[_currentGPSContext DPSStandardEncoding];
}
void GScachestatus(int *bsize, int *bmax, int *msize)
{
[_currentGPSContext DPScachestatus: bsize : bmax : msize];
}
void GScurrentcacheparams( void )
{
[_currentGPSContext DPScurrentcacheparams];
}
void GScurrentfont( void )
{
[_currentGPSContext DPScurrentfont];
}
void GSdefinefont( void )
{
[_currentGPSContext DPSdefinefont];
}
void GSfindfont(const char *name)
{
[_currentGPSContext DPSfindfont: name];
}
void GSmakefont( void )
{
[_currentGPSContext DPSmakefont];
}
void GSscalefont(float size)
{
[_currentGPSContext DPSscalefont: size];
}
void GSselectfont(const char *name, float scale)
{
[_currentGPSContext DPSselectfont: name : scale];
}
void GSsetcachedevice(float wx, float wy, float llx, float lly, float urx, float ury)
{
[_currentGPSContext DPSsetcachedevice: wy : wy : lly : lly : urx : ury];
}
void GSsetcachelimit(float n)
{
[_currentGPSContext DPSsetcachelimit: n];
}
void GSsetcacheparams( void )
{
[_currentGPSContext DPSsetcacheparams];
}
void GSsetcharwidth(float wx, float wy)
{
[_currentGPSContext DPSsetcharwidth: wx : wy];
}
void GSsetfont(int f)
{
[_currentGPSContext DPSsetfont: f];
}
void GSundefinefont(const char *name)
{
[_currentGPSContext DPSundefinefont: name];
}
/* ----------------------------------------------------------------------- */
/* Gstate operations */
/* ----------------------------------------------------------------------- */
void
GSconcat(const float m[])
{
[_currentGPSContext DPSconcat: m];
}
void
GScurrentdash( void )
{
[_currentGPSContext DPScurrentdash];
}
void GScurrentflat(float *flatness)
{
[_currentGPSContext DPScurrentflat: flatness];
}
void GScurrentgray(float *gray)
{
[_currentGPSContext DPScurrentgray: gray];
}
void GScurrentgstate(int gst)
{
[_currentGPSContext DPScurrentgstate: gst];
}
void GScurrenthalftone( void )
{
[_currentGPSContext DPScurrenthalftone];
}
void GScurrenthalftonephase(float *x, float *y)
{
[_currentGPSContext DPScurrenthalftonephase: x : y];
}
void GScurrenthsbcolor(float *h, float *s, float *b)
{
[_currentGPSContext DPScurrenthsbcolor: h : s : b];
}
void GScurrentlinecap(int *linecap)
{
[_currentGPSContext DPScurrentlinecap: linecap];
}
void GScurrentlinejoin(int *linejoin)
{
[_currentGPSContext DPScurrentlinejoin: linejoin];
}
void GScurrentlinewidth(float *width)
{
[_currentGPSContext DPScurrentlinewidth: width];
}
void GScurrentmatrix( void )
{
[_currentGPSContext DPScurrentmatrix];
}
void GScurrentmiterlimit(float *limit)
{
[_currentGPSContext DPScurrentmiterlimit: limit];
}
void GScurrentpoint(float *x, float *y)
{
[_currentGPSContext DPScurrentpoint: x : y];
}
void GScurrentrgbcolor(float *r, float *g, float *b)
{
[_currentGPSContext DPScurrentrgbcolor: r : g : b];
}
void GScurrentscreen( void )
{
[_currentGPSContext DPScurrentscreen];
}
void GScurrentstrokeadjust(int *b)
{
[_currentGPSContext DPScurrentstrokeadjust: b];
}
void GScurrenttransfer( void )
{
[_currentGPSContext DPScurrenttransfer];
}
void GSdefaultmatrix( void )
{
[_currentGPSContext DPSdefaultmatrix];
}
void GSgrestore( void )
{
[_currentGPSContext DPSgrestore];
}
void GSgrestoreall( void )
{
[_currentGPSContext DPSgrestoreall];
}
void GSgsave( void )
{
[_currentGPSContext DPSgsave];
}
void GSgstate( void )
{
[_currentGPSContext DPSgstate];
}
void GSinitgraphics( void )
{
[_currentGPSContext DPSinitgraphics];
}
void GSinitmatrix( void )
{
[_currentGPSContext DPSinitmatrix];
}
void GSrotate(float angle)
{
[_currentGPSContext DPSrotate: angle];
}
void GSscale(float x, float y)
{
[_currentGPSContext DPSscale: x : y];
}
void GSsetdash(const float pat[], int size, float offset)
{
[_currentGPSContext DPSsetdash: pat : size : offset];
}
void GSsetflat(float flatness)
{
[_currentGPSContext DPSsetflat: flatness];
}
void GSsetgray(float gray)
{
[_currentGPSContext DPSsetgray: gray];
}
void GSsetgstate(int gst)
{
[_currentGPSContext DPSsetgstate: gst];
}
void GSsethalftone( void )
{
[_currentGPSContext DPSsethalftone];
}
void GSsethalftonephase(float x, float y)
{
[_currentGPSContext DPSsethalftonephase: x : y];
}
void GSsethsbcolor(float h, float s, float b)
{
[_currentGPSContext DPSsethsbcolor: h : s : b];
}
void GSsetlinecap(int linecap)
{
[_currentGPSContext DPSsetlinecap: linecap];
}
void GSsetlinejoin(int linejoin)
{
[_currentGPSContext DPSsetlinejoin: linejoin];
}
void GSsetlinewidth(float width)
{
[_currentGPSContext DPSsetlinewidth: width];
}
void GSsetmatrix( void )
{
[_currentGPSContext DPSsetmatrix];
}
void GSsetmiterlimit(float limit)
{
[_currentGPSContext DPSsetmiterlimit: limit];
}
void GSsetrgbcolor(float r, float g, float b)
{
[_currentGPSContext DPSsetrgbcolor: r : g : b];
}
void GSsetscreen( void )
{
[_currentGPSContext DPSsetscreen];
}
void GSsetstrokeadjust(int b)
{
[_currentGPSContext DPSsetstrokeadjust: b];
}
void GSsettransfer( void )
{
[_currentGPSContext DPSsettransfer];
}
void GStranslate(float x, float y)
{
[_currentGPSContext DPStranslate: x : y];
}
/* ----------------------------------------------------------------------- */
/* I/O operations */
/* ----------------------------------------------------------------------- */
void GSflush( void )
{
[_currentGPSContext DPSflush];
}
/* ----------------------------------------------------------------------- */
/* Matrix operations */
/* ----------------------------------------------------------------------- */
void GSconcatmatrix( void )
{
[_currentGPSContext DPSconcatmatrix];
}
void GSdtransform(float x1, float y1, float *x2, float *y2)
{
[_currentGPSContext DPSdtransform: x1 : y1 : x2 : y2];
}
void GSidentmatrix( void )
{
[_currentGPSContext DPSidentmatrix];
}
void GSidtransform(float x1, float y1, float *x2, float *y2)
{
[_currentGPSContext DPSidtransform: x1 : y1 : x2 : y2];
}
void GSinvertmatrix( void )
{
[_currentGPSContext DPSinvertmatrix];
}
void GSitransform(float x1, float y1, float *x2, float *y2)
{
[_currentGPSContext DPSitransform: x1 : y1 : x2 : y2];
}
void GStransform(float x1, float y1, float *x2, float *y2)
{
[_currentGPSContext DPStransform: x1 : y1 : x2 : y2];
}
/* ----------------------------------------------------------------------- */
/* Paint operations */
/* ----------------------------------------------------------------------- */
void GSashow(float x, float y, const char *s)
{
[_currentGPSContext DPSashow: x : y : s];
}
void GSawidthshow(float cx, float cy, int c, float ax, float ay, const char *s)
{
[_currentGPSContext DPSawidthshow: cx : cy : c : ax : ay : s];
}
void GScopypage( void )
{
[_currentGPSContext DPScopypage];
}
void GSeofill( void )
{
[_currentGPSContext DPSeofill];
}
void GSerasepage( void )
{
[_currentGPSContext DPSerasepage];
}
void GSfill( void )
{
[_currentGPSContext DPSfill];
}
void GSimage( void )
{
[_currentGPSContext DPSimage];
}
void GSimagemask( void )
{
[_currentGPSContext DPSimagemask];
}
void GSkshow(const char *s)
{
[_currentGPSContext DPSkshow: s];
}
void GSrectfill(float x, float y, float w, float h)
{
[_currentGPSContext DPSrectfill: x : y : w : h];
}
void GSrectstroke(float x, float y, float w, float h)
{
[_currentGPSContext DPSrectstroke: x : y : w : h];
}
void GSshow(const char *s)
{
[_currentGPSContext DPSshow: s];
}
void GSshowpage( void )
{
[_currentGPSContext DPSshowpage];
}
void GSstroke( void )
{
[_currentGPSContext DPSstroke];
}
void GSstrokepath( void )
{
[_currentGPSContext DPSstrokepath];
}
void GSueofill(const char nums[], int n, const char ops[], int l)
{
[_currentGPSContext DPSueofill: nums : n : ops : l];
}
void GSufill(const char nums[], int n, const char ops[], int l)
{
[_currentGPSContext DPSufill: nums : n : ops : l];
}
void GSustroke(const char nums[], int n, const char ops[], int l)
{
[_currentGPSContext DPSustroke: nums : n : ops : l];
}
void GSustrokepath(const char nums[], int n, const char ops[], int l)
{
[_currentGPSContext DPSustrokepath: nums : n : ops : l];
}
void GSwidthshow(float x, float y, int c, const char *s)
{
[_currentGPSContext DPSwidthshow: x : y : c : s];
}
void GSxshow(const char *s, const float numarray[], int size)
{
[_currentGPSContext DPSxshow: s : numarray : size];
}
void GSxyshow(const char *s, const float numarray[], int size)
{
[_currentGPSContext DPSxyshow: s : numarray : size];
}
void GSyshow(const char *s, const float numarray[], int size)
{
[_currentGPSContext DPSyshow: s : numarray : size];
}
/* ----------------------------------------------------------------------- */
/* Path operations */
/* ----------------------------------------------------------------------- */
void GSarc(float x, float y, float r, float angle1, float angle2)
{
[_currentGPSContext DPSarc: x : y : r : angle1 : angle2];
}
void GSarcn(float x, float y, float r, float angle1, float angle2)
{
[_currentGPSContext DPSarcn: x : y : r : angle1 : angle2];
}
void GSarct(float x1, float y1, float x2, float y2, float r)
{
[_currentGPSContext DPSarct: x1 : y1 : x2 : y2 : r];
}
void GSarcto(float x1, float y1, float x2, float y2, float r, float *xt1, float *yt1, float *xt2, float *yt2)
{
[_currentGPSContext DPSarcto: x1 : y1 : x2 : y2 : r : xt1 : yt1 : xt2 : yt2];
}
void GScharpath(const char *s, int b)
{
[_currentGPSContext DPScharpath: s : b];
}
void GSclip( void )
{
[_currentGPSContext DPSclip];
}
void GSclippath( void )
{
[_currentGPSContext DPSclippath];
}
void GSclosepath( void )
{
[_currentGPSContext DPSclosepath];
}
void GScurveto(float x1, float y1, float x2, float y2, float x3, float y3)
{
[_currentGPSContext DPScurveto: x1 : y1 : x2 : y2 : x3 : y3];
}
void GSeoclip( void )
{
[_currentGPSContext DPSeoclip];
}
void GSeoviewclip( void )
{
[_currentGPSContext DPSeoviewclip];
}
void GSflattenpath( void )
{
[_currentGPSContext DPSflattenpath];
}
void GSinitclip( void )
{
[_currentGPSContext DPSinitclip];
}
void GSinitviewclip( void )
{
[_currentGPSContext DPSinitviewclip];
}
void GSlineto(float x, float y)
{
[_currentGPSContext DPSlineto: x : y];
}
void GSmoveto(float x, float y)
{
[_currentGPSContext DPSmoveto: x : y];
}
void GSnewpath( void )
{
[_currentGPSContext DPSnewpath];
}
void GSpathbbox(float *llx, float *lly, float *urx, float *ury)
{
[_currentGPSContext DPSpathbbox: llx : lly : urx : ury];
}
void GSpathforall( void )
{
[_currentGPSContext DPSpathforall];
}
void GSrcurveto(float x1, float y1, float x2, float y2, float x3, float y3)
{
[_currentGPSContext DPSrcurveto: x1 : y1 : x2 : y2 : x3 : y3];
}
void GSrectclip(float x, float y, float w, float h)
{
[_currentGPSContext DPSrectclip: x : y : w : h];
}
void GSrectviewclip(float x, float y, float w, float h)
{
[_currentGPSContext DPSrectviewclip: x : y : w : h];
}
void GSreversepath( void )
{
[_currentGPSContext DPSreversepath];
}
void GSrlineto(float x, float y)
{
[_currentGPSContext DPSrlineto: x : y];
}
void GSrmoveto(float x, float y)
{
[_currentGPSContext DPSrmoveto: x : y];
}
void GSsetbbox(float llx, float lly, float urx, float ury)
{
[_currentGPSContext DPSsetbbox: llx : lly : urx : ury];
}
void GSsetucacheparams( void )
{
[_currentGPSContext DPSsetucacheparams];
}
void GSuappend(const char nums[], int n, const char ops[], int l)
{
[_currentGPSContext DPSuappend: nums : n : ops : l];
}
void GSucache( void )
{
[_currentGPSContext DPSucache];
}
void GSucachestatus( void )
{
[_currentGPSContext DPSucachestatus];
}
void GSupath(int b)
{
[_currentGPSContext DPSupath: b];
}
void GSviewclip( void )
{
[_currentGPSContext DPSviewclip];
}
void GSviewclippath( void )
{
[_currentGPSContext DPSviewclippath];
}
/* ----------------------------------------------------------------------- */
/* X operations */
/* ----------------------------------------------------------------------- */
void GScurrentXdrawingfunction(int *function)
{
[_currentGPSContext DPScurrentXdrawingfunction: function];
}
void GScurrentXgcdrawable(int *gc, int *draw, int *x, int *y)
{
[_currentGPSContext DPScurrentXgcdrawable: gc : draw : x : y];
}
void GScurrentXgcdrawablecolor(int *gc, int *draw, int *x, int *y,
int colorInfo[])
{
[_currentGPSContext DPScurrentXgcdrawablecolor: gc : draw : x : y : colorInfo];
}
void GScurrentXoffset(int *x, int *y)
{
[_currentGPSContext DPScurrentXoffset: x : y];
}
void GSsetXdrawingfunction(int function)
{
[_currentGPSContext DPSsetXdrawingfunction: function];
}
void GSsetXgcdrawable(int gc, int draw, int x, int y)
{
[_currentGPSContext DPSsetXgcdrawable: gc : draw : x : y];
}
void GSsetXgcdrawablecolor(int gc, int draw, int x, int y,
const int colorInfo[])
{
[_currentGPSContext DPSsetXgcdrawablecolor: gc : draw : x : y : colorInfo];
}
void GSsetXoffset(short int x, short int y)
{
[_currentGPSContext DPSsetXoffset: x : y];
}
void GSsetXrgbactual(double r, double g, double b, int *success)
{
[_currentGPSContext DPSsetXrgbactual: r : g : b : success];
}

View file

@ -5,7 +5,7 @@
#
# Author: Adam Fedor <fedor@gnu.org>
#
# This file is part of the GNUstep GUI X/DPS Backend.
# This file is part of the GNUstep GUI frontend (AppKit).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public