mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-22 12:55:44 +00:00
* EOInterface/EOActionAssociation.h/m: New files.
* EOInterface/EOActionInsertionAssociation.h/m: Ditto. * EOInterface/EOColumnAssociation.h/m: Ditto. * EOInterface/EOTableViewAssociation.m: Ditto. * EOInterface/EOInterface.h: Added new headers. * EOInterface/GNUmakefile: Use new files. * EOInterface/EOAssociation.m: (-[debugDescription]): Remove debug method. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20229 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
14be1f330b
commit
c1620a5676
11 changed files with 914 additions and 11 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2004-10-16 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* EOInterface/EOActionAssociation.h/m: New files.
|
||||
* EOInterface/EOActionInsertionAssociation.h/m: Ditto.
|
||||
* EOInterface/EOColumnAssociation.h/m: Ditto.
|
||||
* EOInterface/EOTableViewAssociation.m: Ditto.
|
||||
* EOInterface/EOInterface.h: Added new headers.
|
||||
* EOInterface/GNUmakefile: Use new files.
|
||||
* EOInterface/EOAssociation.m: (-[debugDescription]): Remove debug
|
||||
method.
|
||||
|
||||
2004-10-15 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* EOInterface/EOAssociation.h/m: New files.
|
||||
|
|
68
EOInterface/EOActionAssociation.h
Normal file
68
EOInterface/EOActionAssociation.h
Normal file
|
@ -0,0 +1,68 @@
|
|||
/** -*-ObjC-*-
|
||||
EOActionAssociation.h
|
||||
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
|
||||
Author: David Ayers <d.ayers@inode.at>
|
||||
|
||||
This file is part of the GNUstep Database Library
|
||||
|
||||
The GNUstep Database Library is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU Lesser General Public License
|
||||
as published by the Free Software Foundation; either version 2,
|
||||
or (at your option) any later version.
|
||||
|
||||
The GNUstep Database 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNUstep Database Library; see the file COPYING. If not,
|
||||
write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EOInterface_EOActionAssociation_h__
|
||||
#define __EOInterface_EOActionAssociation_h__
|
||||
|
||||
#ifdef GNUSTEP
|
||||
#include <Foundation/NSObject.h>
|
||||
#include <Foundation/NSMapTable.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <EOInterface/EOAssociation.h>
|
||||
|
||||
@class NSString;
|
||||
@class NSArray;
|
||||
|
||||
@class EODisplayGroup;
|
||||
|
||||
@interface EOActionAssociation : EOAssociation
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* Defining capabilities of concete class. */
|
||||
+ (NSArray *)aspects;
|
||||
+ (NSArray *)aspectSignatures;
|
||||
|
||||
+ (NSArray *)objectKeysTaken;
|
||||
+ (BOOL)isUsableWithObject: (id)object;
|
||||
|
||||
+ (NSString *)primaryAspect;
|
||||
|
||||
/* Creation and configuration. */
|
||||
- (void)establishConnection;
|
||||
- (void)breakConnection;
|
||||
|
||||
/* Display object value manipulation. */
|
||||
- (void)subjectChanged;
|
||||
|
||||
- (void)action: (id)sender;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
104
EOInterface/EOActionAssociation.m
Normal file
104
EOInterface/EOActionAssociation.m
Normal file
|
@ -0,0 +1,104 @@
|
|||
/**
|
||||
EOActionAssociation.m
|
||||
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
|
||||
Author: David Ayers <d.ayers@inode.at>
|
||||
|
||||
This file is part of the GNUstep Database Library
|
||||
|
||||
The GNUstep Database Library is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU Lesser General Public License
|
||||
as published by the Free Software Foundation; either version 2,
|
||||
or (at your option) any later version.
|
||||
|
||||
The GNUstep Database 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNUstep Database Library; see the file COPYING. If not,
|
||||
write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef GNUSTEP
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
|
||||
#include <AppKit/NSControl.h>
|
||||
#include <AppKit/NSActionCell.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <AppKit/AppKit.h>
|
||||
#endif
|
||||
|
||||
#include "EOActionAssociation.h"
|
||||
|
||||
@implementation EOActionAssociation
|
||||
|
||||
+ (NSArray *)aspects
|
||||
{
|
||||
static NSArray *_aspects = nil;
|
||||
if (_aspects == nil)
|
||||
{
|
||||
NSArray *arr = [NSArray arrayWithObjects:
|
||||
@"action", @"argument", @"enabled", nil];
|
||||
_aspects = RETAIN ([[super aspects] arrayByAddingObjectsFromArray: arr]);
|
||||
}
|
||||
return _aspects;
|
||||
}
|
||||
|
||||
+ (NSArray *)aspectSignatures
|
||||
{
|
||||
static NSArray *_signatures = nil;
|
||||
if (_signatures == nil)
|
||||
{
|
||||
NSArray *arr = [NSArray arrayWithObjects:
|
||||
@"A1M", @"", @"A", nil];
|
||||
arr = [[super aspectSignatures] arrayByAddingObjectsFromArray: arr];
|
||||
_signatures = RETAIN(arr);
|
||||
}
|
||||
return _signatures;
|
||||
}
|
||||
|
||||
+ (NSArray *)objectKeysTaken
|
||||
{
|
||||
static NSArray *_keys = nil;
|
||||
if (_keys == nil)
|
||||
{
|
||||
_keys
|
||||
= RETAIN ([[super objectKeysTaken] arrayByAddingObject: @"target"]);
|
||||
}
|
||||
return _keys;
|
||||
}
|
||||
|
||||
+ (BOOL)isUsableWithObject: (id)object
|
||||
{
|
||||
return ([object isKindOfClass: [NSControl class]]
|
||||
|| [object isKindOfClass: [NSActionCell class]]);
|
||||
}
|
||||
|
||||
+ (NSString *)primaryAspect
|
||||
{
|
||||
return @"action";
|
||||
}
|
||||
|
||||
- (void)establishConnection
|
||||
{
|
||||
}
|
||||
- (void)breakConnection
|
||||
{
|
||||
}
|
||||
|
||||
- (void)subjectChanged
|
||||
{
|
||||
}
|
||||
|
||||
- (void)action: (id)sender
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
|
65
EOInterface/EOActionInsertionAssociation.h
Normal file
65
EOInterface/EOActionInsertionAssociation.h
Normal file
|
@ -0,0 +1,65 @@
|
|||
/** -*-ObjC-*-
|
||||
EOActionInsertionAssociation.h
|
||||
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
|
||||
Author: David Ayers <d.ayers@inode.at>
|
||||
|
||||
This file is part of the GNUstep Database Library
|
||||
|
||||
The GNUstep Database Library is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU Lesser General Public License
|
||||
as published by the Free Software Foundation; either version 2,
|
||||
or (at your option) any later version.
|
||||
|
||||
The GNUstep Database 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNUstep Database Library; see the file COPYING. If not,
|
||||
write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EOInterface_EOActionInsertionAssociation_h__
|
||||
#define __EOInterface_EOActionInsertionAssociation_h__
|
||||
|
||||
#ifdef GNUSTEP
|
||||
#include <Foundation/NSObject.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <EOInterface/EOAssociation.h>
|
||||
|
||||
@class NSString;
|
||||
@class NSArray;
|
||||
|
||||
@interface EOActionInsertionAssociation : EOAssociation
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* Defining capabilities of concete class. */
|
||||
+ (NSArray *)aspects;
|
||||
+ (NSArray *)aspectSignatures;
|
||||
|
||||
+ (NSArray *)objectKeysTaken;
|
||||
+ (BOOL)isUsableWithObject: (id)object;
|
||||
|
||||
+ (NSString *)primaryAspect;
|
||||
|
||||
/* Creation and configuration. */
|
||||
- (void)establishConnection;
|
||||
- (void)breakConnection;
|
||||
|
||||
/* Display object value manipulation. */
|
||||
- (void)subjectChanged;
|
||||
|
||||
- (void)action: (id)sender;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
103
EOInterface/EOActionInsertionAssociation.m
Normal file
103
EOInterface/EOActionInsertionAssociation.m
Normal file
|
@ -0,0 +1,103 @@
|
|||
/**
|
||||
EOActionInsertionAssociation.m
|
||||
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
|
||||
Author: David Ayers <d.ayers@inode.at>
|
||||
|
||||
This file is part of the GNUstep Database Library
|
||||
|
||||
The GNUstep Database Library is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU Lesser General Public License
|
||||
as published by the Free Software Foundation; either version 2,
|
||||
or (at your option) any later version.
|
||||
|
||||
The GNUstep Database 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNUstep Database Library; see the file COPYING. If not,
|
||||
write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef GNUSTEP
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
|
||||
#include <AppKit/NSControl.h>
|
||||
#include <AppKit/NSActionCell.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <AppKit/AppKit.h>
|
||||
#endif
|
||||
|
||||
#include "EOActionInsertionAssociation.h"
|
||||
|
||||
@implementation EOActionInsertionAssociation
|
||||
|
||||
+ (NSArray *)aspects
|
||||
{
|
||||
static NSArray *_aspects = nil;
|
||||
if (_aspects == nil)
|
||||
{
|
||||
NSArray *arr = [NSArray arrayWithObjects:
|
||||
@"source", @"destination", @"enabled", nil];
|
||||
_aspects = RETAIN ([[super aspects] arrayByAddingObjectsFromArray: arr]);
|
||||
}
|
||||
return _aspects;
|
||||
}
|
||||
|
||||
+ (NSArray *)aspectSignatures
|
||||
{
|
||||
static NSArray *_signatures = nil;
|
||||
if (_signatures == nil)
|
||||
{
|
||||
NSArray *arr = [NSArray arrayWithObjects:
|
||||
@"", @"1M", @"A", nil];
|
||||
arr = [[super aspectSignatures] arrayByAddingObjectsFromArray: arr];
|
||||
_signatures = RETAIN(arr);
|
||||
}
|
||||
return _signatures;
|
||||
}
|
||||
|
||||
+ (NSArray *)objectKeysTaken
|
||||
{
|
||||
static NSArray *_keys = nil;
|
||||
if (_keys == nil)
|
||||
{
|
||||
_keys
|
||||
= RETAIN ([[super objectKeysTaken] arrayByAddingObject: @"target"]);
|
||||
}
|
||||
return _keys;
|
||||
}
|
||||
|
||||
+ (BOOL)isUsableWithObject: (id)object
|
||||
{
|
||||
return ([object respondsToSelector: @selector(setAction:) ]);
|
||||
}
|
||||
|
||||
+ (NSString *)primaryAspect
|
||||
{
|
||||
return @"source";
|
||||
}
|
||||
|
||||
- (void)establishConnection
|
||||
{
|
||||
}
|
||||
- (void)breakConnection
|
||||
{
|
||||
}
|
||||
|
||||
- (void)subjectChanged
|
||||
{
|
||||
}
|
||||
|
||||
- (void)action: (id)sender
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -347,16 +347,5 @@ static NSMutableArray *_associationClasses = nil;
|
|||
return reply;
|
||||
}
|
||||
|
||||
- (NSString *)debugDescription
|
||||
{
|
||||
NSLog(@"self:%p", self);
|
||||
/*
|
||||
NSLog(@"_end1:%p", &_end1);
|
||||
NSLog(@"_end2:%p", &_end2);
|
||||
*/
|
||||
NSLog(@"dGM :%p", &_displayGroupMap);
|
||||
NSLog(@"dGKM:%p", &_displayGroupKeyMap);
|
||||
return nil;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
204
EOInterface/EOColumnAssociation.h
Normal file
204
EOInterface/EOColumnAssociation.h
Normal file
|
@ -0,0 +1,204 @@
|
|||
/** -*-ObjC-*-
|
||||
EOColumnAssociation.h
|
||||
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
|
||||
Author: David Ayers <d.ayers@inode.at>
|
||||
|
||||
This file is part of the GNUstep Database Library
|
||||
|
||||
The GNUstep Database Library is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU Lesser General Public License
|
||||
as published by the Free Software Foundation; either version 2,
|
||||
or (at your option) any later version.
|
||||
|
||||
The GNUstep Database 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNUstep Database Library; see the file COPYING. If not,
|
||||
write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EOInterface_EOColumnAssociation_h__
|
||||
#define __EOInterface_EOColumnAssociation_h__
|
||||
|
||||
#ifdef GNUSTEP
|
||||
#include <Foundation/NSObject.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <EOInterface/EOAssociation.h>
|
||||
|
||||
@class NSString;
|
||||
@class NSArray;
|
||||
@class NSNotification;
|
||||
|
||||
@class NSTableView;
|
||||
@class NSTableColumn;
|
||||
@class NSControl;
|
||||
@class NSText;
|
||||
|
||||
@class EODisplayGroup;
|
||||
|
||||
@interface EOColumnAssociation : EOAssociation
|
||||
{
|
||||
unsigned int _didChange:1;
|
||||
|
||||
unsigned int _alreadySetObject:1;
|
||||
|
||||
unsigned int _enabledAspectBound:1;
|
||||
unsigned int _colorAspectBound:1;
|
||||
unsigned int _boldAspectBound:1;
|
||||
unsigned int _italicAspectBound:1;
|
||||
|
||||
unsigned _unused:26;
|
||||
|
||||
SEL _sortingSelector;
|
||||
}
|
||||
|
||||
/* Defining capabilities of concete class. */
|
||||
+ (NSArray *)aspects;
|
||||
+ (NSArray *)aspectSignatures;
|
||||
|
||||
+ (NSArray *)objectKeysTaken;
|
||||
+ (BOOL)isUsableWithObject: (id)object;
|
||||
|
||||
+ (NSString *)displayName;
|
||||
|
||||
+ (NSString *)primaryAspect;
|
||||
|
||||
/* Creation and configuration. */
|
||||
- (id)initWithObject: (id)object;
|
||||
|
||||
- (void)establishConnection;
|
||||
- (void)breakConnection;
|
||||
|
||||
/* Display object value manipulation. */
|
||||
- (void)subjectChanged;
|
||||
- (BOOL)endEditing;
|
||||
|
||||
/* EOColumnViewAssociation sort ordering. */
|
||||
- (void)setSortingSelector: (SEL)selector;
|
||||
- (SEL)sortingSelector;
|
||||
|
||||
|
||||
/* EOColumnViewAssociation table view delegate. */
|
||||
- (void)tableView: (NSTableView *)tableView
|
||||
setObjectValue: (id)object
|
||||
forTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row;
|
||||
|
||||
- (id)tableView: (NSTableView *)tableView
|
||||
objectValueForTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row;
|
||||
|
||||
- (BOOL)tableView: (NSTableView *)tableView
|
||||
shouldEditTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row;
|
||||
|
||||
- (void)tableView: (NSTableView *)tableView
|
||||
willDisplayCell: (id)cell
|
||||
forTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row;
|
||||
|
||||
/* EOColumnViewAssociation control delegate. */
|
||||
- (BOOL)control: (NSControl *)control
|
||||
didFailToFormatString: (NSString *)string
|
||||
errorDescription: (NSString *)description;
|
||||
|
||||
- (BOOL)control: (NSControl *)control
|
||||
isValidObject: (id)object;
|
||||
|
||||
- (BOOL)control: (NSControl *)control
|
||||
textShouldBeginEditing: (NSText *)fieldEditor;
|
||||
|
||||
@end
|
||||
|
||||
@interface EOTableViewAssociation : EOAssociation
|
||||
{
|
||||
unsigned int _updating:1;
|
||||
|
||||
unsigned int _enabledAspectBound:1;
|
||||
unsigned int _colorAspectBound:1;
|
||||
unsigned int _boldAspectBound:1;
|
||||
unsigned int _italicAspectBound:1;
|
||||
|
||||
unsigned int _sortsByColumnOrder:1;
|
||||
unsigned int _didSetSortOrdering:1;
|
||||
|
||||
unsigned int _autoCreated:1;
|
||||
|
||||
unsigned int _unused:24;
|
||||
}
|
||||
|
||||
/* Defining capabilities of concete class. */
|
||||
+ (NSArray *)aspects;
|
||||
+ (NSArray *)aspectSignatures;
|
||||
|
||||
+ (NSArray *)objectKeysTaken;
|
||||
+ (BOOL)isUsableWithObject: (id)object;
|
||||
|
||||
+ (NSString *)primaryAspect;
|
||||
|
||||
/* Creation and configuration. */
|
||||
- (void)establishConnection;
|
||||
- (void)breakConnection;
|
||||
|
||||
/* Display object value manipulation. */
|
||||
- (void)subjectChanged;
|
||||
|
||||
/* Creation. */
|
||||
+ (void)bindToTableView: (NSTableView *)tableView
|
||||
displayGroup: (EODisplayGroup *)displayGroup;
|
||||
|
||||
/* Configure sort ordering. */
|
||||
- (BOOL)sortsByColumnOrder;
|
||||
- (void)setSortsByColumnOrder: (BOOL)flag;
|
||||
|
||||
/* Access to EOColumnAssociation. */
|
||||
- (EOColumnAssociation *)editingAssociation;
|
||||
|
||||
/* Providing table view data source. */
|
||||
- (int)numberOfRowsInTableView: (NSTableView *)tableView;
|
||||
|
||||
- (void)tableView: (NSTableView *)tableView
|
||||
setObjectValue: (id)object
|
||||
forTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row;
|
||||
|
||||
- (id)tableView: (NSTableView *)tableView
|
||||
objectValueForTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row;
|
||||
|
||||
/* Delegate methods for table view. */
|
||||
- (BOOL)tableView: (NSTableView *)tableView
|
||||
shouldEditTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row;
|
||||
|
||||
- (void)tableView: (NSTableView *)tableView
|
||||
willDisplayCell: (id)cell
|
||||
forTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row;
|
||||
|
||||
/* Notification methods for table view. */
|
||||
- (void)tableViewSelectionDidChange: (NSNotification *)notification;
|
||||
|
||||
/* Delegate methods for control. */
|
||||
- (BOOL)control: (NSControl *)control
|
||||
didFailToFormatString: (NSString *)string
|
||||
errorDescription: (NSString *)description;
|
||||
|
||||
- (BOOL)control: (NSControl *)control
|
||||
isValidObject: (id)object;
|
||||
|
||||
- (BOOL)control: (NSControl *)control
|
||||
textShouldBeginEditing: (NSText *)fieldEditor;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
174
EOInterface/EOColumnAssociation.m
Normal file
174
EOInterface/EOColumnAssociation.m
Normal file
|
@ -0,0 +1,174 @@
|
|||
/**
|
||||
EOColumnAssociation.m
|
||||
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
|
||||
Author: David Ayers <d.ayers@inode.at>
|
||||
|
||||
This file is part of the GNUstep Database Library
|
||||
|
||||
The GNUstep Database Library is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU Lesser General Public License
|
||||
as published by the Free Software Foundation; either version 2,
|
||||
or (at your option) any later version.
|
||||
|
||||
The GNUstep Database 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNUstep Database Library; see the file COPYING. If not,
|
||||
write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef GNUSTEP
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
|
||||
#include <AppKit/NSTableView.h>
|
||||
#include <AppKit/NSTableColumn.h>
|
||||
#include <AppKit/NSText.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <AppKit/AppKit.h>
|
||||
#endif
|
||||
|
||||
#include "EODisplayGroup.h"
|
||||
#include "EOColumnAssociation.h"
|
||||
|
||||
|
||||
@implementation EOColumnAssociation
|
||||
|
||||
+ (NSArray *)aspects
|
||||
{
|
||||
static NSArray *_aspects = nil;
|
||||
if (_aspects == nil)
|
||||
{
|
||||
NSArray *arr = [NSArray arrayWithObjects:
|
||||
@"value", @"enabled", nil];
|
||||
_aspects = RETAIN ([[super aspects] arrayByAddingObjectsFromArray: arr]);
|
||||
}
|
||||
return _aspects;
|
||||
}
|
||||
|
||||
+ (NSArray *)aspectSignatures
|
||||
{
|
||||
static NSArray *_signatures = nil;
|
||||
if (_signatures == nil)
|
||||
{
|
||||
NSArray *arr = [NSArray arrayWithObjects:
|
||||
@"A", @"A", nil];
|
||||
arr = [[super aspectSignatures] arrayByAddingObjectsFromArray: arr];
|
||||
_signatures = RETAIN(arr);
|
||||
}
|
||||
return _signatures;
|
||||
}
|
||||
|
||||
+ (NSArray *)objectKeysTaken
|
||||
{
|
||||
static NSArray *_keys = nil;
|
||||
if (_keys == nil)
|
||||
{
|
||||
_keys = [NSArray new];
|
||||
}
|
||||
return _keys;
|
||||
}
|
||||
+ (BOOL)isUsableWithObject: (id)object
|
||||
{
|
||||
return [object isKindOfClass: [NSTableColumn class]];
|
||||
}
|
||||
|
||||
+ (NSString *)displayName
|
||||
{
|
||||
return @"EOColumnAssoc";
|
||||
}
|
||||
|
||||
+ (NSString *)primaryAspect
|
||||
{
|
||||
return @"value";
|
||||
}
|
||||
|
||||
- (id)initWithObject: (id)object
|
||||
{
|
||||
if ((self = [super initWithObject: object]))
|
||||
{
|
||||
_sortingSelector = @selector(compareAscending:);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)establishConnection
|
||||
{
|
||||
}
|
||||
- (void)breakConnection
|
||||
{
|
||||
}
|
||||
|
||||
- (void)subjectChanged
|
||||
{
|
||||
}
|
||||
- (BOOL)endEditing
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)setSortingSelector: (SEL)selector
|
||||
{
|
||||
_sortingSelector = selector;
|
||||
}
|
||||
- (SEL)sortingSelector
|
||||
{
|
||||
return _sortingSelector;
|
||||
}
|
||||
|
||||
|
||||
- (void)tableView: (NSTableView *)tableView
|
||||
setObjectValue: (id)object
|
||||
forTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row
|
||||
{
|
||||
}
|
||||
|
||||
- (id)tableView: (NSTableView *)tableView
|
||||
objectValueForTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL)tableView: (NSTableView *)tableView
|
||||
shouldEditTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)tableView: (NSTableView *)tableView
|
||||
willDisplayCell: (id)cell
|
||||
forTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL)control: (NSControl *)control
|
||||
didFailToFormatString: (NSString *)string
|
||||
errorDescription: (NSString *)description
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)control: (NSControl *)control
|
||||
isValidObject: (id)object
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)control: (NSControl *)control
|
||||
textShouldBeginEditing: (NSText *)fieldEditor
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
|
@ -27,7 +27,10 @@
|
|||
#ifndef __EOInterface_h__
|
||||
#define __EOInterface_h__
|
||||
|
||||
#include <EOInterface/EOActionAssociation.h>
|
||||
#include <EOInterface/EOActionInsertionAssociation.h>
|
||||
#include <EOInterface/EOAssociation.h>
|
||||
#include <EOInterface/EOColumnAssociation.h>
|
||||
#include <EOInterface/EODisplayGroup.h>
|
||||
|
||||
#endif /* __EOInterface_h__ */
|
||||
|
|
175
EOInterface/EOTableViewAssociation.m
Normal file
175
EOInterface/EOTableViewAssociation.m
Normal file
|
@ -0,0 +1,175 @@
|
|||
/**
|
||||
EOTableViewAssociation.m
|
||||
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
|
||||
Author: David Ayers <d.ayers@inode.at>
|
||||
|
||||
This file is part of the GNUstep Database Library
|
||||
|
||||
The GNUstep Database Library is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU Lesser General Public License
|
||||
as published by the Free Software Foundation; either version 2,
|
||||
or (at your option) any later version.
|
||||
|
||||
The GNUstep Database 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNUstep Database Library; see the file COPYING. If not,
|
||||
write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef GNUSTEP
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
|
||||
#include <AppKit/NSTableView.h>
|
||||
#include <AppKit/NSTableColumn.h>
|
||||
#include <AppKit/NSText.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <AppKit/AppKit.h>
|
||||
#endif
|
||||
|
||||
#include "EOColumnAssociation.h"
|
||||
|
||||
@implementation EOTableViewAssociation
|
||||
+ (NSArray *)aspects
|
||||
{
|
||||
static NSArray *_aspects = nil;
|
||||
if (_aspects == nil)
|
||||
{
|
||||
NSArray *arr = [NSArray arrayWithObjects:
|
||||
@"source", @"enabled", @"textColor",
|
||||
@"bold", @"italic", nil];
|
||||
_aspects = RETAIN([[super aspects] arrayByAddingObjectsFromArray: arr]);
|
||||
}
|
||||
return _aspects;
|
||||
}
|
||||
|
||||
+ (NSArray *)aspectSignatures
|
||||
{
|
||||
static NSArray *_signatures = nil;
|
||||
if (_signatures == nil)
|
||||
{
|
||||
NSArray *arr = [NSArray arrayWithObjects:
|
||||
@"", @"A", @"A", @"A", @"A", nil];
|
||||
arr = [[super aspectSignatures] arrayByAddingObjectsFromArray: arr];
|
||||
_signatures = RETAIN(arr);
|
||||
}
|
||||
return _signatures;
|
||||
}
|
||||
|
||||
|
||||
+ (NSArray *)objectKeysTaken
|
||||
{
|
||||
static NSArray *_keys = nil;
|
||||
if (_keys == nil)
|
||||
{
|
||||
_keys = [[NSArray alloc] initWithObjects:
|
||||
@"target", @"delegate", @"dataSource", nil];
|
||||
}
|
||||
return _keys;
|
||||
}
|
||||
+ (BOOL)isUsableWithObject: (id)object
|
||||
{
|
||||
return [object isKindOfClass: [NSTableView class]];
|
||||
}
|
||||
|
||||
+ (NSString *)primaryAspect
|
||||
{
|
||||
return @"source";
|
||||
}
|
||||
|
||||
- (void)establishConnection
|
||||
{
|
||||
}
|
||||
- (void)breakConnection
|
||||
{
|
||||
}
|
||||
|
||||
- (void)subjectChanged
|
||||
{
|
||||
}
|
||||
|
||||
+ (void)bindToTableView: (NSTableView *)tableView
|
||||
displayGroup: (EODisplayGroup *)displayGroup
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL)sortsByColumnOrder
|
||||
{
|
||||
return _sortsByColumnOrder;
|
||||
}
|
||||
- (void)setSortsByColumnOrder: (BOOL)flag
|
||||
{
|
||||
_sortsByColumnOrder = flag ? YES : NO;
|
||||
}
|
||||
|
||||
- (EOColumnAssociation *)editingAssociation
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (int)numberOfRowsInTableView: (NSTableView *)tableView
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (void)tableView: (NSTableView *)tableView
|
||||
setObjectValue: (id)object
|
||||
forTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row
|
||||
{
|
||||
}
|
||||
|
||||
- (id)tableView: (NSTableView *)tableView
|
||||
objectValueForTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL)tableView: (NSTableView *)tableView
|
||||
shouldEditTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)tableView: (NSTableView *)tableView
|
||||
willDisplayCell: (id)cell
|
||||
forTableColumn: (NSTableColumn *)tableColumn
|
||||
row: (int)row
|
||||
{
|
||||
}
|
||||
|
||||
- (void)tableViewSelectionDidChange: (NSNotification *)notification
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL)control: (NSControl *)control
|
||||
didFailToFormatString: (NSString *)string
|
||||
errorDescription: (NSString *)description
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)control: (NSControl *)control
|
||||
isValidObject: (id)object
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)control: (NSControl *)control
|
||||
textShouldBeginEditing: (NSText *)fieldEditor
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
|
@ -34,14 +34,21 @@ EOInterface_C_FILES =
|
|||
|
||||
# The Objective-C source files to be compiled
|
||||
EOInterface_OBJC_FILES = \
|
||||
EOActionAssociation.m \
|
||||
EOActionInsertionAssociation.m \
|
||||
EOAssociation.m \
|
||||
EOColumnAssociation.m \
|
||||
EODisplayGroup.m \
|
||||
EOTableViewAssociation.m \
|
||||
|
||||
|
||||
EOInterface_HEADER_FILES_DIR = .
|
||||
|
||||
EOInterface_HEADER_FILES = \
|
||||
EOActionAssociation.h \
|
||||
EOActionInsertionAssociation.h \
|
||||
EOAssociation.h \
|
||||
EOColumnAssociation.h \
|
||||
EODisplayGroup.h \
|
||||
EOInterface.h
|
||||
|
||||
|
|
Loading…
Reference in a new issue