Example #1
0
static gboolean
egg_tree_multi_drag_drag_data_get (GtkWidget        *widget,
				   GdkDragContext   *context,
				   GtkSelectionData *selection_data,
				   guint             info,
				   guint             time)
{
  GtkTreeView  *tree_view;
  GtkTreeModel *model;
  GList        *path_list;

  tree_view = GTK_TREE_VIEW (widget);
  model = gtk_tree_view_get_model (tree_view);
  if (model == NULL)
    return FALSE;

  path_list = get_context_data (context);
  if (path_list == NULL)
    return FALSE;

  /* We can implement the GTK_TREE_MODEL_ROW target generically for
   * any model; for DragSource models there are some other targets
   * we also support.
   */

  if (! EGG_IS_TREE_MULTI_DRAG_SOURCE (model))
    return FALSE;

  return egg_tree_multi_drag_source_drag_data_get (EGG_TREE_MULTI_DRAG_SOURCE (model),
      						   context,
						   selection_data,
						   path_list);
}
Example #2
0
static void
drag_data_get_cb (GtkWidget *widget,
		  GdkDragContext *context,
		  GtkSelectionData *selection_data,
		  guint info,
		  guint time)
{
	GtkTreeView *tree_view;
	GtkTreeModel *model;
	GList *ref_list;

	tree_view = GTK_TREE_VIEW (widget);

	model = gtk_tree_view_get_model (tree_view);
	g_return_if_fail (model != NULL);

	ref_list = g_object_get_data (G_OBJECT (context), "drag-info");

	if (ref_list == NULL)
	{
		return;
	}

	if (EGG_IS_TREE_MULTI_DRAG_SOURCE (model))
	{
		egg_tree_multi_drag_source_drag_data_get (EGG_TREE_MULTI_DRAG_SOURCE (model),
							  ref_list,
							  selection_data);
	}
}
Example #3
0
static gboolean
on_drag_data_get( GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data, guint info, guint time )
{
	static const gchar *thisfn = "egg_tree_multi_dnd_on_drag_data_get";
	GtkTreeView  *tree_view;
	GtkTreeModel *model;
	GList        *path_list;

	g_debug( "%s: widget=%p, context=%p, selection_data=%p, info=%d, time=%d",
			thisfn, ( void * ) widget, ( void * ) context, ( void * ) selection_data, info, time );

	tree_view = GTK_TREE_VIEW( widget );
	model = gtk_tree_view_get_model( tree_view );
	g_assert( model );
	g_assert( EGG_IS_TREE_MULTI_DRAG_SOURCE( model ));

	path_list = get_treeview_data( widget );
	if( path_list == NULL ){
		return( FALSE );
	}

	/* We can implement the GTK_TREE_MODEL_ROW target generically for
	 * any model; for DragSource models there are some other targets
	 * we also support.
	 */
  return( egg_tree_multi_drag_source_drag_data_get(
		  EGG_TREE_MULTI_DRAG_SOURCE( model ), context, selection_data, path_list, info ));
}