[f-spot: 5/8] bundle gtk-sharp-beans
- From: Stephane Delcroix <sdelcroix src gnome org>
- To: svn-commits-list gnome org
- Subject: [f-spot: 5/8] bundle gtk-sharp-beans
- Date: Tue, 26 May 2009 07:13:44 -0400 (EDT)
commit e4658b0b5f99f268ded46fa83c1764bb9907d7d2
Author: Stephane Delcroix <stephane delcroix org>
Date: Tue May 26 12:52:54 2009 +0200
bundle gtk-sharp-beans
---
Makefile.am | 4 +
Makefile.include | 4 +
configure.ac | 5 +-
configure.in | 357 ------------------------
gtk-sharp-beans/AssemblyInfo.cs | 6 +
gtk-sharp-beans/Builder.custom | 409 ++++++++++++++++++++++++++++
gtk-sharp-beans/Dialog.cs | 46 +++
gtk-sharp-beans/Format.cs | 37 +++
gtk-sharp-beans/Gtk.metadata | 6 +
gtk-sharp-beans/Image.cs | 38 +++
gtk-sharp-beans/Makefile.am | 69 +++++
gtk-sharp-beans/PixbufFormat.cs | 35 +++
gtk-sharp-beans/Priority.cs | 31 ++
gtk-sharp-beans/Sources.cs | 39 +++
gtk-sharp-beans/Timeout.cs | 34 +++
gtk-sharp-beans/Widget.cs | 49 ++++
gtk-sharp-beans/gtk-api.raw | 138 ++++++++++
gtk-sharp-beans/gtk-sharp-beans.dll.config | 6 +
gtk-sharp-beans/gtk-sharp-beans.snk | Bin 0 -> 596 bytes
src/Makefile.am | 10 +-
20 files changed, 960 insertions(+), 363 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 38ee03e..3fddd9f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,6 +2,8 @@ SUBDIRS = \
$(subdirs) \
$(DIR_DBUS) \
$(DIR_DBUS_GLIB)\
+ gio-sharp \
+ gtk-sharp-beans \
semweb \
docs \
glitz-sharp \
@@ -20,6 +22,8 @@ SUBDIRS = \
GKeyFile
DIST_SUBDIRS = \
+ gio-sharp \
+ gtk-sharp-beans \
semweb \
dbus-sharp \
dbus-sharp-glib \
diff --git a/Makefile.include b/Makefile.include
index f22ccd4..1db5cbc 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -21,6 +21,8 @@ DIR_TAO_OPENGL = $(top_builddir)/Tao/Tao.OpenGl
DIR_TAO_GLU = $(top_builddir)/Tao/Tao.OpenGl.Glu
DIR_TAO_EXTENSIONLOADER = $(top_builddir)/Tao/Tao.OpenGl.ExtensionLoader
DIR_TAO_GLPOSTPROCESS = $(top_builddir)/Tao/Tao.GlPostProcess
+DIR_GIOSHARP = $(top_builddir)/gio-sharp/gio
+DIR_GTKSHARPBEANS = $(top_builddir)/gtk-sharp-beans
## Links
@@ -36,6 +38,8 @@ LINK_TAO = \
-r:$(DIR_TAO_OPENGL)/Tao.OpenGl.dll \
-r:$(DIR_TAO_GLU)/Tao.OpenGl.Glu.dll \
-r:$(DIR_TAO_EXTENSIONLOADER)/Tao.OpenGl.ExtensionLoader.dll
+LINK_GIOSHARP = -r:$(DIR_GIOSHARP)/gio-sharp.dll
+LINK_GTKSHARPBEANS = -r:$(DIR_GTKSHARPBEANS)/gtk-sharp-beans.dll
## Build
diff --git a/configure.ac b/configure.ac
index 8c90148..28863ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,7 +72,7 @@ dnl -- this check is
LCMS_REQUIRED=1.12
dnl -- LIBGPHOTO2_REQUIRED=2.1.4
-PKG_CHECK_MODULES(F, libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libexif >= $LIBEXIF_REQUIRED_MIN libexif < $LIBEXIF_REQUIRED_MAX gtk-sharp-2.0 >= $GTKSHARP_REQUIRED glib-sharp-2.0 >= $GTKSHARP_REQUIRED gio-sharp-2.0 >= $GIOSHARP_REQUIRED glade-sharp-2.0 >= $GTKSHARP_REQUIRED gnome-vfs-sharp-2.0 >= $GTKSHARP_REQUIRED gtk+-2.0 >= $GTK_REQUIRED mono >= $MONO_REQUIRED mono-cairo >= $MONO_CAIRO_REQUIRED gtk-sharp-beans-2.0 >= $GTKSHARPBEANS_REQUIRED)
+PKG_CHECK_MODULES(F, libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libexif >= $LIBEXIF_REQUIRED_MIN libexif < $LIBEXIF_REQUIRED_MAX gtk-sharp-2.0 >= $GTKSHARP_REQUIRED glib-sharp-2.0 >= $GTKSHARP_REQUIRED glade-sharp-2.0 >= $GTKSHARP_REQUIRED gnome-vfs-sharp-2.0 >= $GTKSHARP_REQUIRED gtk+-2.0 >= $GTK_REQUIRED mono >= $MONO_REQUIRED mono-cairo >= $MONO_CAIRO_REQUIRED)
AC_SUBST(F_CFLAGS)
AC_SUBST(F_LIBS)
@@ -83,6 +83,8 @@ AC_SUBST(GIO_LIBS)
CSC_DEFINES=""
PKG_CHECK_MODULES(GNOME_SHARP, gnome-sharp-2.0 >= 2.8)
+PKG_CHECK_MODULES(GLIBSHARP, glib-sharp-2.0 >= 2.12)
+
if pkg-config --atleast-version=1.2.5 mono-cairo; then
CSC_DEFINES="$CSC_DEFINES -d:CAIRO_1_2_5"
fi
@@ -359,4 +361,5 @@ f-spot-import.desktop.in
gio-sharp/Makefile
gio-sharp/gio/Makefile
gio-sharp/generator/Makefile
+gtk-sharp-beans/Makefile
)
diff --git a/configure.in b/configure.in
deleted file mode 100644
index 2ab5998..0000000
--- a/configure.in
+++ /dev/null
@@ -1,357 +0,0 @@
-AC_INIT(F-Spot, 0.5.0.3)
-AC_CONFIG_SRCDIR(src/main.cs)
-
-AM_CONFIG_HEADER(config.h)
-
-AM_INIT_AUTOMAKE([tar-ustar])
-
-AM_MAINTAINER_MODE
-
-IT_PROG_INTLTOOL([0.35.0])
-
-AC_PROG_CC
-AC_ISC_POSIX
-AC_HEADER_STDC
-AM_PROG_LIBTOOL
-
-GNOME_COMPILE_WARNINGS
-AM_PATH_GLIB_2_0
-
-dnl --- Check for mono and gmcs
-
-AC_PATH_PROG(MONO, mono)
-AC_PATH_PROG(MCS, gmcs)
-
-CS="C#"
-if test ! -x "$MCS"; then
- AC_MSG_ERROR([No $CS compiler found])
-fi
-
-dnl -- Initialize docs
-
-GNOME_DOC_INIT
-
-dnl -- Check for mono pc file
-
-AC_MSG_CHECKING([for mono.pc])
-if test -z `$PKG_CONFIG --variable=prefix mono`; then
- AC_MSG_ERROR([missing the mono.pc file, usually found in the mono-devel package])
-else
- AC_MSG_RESULT([found])
-fi
-
-dnl -- check for various mono DLLs that we need.
-
-needed_dlls="Mono.Data.SqliteClient Mono.Posix System.Runtime.Remoting System.Web System.Web.Services Mono.Cairo"
-for i in $needed_dlls; do
- AC_MSG_CHECKING([for $i.dll])
- if test ! \( -e `$PKG_CONFIG --variable=prefix mono`/lib/mono/2.0/$i.dll -o -e `$PKG_CONFIG --variable=prefix mono`/lib64/mono/2.0//$i.dll \); then
- AC_MSG_ERROR([missing required mono 2.0 DLL: $i.dll])
- else
- AC_MSG_RESULT([found])
- fi
-done
-
-dnl --- Required libraries
-
-LIBGNOME_REQUIRED=2.2
-LIBGNOMEUI_REQUIRED=2.2
-LIBEXIF_REQUIRED_MIN=0.5.7
-LIBEXIF_REQUIRED_MAX=0.7.0
-GIO_REQUIRED=2.16.0
-GTKSHARP_REQUIRED=2.13.90
-MONO_REQUIRED=2.2.0
-GTK_REQUIRED=2.10
-BEAGLE_REQUIRED=0.3.0
-NDESK_DBUS_REQUIRED=0.4.2
-NDESK_DBUS_GLIB_REQUIRED=0.3.0
-MONO_CAIRO_REQUIRED=1.2.4
-dnl -- this check is
-LCMS_REQUIRED=1.12
-dnl -- LIBGPHOTO2_REQUIRED=2.1.4
-
-PKG_CHECK_MODULES(F, libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libexif >= $LIBEXIF_REQUIRED_MIN libexif < $LIBEXIF_REQUIRED_MAX gtk-sharp-2.0 >= $GTKSHARP_REQUIRED glib-sharp-2.0 >= $GTKSHARP_REQUIRED gio-sharp-2.0 >= $GTKSHARP_REQUIRED glade-sharp-2.0 >= $GTKSHARP_REQUIRED gnome-vfs-sharp-2.0 >= $GTKSHARP_REQUIRED gtk+-2.0 >= $GTK_REQUIRED mono >= $MONO_REQUIRED mono-cairo >= $MONO_CAIRO_REQUIRED)
-AC_SUBST(F_CFLAGS)
-AC_SUBST(F_LIBS)
-
-PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQUIRED)
-AC_SUBST(GIO_CFLAGS)
-AC_SUBST(GIO_LIBS)
-
-CSC_DEFINES=""
-PKG_CHECK_MODULES(GNOME_SHARP, gnome-sharp-2.0 >= 2.8)
-
-if pkg-config --atleast-version=1.2.5 mono-cairo; then
- CSC_DEFINES="$CSC_DEFINES -d:CAIRO_1_2_5"
-fi
-
-dnl - Choose PreferenceBackend (default to gconf)
-AC_ARG_ENABLE([gconf],[AC_HELP_STRING([--disable-gconf], [build without gconf preference backend])],,)
-
-AM_CONDITIONAL(NOGCONF, test "x$enable_gconf" = "xno")
-
-if test "x$enable_gconf" = "xno"; then
- CSC_DEFINES="$CSC_DEFINES -d:NOGCONF"
-else
- PKG_CHECK_MODULES(GCONF_SHARP, gconf-sharp-2.0 >= $GTKSHARP_REQUIRED)
- if pkg-config --atleast-version=2.18 gconf-sharp-2.0; then
- CSC_DEFINES="$CSC_DEFINES -d:GCONF_SHARP_2_18"
- fi
- if pkg-config --atleast-version=2.20.2 gconf-sharp-2.0; then
- CSC_DEFINES="$CSC_DEFINES -d:GCONF_SHARP_2_20_2"
- fi
-fi
-
-
-PKG_CHECK_MODULES(BEAGLE, beagle-0.0 >= $BEAGLE_REQUIRED,
-[
- dnl this is a work around to avoid linking against beagles Util.dll
- BEAGLE_DIR=`$PKG_CONFIG --variable=dlldir beagle-0.0`
- LINK_BEAGLE="-r:$BEAGLE_DIR/Beagle"
- CSC_DEFINES="$CSC_DEFINES -d:ENABLE_BEAGLE"
-],
-[
- AC_MSG_RESULT([beagle not found])
-])
-AC_SUBST(BEAGLE_DIR)
-AC_SUBST(LINK_BEAGLE)
-
-AC_SUBST(CSC_DEFINES)
-
-dnl -- dbus-sharp: link or bundle ?
-PKG_CHECK_MODULES(NDESK_DBUS, ndesk-dbus-1.0 >= $NDESK_DBUS_REQUIRED ndesk-dbus-glib-1.0 >= $NDESK_DBUS_GLIB_REQUIRED,
-[
- LINK_DBUS="-pkg:ndesk-dbus-1.0 -pkg:ndesk-dbus-glib-1.0"
- DIR_DBUS=""
- DIR_DBUS_GLIB=""
- PATH_DBUS=""
-],
-[
- LINK_DBUS='-r:$(top_builddir)/dbus-sharp/NDesk.DBus.dll -r:$(top_builddir)/dbus-sharp-glib/NDesk.DBus.GLib.dll'
- DIR_DBUS="dbus-sharp"
- DIR_DBUS_GLIB="dbus-sharp-glib"
- PATH_DBUS='../dbus-sharp:../dbus-sharp-glib:'
-])
-AC_SUBST(DIR_DBUS)
-AC_SUBST(DIR_DBUS_GLIB)
-AC_SUBST(LINK_DBUS)
-AC_SUBST(PATH_DBUS)
-
-dnl -- nunit
-AC_ARG_ENABLE([nunit],[AC_HELP_STRING([--disable-unit], [build without unit tests])],,)
-AM_CONDITIONAL(DISABLE_NUNIT, test "x$enable_nunit" = "xno")
-
-if test "x$enable_nunit" = "xno"; then
- NUNIT_DEFINES=''
- NUNIT_PKG=''
-
-else
-NUNIT_DEFINES='-d:ENABLE_NUNIT'
-PKG_CHECK_MODULES(MONO_NUNIT, mono-nunit >= $MONO_REQUIRED,
-[
- NUNIT_LIBS=$MONO_NUNIT_LIBS
- NUNIT_PKG='-pkg:mono-nunit'
-],
-[
- PKG_CHECK_MODULES(NUNIT22, nunit-2.2 >= $MONO_REQUIRED,
- [
- NUNIT_LIBS=$NUNIT22_LIBS
- NUNIT_PKG='-pkg:nunit-2.2'
- ],
- [
- PKG_CHECK_MODULES(NUNIT, nunit >= $MONO_REQUIRED,
- [
- NUNIT_LIBS=$NUNIT_LIBS
- NUNIT_PKG='-pkg:nunit'
- ],
- [
- NUNIT_DEFINES=''
- NUNIT_PKG=''
- ])
- ])
-])
-fi
-
-AC_SUBST(NUNIT_PKG)
-AC_SUBST(NUNIT_DEFINES)
-
-
-dnl --- GConf
-
-AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
-AM_GCONF_SOURCE_2
-
-
-dnl --- libjpeg
-
-AC_CHECK_LIB(jpeg, jpeg_start_decompress, [],
- [AC_MSG_ERROR([libjpeg not found])], -lm)
-AC_CHECK_HEADER(jpeglib.h, , [AC_MSG_ERROR([libjpeg not found])])
-LIBJPEG='-ljpeg'
-
-dnl --- lcms
-
-PKG_CHECK_MODULES(LCMS, lcms >= $LCMS_REQUIRED, [],
- [AC_CHECK_LIB(lcms, cmsCreateBCHSWabstractProfile, [],
- [AC_MSG_ERROR([liblcms not found])], -lm)
- AC_CHECK_HEADER(lcms.h, , [AC_MSG_ERROR([liblcms not found])])
- LCMS_LIBS='-llcms'
- LCMS_CFLAGS=''])
-
-
-dnl --- libgphoto2-sharp
-
-PKG_CHECK_MODULES(LIBGPHOTO2, libgphoto2 >= 2.1.4)
-
-dnl --- libexif version check
-
-LIBEXIF_API_CHANGE=0.6.0
-PKG_CHECK_MODULES(EXIF, libexif >= $LIBEXIF_API_CHANGE)
-AC_SUBST(EXIF_CFLAGS)
-AC_SUBST(EXIF_LIBS)
-
-
-PKG_CHECK_MODULES(LIBEXIF_VERSION_CHECK, libexif >= 0.6.12, EXIF_SOVERSION=12, EXIF_SOVERSION=10)
-AC_SUBST(EXIF_SOVERSION)
-
-dnl --- Set up paths
-
-AC_ARG_WITH(turtle, [ --with-turtle=DIR set path to source directory for turtle])
-AM_CONDITIONAL(WITH_TURTLE, test "x$with_turtle" != "xno")
-if test "x$with_turtle" != "xno"; then
- TURTLEDIR=$with_turtle
-
- AC_SUBST(TURTLEDIR)
-fi
-
-AC_ARG_WITH(gnome-screensaver,[ --with-gnome-screensaver=PREFIX set gnome gnome-screensaver prefix])
-
-if test "x$with_gnome_screensaver" != "x"; then
- gnome_screensaver_prefix=$with_gnome_screensaver
-else
- gnome_screensaver_prefix=$prefix
-fi
-
-PKG_CHECK_EXISTS(gnome-screensaver, have_gs_pkgconfig=yes, have_gs_pkgconfig=no)
-if test "$have_gs_pkgconfig" = "yes"; then
- gs_pc_prefix=`$PKG_CONFIG --variable=prefix gnome-screensaver`
- gs_pc_saverdir=`$PKG_CONFIG --variable=privlibexecdir gnome-screensaver`
- gs_pc_themesdir=`$PKG_CONFIG --variable=themesdir gnome-screensaver`
-fi
-
-if test "$have_gs_pkgconfig" = "yes" && test "x$gs_pc_prefix" = "x$gnome_screensaver_prefix"; then
- GNOME_SCREENSAVER_SAVERDIR=$gs_pc_saverdir
-elif test -d $gnome_screensaver_prefix/lib/gnome-screensaver; then
- GNOME_SCREENSAVER_SAVERDIR=$gnome_screensaver_prefix/lib/gnome-screensaver/gnome-screensaver
-else
- GNOME_SCREENSAVER_SAVERDIR=$gnome_screensaver_prefix/libexec/gnome-screensaver
-fi
-
-if test "$have_gs_pkgconfig" = "yes" && test "x$gs_pc_prefix" = "x$gnome_screensaver_prefix"; then
- GNOME_SCREENSAVER_THEMESDIR=$gs_pc_themesdir
-else
- GNOME_SCREENSAVER_THEMESDIR=$gnome_screensaver_prefix/share/applications/screensavers
-fi
-
-AC_SUBST(GNOME_SCREENSAVER_SAVERDIR)
-AC_SUBST(GNOME_SCREENSAVER_THEMESDIR)
-
-ICONS_DIRECTORY=${datadir}/${PACKAGE}-${VERSION}
-
-AC_SUBST(ICONS_DIRECTORY)
-
-dnl -- Intl
-
-GETTEXT_PACKAGE=f-spot
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
-AM_GLIB_GNU_GETTEXT
-
-dnl --- Prologue
-
-AC_SUBST(LIBJPEG)
-AC_SUBST(LCMS_LIBS)
-AC_SUBST(LCMS_CFLAGS)
-AC_SUBST(CFLAGS)
-AC_SUBST(CPPFLAGS)
-AC_SUBST(LDFLAGS)
-
-expanded_libdir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac
- case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac
- eval echo $libdir )`
-AC_SUBST(expanded_libdir)
-
-AC_CONFIG_FILES([src/f-spot],[chmod +x src/f-spot])
-
-GNOME_ICON_THEME_PREFIX=`$PKG_CONFIG --variable=prefix gnome-icon-theme`
-AC_SUBST(GNOME_ICON_THEME_PREFIX)
-
-AC_OUTPUT([
-Makefile
-dbus-sharp/Makefile
-dbus-sharp-glib/Makefile
-dpap-sharp/Makefile
-dpap-sharp/lib/Makefile
-dpap-sharp/dpap-client/Makefile
-dpap-sharp/dpap-server/Makefile
-dpap-sharp/DPAPService/Makefile
-dpap-sharp/DPAPBrowser/Makefile
-docs/Makefile
-gnome-keyring-sharp/Makefile
-icons/Makefile
-libeog/Makefile
-libeog/cursors/Makefile
-libjpegtran/Makefile
-libfspot/Makefile
-libgphoto2-sharp/Makefile
-mono-addins/Makefile
-mono-addins/Mono.Addins/Makefile
-mono-addins/Mono.Addins.Gui/Makefile
-mono-addins/Mono.Addins.Setup/Makefile
-semweb/Makefile
-tools/Makefile
-po/Makefile.in
-src/Core/Defines.cs
-src/AssemblyInfo.cs
-src/f-spot.exe.config
-src/Cms.dll.config
-src/Makefile
-GKeyFile/Makefile
-glitz-sharp/Makefile
-glitz-sharp/src/Makefile
-Tao/Makefile
-Tao/Tao.OpenGl/Makefile
-Tao/Tao.OpenGl.Glu/Makefile
-Tao/Tao.GlPostProcess/Makefile
-Tao/Tao.OpenGl.ExtensionLoader/Makefile
-extensions/Makefile
-extensions/Exporters/Makefile
-extensions/Exporters/CDExport/Makefile
-extensions/Exporters/DefaultExporters/Makefile
-extensions/Exporters/FlickrExport/Makefile
-extensions/Exporters/FlickrExport/FlickrNet/Makefile
-extensions/Exporters/GalleryExport/Makefile
-extensions/Exporters/FacebookExport/Makefile
-extensions/Exporters/FolderExport/Makefile
-extensions/Exporters/SmugMugExport/SmugMugNet/Makefile
-extensions/Exporters/SmugMugExport/Makefile
-extensions/Exporters/TabbloExport/Makefile
-extensions/Exporters/TabbloExport/Tabblo/Makefile
-extensions/Exporters/PicasaWebExport/Makefile
-extensions/Exporters/PicasaWebExport/google-sharp/Makefile
-extensions/Exporters/ZipExport/Makefile
-extensions/Services/Makefile
-extensions/Services/BeagleService/Makefile
-extensions/Services/DBusService/Makefile
-extensions/Tools/Makefile
-extensions/Tools/RawPlusJpeg/Makefile
-extensions/Tools/ChangePhotoPath/Makefile
-extensions/Tools/HashJob/Makefile
-extensions/Tools/DevelopInUFraw/Makefile
-extensions/Tools/MergeDb/Makefile
-f-spot.pc
-f-spot.spec
-f-spot.desktop.in
-f-spot-view.desktop.in
-f-spot-import.desktop.in
-])
diff --git a/gtk-sharp-beans/AssemblyInfo.cs b/gtk-sharp-beans/AssemblyInfo.cs
new file mode 100644
index 0000000..284fee2
--- /dev/null
+++ b/gtk-sharp-beans/AssemblyInfo.cs
@@ -0,0 +1,6 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly:AssemblyVersion("2.14.0.0")]
+[assembly:AssemblyDelaySign(false)]
+[assembly:AssemblyKeyFile("gtk-sharp-beans.snk")]
diff --git a/gtk-sharp-beans/Builder.custom b/gtk-sharp-beans/Builder.custom
new file mode 100644
index 0000000..3e3d890
--- /dev/null
+++ b/gtk-sharp-beans/Builder.custom
@@ -0,0 +1,409 @@
+// Builder.custom - customizations to Gtk.Builder
+//
+// Authors: Stephane Delcroix <stephane delcroix org>
+// The biggest part of this code is adapted from glade#, by
+// Ricardo Fernández Pascual <ric users sourceforge net>
+// Rachel Hestilow <hestilow ximian com>
+//
+// Copyright (c) 2008, 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2 of the Lesser GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+[System.Serializable]
+public class HandlerNotFoundException : SystemException
+{
+ string handler_name;
+ string signal_name;
+ System.Reflection.EventInfo evnt;
+ Type delegate_type;
+
+ public HandlerNotFoundException (string handler_name, string signal_name,
+ System.Reflection.EventInfo evnt, Type delegate_type)
+ : this (handler_name, signal_name, evnt, delegate_type, null)
+ {
+ }
+
+ public HandlerNotFoundException (string handler_name, string signal_name,
+ System.Reflection.EventInfo evnt, Type delegate_type, Exception inner)
+ : base ("No handler " + handler_name + " found for signal " + signal_name,
+ inner)
+ {
+ this.handler_name = handler_name;
+ this.signal_name = signal_name;
+ this.evnt = evnt;
+ this.delegate_type = delegate_type;
+ }
+
+ public HandlerNotFoundException (string message, string handler_name, string signal_name,
+ System.Reflection.EventInfo evnt, Type delegate_type)
+ : base ((message != null) ? message : "No handler " + handler_name + " found for signal " + signal_name,
+ null)
+ {
+ this.handler_name = handler_name;
+ this.signal_name = signal_name;
+ this.evnt = evnt;
+ this.delegate_type = delegate_type;
+ }
+
+ protected HandlerNotFoundException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
+ : base (info, context)
+ {
+ handler_name = info.GetString ("HandlerName");
+ signal_name = info.GetString ("SignalName");
+ evnt = info.GetValue ("Event", typeof (System.Reflection.EventInfo)) as System.Reflection.EventInfo;
+ delegate_type = info.GetValue ("DelegateType", typeof (Type)) as Type;
+ }
+
+ public string HandlerName
+ {
+ get {
+ return handler_name;
+ }
+ }
+
+ public string SignalName
+ {
+ get {
+ return signal_name;
+ }
+ }
+
+ public System.Reflection.EventInfo Event
+ {
+ get {
+ return evnt;
+ }
+ }
+
+ public Type DelegateType
+ {
+ get {
+ return delegate_type;
+ }
+ }
+
+ public override void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
+ {
+ base.GetObjectData (info, context);
+ info.AddValue ("HandlerName", handler_name);
+ info.AddValue ("SignalName", signal_name);
+ info.AddValue ("Event", evnt);
+ info.AddValue ("DelegateType", delegate_type);
+ }
+}
+
+
+[AttributeUsage (AttributeTargets.Field)]
+public class ObjectAttribute : Attribute
+{
+ private string name;
+ private bool specified;
+
+ public ObjectAttribute (string name)
+ {
+ specified = true;
+ this.name = name;
+ }
+
+ public ObjectAttribute ()
+ {
+ specified = false;
+ }
+
+ public string Name
+ {
+ get { return name; }
+ }
+
+ public bool Specified
+ {
+ get { return specified; }
+ }
+}
+
+public IntPtr GetRawObject(string name) {
+ IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
+ IntPtr raw_ret = gtk_builder_get_object(Handle, native_name);
+ GLib.Marshaller.Free (native_name);
+ return raw_ret;
+}
+
+public Builder (System.IO.Stream s) : this (s, null)
+{
+}
+
+public Builder (System.IO.Stream s, string translation_domain)
+{
+ if (s == null)
+ throw new ArgumentNullException ("s");
+
+ int size = (int) s.Length;
+ byte[] buffer = new byte[size];
+ s.Read (buffer, 0, size);
+ s.Close ();
+
+ AddFromString(System.Text.Encoding.UTF8.GetString (buffer));
+
+ TranslationDomain = translation_domain;
+}
+
+public Builder (string resource_name) : this (resource_name, null)
+{
+}
+
+public Builder (string resource_name, string translation_domain) : this (System.Reflection.Assembly.GetEntryAssembly (), resource_name, translation_domain)
+{
+}
+
+public Builder (System.Reflection.Assembly assembly, string resource_name, string translation_domain) : this ()
+{
+ if (GetType() != typeof (Builder))
+ throw new InvalidOperationException ("Cannot chain to this constructor from subclasses.");
+
+ if (assembly == null)
+ assembly = System.Reflection.Assembly.GetCallingAssembly ();
+
+ System.IO.Stream s = assembly.GetManifestResourceStream (resource_name);
+ if (s == null)
+ throw new ArgumentException ("Cannot get resource file '" + resource_name + "'",
+ "resource_name");
+
+ int size = (int) s.Length;
+ byte[] buffer = new byte[size];
+ s.Read (buffer, 0, size);
+ s.Close ();
+
+ AddFromString(System.Text.Encoding.UTF8.GetString (buffer));
+
+ TranslationDomain = translation_domain;
+}
+
+public void Autoconnect (object handler)
+{
+ BindFields (handler);
+ (new SignalConnector (this, handler)).ConnectSignals ();
+}
+
+public void Autoconnect (Type handler_class)
+{
+ BindFields (handler_class);
+ (new SignalConnector (this, handler_class)).ConnectSignals ();
+}
+
+class SignalConnector
+{
+ Builder builder;
+ Type handler_type;
+ object handler;
+
+ public SignalConnector (Builder builder, object handler)
+ {
+ this.builder = builder;
+ this.handler = handler;
+ handler_type = handler.GetType ();
+ }
+
+ public SignalConnector (Builder builder, Type handler_type)
+ {
+ this.builder = builder;
+ this.handler = null;
+ this.handler_type = handler_type;
+ }
+
+ [DllImport("libgtk-win32-2.0-0.dll")]
+ static extern void gtk_builder_connect_signals_full(IntPtr raw, GtkBeansSharp.BuilderConnectFuncNative func, IntPtr user_data);
+
+ public void ConnectSignals() {
+ GtkBeansSharp.BuilderConnectFuncWrapper func_wrapper = new GtkBeansSharp.BuilderConnectFuncWrapper (new GtkBeans.BuilderConnectFunc (ConnectFunc));
+ gtk_builder_connect_signals_full(builder.Handle, func_wrapper.NativeDelegate, IntPtr.Zero);
+ }
+
+ public void ConnectFunc (Builder builder, GLib.Object objekt, string signal_name, string handler_name, GLib.Object connect_object, GLib.ConnectFlags flags)
+ {
+ /* search for the event to connect */
+ System.Reflection.MemberInfo[] evnts = objekt.GetType ().
+ FindMembers (System.Reflection.MemberTypes.Event,
+ System.Reflection.BindingFlags.Instance
+ | System.Reflection.BindingFlags.Static
+ | System.Reflection.BindingFlags.Public
+ | System.Reflection.BindingFlags.NonPublic,
+ new System.Reflection.MemberFilter (SignalFilter), signal_name);
+ foreach (System.Reflection.EventInfo ei in evnts) {
+ bool connected = false;
+ System.Reflection.MethodInfo add = ei.GetAddMethod ();
+ System.Reflection.ParameterInfo[] addpi = add.GetParameters ();
+ if (addpi.Length == 1) { /* this should be always true, unless there's something broken */
+ Type delegate_type = addpi[0].ParameterType;
+
+ /* look for an instance method */
+ if (connect_object != null || handler != null)
+ try {
+ Delegate d = Delegate.CreateDelegate (delegate_type, connect_object != null ? connect_object : handler, handler_name);
+ add.Invoke (objekt, new object[] { d } );
+ connected = true;
+ } catch (ArgumentException) { /* ignore if there is not such instance method */
+ }
+
+ /* look for a static method if no instance method has been found */
+ if (!connected && handler_type != null)
+ try {
+ Delegate d = Delegate.CreateDelegate (delegate_type, handler_type, handler_name);
+ add.Invoke (objekt, new object[] { d } );
+ connected = true;
+ } catch (ArgumentException) { /* ignore if there is not such static method */
+ }
+
+ if (!connected) {
+ string msg = ExplainError (ei.Name, delegate_type, handler_type, handler_name);
+ throw new HandlerNotFoundException (msg, handler_name, signal_name, ei, delegate_type);
+ }
+ }
+ }
+ }
+
+ static bool SignalFilter (System.Reflection.MemberInfo m, object filterCriteria)
+ {
+ string signame = (filterCriteria as string);
+ object[] attrs = m.GetCustomAttributes (typeof (GLib.SignalAttribute), false);
+ if (attrs.Length > 0)
+ {
+ foreach (GLib.SignalAttribute a in attrs)
+ {
+ if (signame == a.CName)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else
+ {
+ /* this tries to match the names when no attibutes are present.
+ It is only a fallback. */
+ signame = signame.ToLower ().Replace ("_", "");
+ string evname = m.Name.ToLower ();
+ return signame == evname;
+ }
+ }
+
+ static string GetSignature (System.Reflection.MethodInfo method)
+ {
+ if (method == null)
+ return null;
+
+ System.Reflection.ParameterInfo [] parameters = method.GetParameters ();
+ System.Text.StringBuilder sb = new System.Text.StringBuilder ();
+ sb.Append ('(');
+ foreach (System.Reflection.ParameterInfo info in parameters) {
+ sb.Append (info.ParameterType.ToString ());
+ sb.Append (',');
+ }
+ if (sb.Length != 0)
+ sb.Length--;
+
+ sb.Append (')');
+ return sb.ToString ();
+ }
+
+ static string GetSignature (Type delegate_type)
+ {
+ System.Reflection.MethodInfo method = delegate_type.GetMethod ("Invoke");
+ return GetSignature (method);
+ }
+
+ const System.Reflection.BindingFlags flags = System.Reflection.BindingFlags.NonPublic |
+ System.Reflection.BindingFlags.Public |
+ System.Reflection.BindingFlags.Static |
+ System.Reflection.BindingFlags.Instance;
+ static string GetSignature (Type klass, string method_name)
+ {
+ try {
+ System.Reflection.MethodInfo method = klass.GetMethod (method_name, flags);
+ return GetSignature (method);
+ } catch {
+ // May be more than one method with that name and none matches
+ return null;
+ }
+ }
+
+
+ static string ExplainError (string event_name, Type deleg, Type klass, string method)
+ {
+ if (deleg == null || klass == null || method == null)
+ return null;
+
+ System.Text.StringBuilder sb = new System.Text.StringBuilder ();
+ string expected = GetSignature (deleg);
+ string actual = GetSignature (klass, method);
+ if (actual == null)
+ return null;
+ sb.AppendFormat ("The handler for the event {0} should take '{1}', " +
+ "but the signature of the provided handler ('{2}') is '{3}'\n",
+ event_name, expected, method, actual);
+ return sb.ToString ();
+ }
+
+}
+
+
+void BindFields (object target)
+{
+ BindFields (target, target.GetType ());
+}
+
+void BindFields (Type type)
+{
+ BindFields (null, type);
+}
+
+void BindFields (object target, Type type)
+{
+ System.Reflection.BindingFlags flags = System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.DeclaredOnly;
+ if (target != null)
+ flags |= System.Reflection.BindingFlags.Instance;
+ else
+ flags |= System.Reflection.BindingFlags.Static;
+
+ do {
+ System.Reflection.FieldInfo[] fields = type.GetFields (flags);
+ if (fields == null)
+ return;
+
+ foreach (System.Reflection.FieldInfo field in fields)
+ {
+ object[] attrs = field.GetCustomAttributes (typeof (ObjectAttribute), false);
+ if (attrs == null || attrs.Length == 0)
+ continue;
+ // The widget to field binding must be 1:1, so only check
+ // the first attribute.
+ ObjectAttribute attr = (ObjectAttribute) attrs[0];
+ GLib.Object gobject;
+ if (attr.Specified)
+ gobject = GetObject (attr.Name);
+ else
+ gobject = GetObject (field.Name);
+
+ if (gobject != null)
+ try {
+ field.SetValue (target, gobject, flags, null, null);
+ } catch (Exception e) {
+ Console.WriteLine ("Unable to set value for field " + field.Name);
+ throw e;
+ }
+ }
+ type = type.BaseType;
+ }
+ while (type != typeof(object) && type != null);
+}
diff --git a/gtk-sharp-beans/Dialog.cs b/gtk-sharp-beans/Dialog.cs
new file mode 100644
index 0000000..02e5f5b
--- /dev/null
+++ b/gtk-sharp-beans/Dialog.cs
@@ -0,0 +1,46 @@
+// Gtk.Dialog.cs
+//
+// Author(s):
+// Stephane Delcroix <stephane delcroix org>
+//
+// Copyright (c) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2 of the Lesser GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+
+namespace Gtk {
+ public static class DialogExtensions {
+ [DllImport("libgtk-win32-2.0-0.dll")]
+ static extern IntPtr gtk_dialog_get_action_area (IntPtr raw);
+
+ public static HButtonBox GetActionArea (this Dialog dialog) {
+ IntPtr raw_ret = gtk_dialog_get_action_area (dialog.Handle);
+ Gtk.HButtonBox ret = GLib.Object.GetObject (raw_ret) as Gtk.HButtonBox;
+ return ret;
+ }
+
+ [DllImport("libgtk-win32-2.0-0.dll")]
+ static extern IntPtr gtk_dialog_get_content_area (IntPtr raw);
+
+ public static Widget GetContentArea (this Dialog dialog) {
+ IntPtr raw_ret = gtk_dialog_get_content_area (dialog.Handle);
+ Gtk.Widget ret = GLib.Object.GetObject (raw_ret) as Gtk.Widget;
+ return ret;
+ }
+ }
+}
diff --git a/gtk-sharp-beans/Format.cs b/gtk-sharp-beans/Format.cs
new file mode 100644
index 0000000..5124f0f
--- /dev/null
+++ b/gtk-sharp-beans/Format.cs
@@ -0,0 +1,37 @@
+// Format.cs: Wrapper for the g_format code in Glib
+//
+// Authors:
+// Stephane Delcroix (stephane delcroix org)
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2 of the Lesser GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace GLib {
+ public class Format {
+ [DllImport("libglib-2.0-0.dll")]
+ static extern IntPtr g_format_size_for_display (long size);
+
+ static public string SizeForDisplay (long size)
+ {
+ string result = Marshaller.PtrToStringGFree (g_format_size_for_display (size));
+ return result;
+ }
+ }
+}
diff --git a/gtk-sharp-beans/Gtk.metadata b/gtk-sharp-beans/Gtk.metadata
new file mode 100644
index 0000000..0bdc265
--- /dev/null
+++ b/gtk-sharp-beans/Gtk.metadata
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<metadata>
+ <attr path="/api/namespace/object[ cname='GtkBuilder']" name="name">Builder</attr>
+ <attr path="/api/namespace/enum[ cname='GtkBuilderError']" name="name">BuilderError</attr>
+ <attr path="/api/namespace/callback[ cname='GtkBuilderConnectFunc']" name="name">BuilderConnectFunc</attr>
+</metadata>
diff --git a/gtk-sharp-beans/Image.cs b/gtk-sharp-beans/Image.cs
new file mode 100644
index 0000000..a902faa
--- /dev/null
+++ b/gtk-sharp-beans/Image.cs
@@ -0,0 +1,38 @@
+// Gtk.Image.cs
+//
+// Author(s):
+// Stephane Delcroix <stephane delcroix org>
+//
+// Copyright (c) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2 of the Lesser GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+using Gtk;
+
+namespace GtkBeans {
+ public class Image {
+ [DllImport("libgtk-win32-2.0-0.dll")]
+ static extern IntPtr gtk_image_new_from_gicon(IntPtr icon, int size);
+
+ public static Gtk.Image NewFromIcon (GLib.Icon icon, Gtk.IconSize size)
+ {
+ return new Gtk.Image (gtk_image_new_from_gicon(icon == null ? IntPtr.Zero : icon.Handle, (int) size));
+ }
+ }
+}
+
diff --git a/gtk-sharp-beans/Makefile.am b/gtk-sharp-beans/Makefile.am
new file mode 100644
index 0000000..a6ef612
--- /dev/null
+++ b/gtk-sharp-beans/Makefile.am
@@ -0,0 +1,69 @@
+include ../Makefile.include
+
+SRCS = \
+ $(srcdir)/Dialog.cs \
+ $(srcdir)/Image.cs \
+ $(srcdir)/Widget.cs \
+ $(srcdir)/Format.cs \
+ $(srcdir)/Priority.cs \
+ $(srcdir)/Sources.cs \
+ $(srcdir)/Timeout.cs \
+ $(srcdir)/PixbufFormat.cs \
+ $(srcdir)/AssemblyInfo.cs
+
+
+CUSTOMS = \
+ $(srcdir)/Builder.custom
+
+ASSEMBLIES = \
+ -pkg:glib-sharp-2.0 \
+ -pkg:gio-sharp-2.0 \
+ -pkg:gtk-sharp-2.0
+
+all: gtk-sharp-beans.dll
+
+gtk-api.xml: $(srcdir)/gtk-api.raw $(srcdir)/Gtk.metadata
+ @echo -e "\n*** Massaging the raw api into $@"
+ cp $(srcdir)/gtk-api.raw gtk-api.xml
+ chmod +w $(builddir)/gtk-api.xml
+ gapi2-fixup --api=gtk-api.xml --metadata=$(srcdir)/Gtk.metadata
+
+gtk_generated/Builder.cs: gtk-api.xml $(GTK_CUSTOMS)
+ @echo -e "\n*** Generating C# code"
+ gapi2-codegen $(GLIBSHARP_CFLAGS) --outdir=gtk_generated --customdir=$(srcdir) --generate gtk-api.xml
+
+gtk-sharp-beans.dll: $(srcdir)/gtk_generated/Builder.cs $(SRCS)
+ @echo -e "\n*** Building $@"
+ $(CSC) -target:library -out:$@ -unsafe $(ASSEMBLIES) $(SRCS) $(srcdir)/gtk_generated/*.cs
+
+CLEANFILES = \
+ gtk-sharp-beans.dll \
+ gtk-sharp-beans.dll.mdb \
+ gtk-api.xml
+
+EXTRA_DIST = \
+ $(SRCS) \
+ $(CUSTOMS) \
+ gtk-api.raw
+
+assemblydir = $(pkglibdir)
+assembly_DATA = \
+ gtk-sharp-beans.dll \
+ gtk-sharp-beans.dll.config
+
+
+fetch:
+ rm -rf fetch
+ git clone git://gitorious.org/gtk-sharp-beans/mainline.git fetch
+
+update:
+ cp fetch/*.cs \
+ fetch/gtk-api.raw \
+ fetch/Gdk.Sources/*.cs \
+ fetch/GLib.Sources/*.cs \
+ fetch/Gtk.Customs/*.custom \
+ fetch/Gtk.Sources/*.cs \
+ fetch/Gtk.metadata \
+ .
+
+.PHONY: fetch update
diff --git a/gtk-sharp-beans/PixbufFormat.cs b/gtk-sharp-beans/PixbufFormat.cs
new file mode 100644
index 0000000..bf33d8a
--- /dev/null
+++ b/gtk-sharp-beans/PixbufFormat.cs
@@ -0,0 +1,35 @@
+// Gdk.PixbufFormat.cs
+//
+// Author(s):
+// Stephane Delcroix <stephane delcroix org>
+//
+// Copyright (c) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2 of the Lesser GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+
+namespace Gdk {
+ public static class PixbufFormatExtensions {
+ [DllImport("libgdk_pixbuf-2.0-0.dll")]
+ static extern void gdk_pixbuf_format_set_disabled(IntPtr raw, bool disabled);
+
+ public static void SetDisabled (this PixbufFormat format, bool value) {
+ gdk_pixbuf_format_set_disabled(format.Handle, value);
+ }
+ }
+}
diff --git a/gtk-sharp-beans/Priority.cs b/gtk-sharp-beans/Priority.cs
new file mode 100644
index 0000000..9c7a964
--- /dev/null
+++ b/gtk-sharp-beans/Priority.cs
@@ -0,0 +1,31 @@
+// GLib.Priority.cs
+//
+// Author(s):
+// Stephane Delcroix <stephane delcroix org>
+//
+// Copyright (c) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2 of the Lesser GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+namespace GLib {
+ public enum Priority
+ {
+ High = -100,
+ Default = 0,
+ HighIdle = 100,
+ DefaultIdle = 200,
+ Low = 300,
+ }
+}
diff --git a/gtk-sharp-beans/Sources.cs b/gtk-sharp-beans/Sources.cs
new file mode 100644
index 0000000..e638456
--- /dev/null
+++ b/gtk-sharp-beans/Sources.cs
@@ -0,0 +1,39 @@
+// GLib.SourceExtensions
+//
+// Author(s):
+// Stephane Delcroix <stephane delcroix org>
+//
+// Copyright (c) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2 of the Lesser GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+using System;
+using System.Runtime.InteropServices;
+using GLib;
+
+namespace GLibBeans {
+ public class Sources {
+ [DllImport("libglib-2.0-0.dll")]
+ static extern void g_source_set_priority (IntPtr source, int priority);
+
+ [DllImport("libglib-2.0-0.dll")]
+ static extern IntPtr g_main_context_find_source_by_id (IntPtr context, uint source_id);
+
+ public static void SetPriority (uint source_id, Priority priority)
+ {
+ g_source_set_priority (g_main_context_find_source_by_id (IntPtr.Zero, source_id), (int)priority);
+ }
+ }
+}
diff --git a/gtk-sharp-beans/Timeout.cs b/gtk-sharp-beans/Timeout.cs
new file mode 100644
index 0000000..7d4f7e7
--- /dev/null
+++ b/gtk-sharp-beans/Timeout.cs
@@ -0,0 +1,34 @@
+// GLib.Timeout.cs - Timeout class implementation
+//
+// Author(s):
+// Stephane Delcroix <stephane delcroix org>
+//
+// Copyright (c) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2 of the Lesser GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+
+namespace GLib {
+ static class TimeoutExtensions {
+
+ public static uint AddSeconds (this Timeout timeout, uint interval, TimeoutHandler hndlr)
+ {
+ return Timeout.Add (1000 * interval, hndlr);
+ }
+ }
+}
diff --git a/gtk-sharp-beans/Widget.cs b/gtk-sharp-beans/Widget.cs
new file mode 100644
index 0000000..9521aef
--- /dev/null
+++ b/gtk-sharp-beans/Widget.cs
@@ -0,0 +1,49 @@
+// Gtk.Widget.cs
+//
+// Author(s):
+// Stephane Delcroix <stephane delcroix org>
+//
+// Copyright (c) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2 of the Lesser GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+
+namespace Gtk {
+ public static class WidgetExtensions {
+ [DllImport("libgtk-win32-2.0-0.dll")]
+ static extern IntPtr gtk_widget_get_snapshot(IntPtr raw, IntPtr clip_rect);
+
+ public static Gdk.Pixmap GetSnapshot(this Widget widget, Gdk.Rectangle clip_rect) {
+ IntPtr native_clip_rect = GLib.Marshaller.StructureToPtrAlloc (clip_rect);
+ IntPtr raw_ret = gtk_widget_get_snapshot(widget.Handle, native_clip_rect);
+ Gdk.Pixmap ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixmap;
+ clip_rect = Gdk.Rectangle.New (native_clip_rect);
+ Marshal.FreeHGlobal (native_clip_rect);
+ return ret;
+ }
+
+ [DllImport("libgtk-win32-2.0-0.dll")]
+ static extern IntPtr gtk_widget_get_window(IntPtr raw);
+
+ public static Gdk.Window GetWindow(this Widget widget) {
+ IntPtr raw_ret = gtk_widget_get_window(widget.Handle);
+ Gdk.Window ret = GLib.Object.GetObject(raw_ret) as Gdk.Window;
+ return ret;
+ }
+ }
+}
diff --git a/gtk-sharp-beans/gtk-api.raw b/gtk-sharp-beans/gtk-api.raw
new file mode 100644
index 0000000..498c8bd
--- /dev/null
+++ b/gtk-sharp-beans/gtk-api.raw
@@ -0,0 +1,138 @@
+<?xml version="1.0"?>
+<api>
+ <!--
+
+ This file was automatically generated.
+ Please DO NOT MODIFY THIS FILE, modify .metadata files instead.
+
+-->
+ <namespace name="GtkBeans" library="libgtk-win32-2.0-0.dll">
+ <enum name="GtkBuilderError" cname="GtkBuilderError" type="enum">
+ <member cname="GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION" name="InvalidTypeFunction" />
+ <member cname="GTK_BUILDER_ERROR_UNHANDLED_TAG" name="UnhandledTag" />
+ <member cname="GTK_BUILDER_ERROR_MISSING_ATTRIBUTE" name="MissingAttribute" />
+ <member cname="GTK_BUILDER_ERROR_INVALID_ATTRIBUTE" name="InvalidAttribute" />
+ <member cname="GTK_BUILDER_ERROR_INVALID_TAG" name="InvalidTag" />
+ <member cname="GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE" name="MissingPropertyValue" />
+ <member cname="GTK_BUILDER_ERROR_INVALID_VALUE" name="InvalidValue" />
+ <member cname="GTK_BUILDER_ERROR_VERSION_MISMATCH" name="VersionMismatch" />
+ </enum>
+ <callback name="GtkBuilderConnectFunc" cname="GtkBuilderConnectFunc">
+ <return-type type="void" />
+ <parameters>
+ <parameter type="GtkBuilder*" name="builder" />
+ <parameter type="GObject*" name="object" />
+ <parameter type="const-gchar*" name="signal_name" />
+ <parameter type="const-gchar*" name="handler_name" />
+ <parameter type="GObject*" name="connect_object" />
+ <parameter type="GConnectFlags" name="flags" />
+ <parameter type="gpointer" name="user_data" />
+ </parameters>
+ </callback>
+ <object name="GtkBuilder" cname="GtkBuilder" parent="GObject">
+ <field name="GSEAL" cname="GSEAL (priv)" type="GtkBuilderPrivate*" />
+ <property name="TranslationDomain" cname="translation-domain" type="gchar*" readable="true" writeable="true" />
+ <virtual_method name="GetTypeFromName" cname="get_type_from_name">
+ <return-type type="GType" />
+ <parameters>
+ <parameter type="GtkBuilder*" name="builder" />
+ <parameter type="const-char*" name="type_name" />
+ </parameters>
+ </virtual_method>
+ <method name="AddFromFile" cname="gtk_builder_add_from_file">
+ <return-type type="guint" />
+ <parameters>
+ <parameter type="const-gchar*" name="filename" />
+ <parameter type="GError**" name="error" />
+ </parameters>
+ </method>
+ <method name="AddFromString" cname="gtk_builder_add_from_string">
+ <return-type type="guint" />
+ <parameters>
+ <parameter type="const-gchar*" name="buffer" />
+ <parameter type="gsize" name="length" />
+ <parameter type="GError**" name="error" />
+ </parameters>
+ </method>
+ <method name="AddObjectsFromFile" cname="gtk_builder_add_objects_from_file">
+ <return-type type="guint" />
+ <parameters>
+ <parameter type="const-gchar*" name="filename" />
+ <parameter type="gchar**" name="object_ids" />
+ <parameter type="GError**" name="error" />
+ </parameters>
+ </method>
+ <method name="AddObjectsFromString" cname="gtk_builder_add_objects_from_string">
+ <return-type type="guint" />
+ <parameters>
+ <parameter type="const-gchar*" name="buffer" />
+ <parameter type="gsize" name="length" />
+ <parameter type="gchar**" name="object_ids" />
+ <parameter type="GError**" name="error" />
+ </parameters>
+ </method>
+ <method name="ConnectSignals" cname="gtk_builder_connect_signals">
+ <return-type type="void" />
+ <parameters>
+ <parameter type="gpointer" name="user_data" />
+ </parameters>
+ </method>
+ <method name="ConnectSignalsFull" cname="gtk_builder_connect_signals_full">
+ <return-type type="void" />
+ <parameters>
+ <parameter type="GtkBuilderConnectFunc" name="func" />
+ <parameter type="gpointer" name="user_data" />
+ </parameters>
+ </method>
+ <method name="ErrorQuark" cname="gtk_builder_error_quark" shared="true">
+ <return-type type="GQuark" />
+ </method>
+ <method name="GetObject" cname="gtk_builder_get_object">
+ <return-type type="GObject*" />
+ <parameters>
+ <parameter type="const-gchar*" name="name" />
+ </parameters>
+ </method>
+ <method name="GetObjects" cname="gtk_builder_get_objects">
+ <return-type type="GSList*" />
+ </method>
+ <method name="GetTranslationDomain" cname="gtk_builder_get_translation_domain">
+ <return-type type="const-gchar*" />
+ </method>
+ <method name="GetType" cname="gtk_builder_get_type" shared="true">
+ <return-type type="GType" />
+ </method>
+ <method name="GetTypeFromName" cname="gtk_builder_get_type_from_name">
+ <return-type type="GType" />
+ <parameters>
+ <parameter type="const-char*" name="type_name" />
+ </parameters>
+ </method>
+ <constructor cname="gtk_builder_new" />
+ <method name="SetTranslationDomain" cname="gtk_builder_set_translation_domain">
+ <return-type type="void" />
+ <parameters>
+ <parameter type="const-gchar*" name="domain" />
+ </parameters>
+ </method>
+ <method name="ValueFromString" cname="gtk_builder_value_from_string">
+ <return-type type="gboolean" />
+ <parameters>
+ <parameter type="GParamSpec*" name="pspec" />
+ <parameter type="const-gchar*" name="string" />
+ <parameter type="GValue*" name="value" />
+ <parameter type="GError**" name="error" />
+ </parameters>
+ </method>
+ <method name="ValueFromStringType" cname="gtk_builder_value_from_string_type">
+ <return-type type="gboolean" />
+ <parameters>
+ <parameter type="GType" name="type" />
+ <parameter type="const-gchar*" name="string" />
+ <parameter type="GValue*" name="value" />
+ <parameter type="GError**" name="error" />
+ </parameters>
+ </method>
+ </object>
+ </namespace>
+</api>
\ No newline at end of file
diff --git a/gtk-sharp-beans/gtk-sharp-beans.dll.config b/gtk-sharp-beans/gtk-sharp-beans.dll.config
new file mode 100644
index 0000000..7197ffb
--- /dev/null
+++ b/gtk-sharp-beans/gtk-sharp-beans.dll.config
@@ -0,0 +1,6 @@
+<configuration>
+ <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0"/>
+ <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/>
+ <dllmap dll="libatk-1.0-0.dll" target="libatk-1.0.so.0"/>
+ <dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so.0"/>
+</configuration>
diff --git a/gtk-sharp-beans/gtk-sharp-beans.snk b/gtk-sharp-beans/gtk-sharp-beans.snk
new file mode 100644
index 0000000..ec388f1
Binary files /dev/null and b/gtk-sharp-beans/gtk-sharp-beans.snk differ
diff --git a/src/Makefile.am b/src/Makefile.am
index 96b46ee..cf39560 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -325,16 +325,16 @@ JOBSCHEDULER_ASSEMBLIES = \
WIDGETS_ASSEMBLIES = \
$(LINK_MONO_ADDINS) \
- -pkg:gio-sharp-2.0 \
+ $(LINK_GIOSHARP) \
-pkg:gtk-sharp-2.0 \
-pkg:gnome-sharp-2.0 \
- -pkg:gtk-sharp-beans-2.0 \
+ $(LINK_GTKSHARPBEANS) \
-r:Mono.Posix \
-r:FSpot.Core.dll \
-r:FSpot.Utils.dll
GNOME_PLATFORM_ASSEMBLIES = \
- -pkg:gio-sharp-2.0 \
+ $(LINK_GIOSHARP) \
-pkg:gnome-sharp-2.0 \
-pkg:gtk-sharp-2.0 \
-pkg:gconf-sharp-2.0 \
@@ -354,6 +354,8 @@ F_SPOT_ASSEMBLIES = \
$(LINK_SMUGMUG) \
$(LINK_TAO) \
$(LINK_SEMWEB) \
+ $(LINK_GTKSHARPBEANS) \
+ $(LINK_GIOSHARP) \
-r:System.Data \
-r:System.Web \
-r:Mono.Data.SqliteClient \
@@ -371,8 +373,6 @@ F_SPOT_ASSEMBLIES = \
$(NUNIT_PKG) \
$(GCONF_PKG) \
$(GTKHTML_SHARP_PKG) \
- -pkg:gtk-sharp-beans-2.0 \
- -pkg:gio-sharp-2.0 \
-pkg:glade-sharp-2.0 \
-pkg:gnome-sharp-2.0 \
-pkg:gnome-vfs-sharp-2.0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]