2020-03-03 12:30:47 +00:00
|
|
|
#include <Array.h>
|
2020-03-01 09:25:02 +00:00
|
|
|
#include "qwaq-curses.h"
|
|
|
|
#include "qwaq-screen.h"
|
|
|
|
|
|
|
|
@implementation Screen
|
|
|
|
+(Screen *) screen
|
|
|
|
{
|
|
|
|
return [[[self alloc] init] autorelease];
|
|
|
|
}
|
|
|
|
|
|
|
|
-init
|
|
|
|
{
|
2020-03-05 15:32:09 +00:00
|
|
|
if (!(self = [super initWithRect:getwrect (stdscr)])) {
|
2020-03-01 09:25:02 +00:00
|
|
|
return nil;
|
|
|
|
}
|
2020-03-06 08:25:19 +00:00
|
|
|
textContext = [TextContext screen];
|
2020-03-17 16:39:12 +00:00
|
|
|
[(id)textContext scrollok: 1];
|
2020-03-01 09:25:02 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2020-03-02 06:22:54 +00:00
|
|
|
-handleEvent: (qwaq_event_t *) event
|
|
|
|
{
|
2020-03-04 13:09:40 +00:00
|
|
|
if (event.what & qe_mouse) {
|
2020-03-05 15:32:09 +00:00
|
|
|
[self printf:"%04x %2d %2d %d %08x \r", event.what, event.mouse.x, event.mouse.y, event.mouse.click, event.mouse.buttons];
|
2020-03-04 13:09:40 +00:00
|
|
|
[self redraw];
|
2020-03-03 12:30:47 +00:00
|
|
|
}
|
2020-03-02 06:22:54 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
-draw
|
|
|
|
{
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2020-03-03 12:30:47 +00:00
|
|
|
-redraw
|
|
|
|
{
|
2020-03-14 10:45:07 +00:00
|
|
|
//update_panels ();
|
|
|
|
[TextContext refresh];
|
|
|
|
//[TextContext doupdate];
|
2020-03-03 12:30:47 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2020-03-01 09:25:02 +00:00
|
|
|
@end
|