Change backend initialization

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3428 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 1998-12-10 19:53:41 +00:00
parent 8d0237fbfa
commit 81abcf1f75
13 changed files with 492 additions and 43 deletions

View file

@ -1,3 +1,24 @@
Thu Dec 10 15:03:05 1998 Adam Fedor <fedor@ultra.doc.com>
* Headers/gnustep/gui/GSContext.h: New backend initialization.
* Headers/gnustep/gui/NSApplication.h: Remove backend
initialization declaration.
* Source/Functions.m (initialize_gnustep_backend): New function.
* Source/GSContext.m (+initialize): Set up method table.
(+initializeGUIBackend): New method.
(+initializeMethodTable): Likewise.
* Headers/gnustep/gui/NSScreen.h: New ivars.
* Source/NSScreen.m: Use them.
* Headers/gnustep/gui/NSStringDrawing.h: New methods.
* Source/NSStringDrawing.m: Implement stub.
* Source/GNUServicesManager.m (-registerAsServiceProvider): Add
exception handler.
* Tools/GNUmakefile: Don't make example tool.
Thu Dec 10 1998 Felipe A. Rodriguez <far@ix.netcom.com>
* NSWindow.h change window style enum to match WindowMaker's definition.

View file

@ -32,6 +32,7 @@
#define _GSContext_h_INCLUDE
#include <Foundation/NSObject.h>
#include <AppKit/gsdefs.h>
#include <stdarg.h>
@class NSMutableData;
@ -78,14 +79,22 @@ typedef enum _NSWindowOrderingMode {
} NSWindowOrderingMode;
extern NSString *NSBackendContext;
@interface GSContext : NSObject
{
NSDictionary *context_info;
NSMutableData *context_data;
@public
const gsMethodTable *methods;
}
//
// Setup the Backend library
//
+ (void) initializeGUIBackend;
//
// Setting and Identifying the concrete class
//

View file

@ -296,7 +296,7 @@ extern NSString *NSEventTrackingRunLoopMode;
/* Backend functions */
extern BOOL initialize_gnustep_backend (void);
extern void initialize_gnustep_backend (void);
//

View file

@ -39,6 +39,8 @@
@interface NSScreen : NSObject
{
// Attributes
NSWindowDepth depth;
NSRect frame;
NSMutableDictionary *device_desc;
// Reserved for backend use

View file

@ -67,6 +67,8 @@ enum
@interface NSString (NSStringDrawing)
- (void) drawAtPoint: (NSPoint)aPoint withAttributes: (NSDictionary *)attr;
- (void) drawInRect: (NSRect)aRect withAttributes: (NSDictionary *)attr;
- (NSSize)sizeWithAttributes:(NSDictionary *)attrs;
@end

View file

@ -32,8 +32,6 @@
/* Define NSDebugLog if not defined */
#include <Foundation/NSDebug.h>
extern BOOL initialize_gnustep_backend (void);
#ifndef OBJC_MALLOC
# define OBJC_MALLOC(pointer, type, elements) \
(pointer = calloc (sizeof(type), elements))

View file

@ -32,7 +32,7 @@
#include <AppKit/NSApplication.h>
#include <AppKit/NSEvent.h>
#include <AppKit/GSContext.h>
char **NSArgv = NULL;
@ -60,6 +60,12 @@ extern char** environ;
return 0;
}
void
initialize_gnustep_backend(void)
{
[GSContext initializeGUIBackend];
}
//
// Convert an NSEvent Type to it's respective Event Mask
//

View file

