Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Mikkel Kruse Johnsen 2015-07-24 07:42:55 +02:00
commit 120b3ce9cd
19 changed files with 1104 additions and 995 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

View File

@ -107,7 +107,7 @@ AC_CHECK_SIZEOF(off_t)
OFF_T_FLAGS="-define:OFF_T_$ac_cv_sizeof_off_t"
AC_SUBST(OFF_T_FLAGS)
MONO_REQUIRED_VERSION=2.8
MONO_REQUIRED_VERSION=3.2.8
PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)
AC_PATH_PROG(GACUTIL, gacutil, no)
@ -136,7 +136,7 @@ if test "x$RUNTIME" != "no" ; then
RUNTIME="mono$RUNTIME_DEBUG_FLAGS"
fi
AC_PATH_PROG(CSC, gmcs, no)
AC_PATH_PROG(CSC, mcs, no)
if test `uname -s` = "Darwin"; then
LIB_PREFIX=
LIB_SUFFIX=.dylib

View File

@ -23,7 +23,7 @@ namespace GLib {
using System.Runtime.InteropServices;
public partial class AppInfoAdapter {
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport (GioGlobal.GioNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_app_info_get_all();
public static GLib.IAppInfo[] GetAll () {

67
gio/Application.cs Normal file
View File

@ -0,0 +1,67 @@
//
// Application.cs
//
// Author(s):
// Antonius Riha <antoniusriha@gmail.com>
//
// Copyright (c) 2014 Antonius Riha
//
// 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 partial class Application
{
public Application () : this (null, ApplicationFlags.None)
{
}
[DllImport (GioGlobal.GioNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_application_run (IntPtr raw, int argc, IntPtr argv);
public int Run ()
{
return Run (null, null);
}
public int Run (string program_name, string[] args)
{
var argc = 0;
var argv = IntPtr.Zero;
if (program_name != null) {
program_name = program_name.Trim ();
if (program_name.Length == 0) {
throw new ArgumentException ("program_name must not be empty.", "program_name");
}
if (args == null) {
throw new ArgumentNullException ("args");
}
var prog_args = new string [args.Length + 1];
prog_args [0] = program_name;
args.CopyTo (prog_args, 1);
argc = prog_args.Length;
argv = new Argv (prog_args).Handle;
}
return g_application_run (Handle, argc, argv);
}
}
}

View File

@ -37,7 +37,7 @@ namespace GLib {
return Delete (null);
}
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport (GioGlobal.GioNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_file_get_uri(IntPtr raw);
public System.Uri Uri {

View File

@ -27,7 +27,7 @@ namespace GLib
{
public class FileFactory
{
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport (GioGlobal.GioNativeDll, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr g_file_new_for_uri (string uri);
public static IFile NewForUri (string uri)
@ -40,7 +40,7 @@ namespace GLib
return GLib.FileAdapter.GetObject (g_file_new_for_uri (uri.ToString ()), false) as IFile;
}
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport (GioGlobal.GioNativeDll, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr g_file_new_for_path (string path);
public static IFile NewForPath (string path)
@ -48,7 +48,7 @@ namespace GLib
return GLib.FileAdapter.GetObject (g_file_new_for_path (path), false) as IFile;
}
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
[DllImport (GioGlobal.GioNativeDll, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr g_file_new_for_commandline_arg (string arg);
public static IFile NewFromCommandlineArg (string arg)

View File

@ -106,6 +106,7 @@
<attr path="/api/namespace/object/property[@type='GDbusServerFlags']" name="type">GDBusServerFlags</attr>
<attr path="/api/namespace/object/property[@type='GIoStream']" name="type">GIOStream</attr>
<attr path="/api/namespace/object/property[@type='GUnixFdList']" name="type">GUnixFDList</attr>
<attr path="/api/namespace/object[@cname='GApplication']/method[@cname='g_application_run']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GApplication']/signal[@cname='activate']" name="name">Activated</attr>
<attr path="/api/namespace/object[@cname='GApplication']/signal[@cname='open']" name="name">Opened</attr>
<attr path="/api/namespace/object[@cname='GAppLaunchContext']/signal[@cname='launch-failed']" name="name">LaunchedFailed</attr>

29
gio/GioGlobal.cs Normal file
View File

@ -0,0 +1,29 @@
//
// Global.cs
//
// Author(s):
// Antonius Riha <antoniusriha@gmail.com>
//
// Copyright (c) 2014 Antonius Riha
//
// 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 partial class GioGlobal
{
internal const string GioNativeDll = "libgio-2.0-0.dll";
}
}

View File

@ -12,10 +12,12 @@ glue_includes = gio/gio.h
POLICY_VERSIONS=
sources = \
Application.cs \
AppInfoAdapter.cs \
FileAdapter.cs \
FileEnumerator.cs \
FileFactory.cs \
GioGlobal.cs \
GioStream.cs \
IFile.cs

View File

@ -368,6 +368,8 @@
<Compile Include="generated\GLib\ZlibCompressor.cs" />
<Compile Include="generated\GLib\ZlibCompressorFormat.cs" />
<Compile Include="generated\GLib\ZlibDecompressor.cs" />
<Compile Include="Application.cs" />
<Compile Include="GioGlobal.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\glib\glib.csproj">

View File

@ -4,7 +4,7 @@ lib_LTLIBRARIES = libopaque.la
assemblies=../../glib/glib-sharp.dll ../../gio/gio-sharp.dll ../../pango/pango-sharp.dll ../../atk/atk-sharp.dll ../../gdk/gdk-sharp.dll ../../gtk/gtk-sharp.dll
references=$(addprefix -r:, $(assemblies))
opaquetest.exe: OpaqueTest.cs $(GENERATED_SOURCES_FILES) $(assemblies)
opaquetest.exe: generated-stamp OpaqueTest.cs $(assemblies)
$(CSC) $(CSFLAGS) -out:opaquetest.exe $(references) $(srcdir)/OpaqueTest.cs $(GENERATED_SOURCES_OPTION)
libopaque_la_SOURCES = \
@ -17,11 +17,13 @@ libopaque_la_LIBADD = $(GTK_LIBS)
AM_CPPFLAGS = $(GTK_CFLAGS)
$(GENERATED_SOURCES_FILES): opaque-api.xml
generated-stamp: opaque-api.xml
rm -rf generated/* && \
$(RUNTIME) ../../generator/gapi_codegen.exe --generate $(srcdir)/opaque-api.xml \
--include=../../gtk/gtk-api.xml --include=../../gdk/gdk-api.xml \
--outdir=generated --assembly-name=opaque-sharp \
--schema=$(top_srcdir)/gapi.xsd
--include=../../gtk/gtk-api.xml --include=../../gdk/gdk-api.xml \
--outdir=generated --assembly-name=opaque-sharp \
--schema=$(top_srcdir)/gapi.xsd \
&& touch generated-stamp
api:
PATH=../../parser:$(PATH) $(RUNTIME) ../../parser/gapi-parser.exe opaque-sources.xml
@ -32,6 +34,7 @@ install:
CLEANFILES = \
opaquetest.exe \
opaquetest.exe.mdb \
generated-stamp \
$(GENERATED_SOURCES_FILES)
EXTRA_DIST = \

View File

@ -4,7 +4,7 @@ lib_LTLIBRARIES = libvalobj.la
assemblies=../../glib/glib-sharp.dll ../../gio/gio-sharp.dll ../../cairo/cairo-sharp.dll ../../pango/pango-sharp.dll ../../atk/atk-sharp.dll ../../gdk/gdk-sharp.dll ../../gtk/gtk-sharp.dll
references=$(addprefix -r:, $(assemblies))
valtest.exe: Valtest.cs $(GENERATED_SOURCES_FILES) $(assemblies)
valtest.exe: generated-stamp Valtest.cs $(assemblies)
$(CSC) $(CSFLAGS) -out:valtest.exe $(references) $(srcdir)/Valtest.cs $(GENERATED_SOURCES_OPTION)
libvalobj_la_SOURCES = \
@ -17,11 +17,13 @@ libvalobj_la_LIBADD = $(GTK_LIBS)
AM_CPPFLAGS = $(GTK_CFLAGS)
$(GENERATED_SOURCES_FILES): valobj-api.xml
generated-stamp: valobj-api.xml
rm -rf generated/* && \
$(RUNTIME) ../../generator/gapi_codegen.exe --generate $(srcdir)/valobj-api.xml \
--include=../../gtk/gtk-api.xml --include=../../gdk/gdk-api.xml \
--outdir=generated --assembly-name=valobj-sharp \
--schema=$(top_srcdir)/gapi.xsd
--schema=$(top_srcdir)/gapi.xsd && \
touch generated-stamp
api:
PATH=../../parser:$(PATH) $(RUNTIME) ../../parser/gapi-parser.exe valobj-sources.xml
@ -31,6 +33,7 @@ install:
CLEANFILES = \
valtest.exe \
valtest.exe.mdb \
generated-stamp \
$(GENERATED_SOURCES_FILES)
EXTRA_DIST = \