![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Signals |
enum RBDisplayPageModelColumn; struct RBDisplayPageModel; struct RBDisplayPageModelClass; RBDisplayPageModel * rb_display_page_model_new (void
); void rb_display_page_model_set_playing_source (RBDisplayPageModel *page_model
,RBDisplayPage *source
); void rb_display_page_model_add_page (RBDisplayPageModel *page_model
,RBDisplayPage *page
,RBDisplayPage *parent
); void rb_display_page_model_remove_page (RBDisplayPageModel *page_model
,RBDisplayPage *page
); gboolean rb_display_page_model_find_page (RBDisplayPageModel *page_model
,RBDisplayPage *page
,GtkTreeIter *iter
); void rb_display_page_model_set_dnd_targets (RBDisplayPageModel *page_model
,GtkTreeView *treeview
);
RBDisplayPageModel implements GtkTreeModel, GtkTreeDragSource, RbTreeDragSource and RbTreeDragDest.
The RBDisplayPageTree 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 display page 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 tree widget, 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 display page tree, these result in the creation of a new auto playlist with the dragged items as criteria.
typedef enum { RB_DISPLAY_PAGE_MODEL_COLUMN_PLAYING = 0, RB_DISPLAY_PAGE_MODEL_COLUMN_PAGE, RB_DISPLAY_PAGE_MODEL_N_COLUMNS } RBDisplayPageModelColumn;
Columns present in the display page model.
TRUE if the page is the playing source | |
the RBDisplayPage object | |
the number of columns |
struct RBDisplayPageModelClass { GtkTreeModelFilterClass parent_class; void (*drop_received) (RBDisplayPageModel *model, RBDisplayPage *target, GtkTreeViewDropPosition pos, GtkSelectionData *data); void (*page_inserted) (RBDisplayPageModel *model, RBDisplayPage *page, GtkTreeIter *iter); };
RBDisplayPageModel * rb_display_page_model_new (void
);
This constructs both the GtkTreeStore holding the display page data and the filter model that hides invisible pages.
Returns : |
the RBDisplayPageModel |
void rb_display_page_model_set_playing_source (RBDisplayPageModel *page_model
,RBDisplayPage *source
);
Updates the model with the new playing source.
|
the RBDisplayPageModel |
|
the new playing RBSource (as a RBDisplayPage) |
void rb_display_page_model_add_page (RBDisplayPageModel *page_model
,RBDisplayPage *page
,RBDisplayPage *parent
);
Adds a page to the model, either below a specified page (if it's a source or something else) or at the top level (if it's a group)
|
the RBDisplayPageModel |
|
the RBDisplayPage to add |
|
the parent under which to add page
|
void rb_display_page_model_remove_page (RBDisplayPageModel *page_model
,RBDisplayPage *page
);
Removes a page from the model.
|
the RBDisplayPageModel |
|
the RBDisplayPage to remove |
gboolean rb_display_page_model_find_page (RBDisplayPageModel *page_model
,RBDisplayPage *page
,GtkTreeIter *iter
);
Finds a GtkTreeIter for a specified page in the model. This will only find pages that are currently visible. The returned GtkTreeIter can be used with the RBDisplayPageModel.
|
the RBDisplayPageModel |
|
the RBDisplayPage to find |
|
returns a GtkTreeIter for the page |
Returns : |
TRUE if the page was found |
void rb_display_page_model_set_dnd_targets (RBDisplayPageModel *page_model
,GtkTreeView *treeview
);
Sets up the drag and drop targets for the display page tree.
|
the RBDisplayPageModel |
|
the sourcel ist GtkTreeView |
"drop-received"
signalvoid user_function (RBDisplayPageModel *model,
RBDisplayPage *target,
gint pos,
gpointer data,
gpointer user_data) : Run Last
Emitted when a drag and drop operation to the display page tree completes.
|
the RBDisplayPageModel |
|
the RBSource receiving the drop |
|
the drop position |
|
the drop data |
|
user data set when the signal handler was connected. |
"page-inserted"
signalvoid user_function (RBDisplayPageModel *model,
RBDisplayPage *page,
GtkTreeIter *iter,
gpointer user_data) : Run Last
Emitted when a new page is inserted into the model. Use this instead of GtkTreeModel::row-inserted as this doesn't get complicated by visibility filtering.
|
the RBDisplayPageModel |
|
the RBDisplayPage that was inserted |
|
a GtkTreeIter indicating the page position |
|
user data set when the signal handler was connected. |