<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- gtktext.c.orig	Tue Apr 21 15:46:48 1998
+++ gtktext.c	Thu Apr 30 00:24:50 1998
@@ -300,6 +300,12 @@
 static void gtk_text_select_line               (GtkText          *text,
 						guint32           time);
 
+static void gtk_text_set_info (GtkText* text,
+			       gint type,
+			       const gchar* data,
+			       gint size,
+			       gint location);
+
 /* #define DEBUG_GTK_TEXT */
 
 #if defined(DEBUG_GTK_TEXT) &amp;&amp; defined(__GNUC__)
@@ -504,6 +510,8 @@
   text-&gt;button = 0;
 
   GTK_EDITABLE(text)-&gt;editable = FALSE;
+
+  text-&gt;collect_info = FALSE;
 }
 
 GtkWidget*
@@ -744,6 +752,8 @@
 
   memcpy (text-&gt;text + text-&gt;gap_position, chars, length);
 
+  gtk_text_set_info( text, 1, chars, length, text-&gt;point.index );
+
   insert_text_property (text, font, fore, back, length);
 
   text-&gt;gap_size -= length;
@@ -826,6 +836,8 @@
 
   move_gap_to_point (text);
 
+  gtk_text_set_info( text, 0, text-&gt;text + text-&gt;gap_position + text-&gt;gap_size, nchars, text-&gt;point.index );
+
   text-&gt;gap_size += nchars;
 
   delete_text_property (text, nchars);
@@ -839,6 +851,57 @@
   return TRUE;
 }
 
+void
+gtk_text_set_cursor (GtkText *text,
+		     guint position)
+{
+  GtkEditable *editable = (GtkEditable *) text;
+
+  undraw_cursor( text, FALSE );
+  text-&gt;has_cursor = 1;
+  text-&gt;cursor_mark = find_mark( text, position );
+  find_cursor( text, FALSE );
+  if (!text-&gt;freeze)
+    {
+      find_line_containing_point (text, text-&gt;cursor_mark.index, TRUE);
+    }
+  draw_cursor( text, FALSE );
+  editable-&gt;has_selection = FALSE;
+}
+
+guint
+gtk_text_get_cursor (GtkText *text)
+{
+  if( text-&gt;has_cursor )
+    return text-&gt;cursor_mark.index;
+  else
+    return 0;
+}
+
+void
+gtk_text_collect_info( GtkText *text,
+		       gboolean collect )
+{
+  text-&gt;collect_info = collect;
+}
+
+void
+gtk_text_get_info (GtkText *text,
+		   gint *type,
+		   gchar **info,
+		   gint *length,
+		   gint *location)
+{
+  if (type)
+    *type = text-&gt;last_change_type;
+  if (info)
+    *info = text-&gt;last_change_info;
+  if (length)
+    *length = text-&gt;last_change_length;
+  if (location)
+    *location = text-&gt;last_change_location;
+}
+
 static gchar *    
 gtk_text_get_chars (GtkEditable   *editable,
 		    gint           start_pos,
@@ -3201,6 +3264,24 @@
       g_list_free (member);
 
       return list-&gt;next;
+    }
+}
+
+/**********************************************************************/
+/*                       Change Information                           */
+/**********************************************************************/
+
+void
+gtk_text_set_info( GtkText *text, gint type, const gchar *data, gint length, gint location )
+{
+  if (text-&gt;collect_info)
+    {
+      g_free (text-&gt;last_change_info);
+      text-&gt;last_change_info = g_malloc0 (length + 1);
+      memcpy (text-&gt;last_change_info, data, length);
+      text-&gt;last_change_type = type;
+      text-&gt;last_change_length = length;
+      text-&gt;last_change_location = location;
     }
 }
 
</pre></body></html>