ocarina/gui/history.c

39 lines
858 B
C

/*
* Copyright 2014 (c) Anna Schumaker.
*/
#include <gui/queue.h>
#include <gui/sidebar.h>
static void *__history_init(struct queue *queue, void *data)
{
return gui_queue_alloc(queue, "History", 0);
}
static void __history_added(struct queue *queue, unsigned int pos)
{
gui_queue_added(queue, pos);
gui_sidebar_set_size(gui_queue(queue));
}
static bool __history_erase(struct queue *queue, struct track *track)
{
return false;
}
static void __history_removed(struct queue *queue, unsigned int pos)
{
gui_queue_removed(queue, pos);
gui_sidebar_set_size(gui_queue(queue));
}
struct queue_ops history_ops = {
.qop_init = __history_init,
.qop_deinit = gui_queue_free,
.qop_added = __history_added,
.qop_erase = __history_erase,
.qop_removed = __history_removed,
.qop_cleared = gui_queue_cleared,
.qop_updated = gui_queue_updated,
};