mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-11 15:51:36 +00:00
53b553e892
Needed for structured types (arrays, structs, etc). The multiple rows aren't implemented yet, but the initial groundwork is done.
29 lines
629 B
R
29 lines
629 B
R
#include <string.h>
|
|
#include "ruamoko/qwaq/debugger/views/stringview.h"
|
|
|
|
@implementation StringView
|
|
|
|
-initWithDef:(qdb_def_t)def in:(void *)data type:(qfot_type_t *)type
|
|
{
|
|
if (!(self = [super initWithDef:def])) {
|
|
return nil;
|
|
}
|
|
self.data = (int *)(data + def.offset);
|
|
return self;
|
|
}
|
|
|
|
+(StringView *)withDef:(qdb_def_t)def in:(void *)data type:(qfot_type_t *)type
|
|
{
|
|
return [[[self alloc] initWithDef:def in:data type:type] autorelease];
|
|
}
|
|
|
|
-draw
|
|
{
|
|
[super draw];
|
|
string val = sprintf ("\"%s\"",
|
|
str_quote (qdb_get_string (target, data[0])));
|
|
[self mvprintf:{0, 0}, "%*.*s", xlen, xlen, val];
|
|
return self;
|
|
}
|
|
|
|
@end
|