25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gtkclipboard.h 7.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /* GTK - The GIMP Toolkit
  2. * Copyright (C) 2000 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 Lesser 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. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser 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. * Global clipboard abstraction.
  20. */
  21. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  22. #error "Only <gtk/gtk.h> can be included directly."
  23. #endif
  24. #ifndef __GTK_CLIPBOARD_H__
  25. #define __GTK_CLIPBOARD_H__
  26. #include <gtk/gtkselection.h>
  27. G_BEGIN_DECLS
  28. #define GTK_TYPE_CLIPBOARD (gtk_clipboard_get_type ())
  29. #define GTK_CLIPBOARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CLIPBOARD, GtkClipboard))
  30. #define GTK_IS_CLIPBOARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CLIPBOARD))
  31. typedef void (* GtkClipboardReceivedFunc) (GtkClipboard *clipboard,
  32. GtkSelectionData *selection_data,
  33. gpointer data);
  34. typedef void (* GtkClipboardTextReceivedFunc) (GtkClipboard *clipboard,
  35. const gchar *text,
  36. gpointer data);
  37. typedef void (* GtkClipboardRichTextReceivedFunc) (GtkClipboard *clipboard,
  38. GdkAtom format,
  39. const guint8 *text,
  40. gsize length,
  41. gpointer data);
  42. typedef void (* GtkClipboardImageReceivedFunc) (GtkClipboard *clipboard,
  43. GdkPixbuf *pixbuf,
  44. gpointer data);
  45. typedef void (* GtkClipboardURIReceivedFunc) (GtkClipboard *clipboard,
  46. gchar **uris,
  47. gpointer data);
  48. typedef void (* GtkClipboardTargetsReceivedFunc) (GtkClipboard *clipboard,
  49. GdkAtom *atoms,
  50. gint n_atoms,
  51. gpointer data);
  52. /* Should these functions have GtkClipboard *clipboard as the first argument?
  53. * right now for ClearFunc, you may have trouble determining _which_ clipboard
  54. * was cleared, if you reuse your ClearFunc for multiple clipboards.
  55. */
  56. typedef void (* GtkClipboardGetFunc) (GtkClipboard *clipboard,
  57. GtkSelectionData *selection_data,
  58. guint info,
  59. gpointer user_data_or_owner);
  60. typedef void (* GtkClipboardClearFunc) (GtkClipboard *clipboard,
  61. gpointer user_data_or_owner);
  62. GType gtk_clipboard_get_type (void) G_GNUC_CONST;
  63. GtkClipboard *gtk_clipboard_get_for_display (GdkDisplay *display,
  64. GdkAtom selection);
  65. #ifndef GDK_MULTIHEAD_SAFE
  66. GtkClipboard *gtk_clipboard_get (GdkAtom selection);
  67. #endif
  68. GdkDisplay *gtk_clipboard_get_display (GtkClipboard *clipboard);
  69. gboolean gtk_clipboard_set_with_data (GtkClipboard *clipboard,
  70. const GtkTargetEntry *targets,
  71. guint n_targets,
  72. GtkClipboardGetFunc get_func,
  73. GtkClipboardClearFunc clear_func,
  74. gpointer user_data);
  75. gboolean gtk_clipboard_set_with_owner (GtkClipboard *clipboard,
  76. const GtkTargetEntry *targets,
  77. guint n_targets,
  78. GtkClipboardGetFunc get_func,
  79. GtkClipboardClearFunc clear_func,
  80. GObject *owner);
  81. GObject *gtk_clipboard_get_owner (GtkClipboard *clipboard);
  82. void gtk_clipboard_clear (GtkClipboard *clipboard);
  83. void gtk_clipboard_set_text (GtkClipboard *clipboard,
  84. const gchar *text,
  85. gint len);
  86. void gtk_clipboard_set_image (GtkClipboard *clipboard,
  87. GdkPixbuf *pixbuf);
  88. void gtk_clipboard_request_contents (GtkClipboard *clipboard,
  89. GdkAtom target,
  90. GtkClipboardReceivedFunc callback,
  91. gpointer user_data);
  92. void gtk_clipboard_request_text (GtkClipboard *clipboard,
  93. GtkClipboardTextReceivedFunc callback,
  94. gpointer user_data);
  95. void gtk_clipboard_request_rich_text (GtkClipboard *clipboard,
  96. GtkTextBuffer *buffer,
  97. GtkClipboardRichTextReceivedFunc callback,
  98. gpointer user_data);
  99. void gtk_clipboard_request_image (GtkClipboard *clipboard,
  100. GtkClipboardImageReceivedFunc callback,
  101. gpointer user_data);
  102. void gtk_clipboard_request_uris (GtkClipboard *clipboard,
  103. GtkClipboardURIReceivedFunc callback,
  104. gpointer user_data);
  105. void gtk_clipboard_request_targets (GtkClipboard *clipboard,
  106. GtkClipboardTargetsReceivedFunc callback,
  107. gpointer user_data);
  108. GtkSelectionData *gtk_clipboard_wait_for_contents (GtkClipboard *clipboard,
  109. GdkAtom target);
  110. gchar * gtk_clipboard_wait_for_text (GtkClipboard *clipboard);
  111. guint8 * gtk_clipboard_wait_for_rich_text (GtkClipboard *clipboard,
  112. GtkTextBuffer *buffer,
  113. GdkAtom *format,
  114. gsize *length);
  115. GdkPixbuf * gtk_clipboard_wait_for_image (GtkClipboard *clipboard);
  116. gchar ** gtk_clipboard_wait_for_uris (GtkClipboard *clipboard);
  117. gboolean gtk_clipboard_wait_for_targets (GtkClipboard *clipboard,
  118. GdkAtom **targets,
  119. gint *n_targets);
  120. gboolean gtk_clipboard_wait_is_text_available (GtkClipboard *clipboard);
  121. gboolean gtk_clipboard_wait_is_rich_text_available (GtkClipboard *clipboard,
  122. GtkTextBuffer *buffer);
  123. gboolean gtk_clipboard_wait_is_image_available (GtkClipboard *clipboard);
  124. gboolean gtk_clipboard_wait_is_uris_available (GtkClipboard *clipboard);
  125. gboolean gtk_clipboard_wait_is_target_available (GtkClipboard *clipboard,
  126. GdkAtom target);
  127. void gtk_clipboard_set_can_store (GtkClipboard *clipboard,
  128. const GtkTargetEntry *targets,
  129. gint n_targets);
  130. void gtk_clipboard_store (GtkClipboard *clipboard);
  131. /* private */
  132. void _gtk_clipboard_handle_event (GdkEventOwnerChange *event);
  133. void _gtk_clipboard_store_all (void);
  134. G_END_DECLS
  135. #endif /* __GTK_CLIPBOARD_H__ */