mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
[Feature, Plugin] lastfm_scrobbler_viewer
a plugin to view lastfm scrobbler logs uses print cell to give a spreadsheet view of scrobbler logs buffers the whole file if possible otherwise it reads entries from disk rudimentary text searching for columns include / exclude; all/any and case sensitive Change-Id: Id9616e5796658952fba4ea747f596cb77d6f34c0
This commit is contained in:
parent
43b0fba75d
commit
dfe12252bb
11 changed files with 1361 additions and 114 deletions
|
|
@ -21,25 +21,67 @@
|
|||
|
||||
#ifndef _PRINTCELL_LIST_H_
|
||||
#define _PRINTCELL_LIST_H_
|
||||
#ifndef PRINTCELL_MAX_COLUMNS
|
||||
#define PRINTCELL_MAX_COLUMNS 16 /* Max 32 (hidecol_flags)*/
|
||||
#endif
|
||||
|
||||
#define PRINTCELL_MAXLINELEN MAX_PATH
|
||||
#define PC_COL_FLAG(col) ((uint32_t)(col >= 0 \
|
||||
&& col < PRINTCELL_MAX_COLUMNS) ? 1u<<col : -1u)
|
||||
|
||||
/* sets the printcell function enabled */
|
||||
void printcell_enable(struct gui_synclist *gui_list, bool enable, bool separator);
|
||||
#define PRINTCELL_COLUMN_IS_VISIBLE(flag, col) ((flag & PC_COL_FLAG(col)) == 0)
|
||||
#define PRINTCELL_COLUMN_FLAG(col) (PC_COL_FLAG(col))
|
||||
|
||||
/* sets title and calculates cell widths each column is identified by '$' character
|
||||
ex 3 columns title = "Col1$Col2$Col3" also accepts $*WIDTH$
|
||||
ex 3 columns varying width title = "$*64$Col1$*128$Col2$Col3
|
||||
returns number of columns
|
||||
struct printcell_settings
|
||||
{
|
||||
bool cell_separator;
|
||||
char title_delimeter;
|
||||
char text_delimeter;
|
||||
uint32_t hidecol_flags;
|
||||
};
|
||||
|
||||
/* Printcell initialization - Sets title and calculates cell widths
|
||||
* by default each column is identified by '$' character
|
||||
* ex 3 columns title = "Col1$Col2$Col3" also accepts $*WIDTH$
|
||||
* ex 3 columns varying width title = "$*64$Col1$*128$Col2$Col3
|
||||
* supplying struct printcell_settings pcs allows changing default settings
|
||||
* supply NULL to use defaults
|
||||
*
|
||||
* Returns number of columns
|
||||
*/
|
||||
int printcell_set_columns(struct gui_synclist *gui_list,
|
||||
char * title, enum themable_icons icon);
|
||||
int printcell_set_columns(struct gui_synclist *gui_list,
|
||||
struct printcell_settings * pcs,
|
||||
char * title, enum themable_icons icon);
|
||||
|
||||
/* increments the current selected column negative increment is allowed
|
||||
returns the selected column
|
||||
/* Sets the printcell function enabled (use after initializing with set_column)
|
||||
* Note you should call printcell_enable(false) if the list might be reused */
|
||||
void printcell_enable(bool enable);
|
||||
|
||||
/* Increments the current selected column negative increment is allowed
|
||||
returns the selected column
|
||||
range: -1(no selection) to ncols - 1 */
|
||||
int printcell_increment_column(struct gui_synclist *gui_list, int increment, bool wrap);
|
||||
int printcell_increment_column(int increment, bool wrap);
|
||||
|
||||
/* return the text of currently selected column buffer should be sized
|
||||
/* Return index of the currently selected column (-1 to ncols - 1) */
|
||||
int printcell_get_column_selected(void);
|
||||
|
||||
/* Return the text of currently selected column buffer should be sized
|
||||
* for max item len, buf[PRINTCELL_MAXLINELEN] is a safe bet */
|
||||
char *printcell_get_selected_column_text(struct gui_synclist *gui_list, char *buf, size_t bufsz);
|
||||
char *printcell_get_column_text(int selcol, char *buf, size_t bufsz);
|
||||
|
||||
/* Return the text of currently selected column title should be sized
|
||||
* for max item len, buf[PRINTCELL_MAXLINELEN] is a safe bet */
|
||||
char *printcell_get_title_text(int selcol, char *buf, size_t bufsz);
|
||||
|
||||
|
||||
/* Hide or show a specified column - supply col = -1 to affect all columns */
|
||||
void printcell_set_column_visible(int col, bool visible);
|
||||
|
||||
/* Return visibility of a specified column
|
||||
* returns (1 visible or 0 hidden)
|
||||
* if supply col == -1 a flag with visibility of all columns will be returned
|
||||
* NOTE: flag denotes a hidden column by a 1 in the column bit (1 << col#)
|
||||
* PRINTCELL_COLUMN_IS_VISIBLE(flag,col) macro will convert to bool
|
||||
*/
|
||||
uint32_t printcell_get_column_visibility(int col);
|
||||
#endif /*_PRINTCELL_LIST_H_*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue