Commit b97a0a45 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Instead of always mirroring the selection to a single PRIMARY selection,

Wed Aug 29 20:40:58 2001  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtktextbuffer.[ch] (gtk_text_buffer_add/remove_selection_clipboard):
        Instead of always mirroring the selection to a single PRIMARY
        selection, allow it to be mirrored to any number of clipboards.

        * gtk/gtktextbuffer.[ch] (gtk_text_buffer_paste_primary): Remove,
        just use gtk_text_buffer_paste_clipboard with the appropriate clipboard.

        * gtk/gtktextbuffer.[ch] (gtk_text_buffer_cut/copy/paste_clipboard): Add a
        GtkClipboard argument, and for paste_clipboard, the
        @override_location argument from @paste_primary.

        * gtk/gtktextview.c: Adapt to above change.
parent d5f46998
Wed Aug 29 20:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_add/remove_selection_clipboard):
Instead of always mirroring the selection to a single PRIMARY
selection, allow it to be mirrored to any number of clipboards.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_paste_primary): Remove,
just use gtk_text_buffer_paste_clipboard with the appropriate clipboard.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_cut/copy/paste_clipboard): Add a
GtkClipboard argument, and for paste_clipboard, the
@override_location argument from @paste_primary.
* gtk/gtktextview.c: Adapt to above change.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (invalidated_handler): put validate idle at
......
Wed Aug 29 20:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_add/remove_selection_clipboard):
Instead of always mirroring the selection to a single PRIMARY
selection, allow it to be mirrored to any number of clipboards.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_paste_primary): Remove,
just use gtk_text_buffer_paste_clipboard with the appropriate clipboard.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_cut/copy/paste_clipboard): Add a
GtkClipboard argument, and for paste_clipboard, the
@override_location argument from @paste_primary.
* gtk/gtktextview.c: Adapt to above change.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (invalidated_handler): put validate idle at
......
Wed Aug 29 20:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_add/remove_selection_clipboard):
Instead of always mirroring the selection to a single PRIMARY
selection, allow it to be mirrored to any number of clipboards.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_paste_primary): Remove,
just use gtk_text_buffer_paste_clipboard with the appropriate clipboard.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_cut/copy/paste_clipboard): Add a
GtkClipboard argument, and for paste_clipboard, the
@override_location argument from @paste_primary.
* gtk/gtktextview.c: Adapt to above change.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (invalidated_handler): put validate idle at
......
Wed Aug 29 20:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_add/remove_selection_clipboard):
Instead of always mirroring the selection to a single PRIMARY
selection, allow it to be mirrored to any number of clipboards.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_paste_primary): Remove,
just use gtk_text_buffer_paste_clipboard with the appropriate clipboard.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_cut/copy/paste_clipboard): Add a
GtkClipboard argument, and for paste_clipboard, the
@override_location argument from @paste_primary.
* gtk/gtktextview.c: Adapt to above change.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (invalidated_handler): put validate idle at
......
Wed Aug 29 20:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_add/remove_selection_clipboard):
Instead of always mirroring the selection to a single PRIMARY
selection, allow it to be mirrored to any number of clipboards.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_paste_primary): Remove,
just use gtk_text_buffer_paste_clipboard with the appropriate clipboard.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_cut/copy/paste_clipboard): Add a
GtkClipboard argument, and for paste_clipboard, the
@override_location argument from @paste_primary.
* gtk/gtktextview.c: Adapt to above change.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (invalidated_handler): put validate idle at
......
Wed Aug 29 20:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_add/remove_selection_clipboard):
Instead of always mirroring the selection to a single PRIMARY
selection, allow it to be mirrored to any number of clipboards.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_paste_primary): Remove,
just use gtk_text_buffer_paste_clipboard with the appropriate clipboard.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_cut/copy/paste_clipboard): Add a
GtkClipboard argument, and for paste_clipboard, the
@override_location argument from @paste_primary.
* gtk/gtktextview.c: Adapt to above change.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (invalidated_handler): put validate idle at
......
Wed Aug 29 20:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_add/remove_selection_clipboard):
Instead of always mirroring the selection to a single PRIMARY
selection, allow it to be mirrored to any number of clipboards.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_paste_primary): Remove,
just use gtk_text_buffer_paste_clipboard with the appropriate clipboard.
* gtk/gtktextbuffer.[ch] (gtk_text_buffer_cut/copy/paste_clipboard): Add a
GtkClipboard argument, and for paste_clipboard, the
@override_location argument from @paste_primary.
* gtk/gtktextview.c: Adapt to above change.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (invalidated_handler): put validate idle at
......
This diff is collapsed.
......@@ -28,6 +28,7 @@
#define GTK_TEXT_BUFFER_H
#include <gtk/gtkwidget.h>
#include <gtk/gtkclipboard.h>
#include <gtk/gtktexttagtable.h>
#include <gtk/gtktextiter.h>
#include <gtk/gtktextmark.h>
......@@ -62,7 +63,8 @@ struct _GtkTextBuffer
GtkTextTagTable *tag_table;
GtkTextBTree *btree;
GtkTextBuffer *clipboard_contents;
GSList *clipboard_contents_buffers;
GSList *selection_clipboards;
GtkTextLogAttrCache *log_attr_cache;
......@@ -324,13 +326,19 @@ gboolean gtk_text_buffer_get_modified (GtkTextBuffer *buffer);
void gtk_text_buffer_set_modified (GtkTextBuffer *buffer,
gboolean setting);
void gtk_text_buffer_paste_primary (GtkTextBuffer *buffer,
const GtkTextIter *override_location,
gboolean default_editable);
void gtk_text_buffer_add_selection_clipboard (GtkTextBuffer *buffer,
GtkClipboard *clipboard);
void gtk_text_buffer_remove_selection_clipboard (GtkTextBuffer *buffer,
GtkClipboard *clipboard);
void gtk_text_buffer_cut_clipboard (GtkTextBuffer *buffer,
GtkClipboard *clipboard,
gboolean default_editable);
void gtk_text_buffer_copy_clipboard (GtkTextBuffer *buffer);
void gtk_text_buffer_copy_clipboard (GtkTextBuffer *buffer,
GtkClipboard *clipboard);
void gtk_text_buffer_paste_clipboard (GtkTextBuffer *buffer,
GtkClipboard *clipboard,
GtkTextIter *override_location,
gboolean default_editable);
gboolean gtk_text_buffer_get_selection_bounds (GtkTextBuffer *buffer,
......
......@@ -1050,6 +1050,10 @@ gtk_text_view_set_buffer (GtkTextView *text_view,
gtk_text_view_mark_set_handler, text_view);
g_object_unref (G_OBJECT (text_view->buffer));
text_view->dnd_mark = NULL;
if (GTK_WIDGET_REALIZED (text_view))
gtk_text_buffer_remove_selection_clipboard (text_view->buffer,
gtk_clipboard_get (GDK_SELECTION_PRIMARY));
}
text_view->buffer = buffer;
......@@ -1077,6 +1081,10 @@ gtk_text_view_set_buffer (GtkTextView *text_view,
g_signal_connect (G_OBJECT (text_view->buffer), "mark_set",
G_CALLBACK (gtk_text_view_mark_set_handler), text_view);
if (GTK_WIDGET_REALIZED (text_view))
gtk_text_buffer_remove_selection_clipboard (text_view->buffer,
gtk_clipboard_get (GDK_SELECTION_PRIMARY));
}
if (GTK_WIDGET_VISIBLE (text_view))
......@@ -2939,6 +2947,10 @@ gtk_text_view_realize (GtkWidget *widget)
widget->window);
gtk_text_view_ensure_layout (text_view);
if (text_view->buffer)
gtk_text_buffer_add_selection_clipboard (text_view->buffer,
gtk_clipboard_get (GDK_SELECTION_PRIMARY));
}
static void
......@@ -2948,6 +2960,10 @@ gtk_text_view_unrealize (GtkWidget *widget)
text_view = GTK_TEXT_VIEW (widget);
if (text_view->buffer)
gtk_text_buffer_remove_selection_clipboard (text_view->buffer,
gtk_clipboard_get (GDK_SELECTION_PRIMARY));
if (text_view->first_validate_idle)
{
g_source_remove (text_view->first_validate_idle);
......@@ -3290,9 +3306,10 @@ gtk_text_view_button_press_event (GtkWidget *widget, GdkEventButton *event)
event->x + text_view->xoffset,
event->y + text_view->yoffset);
gtk_text_buffer_paste_primary (get_buffer (text_view),
&iter,
text_view->editable);
gtk_text_buffer_paste_clipboard (get_buffer (text_view),
gtk_clipboard_get (GDK_SELECTION_PRIMARY),
&iter,
text_view->editable);
return TRUE;
}
else if (event->button == 3)
......@@ -4170,7 +4187,9 @@ gtk_text_view_delete_from_cursor (GtkTextView *text_view,
static void
gtk_text_view_cut_clipboard (GtkTextView *text_view)
{
gtk_text_buffer_cut_clipboard (get_buffer (text_view), text_view->editable);
gtk_text_buffer_cut_clipboard (get_buffer (text_view),
gtk_clipboard_get (GDK_NONE),
text_view->editable);
DV(g_print (G_STRLOC": scrolling onscreen\n"));
gtk_text_view_scroll_mark_onscreen (text_view,
gtk_text_buffer_get_mark (get_buffer (text_view),
......@@ -4180,7 +4199,8 @@ gtk_text_view_cut_clipboard (GtkTextView *text_view)
static void
gtk_text_view_copy_clipboard (GtkTextView *text_view)
{
gtk_text_buffer_copy_clipboard (get_buffer (text_view));
gtk_text_buffer_copy_clipboard (get_buffer (text_view),
gtk_clipboard_get (GDK_NONE));
DV(g_print (G_STRLOC": scrolling onscreen\n"));
gtk_text_view_scroll_mark_onscreen (text_view,
gtk_text_buffer_get_mark (get_buffer (text_view),
......@@ -4190,7 +4210,10 @@ gtk_text_view_copy_clipboard (GtkTextView *text_view)
static void
gtk_text_view_paste_clipboard (GtkTextView *text_view)
{
gtk_text_buffer_paste_clipboard (get_buffer (text_view), text_view->editable);
gtk_text_buffer_paste_clipboard (get_buffer (text_view),
gtk_clipboard_get (GDK_NONE),
NULL,
text_view->editable);
DV(g_print (G_STRLOC": scrolling onscreen\n"));
gtk_text_view_scroll_mark_onscreen (text_view,
gtk_text_buffer_get_mark (get_buffer (text_view),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment