mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 15:41:59 +00:00
4057500acc
Currently shows only the axes (along with dev "path" and name), but it has done a good job of pushing dev of other bits of code :)
58 lines
991 B
R
58 lines
991 B
R
#include "ruamoko/qwaq/device/axisdata.h"
|
|
#include "ruamoko/qwaq/device/axisview.h"
|
|
|
|
@implementation AxisData
|
|
|
|
-initWithDevice:(qwaq_devinfo_t *)device
|
|
{
|
|
if (!(self = [super init])) {
|
|
return nil;
|
|
}
|
|
numaxes = device.numaxes;
|
|
axes = device.axes;
|
|
axis_views = obj_malloc (numaxes);
|
|
for (int i = 0; i < numaxes; i++) {
|
|
axis_views[i] = [[AxisView withAxis:&axes[i]] retain];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
+withDevice:(qwaq_devinfo_t *)device
|
|
{
|
|
return [[[self alloc] initWithDevice:device] autorelease];
|
|
}
|
|
|
|
-(void)dalloc
|
|
{
|
|
}
|
|
|
|
-updateAxis:(int)axis value:(int)value
|
|
{
|
|
axes[axis].value = value;
|
|
return self;
|
|
}
|
|
|
|
-(ListenerGroup *)onRowCountChanged
|
|
{
|
|
return nil;
|
|
}
|
|
|
|
-(int)numberOfRows:(TableView *)tableview
|
|
{
|
|
return numaxes;
|
|
}
|
|
|
|
-(View *)tableView:(TableView *)tableview
|
|
forColumn:(TableViewColumn *)column
|
|
row:(int)row
|
|
{
|
|
View *view = nil;
|
|
|
|
if (row >= 0 && row < numaxes) {
|
|
AxisView *av = axis_views[row];
|
|
view = [av viewAtRow:0 forColumn:column];
|
|
}
|
|
return view;
|
|
}
|
|
|
|
@end
|