2020-03-31 11:48:38 +00:00
|
|
|
#include <string.h>
|
2020-06-21 14:15:17 +00:00
|
|
|
#include "ruamoko/qwaq/debugger/views/nameview.h"
|
2020-03-31 11:48:38 +00:00
|
|
|
|
|
|
|
@implementation NameView
|
|
|
|
|
|
|
|
-initWithName:(string)name
|
|
|
|
{
|
2021-06-01 14:52:04 +00:00
|
|
|
if (!(self = [super initWithDef:def])) {
|
2020-03-31 11:48:38 +00:00
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
self.name = name;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void)dealloc
|
|
|
|
{
|
|
|
|
str_free (name);
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
+(NameView *)withName:(string)name
|
|
|
|
{
|
|
|
|
return [[[self alloc] initWithName:name] autorelease];
|
|
|
|
}
|
|
|
|
|
|
|
|
-draw
|
|
|
|
{
|
|
|
|
[super draw];
|
|
|
|
[self mvaddstr:{0, 0}, str_mid (name, 0, xlen)];
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|