mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-11 07:42:18 +00:00
da3ac388fe
Once aggregate initializers are working, ruamoko/gui will "compile" (no object files, and still the bogus integer constant into ... warning).
69 lines
1.1 KiB
R
69 lines
1.1 KiB
R
#include "gui/Size.h"
|
|
#include "gui/Point.h"
|
|
#include "gui/Rect.h"
|
|
#include "gui/View.h"
|
|
|
|
@implementation View
|
|
|
|
- (id) initWithComponents: (integer)x : (integer)y : (integer)w : (integer)h
|
|
{
|
|
self = [self init];
|
|
xpos = xabs = x;
|
|
ypos = yabs = y;
|
|
xlen = w;
|
|
ylen = h;
|
|
parent = nil;
|
|
return self;
|
|
}
|
|
|
|
- (id) initWithOrigin: (Point)anOrigin size: (Size)aSize
|
|
{
|
|
return [self initWithComponents:anOrigin.x :anOrigin.y
|
|
:aSize.width :aSize.height];
|
|
}
|
|
|
|
- (id) initWithBounds: (Rect)aRect
|
|
{
|
|
return [self initWithOrigin:aRect.origin size:aRect.size];
|
|
}
|
|
|
|
- (id) canFocus: (integer) cf
|
|
{
|
|
flags |= 1;
|
|
return self;
|
|
}
|
|
|
|
- (integer) canFocus
|
|
{
|
|
return flags & 1;
|
|
}
|
|
|
|
- (Point) basePos
|
|
{
|
|
return makePoint (xabs, yabs);
|
|
}
|
|
|
|
- (void) setBasePos: (integer) x y: (integer) y
|
|
{
|
|
local Point point = {x, y};
|
|
xabs = xpos + x;
|
|
yabs = ypos + y;
|
|
}
|
|
|
|
- (void) setBasePosFromView: (View *) view
|
|
{
|
|
Point pos = [view basePos];
|
|
xabs = xpos + pos.x;
|
|
yabs = ypos + pos.y;
|
|
}
|
|
|
|
-(void) draw
|
|
{
|
|
}
|
|
|
|
- (integer) keyEvent:(integer)key unicode:(integer)unicode down:(integer)down
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
@end
|