mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:40:47 +00:00
* 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:
parent
57f27ed12d
commit
9af04949cd
4 changed files with 44 additions and 26 deletions
17
ChangeLog
17
ChangeLog
|
@ -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>
|
Thu Nov 26 1998 Felipe A. Rodriguez <far@ix.netcom.com>
|
||||||
|
|
||||||
* NSApplication.m add updateServicesMenu invocation accidently deleted
|
* NSApplication.m add updateServicesMenu invocation accidently deleted
|
||||||
during merge. Move method from _eventMatchingMask to tail of run
|
during merge. Move method from _eventMatchingMask to tail of run
|
||||||
method for performance reasons.
|
method for performance reasons.
|
||||||
* Tools/dummy.m add various new dummy functions.
|
* Tools/dummy.m add various new dummy functions.
|
||||||
* Panels/GNUmakefile make local targets double colon, add local clean to
|
* 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>
|
Wed Nov 25 1998 Felipe A. Rodriguez <far@ix.netcom.com>
|
||||||
|
|
||||||
* move DPSOperators.h to XDPS.
|
* move DPSOperators.h to XDPS.
|
||||||
* move GPS headers into a new backend.
|
* move GPS headers into a new backend.
|
||||||
* define GSContext.h/GSContext.m as abstract super for all drawing
|
* define GSContext.h/GSContext.m as abstract super for all drawing
|
||||||
destinations (eliminates the need for DPS, GPS, DGS at the root of
|
destinations (eliminates the need for DPS, GPS, DGS at the root of
|
||||||
the AppKit) add appropriate defintion to various classes.
|
the AppKit) add appropriate defintion to various classes.
|
||||||
* NSMatrix.m add abstract backend code from xraw (eliminate backend).
|
* NSMatrix.m add abstract backend code from xraw (eliminate backend).
|
||||||
* NSSlider.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).
|
* NSSliderCell.m add abstract backend code from xraw (eliminate backend).
|
||||||
* NSSplitView.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.
|
* NSWindow.m add class method to create backend specific window view.
|
||||||
* NSTextField.m add abstract backend code from xraw (eliminate backend).
|
* NSTextField.m add abstract backend code from xraw (eliminate backend).
|
||||||
* NSForm.m add abstract backend code from xraw (eliminate backend).
|
* NSForm.m add abstract backend code from xraw (eliminate backend).
|
||||||
|
|
|
@ -84,9 +84,6 @@ typedef enum _NSWindowOrderingMode {
|
||||||
{
|
{
|
||||||
NSDictionary *context_info;
|
NSDictionary *context_info;
|
||||||
NSMutableData *context_data;
|
NSMutableData *context_data;
|
||||||
|
|
||||||
// Reserverd for back-end use
|
|
||||||
void *be_context_reserved;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -118,6 +115,7 @@ typedef enum _NSWindowOrderingMode {
|
||||||
// Destroy the Context
|
// Destroy the Context
|
||||||
//
|
//
|
||||||
+ (void) destroyContext:(GSContext *) context;
|
+ (void) destroyContext:(GSContext *) context;
|
||||||
|
+ (void) _destroyContext:(GSContext *) context; // private use only
|
||||||
- (void) destroy;
|
- (void) destroy;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -46,9 +46,8 @@ NSZone *_globalGSZone = NULL; // The memory zone where all
|
||||||
//
|
//
|
||||||
// Class variables
|
// 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 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
|
+ (void)initialize
|
||||||
{
|
{
|
||||||
if (self == (contextConcreteClass = [GSContext class]))
|
if (self == (_concreteClass = [GSContext class]))
|
||||||
{
|
{
|
||||||
contextList = [[NSMutableArray arrayWithCapacity:2] retain];
|
contextList = [[NSMutableArray arrayWithCapacity:2] retain];
|
||||||
NSDebugLog(@"Initialize GSContext class\n");
|
NSDebugLog(@"Initialize GSContext class\n");
|
||||||
|
@ -67,37 +66,50 @@ static GSContext *_currentGSContext = nil; // the current context
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void) setConcreteClass: (Class)c { contextConcreteClass = c; }
|
+ (void) setConcreteClass: (Class)c { _concreteClass = c; }
|
||||||
+ (Class) concreteClass { return contextConcreteClass; }
|
+ (Class) concreteClass { return _concreteClass; }
|
||||||
|
|
||||||
+ allocWithZone: (NSZone*)z
|
+ allocWithZone: (NSZone*)z
|
||||||
{
|
{
|
||||||
return NSAllocateObject(contextConcreteClass, 0, z);
|
return NSAllocateObject(_concreteClass, 0, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ contextWithInfo: (NSDictionary *)info;
|
+ contextWithInfo: (NSDictionary *)info;
|
||||||
{
|
{
|
||||||
GSContext *context;
|
GSContext *context;
|
||||||
|
|
||||||
NSAssert(contextConcreteClass, @"Error: No default GSContext is set\n");
|
NSAssert(_concreteClass, @"Error: No concrete GSContext is set\n");
|
||||||
context = [[contextConcreteClass allocWithZone: _globalGSZone]
|
context = [[_concreteClass allocWithZone: _globalGSZone]
|
||||||
initWithContextInfo: info];
|
initWithContextInfo: info];
|
||||||
[context autorelease];
|
[context autorelease];
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (GSContext *) currentContext { return _currentGSContext; }
|
+ (GSContext *) currentContext { return nil;}
|
||||||
|
|
||||||
+ (void) setCurrentContext: (GSContext *)context
|
+ (void) setCurrentContext: (GSContext *)context
|
||||||
{
|
{
|
||||||
_currentGSContext = context;
|
[self subclassResponsibility:_cmd];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void) destroyContext:(GSContext *) context // remove context from the
|
+ (void) destroyContext:(GSContext *) context
|
||||||
{ // list so that it gets
|
{ // if concrete class is not
|
||||||
[contextList removeObject: context]; // deallocated with the
|
if(_concreteClass != [GSContext class]) // a GSContext invoke it's
|
||||||
} // next autorelease pool
|
[_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
|
// Instance methods
|
||||||
|
@ -110,8 +122,9 @@ GSContext *context;
|
||||||
- initWithContextInfo: (NSDictionary *)info
|
- initWithContextInfo: (NSDictionary *)info
|
||||||
{ // designated initializer
|
{ // designated initializer
|
||||||
[super init]; // for GSContext class
|
[super init]; // for GSContext class
|
||||||
|
|
||||||
[contextList addObject: self];
|
[contextList addObject: self];
|
||||||
[GSContext setCurrentContext: self];
|
[_concreteClass setCurrentContext: self];
|
||||||
|
|
||||||
if(info)
|
if(info)
|
||||||
context_info = [info retain];
|
context_info = [info retain];
|
||||||
|
@ -131,7 +144,7 @@ GSContext *context;
|
||||||
|
|
||||||
- (void) destroy // remove self from context
|
- (void) destroy // remove self from context
|
||||||
{ // list so that self gets
|
{ // list so that self gets
|
||||||
[GSContext destroyContext: self]; // deallocated with the
|
[_concreteClass destroyContext: self]; // deallocated with the
|
||||||
} // next autorelease pool
|
} // next autorelease pool
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
|
|
@ -801,6 +801,8 @@ int i, count;
|
||||||
[subview displayRect:intersection];
|
[subview displayRect:intersection];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[window flushWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)displayRectIgnoringOpacity:(NSRect)aRect
|
- (void)displayRectIgnoringOpacity:(NSRect)aRect
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue