[Monodevelop-patches-list] r1901 - in trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor: . Gui

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Jul 5 16:41:54 EDT 2004


Author: jluke
Date: 2004-07-05 16:41:54 -0400 (Mon, 05 Jul 2004)
New Revision: 1901

Modified:
   trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
   trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
   trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
Log:
2004-07-05  John Luke  <jluke at cfl.rr.com>
 
        * Gui/SourceEditorDisplayBinding.cs:
        * Gui/SourceEditorView.cs: remove pinvokes where possible
        anything that needs to be done in unmanaged code needs to go
        to gtksourceview-sharp, except g_utf8_validate for now



Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-07-05 20:31:27 UTC (rev 1900)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-07-05 20:41:54 UTC (rev 1901)
@@ -1,3 +1,10 @@
+2004-07-05  John Luke  <jluke at cfl.rr.com>
+
+	* Gui/SourceEditorDisplayBinding.cs:
+	* Gui/SourceEditorView.cs: remove pinvokes where possible
+	anything that needs to be done in unmanaged code needs to go
+	to gtksourceview-sharp, except g_utf8_validate for now
+
 2004-07-01  Todd Berman  <tberman at off.net>
 
 	* CodeCompletion/CompletionWindow.cs: Fix bug #61020, by marking the

Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-07-05 20:31:27 UTC (rev 1900)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-07-05 20:41:54 UTC (rev 1901)
@@ -323,10 +323,6 @@
 			needsUpdate = true;
 		}
 		
-		// WORKAROUND until we get this method returning char in gtk#
-		[DllImport("libgtk-win32-2.0-0.dll")]
-		static extern char gtk_text_iter_get_char (ref Gtk.TextIter raw);
-		
 		void UpdateLineCol ()
 		{
 			int col = 1; // first char == 1
@@ -339,8 +335,9 @@
 			
 			iter.LineOffset = 0;
 			
-			while (! iter.Equal (start)) {
-				char c = gtk_text_iter_get_char (ref iter);
+			while (!iter.Equal (start))
+			{
+				char c = iter.Char.ToCharArray ()[0];
 				
 				if (c == '\t')
 					col += (tab_size - (col % tab_size));

Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs	2004-07-05 20:31:27 UTC (rev 1900)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs	2004-07-05 20:41:54 UTC (rev 1901)
@@ -458,17 +458,13 @@
 			}
 		}
 		
-		// WORKAROUND until we get this method returning char in gtk#
-		[DllImport("libgtk-win32-2.0-0.dll")]
-		static extern char gtk_text_iter_get_char (ref Gtk.TextIter raw);
-		
 		void UnIndentLines (int y0, int y1)
 		{
 			for (int l = y0; l <= y1; l ++) {
 				TextIter start = Buffer.GetIterAtLine (l);
 				TextIter end = start;
 				
-				char c = gtk_text_iter_get_char (ref end);
+				char c = start.Char.ToCharArray ()[0];
 				
 				if (c == '\t') {
 					end.ForwardChar ();
@@ -478,7 +474,7 @@
 					int cnt = 0;
 					int max = (int) TabsWidth;
 					
-					while (cnt <= max && gtk_text_iter_get_char (ref end) == ' ' && ! end.EndsLine ()) {
+					while (cnt <= max && end.Char.ToCharArray ()[0] == ' ' && ! end.EndsLine ()) {
 						cnt ++;
 						end.ForwardChar ();
 					}
@@ -520,17 +516,13 @@
 			Buffer.EndUserAction ();
 		}
 		
-		// Need the ref here
-		[DllImport("libgtk-x11-2.0.so.0")]
-		static extern void gtk_text_buffer_delete (IntPtr raw, ref Gtk.TextIter start, ref Gtk.TextIter end);
-		
 		void IFormattableDocument.ReplaceLine (int ln, string txt)
 		{
 			TextIter begin = Buffer.GetIterAtLine (ln);
 			TextIter end = begin;
 			end.ForwardToLineEnd ();
 			
-			gtk_text_buffer_delete (Buffer.Handle, ref begin, ref end);
+			Buffer.Delete (begin, end);
 			Buffer.Insert (begin, txt);
 		}
 		
@@ -553,7 +545,7 @@
 		char IFormattableDocument.GetCharAt (int offset)
 		{
 			TextIter it = Buffer.GetIterAtOffset (offset);
-			return gtk_text_iter_get_char (ref it);
+			return it.Char.ToCharArray ()[0];
 		}
 		
 		void IFormattableDocument.Insert (int offset, string text)




More information about the Monodevelop-patches-list mailing list