@ -726,7 +726,12 @@ static NSString *disabledName = @".GNUstepDisabled";
NSString *appName;
appName = [[[NSProcessInfo processInfo] processName] lastPathComponent];
NSRegisterServicesProvider(self, appName);
NS_DURING
NSRegisterServicesProvider(self, appName);
NS_HANDLER
NSLog(@"Warning: Could not access services due to exception: %@\n",
[localException reason]);
NS_ENDHANDLER
}
/*

View file

@ -32,13 +32,15 @@
#include <Foundation/NSString.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSValue.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSException.h>
#include <Foundation/NSData.h>
#include <Foundation/NSZone.h>
#include <Foundation/NSUserDefaults.h>
#include "AppKit/GSContext.h"
NSZone *_globalGSZone = NULL; // The memory zone where all
// global objects are allocated
// from (Contexts are also
@ -46,10 +48,28 @@ NSZone *_globalGSZone = NULL; // The memory zone where all
//
// Class variables
//
static Class _concreteClass; // actual class of GSContext
static Class _concreteClass; // actual class of GSContext
static NSMutableArray *contextList; // list of drawing destinations
static BOOL _gnustepBackendInitialized = NO;
extern GSContext *_currentGSContext;
/* Class variable for holding pointers to method functions */
static NSMutableDictionary *classMethodTable;
static NSString *knownBackends[] = {
@"XGContext",
@"XRContext",
nil
};
@interface GSContext (Backend)
+ (void) _initializeGUIBackend;
@end
@interface GSContext (Private)
+ (gsMethodTable *) _initializeMethodTable;
@end
@implementation GSContext
@ -60,12 +80,47 @@ static NSMutableArray *contextList; // list of drawing destinations
{
if (self == (_concreteClass = [GSContext class]))
{
contextList = [[NSMutableArray arrayWithCapacity:2] retain];
_globalGSZone = NSDefaultMallocZone();
contextList = [[NSMutableArray allocWithZone: _globalGSZone] init];
classMethodTable =
[[NSMutableDictionary allocWithZone: _globalGSZone] init];
NSDebugLog(@"Initialize GSContext class\n");
[self setVersion:1]; // Initial version
}
}
+ (void) initializeGUIBackend
{
NSString *backend;
if (_gnustepBackendInitialized)
{
NSLog(@"Invalid initialization: Backend already initialized\n");
return;
}
backend = [[NSUserDefaults standardUserDefaults]
stringForKey: NSBackendContext];
if (backend)
_concreteClass = NSClassFromString(backend);
if (!_concreteClass || _concreteClass == [GSContext class])
{
/* No backend class set, or class not found */
int i = 0;
_concreteClass = Nil;
while (knownBackends[i])
if ((_concreteClass = NSClassFromString(knownBackends[i++])))
break;
}
if (!_concreteClass)
{
NSLog(@"Invalid initialization: No backend found\n");
return;
}
[_concreteClass _initializeGUIBackend];
}
+ (void) setConcreteClass: (Class)c { _concreteClass = c; }
+ (Class) concreteClass { return _concreteClass; }
@ -86,11 +141,11 @@ GSContext *context;
return context;
}
+ (GSContext *) currentContext { return nil;} // backend
+ (GSContext *) currentContext { return _currentGSContext;}
+ (void) setCurrentContext: (GSContext *)context
{
[self subclassResponsibility:_cmd]; // backend
_currentGSContext = context;
}
+ (void) destroyContext:(GSContext *) context
@ -125,7 +180,13 @@ int top; // deallocated with the
[contextList addObject: self];
[_concreteClass setCurrentContext: self];
if (!(methods = [[classMethodTable objectForKey: [self class]] pointerValue]))
{
methods = [[self class] _initializeMethodTable];
[classMethodTable setObject: [NSValue valueWithPointer: methods]
forKey: [self class]];
}
if(info)
context_info = [info retain];
@ -148,3 +209,361 @@ int top; // deallocated with the
}
@end
@implementation GSContext (Private)
/* Build up method table for fast access to methods. Cast to (void *) to
avoid compiler warnings */
+ (gsMethodTable *) _initializeMethodTable
{
gsMethodTable methodTable;
gsMethodTable *mptr;
/* ----------------------------------------------------------------------- */
/* Color operations */
/* ----------------------------------------------------------------------- */
methodTable.DPScurrentcmykcolor____ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentcmykcolor::::)];
methodTable.DPSsetcmykcolor____ = (void *)[self instanceMethodForSelector:
@selector(DPSsetcmykcolor::::)];
/* ----------------------------------------------------------------------- */
/* Data operations */
/* ----------------------------------------------------------------------- */
methodTable.DPSclear = (void *)[self instanceMethodForSelector:
@selector(DPSclear)];
methodTable.DPScleartomark = (void *)[self instanceMethodForSelector:
@selector(DPScleartomark)];
methodTable.DPScopy_ = (void *)[self instanceMethodForSelector:
@selector(DPScopy:)];
methodTable.DPScount_ = (void *)[self instanceMethodForSelector:
@selector(DPScount:)];
methodTable.DPScounttomark_ = (void *)[self instanceMethodForSelector:
@selector(DPScounttomark:)];
methodTable.DPSdup = (void *)[self instanceMethodForSelector:
@selector(DPSdup)];
methodTable.DPSexch = (void *)[self instanceMethodForSelector:
@selector(DPSexch)];
methodTable.DPSexecstack = (void *)[self instanceMethodForSelector:
@selector(DPSexecstack)];
methodTable.DPSget = (void *)[self instanceMethodForSelector:
@selector(DPSget)];
methodTable.DPSindex_ = (void *)[self instanceMethodForSelector:
@selector(DPSindex:)];
methodTable.DPSmark = (void *)[self instanceMethodForSelector:
@selector(DPSmark)];
methodTable.DPSmatrix = (void *)[self instanceMethodForSelector:
@selector(DPSmatrix)];
methodTable.DPSnull = (void *)[self instanceMethodForSelector:
@selector(DPSnull)];
methodTable.DPSpop = (void *)[self instanceMethodForSelector:
@selector(DPSpop)];
methodTable.DPSput = (void *)[self instanceMethodForSelector:
@selector(DPSput)];
methodTable.DPSroll__ = (void *)[self instanceMethodForSelector:
@selector(DPSroll::)];
/* ----------------------------------------------------------------------- */
/* Font operations */
/* ----------------------------------------------------------------------- */
methodTable.DPSFontDirectory = (void *)[self instanceMethodForSelector:
@selector(DPSFontDirectory)];
methodTable.DPSISOLatin1Encoding = (void *)[self instanceMethodForSelector:
@selector(DPSISOLatin1Encoding)];
methodTable.DPSSharedFontDirectory = (void *)[self instanceMethodForSelector:
@selector(DPSSharedFontDirectory)];
methodTable.DPSStandardEncoding = (void *)[self instanceMethodForSelector:
@selector(DPSStandardEncoding)];
methodTable.DPScurrentcacheparams = (void *)[self instanceMethodForSelector:
@selector(DPScurrentcacheparams)];
methodTable.DPScurrentfont = (void *)[self instanceMethodForSelector:
@selector(DPScurrentfont)];
methodTable.DPSdefinefont = (void *)[self instanceMethodForSelector:
@selector(DPSdefinefont)];
methodTable.DPSfindfont_ = (void *)[self instanceMethodForSelector:
@selector(DPSfindfont:)];
methodTable.DPSmakefont = (void *)[self instanceMethodForSelector:
@selector(DPSmakefont)];
methodTable.DPSscalefont_ = (void *)[self instanceMethodForSelector:
@selector(DPSscalefont:)];
methodTable.DPSselectfont__ = (void *)[self instanceMethodForSelector:
@selector(DPSselectfont::)];
methodTable.DPSsetfont_ = (void *)[self instanceMethodForSelector:
@selector(DPSsetfont:)];
methodTable.DPSundefinefont_ = (void *)[self instanceMethodForSelector:
@selector(DPSundefinefont:)];
/* ----------------------------------------------------------------------- */
/* Gstate operations */
/* ----------------------------------------------------------------------- */
methodTable.DPSconcat_ = (void *)[self instanceMethodForSelector:
@selector(DPSconcat:)];
methodTable.DPScurrentdash = (void *)[self instanceMethodForSelector:
@selector(DPScurrentdash)];
methodTable.DPScurrentflat_ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentflat:)];
methodTable.DPScurrentgray_ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentgray:)];
methodTable.DPScurrentgstate_ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentgstate:)];
methodTable.DPScurrenthalftone = (void *)[self instanceMethodForSelector:
@selector(DPScurrenthalftone)];
methodTable.DPScurrenthalftonephase__ = (void *)[self instanceMethodForSelector:
@selector(DPScurrenthalftonephase::)];
methodTable.DPScurrenthsbcolor___ = (void *)[self instanceMethodForSelector:
@selector(DPScurrenthsbcolor:::)];
methodTable.DPScurrentlinecap_ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentlinecap:)];
methodTable.DPScurrentlinejoin_ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentlinejoin:)];
methodTable.DPScurrentlinewidth_ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentlinewidth:)];
methodTable.DPScurrentmatrix = (void *)[self instanceMethodForSelector:
@selector(DPScurrentmatrix)];
methodTable.DPScurrentmiterlimit_ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentmiterlimit:)];
methodTable.DPScurrentpoint__ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentpoint::)];
methodTable.DPScurrentrgbcolor___ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentrgbcolor:::)];
methodTable.DPScurrentscreen = (void *)[self instanceMethodForSelector:
@selector(DPScurrentscreen)];
methodTable.DPScurrentstrokeadjust_ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentstrokeadjust:)];
methodTable.DPScurrenttransfer = (void *)[self instanceMethodForSelector:
@selector(DPScurrenttransfer)];
methodTable.DPSdefaultmatrix = (void *)[self instanceMethodForSelector:
@selector(DPSdefaultmatrix)];
methodTable.DPSgrestore = (void *)[self instanceMethodForSelector:
@selector(DPSgrestore)];
methodTable.DPSgrestoreall = (void *)[self instanceMethodForSelector:
@selector(DPSgrestoreall)];
methodTable.DPSgsave = (void *)[self instanceMethodForSelector:
@selector(DPSgsave)];
methodTable.DPSgstate = (void *)[self instanceMethodForSelector:
@selector(DPSgstate)];
methodTable.DPSinitgraphics = (void *)[self instanceMethodForSelector:
@selector(DPSinitgraphics)];
methodTable.DPSinitmatrix = (void *)[self instanceMethodForSelector:
@selector(DPSinitmatrix)];
methodTable.DPSrotate_ = (void *)[self instanceMethodForSelector:
@selector(DPSrotate:)];
methodTable.DPSscale__ = (void *)[self instanceMethodForSelector:
@selector(DPSscale::)];
methodTable.DPSsetdash___ = (void *)[self instanceMethodForSelector:
@selector(DPSsetdash:::)];
methodTable.DPSsetflat_ = (void *)[self instanceMethodForSelector:
@selector(DPSsetflat:)];
methodTable.DPSsetgray_ = (void *)[self instanceMethodForSelector:
@selector(DPSsetgray:)];
methodTable.DPSsetgstate_ = (void *)[self instanceMethodForSelector:
@selector(DPSsetgstate:)];
methodTable.DPSsethalftone = (void *)[self instanceMethodForSelector:
@selector(DPSsethalftone)];
methodTable.DPSsethalftonephase__ = (void *)[self instanceMethodForSelector:
@selector(DPSsethalftonephase::)];
methodTable.DPSsethsbcolor___ = (void *)[self instanceMethodForSelector:
@selector(DPSsethsbcolor:::)];
methodTable.DPSsetlinecap_ = (void *)[self instanceMethodForSelector:
@selector(DPSsetlinecap:)];
methodTable.DPSsetlinejoin_ = (void *)[self instanceMethodForSelector:
@selector(DPSsetlinejoin:)];
methodTable.DPSsetlinewidth_ = (void *)[self instanceMethodForSelector:
@selector(DPSsetlinewidth:)];
methodTable.DPSsetmatrix = (void *)[self instanceMethodForSelector:
@selector(DPSsetmatrix)];
methodTable.DPSsetmiterlimit_ = (void *)[self instanceMethodForSelector:
@selector(DPSsetmiterlimit:)];
methodTable.DPSsetrgbcolor___ = (void *)[self instanceMethodForSelector:
@selector(DPSsetrgbcolor:::)];
methodTable.DPSsetscreen = (void *)[self instanceMethodForSelector:
@selector(DPSsetscreen)];
methodTable.DPSsetstrokeadjust_ = (void *)[self instanceMethodForSelector:
@selector(DPSsetstrokeadjust:)];
methodTable.DPSsettransfer = (void *)[self instanceMethodForSelector:
@selector(DPSsettransfer)];
methodTable.DPStranslate__ = (void *)[self instanceMethodForSelector:
@selector(DPStranslate::)];
/* ----------------------------------------------------------------------- */
/* Matrix operations */
/* ----------------------------------------------------------------------- */
methodTable.DPSconcatmatrix = (void *)[self instanceMethodForSelector:
@selector(DPSconcatmatrix)];
methodTable.DPSdtransform____ = (void *)[self instanceMethodForSelector:
@selector(DPSdtransform::::)];
methodTable.DPSidentmatrix = (void *)[self instanceMethodForSelector:
@selector(DPSidentmatrix)];
methodTable.DPSidtransform____ = (void *)[self instanceMethodForSelector:
@selector(DPSidtransform::::)];
methodTable.DPSinvertmatrix = (void *)[self instanceMethodForSelector:
@selector(DPSinvertmatrix)];
methodTable.DPSitransform____ = (void *)[self instanceMethodForSelector:
@selector(DPSitransform::::)];
methodTable.DPStransform____ = (void *)[self instanceMethodForSelector:
@selector(DPStransform::::)];
/* ----------------------------------------------------------------------- */
/* Opstack operations */
/* ----------------------------------------------------------------------- */
methodTable.DPSgetboolean_ = (void *)[self instanceMethodForSelector:
@selector(DPSgetboolean:)];
methodTable.DPSgetchararray__ = (void *)[self instanceMethodForSelector:
@selector(DPSgetchararray::)];
methodTable.DPSgetfloat_ = (void *)[self instanceMethodForSelector:
@selector(DPSgetfloat:)];
methodTable.DPSgetfloatarray__ = (void *)[self instanceMethodForSelector:
@selector(DPSgetfloatarray::)];
methodTable.DPSgetint_ = (void *)[self instanceMethodForSelector:
@selector(DPSgetint:)];
methodTable.DPSgetintarray__ = (void *)[self instanceMethodForSelector:
@selector(DPSgetintarray::)];
methodTable.DPSgetstring_ = (void *)[self instanceMethodForSelector:
@selector(DPSgetstring:)];
methodTable.DPSsendboolean_ = (void *)[self instanceMethodForSelector:
@selector(DPSsendboolean:)];
methodTable.DPSsendchararray__ = (void *)[self instanceMethodForSelector:
@selector(DPSsendchararray::)];
methodTable.DPSsendfloat_ = (void *)[self instanceMethodForSelector:
@selector(DPSsendfloat:)];
methodTable.DPSsendfloatarray__ = (void *)[self instanceMethodForSelector:
@selector(DPSsendfloatarray::)];
methodTable.DPSsendint_ = (void *)[self instanceMethodForSelector:
@selector(DPSsendint:)];
methodTable.DPSsendintarray__ = (void *)[self instanceMethodForSelector:
@selector(DPSsendintarray::)];
methodTable.DPSsendstring_ = (void *)[self instanceMethodForSelector:
@selector(DPSsendstring:)];
/* ----------------------------------------------------------------------- */
/* Paint operations */
/* ----------------------------------------------------------------------- */
methodTable.DPSashow___ = (void *)[self instanceMethodForSelector:
@selector(DPSashow:::)];
methodTable.DPSawidthshow______ = (void *)[self instanceMethodForSelector:
@selector(DPSawidthshow::::::)];
methodTable.DPScopypage = (void *)[self instanceMethodForSelector:
@selector(DPScopypage)];
methodTable.DPSeofill = (void *)[self instanceMethodForSelector:
@selector(DPSeofill)];
methodTable.DPSerasepage = (void *)[self instanceMethodForSelector:
@selector(DPSerasepage)];
methodTable.DPSfill = (void *)[self instanceMethodForSelector:
@selector(DPSfill)];
methodTable.DPSimage = (void *)[self instanceMethodForSelector:
@selector(DPSimage)];
methodTable.DPSimagemask = (void *)[self instanceMethodForSelector:
@selector(DPSimagemask)];
methodTable.DPSkshow_ = (void *)[self instanceMethodForSelector:
@selector(DPSkshow:)];
methodTable.DPSrectfill____ = (void *)[self instanceMethodForSelector:
@selector(DPSrectfill::::)];
methodTable.DPSrectstroke____ = (void *)[self instanceMethodForSelector:
@selector(DPSrectstroke::::)];
methodTable.DPSshow_ = (void *)[self instanceMethodForSelector:
@selector(DPSshow:)];
methodTable.DPSshowpage = (void *)[self instanceMethodForSelector:
@selector(DPSshowpage)];
methodTable.DPSstroke = (void *)[self instanceMethodForSelector:
@selector(DPSstroke)];
methodTable.DPSstrokepath = (void *)[self instanceMethodForSelector:
@selector(DPSstrokepath)];
methodTable.DPSueofill____ = (void *)[self instanceMethodForSelector:
@selector(DPSueofill::::)];
methodTable.DPSufill____ = (void *)[self instanceMethodForSelector:
@selector(DPSufill::::)];
methodTable.DPSustroke____ = (void *)[self instanceMethodForSelector:
@selector(DPSustroke::::)];
methodTable.DPSustrokepath____ = (void *)[self instanceMethodForSelector:
@selector(DPSustrokepath::::)];
methodTable.DPSwidthshow____ = (void *)[self instanceMethodForSelector:
@selector(DPSwidthshow::::)];
methodTable.DPSxshow___ = (void *)[self instanceMethodForSelector:
@selector(DPSxshow:::)];
methodTable.DPSxyshow___ = (void *)[self instanceMethodForSelector:
@selector(DPSxyshow:::)];
methodTable.DPSyshow___ = (void *)[self instanceMethodForSelector:
@selector(DPSyshow:::)];
/* ----------------------------------------------------------------------- */
/* Path operations */
/* ----------------------------------------------------------------------- */
methodTable.DPSarc_____ = (void *)[self instanceMethodForSelector:
@selector(DPSarc:::::)];
methodTable.DPSarcn_____ = (void *)[self instanceMethodForSelector:
@selector(DPSarcn:::::)];
methodTable.DPSarct_____ = (void *)[self instanceMethodForSelector:
@selector(DPSarct:::::)];
methodTable.DPSarcto_________ = (void *)[self instanceMethodForSelector:
@selector(DPSarcto:::::::::)];
methodTable.DPScharpath__ = (void *)[self instanceMethodForSelector:
@selector(DPScharpath::)];
methodTable.DPSclip = (void *)[self instanceMethodForSelector:
@selector(DPSclip)];
methodTable.DPSclippath = (void *)[self instanceMethodForSelector:
@selector(DPSclippath)];
methodTable.DPSclosepath = (void *)[self instanceMethodForSelector:
@selector(DPSclosepath)];
methodTable.DPScurveto______ = (void *)[self instanceMethodForSelector:
@selector(DPScurveto::::::)];
methodTable.DPSeoclip = (void *)[self instanceMethodForSelector:
@selector(DPSeoclip)];
methodTable.DPSeoviewclip = (void *)[self instanceMethodForSelector:
@selector(DPSeoviewclip)];
methodTable.DPSflattenpath = (void *)[self instanceMethodForSelector:
@selector(DPSflattenpath)];
methodTable.DPSinitclip = (void *)[self instanceMethodForSelector:
@selector(DPSinitclip)];
methodTable.DPSinitviewclip = (void *)[self instanceMethodForSelector:
@selector(DPSinitviewclip)];
methodTable.DPSlineto__ = (void *)[self instanceMethodForSelector:
@selector(DPSlineto::)];
methodTable.DPSmoveto__ = (void *)[self instanceMethodForSelector:
@selector(DPSmoveto::)];
methodTable.DPSnewpath = (void *)[self instanceMethodForSelector:
@selector(DPSnewpath)];
methodTable.DPSpathbbox____ = (void *)[self instanceMethodForSelector:
@selector(DPSpathbbox::::)];
methodTable.DPSpathforall = (void *)[self instanceMethodForSelector:
@selector(DPSpathforall)];
methodTable.DPSrcurveto______ = (void *)[self instanceMethodForSelector:
@selector(DPSrcurveto::::::)];
methodTable.DPSrectclip____ = (void *)[self instanceMethodForSelector:
@selector(DPSrectclip::::)];
methodTable.DPSrectviewclip____ = (void *)[self instanceMethodForSelector:
@selector(DPSrectviewclip::::)];
methodTable.DPSreversepath = (void *)[self instanceMethodForSelector:
@selector(DPSreversepath)];
methodTable.DPSrlineto__ = (void *)[self instanceMethodForSelector:
@selector(DPSrlineto::)];
methodTable.DPSrmoveto__ = (void *)[self instanceMethodForSelector:
@selector(DPSrmoveto::)];
methodTable.DPSsetbbox____ = (void *)[self instanceMethodForSelector:
@selector(DPSsetbbox::::)];
methodTable.DPSviewclip = (void *)[self instanceMethodForSelector:
@selector(DPSviewclip)];
methodTable.DPSviewclippath = (void *)[self instanceMethodForSelector:
@selector(DPSviewclippath)];
/* ----------------------------------------------------------------------- */
/* Window system ops */
/* ----------------------------------------------------------------------- */
methodTable.DPScurrentdrawingfunction_ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentdrawingfunction:)];
methodTable.DPScurrentgcdrawable____ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentgcdrawable::::)];
methodTable.DPScurrentgcdrawablecolor_____ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentgcdrawablecolor:::::)];
methodTable.DPScurrentoffset__ = (void *)[self instanceMethodForSelector:
@selector(DPScurrentoffset::)];
methodTable.DPSsetdrawingfunction_ = (void *)[self instanceMethodForSelector:
@selector(DPSsetdrawingfunction:)];
methodTable.DPSsetgcdrawable____ = (void *)[self instanceMethodForSelector:
@selector(DPSsetgcdrawable::::)];
methodTable.DPSsetgcdrawablecolor_____ = (void *)[self instanceMethodForSelector:
@selector(DPSsetgcdrawablecolor:::::)];
methodTable.DPSsetoffset__ = (void *)[self instanceMethodForSelector:
@selector(DPSsetoffset::)];
methodTable.DPSsetrgbactual____ = (void *)[self instanceMethodForSelector:
@selector(DPSsetrgbactual::::)];
methodTable.DPScapturegstate_ = (void *)[self instanceMethodForSelector:
@selector(DPScapturegstate:)];
mptr = NSZoneMalloc(_globalGSZone, sizeof(gsMethodTable));
memcpy(mptr, &methodTable, sizeof(gsMethodTable));
return mptr;
}
@end

