diff options
author | Benjamin Otte <otte@redhat.com> | 2017-11-27 04:17:36 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-11-29 23:03:33 -0500 |
commit | 3d4743ee62673415d3872d215fa472e883f5158f (patch) | |
tree | e94af811040dee9b612fb32ca78c9ec0cab92700 /gtk/gtkselection.c | |
parent | 138abdbc475f90b5d731d3a27c12f8649837ad6d (diff) | |
download | gtk+-3d4743ee62673415d3872d215fa472e883f5158f.tar.gz |
textview: Remove serialization API
It's unused. Plain text is not using that framework, neither is
in-process same-display transmission.
So it was only useful for sharing text with custom tags across
applications, and nobody is doing that.
Diffstat (limited to 'gtk/gtkselection.c')
-rw-r--r-- | gtk/gtkselection.c | 132 |
1 files changed, 0 insertions, 132 deletions
diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index da5ed4855e..53603c60a1 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -86,7 +86,6 @@ #include "gtkmain.h" #include "gtkdebug.h" -#include "gtktextbufferrichtext.h" #include "gtkintl.h" #include "gdk-pixbuf/gdk-pixbuf.h" @@ -287,50 +286,6 @@ gtk_content_formats_add_text_targets (GdkContentFormats *list) } /** - * gtk_content_formats_add_rich_text_targets: - * @list: a #GdkContentFormats - * @deserializable: if %TRUE, then deserializable rich text formats - * will be added, serializable formats otherwise. - * @buffer: a #GtkTextBuffer. - * - * Appends the rich text targets registered with - * gtk_text_buffer_register_serialize_format() or - * gtk_text_buffer_register_deserialize_format() to the target list. All - * targets are added with the same @info. - * - * Since: 2.10 - **/ -GdkContentFormats * -gtk_content_formats_add_rich_text_targets (GdkContentFormats *list, - gboolean deserializable, - GtkTextBuffer *buffer) -{ - GdkContentFormatsBuilder *builder; - GdkAtom *atoms; - gint n_atoms; - gint i; - - g_return_val_if_fail (list != NULL, NULL); - g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL); - - builder = gdk_content_formats_builder_new (); - gdk_content_formats_builder_add_formats (builder, list); - gdk_content_formats_unref (list); - - if (deserializable) - atoms = gtk_text_buffer_get_deserialize_formats (buffer, &n_atoms); - else - atoms = gtk_text_buffer_get_serialize_formats (buffer, &n_atoms); - - for (i = 0; i < n_atoms; i++) - gdk_content_formats_builder_add_mime_type (builder, atoms[i]); - - g_free (atoms); - - return gdk_content_formats_builder_free (builder); -} - -/** * gtk_content_formats_add_image_targets: * @list: a #GdkContentFormats * @writable: whether to add only targets for which GTK+ knows @@ -1783,56 +1738,6 @@ gtk_targets_include_text (GdkAtom *targets, } /** - * gtk_targets_include_rich_text: - * @targets: (array length=n_targets): an array of #GdkAtoms - * @n_targets: the length of @targets - * @buffer: a #GtkTextBuffer - * - * Determines if any of the targets in @targets can be used to - * provide rich text. - * - * Returns: %TRUE if @targets include a suitable target for rich text, - * otherwise %FALSE. - * - * Since: 2.10 - **/ -gboolean -gtk_targets_include_rich_text (GdkAtom *targets, - gint n_targets, - GtkTextBuffer *buffer) -{ - GdkAtom *rich_targets; - gint n_rich_targets; - gint i, j; - gboolean result = FALSE; - - g_return_val_if_fail (targets != NULL || n_targets == 0, FALSE); - g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), FALSE); - - init_atoms (); - - rich_targets = gtk_text_buffer_get_deserialize_formats (buffer, - &n_rich_targets); - - for (i = 0; i < n_targets; i++) - { - for (j = 0; j < n_rich_targets; j++) - { - if (targets[i] == rich_targets[j]) - { - result = TRUE; - goto done; - } - } - } - - done: - g_free (rich_targets); - - return result; -} - -/** * gtk_selection_data_targets_include_text: * @selection_data: a #GtkSelectionData object * @@ -1864,43 +1769,6 @@ gtk_selection_data_targets_include_text (const GtkSelectionData *selection_data) } /** - * gtk_selection_data_targets_include_rich_text: - * @selection_data: a #GtkSelectionData object - * @buffer: a #GtkTextBuffer - * - * Given a #GtkSelectionData object holding a list of targets, - * determines if any of the targets in @targets can be used to - * provide rich text. - * - * Returns: %TRUE if @selection_data holds a list of targets, - * and a suitable target for rich text is included, - * otherwise %FALSE. - * - * Since: 2.10 - **/ -gboolean -gtk_selection_data_targets_include_rich_text (const GtkSelectionData *selection_data, - GtkTextBuffer *buffer) -{ - GdkAtom *targets; - gint n_targets; - gboolean result = FALSE; - - g_return_val_if_fail (selection_data != NULL, FALSE); - g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), FALSE); - - init_atoms (); - - if (gtk_selection_data_get_targets (selection_data, &targets, &n_targets)) - { - result = gtk_targets_include_rich_text (targets, n_targets, buffer); - g_free (targets); - } - - return result; -} - -/** * gtk_targets_include_image: * @targets: (array length=n_targets): an array of #GdkAtoms * @n_targets: the length of @targets |