mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-12 00:01:43 +00:00
fd0700f9ae
The idea is that the view can be switched out readily: the proxy simply passes all messages to its view object.
38 lines
552 B
R
38 lines
552 B
R
#include "qwaq-proxyview.h"
|
|
|
|
@implementation ProxyView
|
|
- (void) forward: (SEL) sel : (@va_list) args
|
|
{
|
|
if (!view) {
|
|
return;
|
|
}
|
|
obj_msg_sendv (view, sel, args);
|
|
}
|
|
|
|
-initWithView:(View *) view
|
|
{
|
|
if (!(self = [super init])) {
|
|
return nil;
|
|
}
|
|
self.view = view;
|
|
return self;
|
|
}
|
|
|
|
-setView:(View *) view
|
|
{
|
|
int state = [self.view state];
|
|
if (state & sfInFocus) {
|
|
[self.view loseFocus];
|
|
[self.view hide];
|
|
}
|
|
|
|
self.view = view;
|
|
if (state & sfDrawn) {
|
|
[view draw];
|
|
}
|
|
if (state & sfInFocus) {
|
|
[view takeFocus];
|
|
}
|
|
return self;
|
|
}
|
|
@end
|