mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[escher] make simple table view data source inherit from table view
Change-Id: Ia3c64b643f633e4c7c6fd0f921fe6a79336a7b64
This commit is contained in:
52
escher/src/simple_table_view_data_source.cpp
Normal file
52
escher/src/simple_table_view_data_source.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
#include <escher/simple_table_view_data_source.h>
|
||||
#include <escher/metric.h>
|
||||
|
||||
extern "C" {
|
||||
#include <assert.h>
|
||||
}
|
||||
|
||||
KDCoordinate SimpleTableViewDataSource::columnWidth(int i) {
|
||||
return cellWidth();
|
||||
}
|
||||
|
||||
KDCoordinate SimpleTableViewDataSource::rowHeight(int j) {
|
||||
return cellHeight();
|
||||
}
|
||||
|
||||
KDCoordinate SimpleTableViewDataSource::cumulatedWidthFromIndex(int i) {
|
||||
return cellWidth() * i;
|
||||
}
|
||||
|
||||
KDCoordinate SimpleTableViewDataSource::cumulatedHeightFromIndex(int j) {
|
||||
return cellHeight() * j;
|
||||
}
|
||||
|
||||
int SimpleTableViewDataSource::indexFromCumulatedWidth(KDCoordinate offsetX) {
|
||||
KDCoordinate width = cellWidth();
|
||||
if (width == 0) {
|
||||
return 0;
|
||||
}
|
||||
return (offsetX - 1) / width;
|
||||
}
|
||||
|
||||
int SimpleTableViewDataSource::indexFromCumulatedHeight(KDCoordinate offsetY) {
|
||||
KDCoordinate height = cellHeight();
|
||||
if (height == 0) {
|
||||
return 0;
|
||||
}
|
||||
return (offsetY - 1) / height;
|
||||
}
|
||||
|
||||
View * SimpleTableViewDataSource::reusableCell(int index, int type) {
|
||||
assert(type == 0);
|
||||
return reusableCell(index);
|
||||
}
|
||||
|
||||
int SimpleTableViewDataSource::reusableCellCount(int type) {
|
||||
assert(type == 0);
|
||||
return reusableCellCount();
|
||||
}
|
||||
|
||||
int SimpleTableViewDataSource::typeAtLocation(int i, int j) {
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user