mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 22:30:37 +00:00
Initial implementation of NSCursor.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2180 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0fe5f8dae5
commit
8c3afd9724
12 changed files with 410 additions and 72 deletions
|
@ -153,6 +153,9 @@ NSString *NSViewFocusChangedNotification;
|
|||
// Initialize tracking rectangle list
|
||||
tracking_rects = [NSMutableArray array];
|
||||
|
||||
// Initialize cursor rect list
|
||||
cursor_rects = [NSMutableArray array];
|
||||
|
||||
super_view = nil;
|
||||
window = nil;
|
||||
is_flipped = NO;
|
||||
|
@ -185,6 +188,11 @@ NSString *NSViewFocusChangedNotification;
|
|||
for (i = 0;i < j; ++i)
|
||||
[[tracking_rects objectAtIndex:i] release];
|
||||
|
||||
// Free the cursor rectangles
|
||||
j = [cursor_rects count];
|
||||
for (i = 0;i < j; ++i)
|
||||
[[cursor_rects objectAtIndex:i] release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -847,20 +855,55 @@ NSString *NSViewFocusChangedNotification;
|
|||
//
|
||||
// Managing the Cursor
|
||||
//
|
||||
// We utilize the tracking rectangle class
|
||||
// to also maintain the cursor rects
|
||||
//
|
||||
- (void)addCursorRect:(NSRect)aRect
|
||||
cursor:(NSCursor *)anObject
|
||||
{}
|
||||
{
|
||||
TrackingRectangle *m;
|
||||
|
||||
m = [[TrackingRectangle alloc] initWithRect: aRect tag: 0 owner: anObject
|
||||
userData: NULL inside: YES];
|
||||
[cursor_rects addObject:m];
|
||||
}
|
||||
|
||||
- (void)discardCursorRects
|
||||
{}
|
||||
{
|
||||
[cursor_rects removeAllObjects];
|
||||
}
|
||||
|
||||
- (void)removeCursorRect:(NSRect)aRect
|
||||
cursor:(NSCursor *)anObject
|
||||
{}
|
||||
{
|
||||
id e = [cursor_rects objectEnumerator];
|
||||
TrackingRectangle *o;
|
||||
NSCursor *c;
|
||||
BOOL found = NO;
|
||||
|
||||
// Base remove test upon cursor object
|
||||
o = [e nextObject];
|
||||
while (o && (!found))
|
||||
{
|
||||
c = [o owner];
|
||||
if (c == anObject)
|
||||
found = YES;
|
||||
else
|
||||
o = [e nextObject];
|
||||
}
|
||||
|
||||
if (found)
|
||||
[cursor_rects removeObject: o];
|
||||
}
|
||||
|
||||
- (void)resetCursorRects
|
||||
{}
|
||||
|
||||
- (NSArray *)cursorRectangles
|
||||
{
|
||||
return cursor_rects;
|
||||
}
|
||||
|
||||
//
|
||||
// Assigning a Tag
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue