選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

189 行
6.6 KiB

  1. /* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */
  2. /* GTK - The GIMP Toolkit
  3. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the
  17. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18. * Boston, MA 02111-1307, USA.
  19. */
  20. /*
  21. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  22. * file for a list of people on the GTK+ Team. See the ChangeLog
  23. * files for a list of changes. These files are distributed with
  24. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  25. */
  26. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  27. #error "Only <gtk/gtk.h> can be included directly."
  28. #endif
  29. #ifndef __GTK_DND_H__
  30. #define __GTK_DND_H__
  31. #include <gtk/gtkwidget.h>
  32. #include <gtk/gtkselection.h>
  33. G_BEGIN_DECLS
  34. typedef enum {
  35. GTK_DEST_DEFAULT_MOTION = 1 << 0, /* respond to "drag_motion" */
  36. GTK_DEST_DEFAULT_HIGHLIGHT = 1 << 1, /* auto-highlight */
  37. GTK_DEST_DEFAULT_DROP = 1 << 2, /* respond to "drag_drop" */
  38. GTK_DEST_DEFAULT_ALL = 0x07
  39. } GtkDestDefaults;
  40. /* Flags for the GtkTargetEntry on the destination side
  41. */
  42. typedef enum {
  43. GTK_TARGET_SAME_APP = 1 << 0, /*< nick=same-app >*/
  44. GTK_TARGET_SAME_WIDGET = 1 << 1, /*< nick=same-widget >*/
  45. GTK_TARGET_OTHER_APP = 1 << 2, /*< nick=other-app >*/
  46. GTK_TARGET_OTHER_WIDGET = 1 << 3 /*< nick=other-widget >*/
  47. } GtkTargetFlags;
  48. /* Destination side */
  49. void gtk_drag_get_data (GtkWidget *widget,
  50. GdkDragContext *context,
  51. GdkAtom target,
  52. guint32 time_);
  53. void gtk_drag_finish (GdkDragContext *context,
  54. gboolean success,
  55. gboolean del,
  56. guint32 time_);
  57. GtkWidget *gtk_drag_get_source_widget (GdkDragContext *context);
  58. void gtk_drag_highlight (GtkWidget *widget);
  59. void gtk_drag_unhighlight (GtkWidget *widget);
  60. void gtk_drag_dest_set (GtkWidget *widget,
  61. GtkDestDefaults flags,
  62. const GtkTargetEntry *targets,
  63. gint n_targets,
  64. GdkDragAction actions);
  65. void gtk_drag_dest_set_proxy (GtkWidget *widget,
  66. GdkWindow *proxy_window,
  67. GdkDragProtocol protocol,
  68. gboolean use_coordinates);
  69. void gtk_drag_dest_unset (GtkWidget *widget);
  70. GdkAtom gtk_drag_dest_find_target (GtkWidget *widget,
  71. GdkDragContext *context,
  72. GtkTargetList *target_list);
  73. GtkTargetList* gtk_drag_dest_get_target_list (GtkWidget *widget);
  74. void gtk_drag_dest_set_target_list (GtkWidget *widget,
  75. GtkTargetList *target_list);
  76. void gtk_drag_dest_add_text_targets (GtkWidget *widget);
  77. void gtk_drag_dest_add_image_targets (GtkWidget *widget);
  78. void gtk_drag_dest_add_uri_targets (GtkWidget *widget);
  79. void gtk_drag_dest_set_track_motion (GtkWidget *widget,
  80. gboolean track_motion);
  81. gboolean gtk_drag_dest_get_track_motion (GtkWidget *widget);
  82. /* Source side */
  83. void gtk_drag_source_set (GtkWidget *widget,
  84. GdkModifierType start_button_mask,
  85. const GtkTargetEntry *targets,
  86. gint n_targets,
  87. GdkDragAction actions);
  88. void gtk_drag_source_unset (GtkWidget *widget);
  89. GtkTargetList* gtk_drag_source_get_target_list (GtkWidget *widget);
  90. void gtk_drag_source_set_target_list (GtkWidget *widget,
  91. GtkTargetList *target_list);
  92. void gtk_drag_source_add_text_targets (GtkWidget *widget);
  93. void gtk_drag_source_add_image_targets (GtkWidget *widget);
  94. void gtk_drag_source_add_uri_targets (GtkWidget *widget);
  95. void gtk_drag_source_set_icon (GtkWidget *widget,
  96. GdkColormap *colormap,
  97. GdkPixmap *pixmap,
  98. GdkBitmap *mask);
  99. void gtk_drag_source_set_icon_pixbuf (GtkWidget *widget,
  100. GdkPixbuf *pixbuf);
  101. void gtk_drag_source_set_icon_stock (GtkWidget *widget,
  102. const gchar *stock_id);
  103. void gtk_drag_source_set_icon_name (GtkWidget *widget,
  104. const gchar *icon_name);
  105. /* There probably should be functions for setting the targets
  106. * as a GtkTargetList
  107. */
  108. GdkDragContext *gtk_drag_begin (GtkWidget *widget,
  109. GtkTargetList *targets,
  110. GdkDragAction actions,
  111. gint button,
  112. GdkEvent *event);
  113. /* Set the image being dragged around
  114. */
  115. void gtk_drag_set_icon_widget (GdkDragContext *context,
  116. GtkWidget *widget,
  117. gint hot_x,
  118. gint hot_y);
  119. void gtk_drag_set_icon_pixmap (GdkDragContext *context,
  120. GdkColormap *colormap,
  121. GdkPixmap *pixmap,
  122. GdkBitmap *mask,
  123. gint hot_x,
  124. gint hot_y);
  125. void gtk_drag_set_icon_pixbuf (GdkDragContext *context,
  126. GdkPixbuf *pixbuf,
  127. gint hot_x,
  128. gint hot_y);
  129. void gtk_drag_set_icon_stock (GdkDragContext *context,
  130. const gchar *stock_id,
  131. gint hot_x,
  132. gint hot_y);
  133. void gtk_drag_set_icon_name (GdkDragContext *context,
  134. const gchar *icon_name,
  135. gint hot_x,
  136. gint hot_y);
  137. void gtk_drag_set_icon_default (GdkDragContext *context);
  138. gboolean gtk_drag_check_threshold (GtkWidget *widget,
  139. gint start_x,
  140. gint start_y,
  141. gint current_x,
  142. gint current_y);
  143. /* Internal functions */
  144. void _gtk_drag_source_handle_event (GtkWidget *widget,
  145. GdkEvent *event);
  146. void _gtk_drag_dest_handle_event (GtkWidget *toplevel,
  147. GdkEvent *event);
  148. #ifndef GTK_DISABLE_DEPRECATED
  149. void gtk_drag_set_default_icon (GdkColormap *colormap,
  150. GdkPixmap *pixmap,
  151. GdkBitmap *mask,
  152. gint hot_x,
  153. gint hot_y);
  154. #endif /* !GTK_DISABLE_DEPRECATED */
  155. G_END_DECLS
  156. #endif /* __GTK_DND_H__ */