3
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4
<title>rb-tree-dnd</title>
5
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
6
<link rel="start" href="index.html" title="Rhythmbox Development Reference Manual">
7
<link rel="up" href="ch02.html" title="Lib">
8
<link rel="prev" href="rhythmbox-rb-string-helpers.html" title="rb-string-helpers">
9
<link rel="next" href="rhythmbox-rb-util.html" title="rb-util">
10
<meta name="generator" content="GTK-Doc V1.4 (XML mode)">
11
<link rel="stylesheet" href="style.css" type="text/css">
12
<link rel="chapter" href="ch01.html" title="IRadio UI">
13
<link rel="chapter" href="ch02.html" title="Lib">
14
<link rel="chapter" href="ch03.html" title="Metadata">
15
<link rel="chapter" href="ch04.html" title="Player">
16
<link rel="chapter" href="ch05.html" title="RhythmDB">
17
<link rel="chapter" href="ch06.html" title="Shell">
18
<link rel="chapter" href="ch07.html" title="Sources">
19
<link rel="chapter" href="ch08.html" title="Widgets">
21
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
22
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
23
<td><a accesskey="p" href="rhythmbox-rb-string-helpers.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
24
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
25
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
26
<th width="100%" align="center">Rhythmbox Development Reference Manual</th>
27
<td><a accesskey="n" href="rhythmbox-rb-util.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
29
<div class="refentry" lang="en">
30
<a name="rhythmbox-rb-tree-dnd"></a><div class="titlepage"></div>
31
<div class="refnamediv"><table width="100%"><tr>
33
<h2><span class="refentrytitle">rb-tree-dnd</span></h2>
34
<p>rb-tree-dnd — </p>
36
<td valign="top" align="right"></td>
38
<div class="refsynopsisdiv">
40
<a name="RbTreeDragSource"></a><a name="RbTreeDragDest"></a><pre class="synopsis">
44
#define <a href="rhythmbox-rb-tree-dnd.html#RB-TYPE-TREE-DRAG-DEST:CAPS">RB_TYPE_TREE_DRAG_DEST</a>
45
#define <a href="rhythmbox-rb-tree-dnd.html#RB-TREE-DRAG-DEST:CAPS">RB_TREE_DRAG_DEST</a> (obj)
46
#define <a href="rhythmbox-rb-tree-dnd.html#RB-IS-TREE-DRAG-DEST:CAPS">RB_IS_TREE_DRAG_DEST</a> (obj)
47
#define <a href="rhythmbox-rb-tree-dnd.html#RB-TREE-DRAG-DEST-GET-IFACE:CAPS">RB_TREE_DRAG_DEST_GET_IFACE</a> (obj)
48
<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragSource-struct">RbTreeDragSource</a>;
49
<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragSourceIface">RbTreeDragSourceIface</a>;
50
<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragDest-struct">RbTreeDragDest</a>;
51
<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragDestIface">RbTreeDragDestIface</a>;
52
enum <a href="rhythmbox-rb-tree-dnd.html#RbTreeDestFlag">RbTreeDestFlag</a>;
53
gboolean <a href="rhythmbox-rb-tree-dnd.html#rb-tree-drag-source-row-draggable">rb_tree_drag_source_row_draggable</a>
54
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragSource">RbTreeDragSource</a> *drag_source,
56
gboolean <a href="rhythmbox-rb-tree-dnd.html#rb-tree-drag-source-drag-data-delete">rb_tree_drag_source_drag_data_delete</a>
57
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragSource">RbTreeDragSource</a> *drag_source,
59
gboolean <a href="rhythmbox-rb-tree-dnd.html#rb-tree-drag-source-drag-data-get">rb_tree_drag_source_drag_data_get</a>
60
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragSource">RbTreeDragSource</a> *drag_source,
62
GtkSelectionData *selection_data);
63
GType <a href="rhythmbox-rb-tree-dnd.html#rb-tree-drag-dest-get-type">rb_tree_drag_dest_get_type</a> (void);
64
gboolean <a href="rhythmbox-rb-tree-dnd.html#rb-tree-drag-dest-drag-data-received">rb_tree_drag_dest_drag_data_received</a>
65
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragDest">RbTreeDragDest</a> *drag_dest,
67
GtkTreeViewDropPosition pos,
68
GtkSelectionData *selection_data);
69
gboolean <a href="rhythmbox-rb-tree-dnd.html#rb-tree-drag-dest-row-drop-possible">rb_tree_drag_dest_row_drop_possible</a>
70
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragDest">RbTreeDragDest</a> *drag_dest,
71
GtkTreePath *dest_path,
72
GtkTreeViewDropPosition pos,
73
GtkSelectionData *selection_data);
74
gboolean <a href="rhythmbox-rb-tree-dnd.html#rb-tree-drag-dest-row-drop-position">rb_tree_drag_dest_row_drop_position</a>
75
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragDest">RbTreeDragDest</a> *drag_dest,
76
GtkTreePath *dest_path,
78
GtkTreeViewDropPosition *pos);
79
void <a href="rhythmbox-rb-tree-dnd.html#rb-tree-dnd-add-drag-dest-support">rb_tree_dnd_add_drag_dest_support</a>
80
(GtkTreeView *tree_view,
81
<a href="rhythmbox-rb-tree-dnd.html#RbTreeDestFlag">RbTreeDestFlag</a> flags,
82
const GtkTargetEntry *targets,
84
GdkDragAction actions);
85
void <a href="rhythmbox-rb-tree-dnd.html#rb-tree-dnd-add-drag-source-support">rb_tree_dnd_add_drag_source_support</a>
86
(GtkTreeView *tree_view,
87
GdkModifierType start_button_mask,
88
const GtkTargetEntry *targets,
90
GdkDragAction actions);
94
<div class="refsect1" lang="en">
95
<a name="id2553573"></a><h2>Object Hierarchy</h2>
96
<pre class="synopsis">
101
<pre class="synopsis">
107
<div class="refsect1" lang="en">
108
<a name="id2553604"></a><h2>Description</h2>
113
<div class="refsect1" lang="en">
114
<a name="id2553616"></a><h2>Details</h2>
115
<div class="refsect2" lang="en">
116
<a name="id2553622"></a><h3>
117
<a name="RB-TYPE-TREE-DRAG-DEST:CAPS"></a>RB_TYPE_TREE_DRAG_DEST</h3>
118
<a class="indexterm" name="id2553631"></a><pre class="programlisting">#define RB_TYPE_TREE_DRAG_DEST (rb_tree_drag_dest_get_type ())
125
<div class="refsect2" lang="en">
126
<a name="id2553647"></a><h3>
127
<a name="RB-TREE-DRAG-DEST:CAPS"></a>RB_TREE_DRAG_DEST()</h3>
128
<a class="indexterm" name="id2553657"></a><pre class="programlisting">#define RB_TREE_DRAG_DEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RB_TYPE_TREE_DRAG_DEST, RbTreeDragDest))
133
<div class="variablelist"><table border="0">
134
<col align="left" valign="top">
137
<span class="term"><em class="parameter"><code>obj</code></em> :</span></td>
146
<div class="refsect2" lang="en">
147
<a name="id2553693"></a><h3>
148
<a name="RB-IS-TREE-DRAG-DEST:CAPS"></a>RB_IS_TREE_DRAG_DEST()</h3>
149
<a class="indexterm" name="id2553702"></a><pre class="programlisting">#define RB_IS_TREE_DRAG_DEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RB_TYPE_TREE_DRAG_DEST))
154
<div class="variablelist"><table border="0">
155
<col align="left" valign="top">
158
<span class="term"><em class="parameter"><code>obj</code></em> :</span></td>
167
<div class="refsect2" lang="en">
168
<a name="id2553738"></a><h3>
169
<a name="RB-TREE-DRAG-DEST-GET-IFACE:CAPS"></a>RB_TREE_DRAG_DEST_GET_IFACE()</h3>
170
<a class="indexterm" name="id2553749"></a><pre class="programlisting">#define RB_TREE_DRAG_DEST_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RB_TYPE_TREE_DRAG_DEST, RbTreeDragDestIface))
175
<div class="variablelist"><table border="0">
176
<col align="left" valign="top">
179
<span class="term"><em class="parameter"><code>obj</code></em> :</span></td>
188
<div class="refsect2" lang="en">
189
<a name="id2553785"></a><h3>
190
<a name="RbTreeDragSource-struct"></a>RbTreeDragSource</h3>
191
<a class="indexterm" name="id2553794"></a><pre class="programlisting">typedef struct _RbTreeDragSource RbTreeDragSource;</pre>
197
<div class="refsect2" lang="en">
198
<a name="id2537440"></a><h3>
199
<a name="RbTreeDragSourceIface"></a>RbTreeDragSourceIface</h3>
200
<a class="indexterm" name="id2537449"></a><pre class="programlisting">typedef struct {
201
GTypeInterface g_iface;
203
/* VTable - not signals */
204
gboolean (* row_draggable) (RbTreeDragSource *drag_source,
207
gboolean (* drag_data_get) (RbTreeDragSource *drag_source,
209
GtkSelectionData *selection_data);
211
gboolean (* drag_data_delete) (RbTreeDragSource *drag_source,
213
} RbTreeDragSourceIface;
220
<div class="refsect2" lang="en">
221
<a name="id2550488"></a><h3>
222
<a name="RbTreeDragDest-struct"></a>RbTreeDragDest</h3>
223
<a class="indexterm" name="id2515833"></a><pre class="programlisting">typedef struct _RbTreeDragDest RbTreeDragDest;</pre>
229
<div class="refsect2" lang="en">
230
<a name="id2545985"></a><h3>
231
<a name="RbTreeDragDestIface"></a>RbTreeDragDestIface</h3>
232
<a class="indexterm" name="id2537471"></a><pre class="programlisting">typedef struct {
233
GTypeInterface g_iface;
235
/* VTable - not signals */
237
gboolean (* drag_data_received) (RbTreeDragDest *drag_dest,
239
GtkTreeViewDropPosition pos,
240
GtkSelectionData *selection_data);
242
gboolean (* row_drop_possible) (RbTreeDragDest *drag_dest,
243
GtkTreePath *dest_path,
244
GtkTreeViewDropPosition pos,
245
GtkSelectionData *selection_data);
247
gboolean (* row_drop_position) (RbTreeDragDest *drag_dest,
248
GtkTreePath *dest_path,
250
GtkTreeViewDropPosition *pos);
253
GdkAtom (* get_drag_target) (RbTreeDragDest *drag_dest,
255
GdkDragContext *context,
256
GtkTreePath *dest_path,
257
GtkTargetList *target_list);
258
} RbTreeDragDestIface;
265
<div class="refsect2" lang="en">
266
<a name="id2537500"></a><h3>
267
<a name="RbTreeDestFlag"></a>enum RbTreeDestFlag</h3>
268
<a class="indexterm" name="id2537510"></a><pre class="programlisting">typedef enum {
269
RB_TREE_DEST_EMPTY_VIEW_DROP = 1 << 0,
270
RB_TREE_DEST_CAN_DROP_INTO = 1 << 1,
271
RB_TREE_DEST_CAN_DROP_BETWEEN = 1 << 2
279
<div class="refsect2" lang="en">
280
<a name="id2537528"></a><h3>
281
<a name="rb-tree-drag-source-row-draggable"></a>rb_tree_drag_source_row_draggable ()</h3>
282
<a class="indexterm" name="id2537539"></a><pre class="programlisting">gboolean rb_tree_drag_source_row_draggable
283
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragSource">RbTreeDragSource</a> *drag_source,
284
GList *path_list);</pre>
286
Asks the <span class="type">EggTreeMultiDragSource</span> whether a particular row can be used as
287
the source of a DND operation. If the source doesn't implement
288
this interface, the row is assumed draggable.</p>
292
<div class="variablelist"><table border="0">
293
<col align="left" valign="top">
297
<span class="term"><em class="parameter"><code>drag_source</code></em> :</span></td>
298
<td> a <span class="type">EggTreeMultiDragSource</span>
303
<span class="term"><em class="parameter"><code>path_list</code></em> :</span></td>
309
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
310
<td> <code class="literal">TRUE</code> if the row can be dragged
317
<div class="refsect2" lang="en">
318
<a name="id2537642"></a><h3>
319
<a name="rb-tree-drag-source-drag-data-delete"></a>rb_tree_drag_source_drag_data_delete ()</h3>
320
<a class="indexterm" name="id2537652"></a><pre class="programlisting">gboolean rb_tree_drag_source_drag_data_delete
321
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragSource">RbTreeDragSource</a> *drag_source,
322
GList *path_list);</pre>
324
Asks the <span class="type">EggTreeMultiDragSource</span> to delete the row at <em class="parameter"><code>path</code></em>, because
325
it was moved somewhere else via drag-and-drop. Returns <code class="literal">FALSE</code>
326
if the deletion fails because <em class="parameter"><code>path</code></em> no longer exists, or for
327
some model-specific reason. Should robustly handle a <em class="parameter"><code>path</code></em> no
328
longer found in the model!</p>
332
<div class="variablelist"><table border="0">
333
<col align="left" valign="top">
337
<span class="term"><em class="parameter"><code>drag_source</code></em> :</span></td>
338
<td> a <span class="type">EggTreeMultiDragSource</span>
343
<span class="term"><em class="parameter"><code>path_list</code></em> :</span></td>
349
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
350
<td> <code class="literal">TRUE</code> if the row was successfully deleted
357
<div class="refsect2" lang="en">
358
<a name="id2561316"></a><h3>
359
<a name="rb-tree-drag-source-drag-data-get"></a>rb_tree_drag_source_drag_data_get ()</h3>
360
<a class="indexterm" name="id2561327"></a><pre class="programlisting">gboolean rb_tree_drag_source_drag_data_get
361
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragSource">RbTreeDragSource</a> *drag_source,
363
GtkSelectionData *selection_data);</pre>
365
Asks the <span class="type">EggTreeMultiDragSource</span> to fill in <em class="parameter"><code>selection_data</code></em> with a
366
representation of the row at <em class="parameter"><code>path</code></em>. <em class="parameter"><code>selection_data->target</code></em> gives
367
the required type of the data. Should robustly handle a <em class="parameter"><code>path</code></em> no
368
longer found in the model!</p>
372
<div class="variablelist"><table border="0">
373
<col align="left" valign="top">
377
<span class="term"><em class="parameter"><code>drag_source</code></em> :</span></td>
378
<td> a <span class="type">EggTreeMultiDragSource</span>
383
<span class="term"><em class="parameter"><code>path_list</code></em> :</span></td>
389
<span class="term"><em class="parameter"><code>selection_data</code></em> :</span></td>
390
<td> a <span class="type">EggSelectionData</span> to fill with data from the dragged row
395
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
396
<td> <code class="literal">TRUE</code> if data of the required type was provided
403
<div class="refsect2" lang="en">
404
<a name="id2561468"></a><h3>
405
<a name="rb-tree-drag-dest-get-type"></a>rb_tree_drag_dest_get_type ()</h3>
406
<a class="indexterm" name="id2561477"></a><pre class="programlisting">GType rb_tree_drag_dest_get_type (void);</pre>
410
<div class="variablelist"><table border="0">
411
<col align="left" valign="top">
414
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
423
<div class="refsect2" lang="en">
424
<a name="id2561510"></a><h3>
425
<a name="rb-tree-drag-dest-drag-data-received"></a>rb_tree_drag_dest_drag_data_received ()</h3>
426
<a class="indexterm" name="id2561520"></a><pre class="programlisting">gboolean rb_tree_drag_dest_drag_data_received
427
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragDest">RbTreeDragDest</a> *drag_dest,
429
GtkTreeViewDropPosition pos,
430
GtkSelectionData *selection_data);</pre>
434
<div class="variablelist"><table border="0">
435
<col align="left" valign="top">
439
<span class="term"><em class="parameter"><code>drag_dest</code></em> :</span></td>
445
<span class="term"><em class="parameter"><code>dest</code></em> :</span></td>
451
<span class="term"><em class="parameter"><code>pos</code></em> :</span></td>
457
<span class="term"><em class="parameter"><code>selection_data</code></em> :</span></td>
463
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
473
<div class="refsect2" lang="en">
474
<a name="id2561629"></a><h3>
475
<a name="rb-tree-drag-dest-row-drop-possible"></a>rb_tree_drag_dest_row_drop_possible ()</h3>
476
<a class="indexterm" name="id2561640"></a><pre class="programlisting">gboolean rb_tree_drag_dest_row_drop_possible
477
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragDest">RbTreeDragDest</a> *drag_dest,
478
GtkTreePath *dest_path,
479
GtkTreeViewDropPosition pos,
480
GtkSelectionData *selection_data);</pre>
484
<div class="variablelist"><table border="0">
485
<col align="left" valign="top">
489
<span class="term"><em class="parameter"><code>drag_dest</code></em> :</span></td>
495
<span class="term"><em class="parameter"><code>dest_path</code></em> :</span></td>
501
<span class="term"><em class="parameter"><code>pos</code></em> :</span></td>
507
<span class="term"><em class="parameter"><code>selection_data</code></em> :</span></td>
513
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
523
<div class="refsect2" lang="en">
524
<a name="id2561748"></a><h3>
525
<a name="rb-tree-drag-dest-row-drop-position"></a>rb_tree_drag_dest_row_drop_position ()</h3>
526
<a class="indexterm" name="id2561759"></a><pre class="programlisting">gboolean rb_tree_drag_dest_row_drop_position
527
(<a href="rhythmbox-rb-tree-dnd.html#RbTreeDragDest">RbTreeDragDest</a> *drag_dest,
528
GtkTreePath *dest_path,
530
GtkTreeViewDropPosition *pos);</pre>
534
<div class="variablelist"><table border="0">
535
<col align="left" valign="top">
539
<span class="term"><em class="parameter"><code>drag_dest</code></em> :</span></td>
545
<span class="term"><em class="parameter"><code>dest_path</code></em> :</span></td>
551
<span class="term"><em class="parameter"><code>targets</code></em> :</span></td>
557
<span class="term"><em class="parameter"><code>pos</code></em> :</span></td>
563
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
573
<div class="refsect2" lang="en">
574
<a name="id2561867"></a><h3>
575
<a name="rb-tree-dnd-add-drag-dest-support"></a>rb_tree_dnd_add_drag_dest_support ()</h3>
576
<a class="indexterm" name="id2561878"></a><pre class="programlisting">void rb_tree_dnd_add_drag_dest_support
577
(GtkTreeView *tree_view,
578
<a href="rhythmbox-rb-tree-dnd.html#RbTreeDestFlag">RbTreeDestFlag</a> flags,
579
const GtkTargetEntry *targets,
581
GdkDragAction actions);</pre>
585
<div class="variablelist"><table border="0">
586
<col align="left" valign="top">
590
<span class="term"><em class="parameter"><code>tree_view</code></em> :</span></td>
596
<span class="term"><em class="parameter"><code>flags</code></em> :</span></td>
602
<span class="term"><em class="parameter"><code>targets</code></em> :</span></td>
608
<span class="term"><em class="parameter"><code>n_targets</code></em> :</span></td>
614
<span class="term"><em class="parameter"><code>actions</code></em> :</span></td>
624
<div class="refsect2" lang="en">
625
<a name="id2561995"></a><h3>
626
<a name="rb-tree-dnd-add-drag-source-support"></a>rb_tree_dnd_add_drag_source_support ()</h3>
627
<a class="indexterm" name="id2562006"></a><pre class="programlisting">void rb_tree_dnd_add_drag_source_support
628
(GtkTreeView *tree_view,
629
GdkModifierType start_button_mask,
630
const GtkTargetEntry *targets,
632
GdkDragAction actions);</pre>
636
<div class="variablelist"><table border="0">
637
<col align="left" valign="top">
641
<span class="term"><em class="parameter"><code>tree_view</code></em> :</span></td>
647
<span class="term"><em class="parameter"><code>start_button_mask</code></em> :</span></td>
653
<span class="term"><em class="parameter"><code>targets</code></em> :</span></td>
659
<span class="term"><em class="parameter"><code>n_targets</code></em> :</span></td>
665
<span class="term"><em class="parameter"><code>actions</code></em> :</span></td>
676
<table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
677
<td align="left"><a accesskey="p" href="rhythmbox-rb-string-helpers.html"><b><< rb-string-helpers</b></a></td>
678
<td align="right"><a accesskey="n" href="rhythmbox-rb-util.html"><b>rb-util >></b></a></td>