2020-03-29 17:34:08 +00:00
|
|
|
#ifndef __qwaq_ui_textcontect_h
|
|
|
|
#define __qwaq_ui_textcontect_h
|
2020-03-06 04:54:46 +00:00
|
|
|
|
|
|
|
#ifdef __QFCC__
|
|
|
|
#include <Object.h>
|
2020-06-21 14:15:17 +00:00
|
|
|
#include "ruamoko/qwaq/ui/curses.h"
|
|
|
|
#include "ruamoko/qwaq/ui/draw.h"
|
|
|
|
#include "ruamoko/qwaq/ui/rect.h"
|
2020-03-06 04:54:46 +00:00
|
|
|
|
2020-03-10 10:23:51 +00:00
|
|
|
@class DrawBuffer;
|
|
|
|
|
2020-03-17 16:39:12 +00:00
|
|
|
@interface TextContext : Object<TextContext>
|
2020-03-06 04:54:46 +00:00
|
|
|
{
|
|
|
|
window_t window;
|
2020-03-10 10:23:51 +00:00
|
|
|
union {
|
|
|
|
Rect rect;
|
|
|
|
struct {
|
|
|
|
Point offset;
|
|
|
|
Extent size;
|
|
|
|
};
|
|
|
|
struct {
|
|
|
|
int xpos;
|
|
|
|
int ypos;
|
|
|
|
int xlen;
|
|
|
|
int ylen;
|
|
|
|
};
|
|
|
|
};
|
2020-03-28 00:41:54 +00:00
|
|
|
int background;
|
2020-03-06 04:54:46 +00:00
|
|
|
}
|
|
|
|
+ (int) max_colors;
|
|
|
|
+ (int) max_color_pairs;
|
|
|
|
+ (void) init_pair: (int) pair, int fg, int bg;
|
|
|
|
+ (int) acs_char: (int) acs;
|
|
|
|
+ (void) move: (Point) pos;
|
|
|
|
+ (void) curs_set: (int) visibility;
|
|
|
|
+ (void) doupdate;
|
2020-03-06 08:25:19 +00:00
|
|
|
+ (TextContext *) screen;
|
2020-03-06 04:54:46 +00:00
|
|
|
|
2020-03-30 07:30:58 +00:00
|
|
|
+(TextContext *)textContext;
|
|
|
|
+(TextContext *)withRect:(Rect)rect;
|
|
|
|
+(TextContext *)withWindow:(window_t)window;
|
|
|
|
|
2020-03-06 04:54:46 +00:00
|
|
|
-init;
|
|
|
|
-initWithRect: (Rect) rect;
|
|
|
|
-initWithWindow: (window_t) window;
|
2020-03-06 08:25:19 +00:00
|
|
|
|
2020-03-12 17:52:23 +00:00
|
|
|
- (window_t) window;
|
|
|
|
- (Extent) size;
|
2020-03-06 08:25:19 +00:00
|
|
|
|
2020-03-10 10:23:51 +00:00
|
|
|
- blitFromBuffer: (DrawBuffer *) srcBuffer to: (Point) pos from: (Rect) rect;
|
|
|
|
|
2020-03-06 08:25:19 +00:00
|
|
|
- (void) refresh;
|
2020-03-12 17:43:01 +00:00
|
|
|
+ (void) refresh;
|
2020-03-06 04:54:46 +00:00
|
|
|
- (void) bkgd: (int) ch;
|
|
|
|
- (void) scrollok: (int) flag;
|
|
|
|
- (void) border: (box_sides_t) sides, box_corners_t corners;
|
2020-03-28 00:41:54 +00:00
|
|
|
- (void) mvhline: (Point) pos, int ch, int n;
|
2020-03-30 11:29:48 +00:00
|
|
|
- (void) mvvline: (Point) pos, int ch, int n;
|
2020-03-28 00:41:54 +00:00
|
|
|
-clearReact: (Rect) rect;
|
2020-03-06 04:54:46 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#include "QF/pr_obj.h"
|
|
|
|
|
|
|
|
typedef struct qwaq_textcontext_s {
|
|
|
|
pr_id_t isa;
|
|
|
|
pointer_t window;
|
2020-03-23 11:14:32 +00:00
|
|
|
union {
|
|
|
|
Rect rect;
|
|
|
|
struct {
|
|
|
|
Point offset;
|
|
|
|
Extent size;
|
|
|
|
};
|
|
|
|
struct {
|
|
|
|
int xpos;
|
|
|
|
int ypos;
|
|
|
|
int xlen;
|
|
|
|
int ylen;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
int background;
|
2020-03-06 04:54:46 +00:00
|
|
|
} qwaq_textcontext_t;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2020-03-29 17:34:08 +00:00
|
|
|
#endif//__qwaq_ui_textcontect_h
|