diff --git a/ruamoko/qwaq/qwaq-view.h b/ruamoko/qwaq/qwaq-view.h index 10e0c93ae..086b9d12d 100644 --- a/ruamoko/qwaq/qwaq-view.h +++ b/ruamoko/qwaq/qwaq-view.h @@ -59,12 +59,16 @@ enum { -redraw; - (void) refresh; -- (void) printf: (string) fmt, ...; -- (void) vprintf: (string) fmt, @va_list args; -- (void) addch: (int) ch; - (void) mvprintf: (Point) pos, string fmt, ...; - (void) mvvprintf: (Point) pos, string fmt, @va_list args; - (void) mvaddch: (Point) pos, int ch; @end +//These are forwarded (FIXME make a protocol) +@interface View (TextContext) +- (void) printf: (string) fmt, ...; +- (void) vprintf: (string) fmt, @va_list args; +- (void) addch: (int) ch; +@end + #endif//__qwaq_view_h diff --git a/ruamoko/qwaq/qwaq-view.r b/ruamoko/qwaq/qwaq-view.r index fc0ccf90f..98cdf4429 100644 --- a/ruamoko/qwaq/qwaq-view.r +++ b/ruamoko/qwaq/qwaq-view.r @@ -89,14 +89,15 @@ updateScreenCursor (View *view) return ▭ } -- (void) printf: (string) fmt, ... +- (void) forward: (SEL) sel : (@va_list) args { - [textContext vprintf: fmt, @args]; -} - -- (void) vprintf: (string) fmt, @va_list args -{ - [textContext vprintf: fmt, args]; + if (!textContext) { + return; + } + if (!__obj_responds_to (textContext, sel)) { + [self error: "no implementation for %s", sel_get_name (sel)]; + } + obj_msg_sendv (textContext, sel, args); } - (void) refresh @@ -104,11 +105,6 @@ updateScreenCursor (View *view) [textContext refresh]; } -- (void) addch: (int) ch -{ - [textContext addch:ch]; -} - - (void) mvprintf: (Point) pos, string fmt, ... { pos.x += xpos;