2020-02-29 15:40:55 +00:00
|
|
|
#ifndef __qwaq_view_h
|
|
|
|
#define __qwaq_view_h
|
|
|
|
|
|
|
|
#include <Array.h>
|
|
|
|
#include <Object.h>
|
|
|
|
|
2020-03-02 06:22:54 +00:00
|
|
|
#include "qwaq-draw.h"
|
2020-03-01 09:25:02 +00:00
|
|
|
#include "qwaq-rect.h"
|
2020-03-06 08:25:19 +00:00
|
|
|
#include "qwaq-textcontext.h"
|
2020-02-29 15:40:55 +00:00
|
|
|
|
2020-03-05 06:44:53 +00:00
|
|
|
@class Group;
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ofCanFocus =0x0001,
|
|
|
|
ofFirstClick =0x0002,
|
|
|
|
ofDontDraw =0x0004,
|
|
|
|
ofPreProcess =0x0008,
|
|
|
|
ofPostProcess =0x0010,
|
|
|
|
ofMakeFirst =0x0020,
|
|
|
|
ofTileable =0x0040,
|
|
|
|
ofCentered =0x0080,
|
|
|
|
|
|
|
|
ofCallHasObject =0x8000,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
sfDrawn =0x0001,
|
|
|
|
sfDisabled =0x0002,
|
|
|
|
sfInFocus =0x0004,
|
|
|
|
sfModal =0x0008,
|
|
|
|
sfLocked =0x0010,
|
|
|
|
};
|
|
|
|
|
|
|
|
@interface View: Object
|
2020-02-29 15:40:55 +00:00
|
|
|
{
|
2020-03-05 06:44:53 +00:00
|
|
|
union {
|
|
|
|
Rect rect;
|
|
|
|
struct {
|
2020-03-19 04:50:35 +00:00
|
|
|
int xpos;
|
|
|
|
int ypos;
|
|
|
|
int xlen;
|
|
|
|
int ylen;
|
|
|
|
};
|
|
|
|
struct {
|
|
|
|
Point pos;
|
|
|
|
Extent size;
|
2020-03-05 06:44:53 +00:00
|
|
|
};
|
|
|
|
};
|
2020-02-29 15:40:55 +00:00
|
|
|
Rect absRect;
|
|
|
|
Point point; // can't be local :(
|
2020-03-05 06:44:53 +00:00
|
|
|
Group *owner;
|
2020-03-17 16:39:12 +00:00
|
|
|
id<TextContext> textContext;
|
2020-03-05 06:44:53 +00:00
|
|
|
int state;
|
|
|
|
int options;
|
|
|
|
int cursorState;
|
|
|
|
Point cursor;
|
2020-02-29 15:40:55 +00:00
|
|
|
}
|
|
|
|
-initWithRect: (Rect) rect;
|
2020-03-05 06:44:53 +00:00
|
|
|
- (void) dealloc;
|
2020-03-19 02:32:44 +00:00
|
|
|
|
2020-03-05 06:44:53 +00:00
|
|
|
-setOwner: (Group *) owner;
|
2020-03-19 02:32:44 +00:00
|
|
|
|
|
|
|
-(struct Rect_s *)rect;
|
|
|
|
|
|
|
|
-(int) options;
|
|
|
|
|
|
|
|
-setContext: (id<TextContext>) context;
|
2020-03-05 06:44:53 +00:00
|
|
|
-draw;
|
|
|
|
-redraw;
|
2020-03-14 10:45:07 +00:00
|
|
|
-handleEvent: (qwaq_event_t *) event;
|
2020-03-06 08:25:19 +00:00
|
|
|
|
2020-03-19 02:32:44 +00:00
|
|
|
|
2020-03-06 08:25:19 +00:00
|
|
|
- (void) refresh;
|
|
|
|
- (void) mvprintf: (Point) pos, string fmt, ...;
|
|
|
|
- (void) mvvprintf: (Point) pos, string fmt, @va_list args;
|
|
|
|
- (void) mvaddch: (Point) pos, int ch;
|
2020-02-29 15:40:55 +00:00
|
|
|
@end
|
|
|
|
|
2020-03-17 16:39:12 +00:00
|
|
|
@interface View (TextContext) <TextContext>
|
2020-03-09 17:58:30 +00:00
|
|
|
@end
|
|
|
|
|
2020-02-29 15:40:55 +00:00
|
|
|
#endif//__qwaq_view_h
|