[Mono-list] Patch for sqlsharpgtk
Francisco T. Martinez
martinf@mfconsulting.com
Fri, 26 Mar 2004 10:12:54 -0600
--=-InuMogmOSnThYkprXiEt
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
The included patch should fix some of the compilation problems
sqlgtksharp has been suffering due to evolutionary changes in GTK#. The
patch was put together for the module found in Mono's anonymous access
CVS repository.
Interested parties can get a hold of this module by checking it out of
anonymous CVS -- detailed steps to access that CVS repository can be
found here: http://www.go-mono.com/anoncvs.html
To chekcout:
Create a directory of your choice and change to it.
mkdir ~/monocvs && cd ~/monocvs
Export the CVSROOT environment variable.
export CVSROOT=:pserver:anonymous@anoncvs.go-mono.com:/mono
Run the following line at the prompt
cvs -z3 co sqlsharpgtk
To Patch:
Copy the attached file sqlsharpgtk.patch to the base project directory
Change to the project directory if necessary
cd ~/monocvs/sqlsharpgtk
Run the patch utility as follows
patch -p 1 <./sqlsharpgtk.patch
To compile and run:
Change to the directory containing the Makefile
cd ~/monocvs/sqlsharpgtk/sqlsharpgtk
Compile the project
make
If in Windows use
nmake -f Makefile
Run the resulting assembly
mono sqlsharpgtk.exe
This was tested to work with both Linux and Windows running Mono Runtime
0.30 and GTK# 0.17
Best reguards to everyone...
Paco
--=-InuMogmOSnThYkprXiEt
Content-Disposition: attachment; filename=sqlsharpgtk.patch
Content-Type: text/x-patch; name=sqlsharpgtk.patch; charset=utf-8
Content-Transfer-Encoding: 8bit
diff -Naur sqlsharpgtk/sqlsharpgtk/AssemblyInfo.cs sqlsharpgtk-200403260607/sqlsharpgtk/AssemblyInfo.cs
--- sqlsharpgtk/sqlsharpgtk/AssemblyInfo.cs 1969-12-31 18:00:00.000000000 -0600
+++ sqlsharpgtk-200403260607/sqlsharpgtk/AssemblyInfo.cs 2004-03-26 06:05:14.000000000 -0600
@@ -0,0 +1,32 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following
+// attributes.
+//
+// change them to the information which is associated with the assembly
+// you compile.
+
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("Interactive SQL workbench application written using GTK# for the GUI")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// The assembly version has following format :
+//
+// Major.Minor.Build.Revision
+//
+// You can specify all values by your own or you can build default build and revision
+// numbers with the '*' character (the default):
+
+[assembly: AssemblyVersion("1.0.*")]
+
+// The following attributes specify the key for the sign of your assembly. See the
+// .NET Framework documentation for more information about signing.
+// This is not required, if you don't want signing let these attributes like they're.
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
diff -Naur sqlsharpgtk/sqlsharpgtk/ChangeLog sqlsharpgtk-200403260607/sqlsharpgtk/ChangeLog
--- sqlsharpgtk/sqlsharpgtk/ChangeLog 2004-01-25 20:11:09.000000000 -0600
+++ sqlsharpgtk-200403260607/sqlsharpgtk/ChangeLog 2004-03-26 06:35:30.000000000 -0600
@@ -1,24 +1,33 @@
-2004-01-25 Daniel Morgan <danielmorgan@verizon.net>
-
- * sqlsharpgtk.cs: fix AppendTextWithoutScroll causing
- Mono to crash
-
-2004-01-11 Daniel Morgan <danielmorgan@verizon.net>
-
- * DataGrid.cs
- * LoginDialog.cs
- * Makefile
- * SqlEditorSharp.cs
- * SqlSharpDataAdapter.cs
- * sqlsharpgtk.cs: changes to get it to build
- with GTK# 0.15 and Mono 0.29 releases
-
-2003-11-13 Pedro Martínez Juliá <yoros@wanadoo.es>
-
- * LoginDialog.cs
- * SqlEditorSharp.cs
- * sqlsharpgtk.cs: Updated to the new changes in gtk-sharp
- library.
+2004-03-26 Francisco "Paco" Martinez <paco@mfcon.com>
+
+ * DataGrid.cs: Changes resulting from GTK# evolutionay improvements
+ * SqlEditorSharp.cs: Changes resulting from GTK# evolutionay improvements
+ * sqlsharpgtk.cs: Changes resulting from GTK# evolutionay improvements
+ * Makefile: Added the AssemblyInfo.cs file to the sources variable
+ * AssemblyInfo.cs: Added this file to provide enhanced metadata and version information
+ about the sqlsharpgtk.exe assembly
+
+2004-01-25 Daniel Morgan <danielmorgan@verizon.net>
+
+ * sqlsharpgtk.cs: fix AppendTextWithoutScroll causing
+ Mono to crash
+
+2004-01-11 Daniel Morgan <danielmorgan@verizon.net>
+
+ * DataGrid.cs
+ * LoginDialog.cs
+ * Makefile
+ * SqlEditorSharp.cs
+ * SqlSharpDataAdapter.cs
+ * sqlsharpgtk.cs: changes to get it to build
+ with GTK# 0.15 and Mono 0.29 releases
+
+2003-11-13 Pedro Martínez Juliá <yoros@wanadoo.es>
+
+ * LoginDialog.cs
+ * SqlEditorSharp.cs
+ * sqlsharpgtk.cs: Updated to the new changes in gtk-sharp
+ library.
2003-10-16 Daniel Morgan <danielmorgan@verizon.net>
diff -Naur sqlsharpgtk/sqlsharpgtk/DataGrid.cs sqlsharpgtk-200403260607/sqlsharpgtk/DataGrid.cs
--- sqlsharpgtk/sqlsharpgtk/DataGrid.cs 2004-01-10 23:27:58.000000000 -0600
+++ sqlsharpgtk-200403260607/sqlsharpgtk/DataGrid.cs 2004-03-26 06:05:14.000000000 -0600
@@ -226,9 +226,7 @@
public TreeIter NewRow ()
{
- TreeIter rowTreeIter = new TreeIter();
- store.Append (out rowTreeIter);
- return rowTreeIter;
+ return store.Append();
}
public void AddRow (object[] columnValues)
diff -Naur sqlsharpgtk/sqlsharpgtk/Makefile sqlsharpgtk-200403260607/sqlsharpgtk/Makefile
--- sqlsharpgtk/sqlsharpgtk/Makefile 2004-01-10 23:27:58.000000000 -0600
+++ sqlsharpgtk-200403260607/sqlsharpgtk/Makefile 2004-03-26 06:31:45.000000000 -0600
@@ -13,7 +13,7 @@
GTK_SHARP_LIBS = -r glib-sharp -r gdk-sharp -r pango-sharp -r atk-sharp -r gtk-sharp -r System.Drawing
SQLSHARP_GTK_LIBS = $(GTK_SHARP_LIBS) -r System.Data
-SOURCES = sqlsharpgtk.cs SqlEditorSharp.cs LoginDialog.cs DbProvider.cs DbProviderCollection.cs DataGrid.cs FileSelectionDialog.cs SqlSharpDataAdapter.cs
+SOURCES = sqlsharpgtk.cs SqlEditorSharp.cs LoginDialog.cs DbProvider.cs DbProviderCollection.cs DataGrid.cs FileSelectionDialog.cs SqlSharpDataAdapter.cs AssemblyInfo.cs
all : $(PROJECT)
diff -Naur sqlsharpgtk/sqlsharpgtk/SqlEditorSharp.cs sqlsharpgtk-200403260607/sqlsharpgtk/SqlEditorSharp.cs
--- sqlsharpgtk/sqlsharpgtk/SqlEditorSharp.cs 2004-01-10 23:27:58.000000000 -0600
+++ sqlsharpgtk-200403260607/sqlsharpgtk/SqlEditorSharp.cs 2004-03-26 06:05:14.000000000 -0600
@@ -195,13 +195,13 @@
char ch = ' ';
insert_mark = sqlTextBuffer.InsertMark;
- sqlTextBuffer.GetIterAtMark (out insert_iter, insert_mark);
+ insert_iter = sqlTextBuffer.GetIterAtMark (insert_mark);
//line = insert_iter.Line;
/* get the starting and ending text iterators */
- sqlTextBuffer.GetIterAtOffset (out start_iter, 0);
+ start_iter = sqlTextBuffer.GetIterAtOffset (0);
char_count = sqlTextBuffer.CharCount;
- sqlTextBuffer.GetIterAtOffset (out end_iter, char_count);
+ end_iter = sqlTextBuffer.GetIterAtOffset (char_count);
SqlSharpGtk.DebugWriteLine ("char_count: " + char_count);
@@ -317,7 +317,7 @@
* - SQL keywords (SELECT, FROM, WHERE, UPDATE, etc)
*********************************************************************/
//if (line != line_last_changed) {
- sqlTextBuffer.GetIterAtOffset (out start_iter, 0);
+ start_iter = sqlTextBuffer.GetIterAtOffset (0);
//}
//else {
// if (insert_iter.StartsLine () == true) {
@@ -332,7 +332,7 @@
// get starting and ending iters
// and character count of line
char_count = sqlTextBuffer.CharCount;
- sqlTextBuffer.GetIterAtOffset (out end_iter, char_count);
+ end_iter = sqlTextBuffer.GetIterAtOffset (char_count);
// for each line, look for:
// line comments, constants, and keywoards
@@ -651,7 +651,7 @@
StreamWriter sw = null;
sw = new StreamWriter(outFilename);
- sqlTextBuffer.GetIterAtOffset (out iter, 0);
+ iter = sqlTextBuffer.GetIterAtOffset (0);
start_iter = iter;
while (iter.ForwardLine()) {
text = sqlTextBuffer.GetText(start_iter, iter, false);
diff -Naur sqlsharpgtk/sqlsharpgtk/sqlsharpgtk.cs sqlsharpgtk-200403260607/sqlsharpgtk/sqlsharpgtk.cs
--- sqlsharpgtk/sqlsharpgtk/sqlsharpgtk.cs 2004-01-25 20:11:09.000000000 -0600
+++ sqlsharpgtk-200403260607/sqlsharpgtk/sqlsharpgtk.cs 2004-03-26 06:05:14.000000000 -0600
@@ -112,9 +112,10 @@
public void CreateGui()
{
win = new Gtk.Window (ApplicationName);
- win.DeleteEvent += new GtkSharp.DeleteEventHandler(OnWindow_Delete);
+ win.DeleteEvent += new Gtk.DeleteEventHandler(OnWindow_Delete);
win.BorderWidth = 4;
- win.DefaultSize = new Size (450, 300);
+ win.SetDefaultSize (450, 300);
+ // win.DefaultSize = new Gtk.Size (450, 300);
VBox vbox = new VBox (false, 4);
win.Add (vbox);
@@ -137,7 +138,7 @@
NewEditorTab();
paned.Add1 (sourceFileNotebook);
sourceFileNotebook.SwitchPage += new
- GtkSharp.SwitchPageHandler(OnEditorTabSwitched);
+ Gtk.SwitchPageHandler(OnEditorTabSwitched);
// bottom panel
resultsNotebook = CreateOutputResultsGui ();
@@ -157,7 +158,7 @@
editor.UseSyntaxHiLighting = true;
editor.View.Show ();
editor.View.KeyPressEvent +=
- new GtkSharp.KeyPressEventHandler(OnKeyPressEventKey);
+ new Gtk.KeyPressEventHandler(OnKeyPressEventKey);
lastUnknownFile ++;
string unknownFile = "Unknown" +
@@ -231,14 +232,14 @@
return sw;
}
- void OnKeyPressEventKey(object o, GtkSharp.KeyPressEventArgs args)
+ void OnKeyPressEventKey(object o, Gtk.KeyPressEventArgs args)
{
if (o is TextView) {
TextView tv = (TextView) o;
//Gdk.EventKey k = args.Event;
// if the F5 key was pressed
- if (args.Event.keyval == 0xFFC2) {
+ if (args.Event.KeyValue == 0xFFC2) {
if (tv.Editable == true) {
// execute SQL
ExecuteSQL (ExecuteOutputType.Normal, "");
@@ -605,14 +606,14 @@
win.Title = title;
}
- void OnEditorTabSwitched (object o, GtkSharp.SwitchPageArgs args)
+ void OnEditorTabSwitched (object o, Gtk.SwitchPageArgs args)
{
int page = (int) args.PageNum;
EditorTab tab = FindEditorTab(page);
UpdateTitleBar (tab);
}
- void OnWindow_Delete (object o, GtkSharp.DeleteEventArgs args)
+ void OnWindow_Delete (object o, Gtk.DeleteEventArgs args)
{
QuitApplication();
}
--=-InuMogmOSnThYkprXiEt--