View file

@ -77,7 +77,8 @@ NSScreen *mainScreen = nil;
[super init]; // Create our device description dictionary
// The backend will have to fill the dictionary
device_desc = [NSMutableDictionary dictionary];
depth = 0;
frame = NSZeroRect;
return self;
}
@ -86,12 +87,12 @@ NSScreen *mainScreen = nil;
//
- (NSWindowDepth)depth
{
return 0;
return depth;
}
- (NSRect)frame
{
return NSZeroRect;
return frame;
}
- (NSDictionary *)deviceDescription // Make a copy of device

View file

@ -35,6 +35,16 @@
@implementation NSString (NSStringDrawing)
- (void) drawAtPoint: (NSPoint)aPoint withAttributes: (NSDictionary *)attr
{
[self notImplemented: _cmd];
}
- (void) drawInRect: (NSRect)aRect withAttributes: (NSDictionary *)attr
{
[self notImplemented: _cmd];
}
- (NSSize)sizeWithAttributes:(NSDictionary *)attrs
{
NSFont *font;

View file

@ -319,33 +319,9 @@ NSString *NSAttachmentAttributeName = @"NSAttachmentAttributeName";
NSString *NSLigatureAttributeName = @"NSLigatureAttributeName";
NSString *NSBaselineOffsetAttributeName = @"NSBaselineOffsetAttributeName";
NSString *NSKernAttributeName = @"NSKernAttributeName";
/* Drawing engine externs */
NSString *NSBackendContext = @"NSBackendContext";
GSContext *_currentGSContext;
NSString *DPSconfigurationerror = @"DPSconfigurationerror";
NSString *DPSinvalidaccess = @"DPSinvalidaccess";
NSString *DPSinvalidcontext = @"DPSinvalidcontext";
NSString *DPSinvalidexit = @"DPSinvalidexit";
NSString *DPSinvalidfileaccess = @"DPSinvalidfileaccess";
NSString *DPSinvalidfont = @"DPSinvalidfont";
NSString *DPSinvalidid = @"DPSinvalidid";
NSString *DPSinvalidrestore = @"DPSinvalidrestore";
NSString *DPSinvalidparam = @"DPSinvalidparam";
NSString *DPSioerror = @"DPSioerror";
NSString *DPSlimitcheck = @"DPSlimitcheck";
NSString *DPSnocurrentpoint = @"DPSnocurrentpoint";
NSString *DPSnulloutput = @"DPSnulloutput";
NSString *DPSrangecheck = @"DPSrangecheck";
NSString *DPSstackoverflow = @"DPSstackoverflow";
NSString *DPSstackunderflow = @"DPSstackunderflow";
NSString *DPStypecheck = @"DPStypecheck";
NSString *DPSundefined = @"DPSundefined";
NSString *DPSundefinedfilename = @"DPSundefinedfilename";
NSString *DPSundefinedresource = @"DPSundefinedresource";
NSString *DPSundefinedresult = @"DPSundefinedresult";
NSString *DPSunmatchedmark = @"DPSunmatchedmark";
NSString *DPSunregistered = @"DPSunregistered";
NSString *DPSVMerror = @"DPSVMerror";

View file

@ -33,7 +33,7 @@ include $(GNUSTEP_MAKEFILES)/common.make
# The applications to be compiled
TOOL_NAME = gpbs make_services set_show_service
SERVICE_NAME = example
#SERVICE_NAME = example
# The source files to be compiled
gpbs_OBJC_FILES = gpbs.m dummy.m