d007812006-10-31Martin Nilsson /* -*- C -*- */
ad97972006-01-21Lance Dillon class GTK2.TreeDragSource; mixin_for G.Object;
1a05542005-07-28Martin Nilsson  int drag_data_delete(GTK2.TreePath path) //! Asks to delete the row at path, because it was moved somewhere else via //! drag-and-drop. Returns false if the deletion fails because path no longer //! exists, or for some model-specific reason. {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_inited();
1a05542005-07-28Martin Nilsson  { struct object *o1; int res; get_all_args("drag_data_delete",args,"%o",&o1); res=gtk_tree_drag_source_drag_data_delete( GTK_TREE_DRAG_SOURCE(THIS->obj),
67ad922011-11-21Lance Dillon  (GtkTreePath *)get_pg2object(o1,pgtk2_tree_path_program));
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args);
1a05542005-07-28Martin Nilsson  PGTK_PUSH_INT(res); } }
f284492006-08-03Lance Dillon +GTK2.SelectionData drag_data_get(GTK2.TreePath path)
1a05542005-07-28Martin Nilsson //! Asks to return a representation of the row at path. {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_inited();
1a05542005-07-28Martin Nilsson  { GtkSelectionData *sel; struct object *o1; int res; get_all_args("drag_data_get",args,"%o",&o1); sel=(GtkSelectionData *)g_malloc(sizeof(GtkSelectionData)); if (sel==NULL) SIMPLE_OUT_OF_MEMORY_ERROR("drag_data_get",sizeof(GtkSelectionData)); res=gtk_tree_drag_source_drag_data_get(GTK_TREE_DRAG_SOURCE(THIS->obj),
67ad922011-11-21Lance Dillon  (GtkTreePath *)get_pg2object(o1,pgtk2_tree_path_program),sel);
1a05542005-07-28Martin Nilsson 
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args);
1a05542005-07-28Martin Nilsson  if (res)
2fa8a62008-04-11Per Hedbor  push_pgdk2object(sel,pgtk2_selection_data_program,1);
1a05542005-07-28Martin Nilsson  else
2fa8a62008-04-11Per Hedbor  push_int(0);
1a05542005-07-28Martin Nilsson  } } int row_draggable(GTK2.TreePath path) //! Asks the source whether a particular row can be used as the source of a //! DND operation. If the source doesn't implement this interface, the row //! is assumed draggable. {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_inited();
1a05542005-07-28Martin Nilsson  { struct object *o1; int res; get_all_args("row_draggable",args,"%o",&o1); res=gtk_tree_drag_source_row_draggable( GTK_TREE_DRAG_SOURCE(THIS->obj),
67ad922011-11-21Lance Dillon  (GtkTreePath *)get_pg2object(o1,pgtk2_tree_path_program));
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args);
1a05542005-07-28Martin Nilsson  PGTK_PUSH_INT(res); } }