1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
|
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="RBSourceListModel">
<refmeta>
<refentrytitle role="top_of_page" id="RBSourceListModel.top_of_page">rb-sourcelist-model</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>RHYTHMBOX Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>rb-sourcelist-model</refname>
<refpurpose>models backing the source list widget</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>
<refsynopsisdiv id="RBSourceListModel.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>
<synopsis>
<link linkend="RBSourceListModel-struct">RBSourceListModel</link>;
<link linkend="RBSourceListModelClass">RBSourceListModelClass</link>;
enum <link linkend="RBSourceListModelColumn">RBSourceListModelColumn</link>;
<link linkend="GtkTreeModel">GtkTreeModel</link>* <link linkend="rb-sourcelist-model-new">rb_sourcelist_model_new</link> (void);
<link linkend="void">void</link> <link linkend="rb-sourcelist-model-set-dnd-targets">rb_sourcelist_model_set_dnd_targets</link> (<link linkend="RBSourceListModel">RBSourceListModel</link> *sourcelist,
<link linkend="GtkTreeView">GtkTreeView</link> *treeview);
</synopsis>
</refsynopsisdiv>
<refsect1 id="RBSourceListModel.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
<link linkend="GObject">GObject</link>
+----<link linkend="GtkTreeModelFilter">GtkTreeModelFilter</link>
+----RBSourceListModel
</synopsis>
</refsect1>
<refsect1 id="RBSourceListModel.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
RBSourceListModel implements
<link linkend="GtkTreeModel">GtkTreeModel</link>, <link linkend="GtkTreeDragSource">GtkTreeDragSource</link>, <link linkend="RbTreeDragSource">RbTreeDragSource</link> and <link linkend="RbTreeDragDest">RbTreeDragDest</link>.</para>
</refsect1>
<refsect1 id="RBSourceListModel.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
"<link linkend="RBSourceListModel-drop-received">drop-received</link>" : Run Last
</synopsis>
</refsect1>
<refsect1 id="RBSourceListModel.description" role="desc">
<title role="desc.title">Description</title>
<para>
The <link linkend="RBSourceList"><type>RBSourceList</type></link> widget is backed by a <link linkend="GtkTreeStore"><type>GtkTreeStore</type></link> containing
the sources and a set of attributes used to structure and display
them, and a <link linkend="GtkTreeModelFilter"><type>GtkTreeModelFilter</type></link> that hides sources with the
visibility property set to FALSE. This class implements the filter
model and also creates the actual model.
</para>
<para>
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.
</para>
<para>
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.</para>
<para>
</para>
</refsect1>
<refsect1 id="RBSourceListModel.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="RBSourceListModel-struct" role="struct">
<title>RBSourceListModel</title>
<indexterm zone="RBSourceListModel-struct"><primary>RBSourceListModel</primary></indexterm><programlisting>typedef struct _RBSourceListModel RBSourceListModel;</programlisting>
<para>
</para></refsect2>
<refsect2 id="RBSourceListModelClass" role="struct">
<title>RBSourceListModelClass</title>
<indexterm zone="RBSourceListModelClass"><primary>RBSourceListModelClass</primary></indexterm><programlisting>typedef struct {
GtkTreeModelFilterClass parent_class;
void (*drop_received) (RBSourceListModel *model, RBSource *target, GtkTreeViewDropPosition pos, GtkSelectionData *data);
} RBSourceListModelClass;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="RBSourceListModelColumn" role="enum">
<title>enum RBSourceListModelColumn</title>
<indexterm zone="RBSourceListModelColumn"><primary>RBSourceListModelColumn</primary></indexterm><programlisting>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;
</programlisting>
<para>
Columns present in the source list model.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="RB-SOURCELIST-MODEL-COLUMN-PLAYING:CAPS" role="constant">
<term><literal>RB_SOURCELIST_MODEL_COLUMN_PLAYING</literal></term>
<listitem><simpara> TRUE if the source is playing
</simpara></listitem>
</varlistentry>
<varlistentry id="RB-SOURCELIST-MODEL-COLUMN-PIXBUF:CAPS" role="constant">
<term><literal>RB_SOURCELIST_MODEL_COLUMN_PIXBUF</literal></term>
<listitem><simpara> the source's icon as a pixbuf
</simpara></listitem>
</varlistentry>
<varlistentry id="RB-SOURCELIST-MODEL-COLUMN-NAME:CAPS" role="constant">
<term><literal>RB_SOURCELIST_MODEL_COLUMN_NAME</literal></term>
<listitem><simpara> the source name
</simpara></listitem>
</varlistentry>
<varlistentry id="RB-SOURCELIST-MODEL-COLUMN-SOURCE:CAPS" role="constant">
<term><literal>RB_SOURCELIST_MODEL_COLUMN_SOURCE</literal></term>
<listitem><simpara> the <link linkend="RBSource"><type>RBSource</type></link> object
</simpara></listitem>
</varlistentry>
<varlistentry id="RB-SOURCELIST-MODEL-COLUMN-ATTRIBUTES:CAPS" role="constant">
<term><literal>RB_SOURCELIST_MODEL_COLUMN_ATTRIBUTES</literal></term>
<listitem><simpara> Pango attributes used to render the source name
</simpara></listitem>
</varlistentry>
<varlistentry id="RB-SOURCELIST-MODEL-COLUMN-VISIBILITY:CAPS" role="constant">
<term><literal>RB_SOURCELIST_MODEL_COLUMN_VISIBILITY</literal></term>
<listitem><simpara> the source's visibility
</simpara></listitem>
</varlistentry>
<varlistentry id="RB-SOURCELIST-MODEL-COLUMN-IS-GROUP:CAPS" role="constant">
<term><literal>RB_SOURCELIST_MODEL_COLUMN_IS_GROUP</literal></term>
<listitem><simpara> whether the row identifies a group or a source
</simpara></listitem>
</varlistentry>
<varlistentry id="RB-SOURCELIST-MODEL-COLUMN-GROUP-CATEGORY:CAPS" role="constant">
<term><literal>RB_SOURCELIST_MODEL_COLUMN_GROUP_CATEGORY</literal></term>
<listitem><simpara> if the row is a group, the category for the group
</simpara></listitem>
</varlistentry>
<varlistentry id="RB-SOURCELIST-MODEL-N-COLUMNS:CAPS" role="constant">
<term><literal>RB_SOURCELIST_MODEL_N_COLUMNS</literal></term>
<listitem><simpara>
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="rb-sourcelist-model-new" role="function">
<title>rb_sourcelist_model_new ()</title>
<indexterm zone="rb-sourcelist-model-new"><primary>rb_sourcelist_model_new</primary></indexterm><programlisting><link linkend="GtkTreeModel">GtkTreeModel</link>* rb_sourcelist_model_new (void);</programlisting>
<para>
This constructs both the GtkTreeStore holding the source
data and the filter model that hides invisible sources.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the <link linkend="RBSourceListModel"><type>RBSourceListModel</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="rb-sourcelist-model-set-dnd-targets" role="function">
<title>rb_sourcelist_model_set_dnd_targets ()</title>
<indexterm zone="rb-sourcelist-model-set-dnd-targets"><primary>rb_sourcelist_model_set_dnd_targets</primary></indexterm><programlisting><link linkend="void">void</link> rb_sourcelist_model_set_dnd_targets (<link linkend="RBSourceListModel">RBSourceListModel</link> *sourcelist,
<link linkend="GtkTreeView">GtkTreeView</link> *treeview);</programlisting>
<para>
Sets up the drag and drop targets for the source list.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sourcelist</parameter> :</term>
<listitem><simpara> the <link linkend="RBSourceListModel"><type>RBSourceListModel</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>treeview</parameter> :</term>
<listitem><simpara> the sourcel ist <link linkend="GtkTreeView"><type>GtkTreeView</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
<refsect1 id="RBSourceListModel.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="RBSourceListModel-drop-received"><title>The <literal>"drop-received"</literal> signal</title>
<indexterm zone="RBSourceListModel-drop-received"><primary>RBSourceListModel::drop-received</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="RBSourceListModel">RBSourceListModel</link> *model,
<link linkend="RBSource">RBSource</link> *target,
<link linkend="gint">gint</link> pos,
<link linkend="gpointer">gpointer</link> data,
<link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
<para>
Emitted when a drag and drop operation to the source list completes.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>model</parameter> :</term>
<listitem><simpara> the <link linkend="RBSourceListModel"><type>RBSourceListModel</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>target</parameter> :</term>
<listitem><simpara> the <link linkend="RBSource"><type>RBSource</type></link> receiving the drop
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pos</parameter> :</term>
<listitem><simpara> the drop position
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter> :</term>
<listitem><simpara> the drop data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
</refentry>
|