Discussion:
[Gtk-sharp-list] rsvg sharp on windows
Gerhard Götz
2010-08-28 14:00:47 UTC
Permalink
Hi,

i have been testing my c# shogi game on Windows (developed on linux). It
worked perfectly except one thing: librsvg-sharp is not available for
Windows. At least i couldn't find it.

Looking at [1] it's said that it is available for Windows. But on the
other hand it is in the gnome-desktop-sharp module which is gnome
specific.

Is there a specific reason why librsvg-sharp is in gnome-desktop-sharp?
Maybe it can be moved to the gtk-sharp module. I think that it shouldn't
be too complicated since the native librsvg is already there.

Greetings
Gerhard Götz

[1] http://www.mono-project.com/GtkSharpDetails
Matt Guo
2010-10-19 04:59:26 UTC
Permalink
Gerhard,

I just had the same requirement/issue several months before.

First of all I agreed on that the rsvg2-sharp.dll shall be included in
the gtk-sharp windows installer.

Since the native lib is already there, (on my Windows it's named
librsvg-2-2.dll), I used the the following solution:
a) if using mono on Windows, then just copy rsvg2-sharp.dll, and
rsvg2-sharp.dll.config from Linux to Windows, then rewrite the .config
to:
<configuration>
<dllmap dll="rsvg-2" target="librsvg-2-2.dll"/>
</configuration>

b) if using .Net on Windows, then modify the GAPI generated code and
build it again, the modification includes:
1) change all [DllImport("rsvg-2")] to [DllImport("librsvg-2-2.dll")]
2) call gapi-cdecl-insert (see "Win32 binding issues" in this
page: http://www.mono-project.com/GAPI)
Then the compiled dll shall work on Windows .Net (I'm not 100% sure
since I already lost the related files). BTW, the (generated) code
base of rsvg2-sharp's is really small and straight-forward.

BTW, is your shogi game open source? Any URL of it?

B.R.
Post by Gerhard Götz
Hi,
i have been testing my c# shogi game on Windows (developed on linux). It
worked perfectly except one thing: librsvg-sharp is not available for
Windows. At least i couldn't find it.
Looking at [1] it's said that it is available for Windows. But on the
other hand it is in the gnome-desktop-sharp module which is gnome
specific.
Is there a specific reason why librsvg-sharp is in gnome-desktop-sharp?
Maybe it can be moved to the gtk-sharp module. I think that it shouldn't
be too complicated since the native librsvg is already there.
Greetings
Gerhard Götz
[1] http://www.mono-project.com/GtkSharpDetails
_______________________________________________
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
--
--
B.R.
GUO Rui (Matt)
Matt Guo
2010-10-19 05:34:16 UTC
Permalink
Post by Matt Guo
Gerhard,
I just had the same requirement/issue several months before.
First of all I agreed on that the rsvg2-sharp.dll shall be included in
the gtk-sharp windows installer.
Since the native lib is already there, (on my Windows it's named
a) if using mono on Windows, then just copy rsvg2-sharp.dll, and
rsvg2-sharp.dll.config from Linux to Windows, then rewrite the .config
<configuration>
 <dllmap dll="rsvg-2" target="librsvg-2-2.dll"/>
</configuration>
b) if using .Net on Windows, then modify the GAPI generated code and
   1) change all [DllImport("rsvg-2")] to [DllImport("librsvg-2-2.dll")]
   2) call gapi-cdecl-insert (see "Win32 binding issues" in this
page: http://www.mono-project.com/GAPI)
Then the compiled dll shall work on Windows .Net (I'm not 100% sure
since I already lost the related files). BTW, the (generated) code
base of rsvg2-sharp's is really small and straight-forward.
Oh, I just recalled that with .Net 2.0, we don't need to call
gapi-cdcel-insert, but insteadly, we replace the CDeclCallback
attribute with UnmanagedFunctionPointer(CallingConvention.Cdecl)
attribute in the generated code.

e.g.:

[CDeclCallback]
internal delegate void SizeFuncNative(out int width, out int height,
IntPtr user_data);
=>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void SizeFuncNative(out int width, out int height,
IntPtr user_data);
Post by Matt Guo
BTW, is your shogi game open source? Any URL of it?
B.R.
Post by Gerhard Götz
Hi,
i have been testing my c# shogi game on Windows (developed on linux). It
worked perfectly except one thing: librsvg-sharp is not available for
Windows. At least i couldn't find it.
Looking at [1] it's said that it is available for Windows. But on the
other hand it is in the gnome-desktop-sharp module which is gnome
specific.
Is there a specific reason why librsvg-sharp is in gnome-desktop-sharp?
Maybe it can be moved to the gtk-sharp module. I think that it shouldn't
be too complicated since the native librsvg is already there.
Greetings
Gerhard Götz
[1] http://www.mono-project.com/GtkSharpDetails
_______________________________________________
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
--
--
B.R.
GUO Rui (Matt)
--
--
B.R.
GUO Rui (Matt)
Gerhard Götz
2010-10-20 16:20:42 UTC
Permalink
Hi Matt,

I quickly tried the copy approach. But it didn't work, maybe because I
used .Net on Windows.

I thought I could try to move rsvg-sharp.dll to gtk-sharp, build it
(maybe on Windows? Are the official downloads built on Windows?) and at
least use the dll from there. Maybe if that's done the chances are
higher that it gets into the official source tree.
But i didn't spent much time working on this yet, because i want to get
some more basic stuff ready before fully starting the windows porting.
The past tests were just to quickly see where the problems are.

The game is open source. It's name is Koushu Shogi.
It should run fine under Linux. You can play against a computer (only
gnushogi at the moment) or against a human player.

http://github.com/Rootie/KoushuShogi

Greetings
Gerhard Götz
Post by Matt Guo
Gerhard,
I just had the same requirement/issue several months before.
First of all I agreed on that the rsvg2-sharp.dll shall be included in
the gtk-sharp windows installer.
Since the native lib is already there, (on my Windows it's named
a) if using mono on Windows, then just copy rsvg2-sharp.dll, and
rsvg2-sharp.dll.config from Linux to Windows, then rewrite the .config
<configuration>
<dllmap dll="rsvg-2" target="librsvg-2-2.dll"/>
</configuration>
b) if using .Net on Windows, then modify the GAPI generated code and
1) change all [DllImport("rsvg-2")] to [DllImport("librsvg-2-2.dll")]
2) call gapi-cdecl-insert (see "Win32 binding issues" in this
page: http://www.mono-project.com/GAPI)
Then the compiled dll shall work on Windows .Net (I'm not 100% sure
since I already lost the related files). BTW, the (generated) code
base of rsvg2-sharp's is really small and straight-forward.
BTW, is your shogi game open source? Any URL of it?
B.R.
Post by Gerhard Götz
Hi,
i have been testing my c# shogi game on Windows (developed on linux). It
worked perfectly except one thing: librsvg-sharp is not available for
Windows. At least i couldn't find it.
Looking at [1] it's said that it is available for Windows. But on the
other hand it is in the gnome-desktop-sharp module which is gnome
specific.
Is there a specific reason why librsvg-sharp is in gnome-desktop-sharp?
Maybe it can be moved to the gtk-sharp module. I think that it shouldn't
be too complicated since the native librsvg is already there.
Greetings
Gerhard Götz
[1] http://www.mono-project.com/GtkSharpDetails
_______________________________________________
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
Matt Guo
2010-10-23 08:41:39 UTC
Permalink
Hi, Gerhard,

I just built a Windows/.Net version Rsvg# and did some little test on it,
you can download the built binary, or find out how I built it here:
http://mattguo.com/rsvg-sharp/rsvg-sharp-windows.htm

And the Shogi game is great.
Post by Gerhard Götz
Hi Matt,
I quickly tried the copy approach. But it didn't work, maybe because I
used .Net on Windows.
I thought I could try to move rsvg-sharp.dll to gtk-sharp, build it
(maybe on Windows? Are the official downloads built on Windows?) and at
least use the dll from there. Maybe if that's done the chances are
higher that it gets into the official source tree.
But i didn't spent much time working on this yet, because i want to get
some more basic stuff ready before fully starting the windows porting.
The past tests were just to quickly see where the problems are.
The game is open source. It's name is Koushu Shogi.
It should run fine under Linux. You can play against a computer (only
gnushogi at the moment) or against a human player.
http://github.com/Rootie/KoushuShogi
Greetings
Gerhard Götz
Post by Matt Guo
Gerhard,
I just had the same requirement/issue several months before.
First of all I agreed on that the rsvg2-sharp.dll shall be included in
the gtk-sharp windows installer.
Since the native lib is already there, (on my Windows it's named
a) if using mono on Windows, then just copy rsvg2-sharp.dll, and
rsvg2-sharp.dll.config from Linux to Windows, then rewrite the .config
<configuration>
  <dllmap dll="rsvg-2" target="librsvg-2-2.dll"/>
</configuration>
b) if using .Net on Windows, then modify the GAPI generated code and
    1) change all [DllImport("rsvg-2")] to [DllImport("librsvg-2-2.dll")]
    2) call gapi-cdecl-insert (see "Win32 binding issues" in this
page: http://www.mono-project.com/GAPI)
Then the compiled dll shall work on Windows .Net (I'm not 100% sure
since I already lost the related files). BTW, the (generated) code
base of rsvg2-sharp's is really small and straight-forward.
BTW, is your shogi game open source? Any URL of it?
B.R.
Post by Gerhard Götz
Hi,
i have been testing my c# shogi game on Windows (developed on linux). It
worked perfectly except one thing: librsvg-sharp is not available for
Windows. At least i couldn't find it.
Looking at [1] it's said that it is available for Windows. But on the
other hand it is in the gnome-desktop-sharp module which is gnome
specific.
Is there a specific reason why librsvg-sharp is in gnome-desktop-sharp?
Maybe it can be moved to the gtk-sharp module. I think that it shouldn't
be too complicated since the native librsvg is already there.
Greetings
Gerhard Götz
[1] http://www.mono-project.com/GtkSharpDetails
_______________________________________________
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
--
--
B.R.
GUO Rui (Matt)
Loading...