mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
affadc3d25
Plenty of flaws at the moment (casts to id :/), but the basic idea seems to be ok.
43 lines
695 B
R
43 lines
695 B
R
#include <Array.h>
|
|
#include "qwaq-curses.h"
|
|
#include "qwaq-screen.h"
|
|
|
|
@implementation Screen
|
|
+(Screen *) screen
|
|
{
|
|
return [[[self alloc] init] autorelease];
|
|
}
|
|
|
|
-init
|
|
{
|
|
if (!(self = [super initWithRect:getwrect (stdscr)])) {
|
|
return nil;
|
|
}
|
|
textContext = [TextContext screen];
|
|
[(id)textContext scrollok: 1];
|
|
return self;
|
|
}
|
|
|
|
-handleEvent: (qwaq_event_t *) event
|
|
{
|
|
if (event.what & qe_mouse) {
|
|
[self printf:"%04x %2d %2d %d %08x \r", event.what, event.mouse.x, event.mouse.y, event.mouse.click, event.mouse.buttons];
|
|
[self redraw];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
-draw
|
|
{
|
|
return self;
|
|
}
|
|
|
|
-redraw
|
|
{
|
|
//update_panels ();
|
|
[TextContext refresh];
|
|
//[TextContext doupdate];
|
|
return self;
|
|
}
|
|
|
|
@end
|