9/4/2010

Using xbuild on Visual Studio .NET 2008 generated project file

Create symbolic link to 2.0 target files
Building projects with xbuild and receiving errors regarding imported project/target files, such as:
/usr/lib/mono/3.5/Microsoft.CSharp.targets not found

The following worked:

$ sudo ln -s /usr/lib/mono/2.0/Microsoft.CSharp.targets /usr/lib/mono/3.5/Microsoft.CSharp.targets
$ sudo ln -s /usr/lib/mono/2.0/Microsoft.Common.targets /usr/lib/mono/3.5/Microsoft.Common.targets
$ sudo ln -s /usr/lib/mono/2.0/Microsoft.Common.tasks /usr/lib/mono/3.5/Microsoft.Common.tasks

8/21/2010

scintilla-sharp updated to GtkSharp 2.12, Scintilla 2.20

Since I'm still using this component I decided to upgrade to the latest releases of both Scintilla and GtkSharp.
Building on Windows

Follow these instructions first and get gtk-sharp building on your development machine: Compiling GtkSharp

Tips:

Most Windows developers have multiple instances of the .NET framework installed, usually from 2.0 through to 4.0 or something along those lines. You must have .NET 1.1 installed to build a working gtk-sharp 2.12 installation.

  • I started with this bundle GTK+ 2.20 win32 binaries
  • I used a virtual machine with XP Pro SP3. This makes things a lot easier eliminating conflicts with my development environment
  • Remember that the /sdk symbolic link MUST point to the .NET 1.1 sdk
  • Likewise, the /dotnet symbolic link MUST point to .NET 1.1 redist
  • Cygwin make 3.81 will not work as installed by setup.exe, use this one: http://www.cmake.org/files/cygwin/make.exe or browse the web for other solutions, apparently downgrading to 3.80 also works
  • Set PKG_CONFIG_PATH to the location where you unzipped the GTK+ 2.20 bundle, e.g.:
    $ export PKG_CONFIG_PATH=e:/gtkrun2.20/lib/pkgconfig
Once gtk-sharp is building without error, the next step is to integrate scintilla-sharp into the build process. This involves placing the scintilla-sharp folder under the gtk-sharp-2.12 folder and modifying some of the autotools build files. Add scintilla-sharp to the top-level Makefile.am, line 1:

SUBDIRS = sources generator parser glib cairo pango atk gdk gtk glade gtkdotnet scintilla-sharp sample doc msi

The same change may need to be manually made to Makefile.in depending on circumstance.

You must also modify configure.in, adding these lines to the AC_OUTPUT section:
scintilla-sharp/Makefile
scintilla-sharp/scintilla-sharp.dll.config
scintilla-sharp/scintilla-sharp.pc

Now at the Cygwin bash prompt:

$ aclocal & autoconf & automake
$ ./configure
$ make

If all goes well you'll have a scintilla-sharp.dll ready to move to either your mono approved GtkSharp install or to the runtime directory you have just used to build the assembly.

If changes are make to the GTK+ widget interface in gtkscintilla2.h.in/c.in for example, you'll need to produce a new scintilla-api.raw file that will be processed by the make process resulting in generated C# code in the generated/ folder. Here's an example:

$ ../parser/gapi_pp.pl ../../gtkscintilla2/win32| ../parser/gapi2xml.pl Sansguerre scintilla-api.raw libgtkscintilla2.dll

1/22/2006 xtp: a scintilla-sharp example

In addition to the dependencies listed for building and deploying scintilla-sharp the xtp example program require SQLite 3, an embeddable database engine: The database capabilities are currently underused in the program but I had hoped to explore the possibility of using it to cache code completion results.

In any case a proprietary file structure for the proposed cache doesn't appeal to me and if for some reason an embedded database engine cannot be coaxed into providing the needed persistence I will take a look at other options.

1/14/2006 notes gtkscintilla2

The scintilla gtk implementation has an unusual API that doesn't strictly follow the pattern of other gtk components. No doubt this is due to the need to maintain interfaces for both win32 and gtk.

The process of automating the .NET bindings for gtk# components is closely tied to having header files available that 'look like' gtk2 components.

I therefore decided to use the pass-through type interface provided by gtkscintilla2. This component wraps the scintilla gtk2 interface in a more standard package, for the most part just delegating all calls to the scintilla message counterpart.

I've added a win32 directory to the gtkscintilla2 distribution for those interested in running scintilla# under windows.

In this alpha stage of release scintilla# itself has some API quirks that need to be addressed. Examples are methods returning int instead of bool:

public int AutocActive()

really should be:

public bool AutocActive { get; }

Fortunately gtk# has a mechanism for coping with this kind of change and I will be implementing that this week.

1/8/2006 Building scintilla-sharp

Pre-requisites
Notes

The following assumes some knowledge of building gtk 2 libraries and applications.  On Windows especially getting the environment set up from scratch requires some patience. 

First, install the pre-requisites. The mono distribution does a good job of installing the underlying gtk 2 development packages on both Linux and Windows. 

Next you'll probably need to adjust your PKG_CONFIG_PATH environment variable.  On Windows, I do this by editing ~/.bash_profile in a bash session and adding the following line:
export PKG_CONFIG_PATH=$MONO_PATH/lib/pkgconfig:$PKG_CONFIG_PATH:

Where $MONO_PATH is defined as the base directory of your mono installation.

Next verify that we can build gtk-sharp-2.4.0 from source.  Change directories to the gtk-sharp sources directory.  On Windows type

<path to gtk#>:\> make -f makefile.win32

On Linux

$./configure
$./make

If you're able to build gtk-sharp-2.4.0 from source then building scintilla involves unzipping the scintilla-sharp package into the root of the gtk-sharp source directory and modifying the gtk-sharp top level makefile to include the scintilla directory.

On windows this file is called 'makefile.win32' and it is line 1 that you want to change, like so:

DIRS=generator parser glib pango atk gdk gtk glade gtkdotnet scintilla
On linux this file is called 'Makefile.am' and line 1 should look like this after you edit it:
SUBDIRS = sources generator parser glib pango atk gdk gtk glade art gnomevfs gnome gtkhtml gconf rsvg vte gtkdotnet scintilla sample doc

Now repeat the build process from the base of the gtk sharp source tree just as above.

If all went well you have built the 2.4.0 release of gtk# including the scintilla-sharp package and the next step is to install it.

12/31/2005

scintilla-sharp is a .NET binding for scintilla and gtk#.

In the next few days we'll have a binary distribution and sample code for those of you interested in an advanced editing component for gtk#.

Meanwhile you can download the scintilla-sharp source code from here.