mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-23 10:50:58 +00:00
[qwaq] Use forwarding for some text methods
refresh won't be in the drawing buffer protocol, and the move commands need to be offset by the view's position in its window, but it works as intended.
This commit is contained in:
parent
4b7d5447bb
commit
f9d798c314
2 changed files with 15 additions and 15 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue