* GSContext.m/.h second rewrite and polish of API.

* NSView.m displayrect add flushWindow at end.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3339 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Felipe A. Rodriguez 1998-11-27 12:17:37 +00:00
parent 16dab0eb75
commit e75279e0eb
4 changed files with 44 additions and 26 deletions

View file

@ -1,24 +1,29 @@
Fri Nov 27 1998 Felipe A. Rodriguez <far@ix.netcom.com>
* GSContext.m/.h second rewrite and polish of API.
* NSView.m displayrect add flushWindow at end.
Thu Nov 26 1998 Felipe A. Rodriguez <far@ix.netcom.com>
* NSApplication.m add updateServicesMenu invocation accidently deleted
during merge. Move method from _eventMatchingMask to tail of run
method for performance reasons.
during merge. Move method from _eventMatchingMask to tail of run
method for performance reasons.
* Tools/dummy.m add various new dummy functions.
* Panels/GNUmakefile make local targets double colon, add local clean to
fix make clean failure.
fix make clean failure.
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.
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()
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).

View file

@ -84,9 +84,6 @@ typedef enum _NSWindowOrderingMode {
{
NSDictionary *context_info;
NSMutableData *context_data;
// Reserverd for back-end use
void *be_context_reserved;
}
//
@ -118,6 +115,7 @@ typedef enum _NSWindowOrderingMode {
// Destroy the Context
//
+ (void) destroyContext:(GSContext *) context;
+ (void) _destroyContext:(GSContext *) context; // private use only
- (void) destroy;
@end

View file

@ -46,9 +46,8 @@ NSZone *_globalGSZone = NULL; // The memory zone where all
//
// Class variables
//
static Class contextConcreteClass; // actual class of GSContext's
static Class _concreteClass; // actual class of GSContext
static NSMutableArray *contextList; // list of drawing destinations
static GSContext *_currentGSContext = nil; // the current context
@ -59,7 +58,7 @@ static GSContext *_currentGSContext = nil; // the current context
//
+ (void)initialize
{
if (self == (contextConcreteClass = [GSContext class]))
if (self == (_concreteClass = [GSContext class]))
{
contextList = [[NSMutableArray arrayWithCapacity:2] retain];
NSDebugLog(@"Initialize GSContext class\n");
@ -67,37 +66,50 @@ static GSContext *_currentGSContext = nil; // the current context
}
}
+ (void) setConcreteClass: (Class)c { contextConcreteClass = c; }
+ (Class) concreteClass { return contextConcreteClass; }
+ (void) setConcreteClass: (Class)c { _concreteClass = c; }
+ (Class) concreteClass { return _concreteClass; }
+ allocWithZone: (NSZone*)z
{
return NSAllocateObject(contextConcreteClass, 0, z);
return NSAllocateObject(_concreteClass, 0, z);
}
+ contextWithInfo: (NSDictionary *)info;
{
GSContext *context;
NSAssert(contextConcreteClass, @"Error: No default GSContext is set\n");
context = [[contextConcreteClass allocWithZone: _globalGSZone]
initWithContextInfo: info];
NSAssert(_concreteClass, @"Error: No concrete GSContext is set\n");
context = [[_concreteClass allocWithZone: _globalGSZone]
initWithContextInfo: info];
[context autorelease];
return context;
}
+ (GSContext *) currentContext { return _currentGSContext; }
+ (GSContext *) currentContext { return nil;}
+ (void) setCurrentContext: (GSContext *)context
{
_currentGSContext = context;
[self subclassResponsibility:_cmd];
}
+ (void) destroyContext:(GSContext *) context // remove context from the
{ // list so that it gets
[contextList removeObject: context]; // deallocated with the
} // next autorelease pool
+ (void) destroyContext:(GSContext *) context
{ // if concrete class is not
if(_concreteClass != [GSContext class]) // a GSContext invoke it's
[_concreteClass destroyContext: context]; // equivalent method first
else
[self _destroyContext: context];
}
// private method which
+ (void) _destroyContext:(GSContext *) context // removes context from the
{ // list so that it gets
int top; // deallocated with the
// next autorelease pool
[contextList removeObject: context];
// if not last context set
if((top = [contextList count]) > 0) // next in list as current
[_concreteClass setCurrentContext:[contextList objectAtIndex:top - 1]];
}
//
// Instance methods
@ -110,8 +122,9 @@ GSContext *context;
- initWithContextInfo: (NSDictionary *)info
{ // designated initializer
[super init]; // for GSContext class
[contextList addObject: self];
[GSContext setCurrentContext: self];
[_concreteClass setCurrentContext: self];
if(info)
context_info = [info retain];
@ -131,7 +144,7 @@ GSContext *context;
- (void) destroy // remove self from context
{ // list so that self gets
[GSContext destroyContext: self]; // deallocated with the
[_concreteClass destroyContext: self]; // deallocated with the
} // next autorelease pool
- (void) dealloc

View file

@ -801,6 +801,8 @@ int i, count;
[subview displayRect:intersection];
}
}
[window flushWindow];
}
- (void)displayRectIgnoringOpacity:(NSRect)aRect