Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

126 wiersze
5.1 KiB

  1. /* gtktreednd.h
  2. * Copyright (C) 2001 Red Hat, Inc.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  20. #error "Only <gtk/gtk.h> can be included directly."
  21. #endif
  22. #ifndef __GTK_TREE_DND_H__
  23. #define __GTK_TREE_DND_H__
  24. #include <gtk/gtktreemodel.h>
  25. #include <gtk/gtkdnd.h>
  26. G_BEGIN_DECLS
  27. #define GTK_TYPE_TREE_DRAG_SOURCE (gtk_tree_drag_source_get_type ())
  28. #define GTK_TREE_DRAG_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_DRAG_SOURCE, GtkTreeDragSource))
  29. #define GTK_IS_TREE_DRAG_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_DRAG_SOURCE))
  30. #define GTK_TREE_DRAG_SOURCE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_TREE_DRAG_SOURCE, GtkTreeDragSourceIface))
  31. typedef struct _GtkTreeDragSource GtkTreeDragSource; /* Dummy typedef */
  32. typedef struct _GtkTreeDragSourceIface GtkTreeDragSourceIface;
  33. struct _GtkTreeDragSourceIface
  34. {
  35. GTypeInterface g_iface;
  36. /* VTable - not signals */
  37. gboolean (* row_draggable) (GtkTreeDragSource *drag_source,
  38. GtkTreePath *path);
  39. gboolean (* drag_data_get) (GtkTreeDragSource *drag_source,
  40. GtkTreePath *path,
  41. GtkSelectionData *selection_data);
  42. gboolean (* drag_data_delete) (GtkTreeDragSource *drag_source,
  43. GtkTreePath *path);
  44. };
  45. GType gtk_tree_drag_source_get_type (void) G_GNUC_CONST;
  46. /* Returns whether the given row can be dragged */
  47. gboolean gtk_tree_drag_source_row_draggable (GtkTreeDragSource *drag_source,
  48. GtkTreePath *path);
  49. /* Deletes the given row, or returns FALSE if it can't */
  50. gboolean gtk_tree_drag_source_drag_data_delete (GtkTreeDragSource *drag_source,
  51. GtkTreePath *path);
  52. /* Fills in selection_data with type selection_data->target based on
  53. * the row denoted by path, returns TRUE if it does anything
  54. */
  55. gboolean gtk_tree_drag_source_drag_data_get (GtkTreeDragSource *drag_source,
  56. GtkTreePath *path,
  57. GtkSelectionData *selection_data);
  58. #define GTK_TYPE_TREE_DRAG_DEST (gtk_tree_drag_dest_get_type ())
  59. #define GTK_TREE_DRAG_DEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_DRAG_DEST, GtkTreeDragDest))
  60. #define GTK_IS_TREE_DRAG_DEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_DRAG_DEST))
  61. #define GTK_TREE_DRAG_DEST_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_TREE_DRAG_DEST, GtkTreeDragDestIface))
  62. typedef struct _GtkTreeDragDest GtkTreeDragDest; /* Dummy typedef */
  63. typedef struct _GtkTreeDragDestIface GtkTreeDragDestIface;
  64. struct _GtkTreeDragDestIface
  65. {
  66. GTypeInterface g_iface;
  67. /* VTable - not signals */
  68. gboolean (* drag_data_received) (GtkTreeDragDest *drag_dest,
  69. GtkTreePath *dest,
  70. GtkSelectionData *selection_data);
  71. gboolean (* row_drop_possible) (GtkTreeDragDest *drag_dest,
  72. GtkTreePath *dest_path,
  73. GtkSelectionData *selection_data);
  74. };
  75. GType gtk_tree_drag_dest_get_type (void) G_GNUC_CONST;
  76. /* Inserts a row before dest which contains data in selection_data,
  77. * or returns FALSE if it can't
  78. */
  79. gboolean gtk_tree_drag_dest_drag_data_received (GtkTreeDragDest *drag_dest,
  80. GtkTreePath *dest,
  81. GtkSelectionData *selection_data);
  82. /* Returns TRUE if we can drop before path; path may not exist. */
  83. gboolean gtk_tree_drag_dest_row_drop_possible (GtkTreeDragDest *drag_dest,
  84. GtkTreePath *dest_path,
  85. GtkSelectionData *selection_data);
  86. /* The selection data would normally have target type GTK_TREE_MODEL_ROW in this
  87. * case. If the target is wrong these functions return FALSE.
  88. */
  89. gboolean gtk_tree_set_row_drag_data (GtkSelectionData *selection_data,
  90. GtkTreeModel *tree_model,
  91. GtkTreePath *path);
  92. gboolean gtk_tree_get_row_drag_data (GtkSelectionData *selection_data,
  93. GtkTreeModel **tree_model,
  94. GtkTreePath **path);
  95. G_END_DECLS
  96. #endif /* __GTK_TREE_DND_H__ */