[qwaq] Make a View protocol

This commit is contained in:
Bill Currie 2020-03-24 21:02:26 +09:00
parent d73f380ba4
commit 05e377c3ac

View file

@ -43,36 +43,8 @@ enum {
gfGrowY = gfGrowLoY | gfGrowHiY,
gfGrowAll = gfGrowX | gfGrowY,
};
@interface View: Object
{
union {
Rect rect;
struct {
int xpos;
int ypos;
int xlen;
int ylen;
};
struct {
Point pos;
Extent size;
};
};
Rect absRect;
Point point; // can't be local :(
Group *owner;
id<TextContext> textContext;
int state;
int options;
int growMode;
int cursorState;
Point cursor;
ListenerGroup *onReceiveFocus;
ListenerGroup *onReleaseFocus;
}
-initWithRect: (Rect) rect;
- (void) dealloc;
@protocol View
-setOwner: (Group *) owner;
-setGrowMode: (int) mode;
@ -109,6 +81,36 @@ enum {
- (void) mvaddch: (Point) pos, int ch;
@end
@interface View: Object <View>
{
union {
Rect rect;
struct {
int xpos;
int ypos;
int xlen;
int ylen;
};
struct {
Point pos;
Extent size;
};
};
Rect absRect;
Point point; // can't be local :(
Group *owner;
id<TextContext> textContext;
int state;
int options;
int growMode;
int cursorState;
Point cursor;
ListenerGroup *onReceiveFocus;
ListenerGroup *onReleaseFocus;
}
-initWithRect: (Rect) rect;
@end
@interface View (TextContext) <TextContext>
@end