diff --git a/ruamoko/qwaq/Makefile.am b/ruamoko/qwaq/Makefile.am index 182ed2565..c61fbafb7 100644 --- a/ruamoko/qwaq/Makefile.am +++ b/ruamoko/qwaq/Makefile.am @@ -32,6 +32,7 @@ qwaq_app_dat_src= \ qwaq-garray.r \ qwaq-group.r \ qwaq-listener.r \ + qwaq-proxyview.r \ qwaq-rect.r \ qwaq-screen.r \ qwaq-textcontext.r \ diff --git a/ruamoko/qwaq/qwaq-proxyview.h b/ruamoko/qwaq/qwaq-proxyview.h new file mode 100644 index 000000000..7789678fc --- /dev/null +++ b/ruamoko/qwaq/qwaq-proxyview.h @@ -0,0 +1,17 @@ +#ifndef __qwaq_proxyview_h +#define __qwaq_proxyview_h + +#include "qwaq-view.h" + +@interface ProxyView : Object +{ + View *view; +} +-initWithView:(View *) view; +-setView: (View *) view; +@end + +@interface ProxyView (View) +@end + +#endif//__qwaq_proxyview_h diff --git a/ruamoko/qwaq/qwaq-proxyview.r b/ruamoko/qwaq/qwaq-proxyview.r new file mode 100644 index 000000000..a29b1dedd --- /dev/null +++ b/ruamoko/qwaq/qwaq-proxyview.r @@ -0,0 +1,38 @@ +#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