mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-11 07:42:18 +00:00
c58cf2c2d0
This is horrible, doesn't work, isn't really the direction I want to go (that became apparent while implementing Screen's handleEvent) and crashes anyway (Array and not-id...) *sigh* Still, this does have some good stuff in it, and it pushed qfcc along some more.
49 lines
694 B
R
49 lines
694 B
R
#include "qwaq-curses.h"
|
|
#include "qwaq-view.h"
|
|
|
|
Rect
|
|
makeRect (int xpos, int ypos, int xlen, int ylen)
|
|
{
|
|
Rect rect = {xpos, ypos, xlen, ylen};
|
|
return rect;
|
|
}
|
|
|
|
int
|
|
rectContainsPoint (Rect *rect, Point *point)
|
|
{
|
|
return ((point.x >= rect.xpos && point.x < rect.xpos + rect.xlen)
|
|
&& (point.y >= rect.ypos && point.y < rect.ypos + rect.ylen));
|
|
}
|
|
|
|
@implementation View
|
|
|
|
-initWithRect: (Rect) rect
|
|
{
|
|
if (!(self = [super init])) {
|
|
return nil;
|
|
}
|
|
self.rect = rect;
|
|
self.absRect = rect;
|
|
self.window = nil;
|
|
return self;
|
|
}
|
|
|
|
-draw
|
|
{
|
|
return self;
|
|
}
|
|
|
|
-setParent: parent
|
|
{
|
|
self.parent = parent;
|
|
return self;
|
|
}
|
|
|
|
-redraw
|
|
{
|
|
return [parent redraw];
|
|
}
|
|
|
|
@end
|
|
|
|
Rect getwrect (window_t window) = #0;
|