quakeforge/ruamoko/qwaq/qwaq-view.h
Bill Currie 2f3ca9d9e4 [qwaq] Clean up the hierarchy
I think I've finally figured out what I want the core hierarchy to be.
Right now, it's just the two classes: View and Window (derived from
View). Window has a Group, and Group is just a collection of Views that
it manages. QwaqApplication is just an object but like a Window, it has
a Group of views.

    View
      Window has a Group
    Group contains Views
    QwaqApplication has a group

More work needs to be done on drawing and event handling, but things are
working again.
2020-03-19 11:32:44 +09:00

78 lines
1.3 KiB
Objective-C

#ifndef __qwaq_view_h
#define __qwaq_view_h
#include <Array.h>
#include <Object.h>
#include "qwaq-draw.h"
#include "qwaq-rect.h"
#include "qwaq-textcontext.h"
@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
{
union {
Rect rect;
struct {
int xpos;
int ypos;
int xlen;
int ylen;
};
};
Rect absRect;
Point point; // can't be local :(
Group *owner;
id<TextContext> textContext;
int state;
int options;
int cursorState;
Point cursor;
}
-initWithRect: (Rect) rect;
- (void) dealloc;
-setOwner: (Group *) owner;
-(struct Rect_s *)rect;
-(int) options;
-setContext: (id<TextContext>) context;
-draw;
-redraw;
-handleEvent: (qwaq_event_t *) event;
- (void) refresh;
- (void) mvprintf: (Point) pos, string fmt, ...;
- (void) mvvprintf: (Point) pos, string fmt, @va_list args;
- (void) mvaddch: (Point) pos, int ch;
@end
@interface View (TextContext) <TextContext>
@end
#endif//__qwaq_view_h