mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher] break table view and table view data source in two files
Change-Id: I98407e8900727d1ce8fea78c721f56192a24e1f8
This commit is contained in:
@@ -23,6 +23,7 @@ objs += $(addprefix escher/src/,\
|
||||
tab_view_controller.o\
|
||||
table_view.o\
|
||||
table_view_cell.o\
|
||||
table_view_data_source.o\
|
||||
text_field.o\
|
||||
text_view.o\
|
||||
tiled_view.o\
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <escher/tab_view_controller.h>
|
||||
#include <escher/table_view.h>
|
||||
#include <escher/table_view_cell.h>
|
||||
#include <escher/table_view_data_source.h>
|
||||
#include <escher/tiled_view.h>
|
||||
#include <escher/view.h>
|
||||
#include <escher/view_controller.h>
|
||||
|
||||
@@ -2,28 +2,7 @@
|
||||
#define ESCHER_TABLE_VIEW_H
|
||||
|
||||
#include <escher/scroll_view.h>
|
||||
|
||||
class TableViewDataSource {
|
||||
public:
|
||||
virtual int numberOfRows() = 0;
|
||||
virtual int numberOfColumns() = 0;
|
||||
virtual void willDisplayCellAtLocation(View * cell, int i, int j);
|
||||
virtual KDCoordinate columnWidth(int i) = 0;
|
||||
virtual KDCoordinate rowHeight(int j) = 0;
|
||||
/* return the number of pixels to include in offset to display the column i at
|
||||
the top */
|
||||
virtual KDCoordinate cumulatedWidthFromIndex(int i) = 0;
|
||||
virtual KDCoordinate cumulatedHeightFromIndex(int j) = 0;
|
||||
/* return the number of columns (starting with first ones) that can be fully
|
||||
* displayed in offsetX pixels.
|
||||
* Caution: if the offset is exactly the size of n columns, the function
|
||||
* returns n-1. */
|
||||
virtual int indexFromCumulatedWidth(KDCoordinate offsetX) = 0;
|
||||
virtual int indexFromCumulatedHeight(KDCoordinate offsetY) = 0;
|
||||
virtual View * reusableCell(int index, int type) = 0;
|
||||
virtual int reusableCellCount(int type) = 0;
|
||||
virtual int typeAtLocation(int i, int j) = 0;
|
||||
};
|
||||
#include <escher/table_view_data_source.h>
|
||||
|
||||
class TableView : public ScrollView {
|
||||
public:
|
||||
|
||||
28
escher/include/escher/table_view_data_source.h
Normal file
28
escher/include/escher/table_view_data_source.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef ESCHER_TABLE_VIEW_DATA_SOURCE_H
|
||||
#define ESCHER_TABLE_VIEW_DATA_SOURCE_H
|
||||
|
||||
#include <escher/view.h>
|
||||
|
||||
class TableViewDataSource {
|
||||
public:
|
||||
virtual int numberOfRows() = 0;
|
||||
virtual int numberOfColumns() = 0;
|
||||
virtual void willDisplayCellAtLocation(View * cell, int i, int j);
|
||||
virtual KDCoordinate columnWidth(int i) = 0;
|
||||
virtual KDCoordinate rowHeight(int j) = 0;
|
||||
/* return the number of pixels to include in offset to display the column i at
|
||||
the top */
|
||||
virtual KDCoordinate cumulatedWidthFromIndex(int i) = 0;
|
||||
virtual KDCoordinate cumulatedHeightFromIndex(int j) = 0;
|
||||
/* return the number of columns (starting with first ones) that can be fully
|
||||
* displayed in offsetX pixels.
|
||||
* Caution: if the offset is exactly the size of n columns, the function
|
||||
* returns n-1. */
|
||||
virtual int indexFromCumulatedWidth(KDCoordinate offsetX) = 0;
|
||||
virtual int indexFromCumulatedHeight(KDCoordinate offsetY) = 0;
|
||||
virtual View * reusableCell(int index, int type) = 0;
|
||||
virtual int reusableCellCount(int type) = 0;
|
||||
virtual int typeAtLocation(int i, int j) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -7,9 +7,6 @@ extern "C" {
|
||||
|
||||
#define MIN(x,y) ((x)<(y) ? (x) : (y))
|
||||
|
||||
void TableViewDataSource::willDisplayCellAtLocation(View * cell, int i, int j) {
|
||||
}
|
||||
|
||||
TableView::TableView(TableViewDataSource * dataSource, KDCoordinate topMargin, KDCoordinate rightMargin,
|
||||
KDCoordinate bottomMargin, KDCoordinate leftMargin) :
|
||||
ScrollView(&m_contentView, topMargin, rightMargin, bottomMargin, leftMargin),
|
||||
|
||||
4
escher/src/table_view_data_source.cpp
Normal file
4
escher/src/table_view_data_source.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
#include <escher/table_view_data_source.h>
|
||||
|
||||
void TableViewDataSource::willDisplayCellAtLocation(View * cell, int i, int j) {
|
||||
}
|
||||
Reference in New Issue
Block a user