mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
Well, that took a fair bit more than it should have to get working: had to implement the protocol support in qfcc and engine-side ruamoko.
48 lines
635 B
R
48 lines
635 B
R
#include "qwaq-curses.h"
|
|
#include "qwaq-screen.h"
|
|
|
|
@implementation Screen
|
|
+(Screen *) screen
|
|
{
|
|
return [[[self alloc] init] autorelease];
|
|
}
|
|
|
|
-init
|
|
{
|
|
if (!(self = [super init])) {
|
|
return nil;
|
|
}
|
|
window = stdscr;
|
|
rect = getwrect (window);
|
|
return self;
|
|
}
|
|
|
|
-add: obj
|
|
{
|
|
if ([obj conformsToProtocol: @protocol (Draw)]) {
|
|
[views addObject: obj];
|
|
}
|
|
if ([obj conformsToProtocol: @protocol (HandleEvent)]) {
|
|
[event_handlers addObject: obj];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
-setBackground: (int) ch
|
|
{
|
|
wbkgd (window, ch);
|
|
wrefresh (window);
|
|
return self;
|
|
}
|
|
|
|
-handleEvent: (qwaq_event_t *) event
|
|
{
|
|
return self;
|
|
}
|
|
|
|
-draw
|
|
{
|
|
return self;
|
|
}
|
|
|
|
@end
|