2015-12-29 09:11:51 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2015 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#ifndef OCARINA_GUI_SIDEBAR_H
|
|
|
|
#define OCARINA_GUI_SIDEBAR_H
|
2016-08-25 10:58:24 -04:00
|
|
|
#include <core/playlist.h>
|
2016-08-21 13:34:05 -04:00
|
|
|
#include <gui/builder.h>
|
2016-01-04 08:27:30 -05:00
|
|
|
|
2015-12-29 09:11:51 -05:00
|
|
|
/* Called to initialize the sidebar. */
|
|
|
|
void gui_sidebar_init();
|
|
|
|
|
2017-08-29 10:56:03 -04:00
|
|
|
/* Called to set an iterator to the currently displayed playlist. */
|
|
|
|
gboolean gui_sidebar_iter_current(GtkTreeIter *);
|
|
|
|
|
2016-08-25 10:58:24 -04:00
|
|
|
/* Called to set an iterator to the first playlist. */
|
|
|
|
gboolean gui_sidebar_iter_first(GtkTreeIter *);
|
|
|
|
|
|
|
|
/* Called to advance the iterator to the next playlist. */
|
|
|
|
gboolean gui_sidebar_iter_next(GtkTreeIter *);
|
|
|
|
|
2016-08-25 11:41:40 -04:00
|
|
|
/* Called to set an iterator to the first child of the parent iterator. */
|
|
|
|
gboolean gui_sidebar_iter_down(GtkTreeIter *, GtkTreeIter *);
|
|
|
|
|
2016-08-25 10:58:24 -04:00
|
|
|
/*
|
|
|
|
* Called to find the name of the playlist at the given iterator.
|
|
|
|
* NOTE: This function returns a new string that must be freed with g_free().
|
|
|
|
*/
|
|
|
|
gchar *gui_sidebar_iter_name(GtkTreeIter *);
|
|
|
|
|
|
|
|
/* Called to find the type of the playlist at the given iterator. */
|
|
|
|
enum playlist_type_t gui_sidebar_iter_type(GtkTreeIter *);
|
|
|
|
|
2017-08-25 13:13:15 -04:00
|
|
|
/* Called to find the editable state of the playlist at the given iterator. */
|
|
|
|
bool gui_sidebar_iter_editable(GtkTreeIter *);
|
|
|
|
|
2016-09-10 14:03:11 -04:00
|
|
|
/* Called to find the playlist at the given iterator. */
|
|
|
|
struct playlist *gui_sidebar_iter_playlist(GtkTreeIter *);
|
|
|
|
|
2016-08-25 10:05:27 -04:00
|
|
|
/* Called to add a playlist at the current iterator. */
|
|
|
|
void gui_sidebar_iter_add(GtkTreeIter *, struct playlist *, const gchar *);
|
|
|
|
|
2016-08-25 14:40:45 -04:00
|
|
|
/* Called to add a child playlist to the current iterator in sorted order. */
|
|
|
|
void gui_sidebar_iter_sort_child(GtkTreeIter *, struct playlist *,
|
|
|
|
const gchar *);
|
|
|
|
|
2016-08-25 11:41:40 -04:00
|
|
|
/* Called to append a child playlist to the current iterator. */
|
|
|
|
void gui_sidebar_iter_append_child(GtkTreeIter *, struct playlist *,
|
|
|
|
const gchar *);
|
|
|
|
|
2016-08-30 14:13:02 -04:00
|
|
|
/* Called to update the playlist at the current iterator. */
|
2016-10-01 11:38:27 -04:00
|
|
|
void gui_sidebar_iter_update_playlist(GtkTreeIter *, struct playlist *);
|
2016-08-30 14:13:02 -04:00
|
|
|
void gui_sidebar_iter_update(GtkTreeIter *);
|
|
|
|
|
2017-04-04 11:24:56 -04:00
|
|
|
/* Called to select the row at the current iterator. */
|
|
|
|
void gui_sidebar_iter_select(GtkTreeIter *);
|
|
|
|
|
2017-08-25 13:13:15 -04:00
|
|
|
/* Called to set the current iterator as editable. */
|
|
|
|
bool gui_sidebar_iter_set_editable(GtkTreeIter *, bool);
|
|
|
|
|
2016-08-31 16:55:19 -04:00
|
|
|
/* Called to set the playlist at the given iterator as the default. */
|
|
|
|
void gui_sidebar_filter_path_select(GtkTreePath *);
|
|
|
|
|
2017-04-04 10:23:12 -04:00
|
|
|
/* Called to expand or collapse sidebar rows from the user's settings. */
|
|
|
|
void gui_sidebar_filter_set_expand(GtkTreeIter *);
|
|
|
|
|
2017-04-04 09:46:15 -04:00
|
|
|
/* Called when a playlist treeview row is expanded or collapsed. */
|
|
|
|
void gui_sidebar_filter_row_expanded(GtkTreeIter *, bool);
|
|
|
|
|
2016-08-25 10:34:00 -04:00
|
|
|
/*
|
|
|
|
* Called to find a playlist with the given name and type,
|
|
|
|
* starting from the current iterator position.
|
|
|
|
*/
|
|
|
|
gboolean gui_sidebar_iter_find(GtkTreeIter *, const gchar *,
|
|
|
|
enum playlist_type_t);
|
|
|
|
|
2016-10-01 11:32:31 -04:00
|
|
|
/* Called to set the a GtkTreeIter to the row at path string */
|
|
|
|
gboolean gui_sidebar_iter_from_string(const gchar *, GtkTreeIter *);
|
|
|
|
|
2016-08-21 13:34:05 -04:00
|
|
|
/* Called to get the sidebar widget. */
|
|
|
|
static inline GtkPaned *gui_sidebar()
|
|
|
|
{
|
|
|
|
return GTK_PANED(gui_builder_widget("sidebar"));
|
|
|
|
}
|
|
|
|
|
2016-08-25 07:44:02 -04:00
|
|
|
/* Called to get the sidebar treestore. */
|
|
|
|
static inline GtkTreeStore *gui_sidebar_store()
|
|
|
|
{
|
|
|
|
return GTK_TREE_STORE(gui_builder_object("sidebar_store"));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Called to get the sidebar treemodel. */
|
|
|
|
static inline GtkTreeModel *gui_sidebar_model()
|
|
|
|
{
|
|
|
|
return GTK_TREE_MODEL(gui_builder_object("sidebar_store"));
|
|
|
|
}
|
|
|
|
|
2016-08-25 07:50:16 -04:00
|
|
|
/* Called to get the sidebar filter model. */
|
|
|
|
static inline GtkTreeModelFilter *gui_sidebar_filter()
|
|
|
|
{
|
|
|
|
return GTK_TREE_MODEL_FILTER(gui_builder_object("sidebar_filter"));
|
|
|
|
}
|
|
|
|
|
2016-08-25 07:56:20 -04:00
|
|
|
/* Called to get the sidebar treeview. */
|
|
|
|
static inline GtkTreeView *gui_sidebar_treeview()
|
|
|
|
{
|
|
|
|
return GTK_TREE_VIEW(gui_builder_widget("sidebar_treeview"));
|
|
|
|
}
|
|
|
|
|
2017-09-03 09:07:23 -04:00
|
|
|
/* Called to get the sidebar right-click menu. */
|
|
|
|
static inline GtkMenu *gui_sidebar_menu()
|
|
|
|
{
|
|
|
|
return GTK_MENU(gui_builder_widget("rc_sidebar"));
|
|
|
|
}
|
|
|
|
|
2016-08-26 10:00:26 -04:00
|
|
|
/* Called to get the random button. */
|
|
|
|
static inline GtkToggleButton *gui_random_button()
|
|
|
|
{
|
|
|
|
return GTK_TOGGLE_BUTTON(gui_builder_widget("random_button"));
|
|
|
|
}
|
|
|
|
|
2015-12-29 09:11:51 -05:00
|
|
|
#endif /* OCARINA_GUI_SIDEBAR_H */
|