3 |
|
* |
4 |
|
* $Id$ |
5 |
|
* |
6 |
< |
* Basilisk II (C) 1997-2003 Christian Bauer |
6 |
> |
* Basilisk II (C) 1997-2004 Christian Bauer |
7 |
|
* |
8 |
|
* This program is free software; you can redistribute it and/or modify |
9 |
|
* it under the terms of the GNU General Public License as published by |
396 |
|
|
397 |
|
mouse = location; |
398 |
|
|
399 |
< |
#ifdef CAN_RESIZE_VIEW |
400 |
< |
int mouseY = y - y * mouse.y / [self height]; |
401 |
< |
int mouseX = x * mouse.x / [self width]; |
402 |
< |
#else |
403 |
< |
int mouseY = y - (int) mouse.y; |
404 |
< |
int mouseX = (int) mouse.x; |
405 |
< |
#endif |
399 |
> |
int mouseY = y - (int) (y * mouse.y / [self height]); |
400 |
> |
int mouseX = (int) (x * mouse.x / [self width]); |
401 |
> |
// If the view was not resizable, then this would be simpler: |
402 |
> |
// int mouseY = y - (int) mouse.y; |
403 |
> |
// int mouseX = (int) mouse.x; |
404 |
|
|
405 |
|
ADBMouseMoved(mouseX, mouseY); |
406 |
|
return YES; |
477 |
|
#endif |
478 |
|
} |
479 |
|
|
480 |
+ |
- (void) setTo: (int) val // Set all of bitmap to val |
481 |
+ |
{ |
482 |
+ |
unsigned char *data |
483 |
+ |
#ifdef NSBITMAP |
484 |
+ |
= [bitmap bitmapData]; |
485 |
+ |
#else |
486 |
+ |
= (unsigned char *) bitmap; |
487 |
+ |
#endif |
488 |
+ |
|
489 |
+ |
memset(data, val, (long unsigned)numBytes); |
490 |
+ |
} |
491 |
+ |
|
492 |
+ |
- (void) blacken // Set bitmap black |
493 |
+ |
{ |
494 |
+ |
[self setTo: 0]; |
495 |
+ |
} |
496 |
+ |
|
497 |
+ |
- (void) clear // Set bitmap white |
498 |
+ |
{ |
499 |
+ |
[self setTo: 0xFF]; |
500 |
+ |
} |
501 |
+ |
|
502 |
|
// |
503 |
|
// Extra drawing stuff |
504 |
|
// |