mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-22 12:55:44 +00:00
* EOControl/EOObserver.m: Added implementation for EODelayedObserver
and EODelayedObserverQueue. * EOAdaptors/Postgres95/Postgres95Adaptor.m: Added import of NSDebug.h/EODebug.h Removed NSLog of connection information * EOAdaptors/Postgres95/Postgres95Channel.m * EOAdaptors/Postgres95/Postgres95Context.m * EOAdaptors/Postgres95/Postgres95Expression.m * EOAdaptors/Postgres95/Postgres95Value.m: Added import of NSDebug.h/EODebug.h * EOControl/EOControl.h: Added import of EOUndoManager.h * EOControl/EOObserver.m: Added empty implementation for EOObserverProxy git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@15608 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3d906d124f
commit
e3218a2fac
8 changed files with 235 additions and 3 deletions
23
ChangeLog
23
ChangeLog
|
@ -1,3 +1,26 @@
|
|||
2003-01-16 Mirko Viviani <mirko.viviani@rccr.cremona.it>
|
||||
|
||||
* EOControl/EOObserver.m: Added implementation for EODelayedObserver
|
||||
and EODelayedObserverQueue.
|
||||
|
||||
2003-01-16 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* EOAdaptors/Postgres95/Postgres95Adaptor.m:
|
||||
Added import of NSDebug.h/EODebug.h
|
||||
Removed NSLog of connection information
|
||||
|
||||
* EOAdaptors/Postgres95/Postgres95Channel.m
|
||||
* EOAdaptors/Postgres95/Postgres95Context.m
|
||||
* EOAdaptors/Postgres95/Postgres95Expression.m
|
||||
* EOAdaptors/Postgres95/Postgres95Value.m:
|
||||
Added import of NSDebug.h/EODebug.h
|
||||
|
||||
* EOControl/EOControl.h:
|
||||
Added import of EOUndoManager.h
|
||||
|
||||
* EOControl/EOObserver.m:
|
||||
Added empty implementation for EOObserverProxy
|
||||
|
||||
2002-12-31 Mirko Viviani <mirko.viviani@rccr.cremona.it>
|
||||
|
||||
* EOControl/EOFault.m ([EOFault -editingContext]): simplified.
|
||||
|
|
|
@ -50,6 +50,7 @@ RCS_ID("$Id$")
|
|||
#import <Foundation/NSDate.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSDebug.h>
|
||||
|
||||
#import <EOAccess/EOAccess.h>
|
||||
#import <EOAccess/EOAttribute.h>
|
||||
|
@ -57,6 +58,8 @@ RCS_ID("$Id$")
|
|||
#import <EOAccess/EOEntity.h>
|
||||
#import <EOAccess/EOModel.h>
|
||||
|
||||
#import <EOControl/EODebug.h>
|
||||
|
||||
#import <Postgres95EOAdaptor/Postgres95Adaptor.h>
|
||||
#import <Postgres95EOAdaptor/Postgres95Context.h>
|
||||
#import <Postgres95EOAdaptor/Postgres95Channel.h>
|
||||
|
@ -360,7 +363,6 @@ static NSString *internalTypeNames[] = {
|
|||
pg_pwd = (char*)[[_connectionDictionary objectForKey: @"password"]
|
||||
cString];
|
||||
|
||||
NSLog(@"%s %s %s %s %s", pg_host, pg_port, pg_database, pg_user, pg_pwd);
|
||||
NSDebugMLog(@"%s %s %s %s %s", pg_host, pg_port, pg_database, pg_user, pg_pwd);
|
||||
|
||||
// Try to connect to the Postgres95 server
|
||||
|
|
|
@ -47,12 +47,14 @@ RCS_ID("$Id$")
|
|||
#import <Foundation/NSObjCRuntime.h>
|
||||
#import <Foundation/NSUtilities.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSDebug.h>
|
||||
|
||||
#import <EOAccess/EOAccess.h>
|
||||
|
||||
#import <EOControl/EONull.h>
|
||||
#import <EOControl/EOQualifier.h>
|
||||
#import <EOControl/EOFetchSpecification.h>
|
||||
#import <EOControl/EODebug.h>
|
||||
|
||||
#import <Postgres95EOAdaptor/Postgres95Channel.h>
|
||||
#import <Postgres95EOAdaptor/Postgres95Context.h>
|
||||
|
|
|
@ -45,9 +45,12 @@ RCS_ID("$Id$")
|
|||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSDebug.h>
|
||||
|
||||
#import <EOAccess/EOAccess.h>
|
||||
|
||||
#import <EOControl/EODebug.h>
|
||||
|
||||
#import <Postgres95EOAdaptor/Postgres95Adaptor.h>
|
||||
#import <Postgres95EOAdaptor/Postgres95Context.h>
|
||||
#import <Postgres95EOAdaptor/Postgres95Channel.h>
|
||||
|
|
|
@ -38,11 +38,12 @@ RCS_ID("$Id$")
|
|||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Foundation/NSUtilities.h>
|
||||
|
||||
#include <Foundation/NSException.h>
|
||||
#import <Foundation/NSException.h>
|
||||
|
||||
#import <EOAccess/EOAccess.h>
|
||||
|
||||
#import <EOControl/EODebug.h>
|
||||
|
||||
#import <Postgres95EOAdaptor/Postgres95SQLExpression.h>
|
||||
#import <Postgres95EOAdaptor/Postgres95Values.h>
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ RCS_ID("$Id$")
|
|||
#import <Foundation/NSValue.h>
|
||||
#import <Foundation/NSDecimalNumber.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSDebug.h>
|
||||
|
||||
#import <EOAccess/EOAccess.h>
|
||||
#import <EOAccess/EOAttribute.h>
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#import <EOControl/EOKeyValueArchiver.h>
|
||||
#import <EOControl/EOGlobalID.h>
|
||||
#import <EOControl/EOKeyGlobalID.h>
|
||||
#import <EOControl/EOUndoManager.h>
|
||||
#import <EOControl/EOObjectStore.h>
|
||||
#import <EOControl/EOObjectStoreCoordinator.h>
|
||||
#import <EOControl/EOFault.h>
|
||||
|
|
|
@ -39,6 +39,7 @@ RCS_ID("$Id$")
|
|||
#import <Foundation/NSMapTable.h>
|
||||
#import <Foundation/NSNotification.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSRunLoop.h>
|
||||
#import <Foundation/NSDebug.h>
|
||||
|
||||
#import <EOControl/EOClassDescription.h>
|
||||
|
@ -224,3 +225,201 @@ static id lastObject;
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation EODelayedObserver
|
||||
|
||||
- (void)objectWillChange: (id)subject
|
||||
{
|
||||
[[EODelayedObserverQueue defaultObserverQueue] enqueueObserver: self];
|
||||
}
|
||||
|
||||
- (EOObserverPriority)priority
|
||||
{
|
||||
return EOObserverPriorityThird;
|
||||
}
|
||||
|
||||
- (EODelayedObserverQueue *)observerQueue
|
||||
{
|
||||
return [EODelayedObserverQueue defaultObserverQueue];
|
||||
}
|
||||
|
||||
- (void)subjectChanged
|
||||
{
|
||||
}
|
||||
|
||||
- (void)discardPendingNotification
|
||||
{
|
||||
[[EODelayedObserverQueue defaultObserverQueue] dequeueObserver: self];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
static EODelayedObserverQueue *observerQueue;
|
||||
|
||||
|
||||
@implementation EODelayedObserverQueue
|
||||
|
||||
+ (EODelayedObserverQueue *)defaultObserverQueue
|
||||
{
|
||||
if (!observerQueue)
|
||||
observerQueue = [[self alloc] init];
|
||||
|
||||
return observerQueue;
|
||||
}
|
||||
|
||||
- init
|
||||
{
|
||||
if ((self == [super init]))
|
||||
{
|
||||
ASSIGN(_modes, [NSArray arrayWithObject: NSDefaultRunLoopMode]);
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)_notifyObservers
|
||||
{
|
||||
[self notifyObserversUpToPriority: EOObserverPrioritySixth];
|
||||
}
|
||||
|
||||
- (void)enqueueObserver: (EODelayedObserver *)observer
|
||||
{
|
||||
EOObserverPriority priority = [observer priority];
|
||||
|
||||
if (priority == EOObserverPriorityImmediate)
|
||||
[observer subjectChanged];
|
||||
else
|
||||
{
|
||||
if (_queue[priority])
|
||||
{
|
||||
EODelayedObserver *obj = _queue[priority];
|
||||
|
||||
while (YES)
|
||||
{
|
||||
if (obj == observer)
|
||||
return;
|
||||
|
||||
obj = obj->_next;
|
||||
|
||||
if (!obj)
|
||||
{
|
||||
obj->_next = observer;
|
||||
|
||||
if (priority > _highestNonEmptyQueue)
|
||||
{
|
||||
_highestNonEmptyQueue = priority;
|
||||
_haveEntryInNotificationQueue = YES;
|
||||
}
|
||||
|
||||
break;;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
_queue[priority] = observer;
|
||||
|
||||
[[NSRunLoop currentRunLoop]
|
||||
performSelector: @selector(_notifyObservers)
|
||||
target: self
|
||||
argument: nil
|
||||
order: EOFlushDelayedObserversRunLoopOrdering
|
||||
modes: _modes];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dequeueObserver: (EODelayedObserver *)observer
|
||||
{
|
||||
EOObserverPriority priority;
|
||||
EODelayedObserver *obj, *last = nil;
|
||||
|
||||
if (!observer)
|
||||
return;
|
||||
|
||||
priority = [observer priority];
|
||||
obj = _queue[priority];
|
||||
|
||||
while (obj)
|
||||
{
|
||||
if (obj == observer)
|
||||
{
|
||||
if (last)
|
||||
last->_next = obj->_next;
|
||||
else
|
||||
_queue[priority] = obj->_next;
|
||||
|
||||
|
||||
if (!_queue[priority])
|
||||
{
|
||||
int i = priority;
|
||||
|
||||
if (priority >= _highestNonEmptyQueue)
|
||||
{
|
||||
for (; i > EOObserverPriorityImmediate; --i)
|
||||
{
|
||||
if (_queue[priority])
|
||||
{
|
||||
_highestNonEmptyQueue = priority;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (priority == EOObserverPriorityFirst
|
||||
|| i == EOObserverPriorityImmediate)
|
||||
{
|
||||
_highestNonEmptyQueue = EOObserverPriorityImmediate;
|
||||
_haveEntryInNotificationQueue = NO;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
last = obj;
|
||||
obj = obj->_next;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)notifyObserversUpToPriority: (EOObserverPriority)priority
|
||||
{
|
||||
int i = _highestNonEmptyQueue;
|
||||
|
||||
for (; i > EOObserverPriorityImmediate; i--)
|
||||
{
|
||||
EODelayedObserver *observer = _queue[i];
|
||||
|
||||
while (observer)
|
||||
{
|
||||
[observer subjectChanged];
|
||||
|
||||
observer = observer->_next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setRunLoopModes: (NSArray *)modes
|
||||
{
|
||||
ASSIGN(_modes, modes);
|
||||
}
|
||||
|
||||
- (NSArray *)runLoopModes
|
||||
{
|
||||
return _modes;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation EOObserverProxy
|
||||
|
||||
- initWithTarget: (id)target
|
||||
action: (SEL)action
|
||||
priority: (EOObserverPriority)priority
|
||||
{
|
||||
NSEmitTODO();
|
||||
return [self notImplemented: _cmd]; //TODO
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue