![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
RBSourceListModel; RBSourceListModelClass; enum RBSourceListModelColumn; GtkTreeModel* rb_sourcelist_model_new (void); void rb_sourcelist_model_set_dnd_targets (RBSourceListModel *sourcelist, GtkTreeView *treeview);
RBSourceListModel implements GtkTreeModel, GtkTreeDragSource, RbTreeDragSource and RbTreeDragDest.
The RBSourceList widget is backed by a GtkTreeStore containing the sources and a set of attributes used to structure and display them, and a GtkTreeModelFilter that hides sources with the visibility property set to FALSE. This class implements the filter model and also creates the actual model.
The source list model supports drag and drop in a variety of formats. The simplest of these are text/uri-list and application/x-rhythmbox-entry, which convey URIs and IDs of existing database entries. When dragged to an existing source, these just add the URIs or entries to the target source. When dragged to an empty space in the source list, this results in the creation of a static playlist.
text/x-rhythmbox-artist, text/x-rhythmbox-album, and text/x-rhythmbox-genre are used when dragging items from the library browser. When dragged to the source list, these result in the creation of a new auto playlist with the dragged items as criteria.
typedef struct { GtkTreeModelFilterClass parent_class; void (*drop_received) (RBSourceListModel *model, RBSource *target, GtkTreeViewDropPosition pos, GtkSelectionData *data); } RBSourceListModelClass;
typedef enum { RB_SOURCELIST_MODEL_COLUMN_PLAYING = 0, RB_SOURCELIST_MODEL_COLUMN_PIXBUF, RB_SOURCELIST_MODEL_COLUMN_NAME, RB_SOURCELIST_MODEL_COLUMN_SOURCE, RB_SOURCELIST_MODEL_COLUMN_ATTRIBUTES, RB_SOURCELIST_MODEL_COLUMN_VISIBILITY, RB_SOURCELIST_MODEL_COLUMN_IS_GROUP, RB_SOURCELIST_MODEL_COLUMN_GROUP_CATEGORY, RB_SOURCELIST_MODEL_N_COLUMNS } RBSourceListModelColumn;
Columns present in the source list model.
TRUE if the source is playing | |
the source's icon as a pixbuf | |
the source name | |
the RBSource object | |
Pango attributes used to render the source name | |
the source's visibility | |
whether the row identifies a group or a source | |
if the row is a group, the category for the group | |
GtkTreeModel* rb_sourcelist_model_new (void);
This constructs both the GtkTreeStore holding the source data and the filter model that hides invisible sources.
Returns : |
the RBSourceListModel |
void rb_sourcelist_model_set_dnd_targets (RBSourceListModel *sourcelist, GtkTreeView *treeview);
Sets up the drag and drop targets for the source list.
|
the RBSourceListModel |
|
the sourcel ist GtkTreeView |
"drop-received"
signalvoid user_function (RBSourceListModel *model, RBSource *target, gint pos, gpointer data, gpointer user_data) : Run Last
Emitted when a drag and drop operation to the source list completes.
|
the RBSourceListModel |
|
the RBSource receiving the drop |
|
the drop position |
|
the drop data |
|
user data set when the signal handler was connected. |