no more submodule

This commit is contained in:
2024-09-15 22:40:48 +02:00
parent df3b8a3135
commit 0234b33671
5804 changed files with 943618 additions and 1 deletions

View File

@@ -0,0 +1 @@
*.snk

View File

@@ -0,0 +1,110 @@
// Graphics.cs - System.Drawing integration with Gtk#
//
// Author: Miguel de Icaza <miguel@novell.com>
//
// Copyright (c) 2004 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.
// API issues:
// Maybe make the translation `out' parameters so they are explicit and the user knows about it?
// Add a way to copy a Graphics into a drawable?
//
using System;
using System.Reflection;
using System.Runtime.InteropServices;
namespace Gtk.DotNet {
public class Graphics {
private const string GdkNativeDll = "libgdk-3-0.dll";
private Graphics () {}
[DllImport (GdkNativeDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr gdk_win32_drawable_get_handle(IntPtr raw);
[DllImport (GdkNativeDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr gdk_win32_hdc_get(IntPtr drawable, IntPtr gc, int usage);
[DllImport (GdkNativeDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern void gdk_win32_hdc_release(IntPtr drawable,IntPtr gc,int usage);
[DllImport (GdkNativeDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr gdk_x11_drawable_get_xdisplay (IntPtr raw);
[DllImport (GdkNativeDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr gdk_x11_drawable_get_xid (IntPtr raw);
public static System.Drawing.Graphics FromDrawable (Gdk.Window drawable)
{
return FromDrawable (drawable, true);
}
public static System.Drawing.Graphics FromDrawable(Gdk.Window drawable, bool double_buffered)
{
#if FIXME30
IntPtr x_drawable;
int x_off = 0, y_off = 0;
PlatformID osversion = Environment.OSVersion.Platform;
if (osversion == PlatformID.Win32Windows || osversion == PlatformID.Win32NT ||
osversion == PlatformID.Win32S || osversion == PlatformID.WinCE){
if (drawable is Gdk.Window && double_buffered)
((Gdk.Window)drawable).GetInternalPaintInfo(out drawable, out x_off, out y_off);
Cairo.Context gcc = new Gdk.GC(drawable);
IntPtr windc = gdk_win32_hdc_get(drawable.Handle, gcc.Handle, 0);
System.Drawing.Graphics g = System.Drawing.Graphics.FromHdc(windc);
if (double_buffered) {
gdk_win32_hdc_release(drawable.Handle, gcc.Handle, 0);
}
g.TranslateTransform(-x_off, -y_off);
return g;
} else {
if (drawable is Gdk.Window && double_buffered)
((Gdk.Window) drawable).GetInternalPaintInfo(out drawable, out x_off, out y_off);
x_drawable = drawable.Handle;
IntPtr display = gdk_x11_drawable_get_xdisplay (x_drawable);
Type graphics = typeof (System.Drawing.Graphics);
MethodInfo mi = graphics.GetMethod ("FromXDrawable", BindingFlags.Static | BindingFlags.NonPublic);
if (mi == null)
throw new NotImplementedException ("In this implementation I can not get a graphics from a drawable");
object [] args = new object [2] { (IntPtr) gdk_x11_drawable_get_xid (drawable.Handle), (IntPtr) display };
object r = mi.Invoke (null, args);
System.Drawing.Graphics g = (System.Drawing.Graphics) r;
g.TranslateTransform (-x_off, -y_off);
return g;
}
#else
throw new NotSupportedException ();
#endif
}
}
}

View File

@@ -0,0 +1,95 @@
// Copyright (c) 2011 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.Drawing;
namespace Gtk.DotNet {
public static class StyleContextExtensions {
public static void RenderActivity (this Gtk.StyleContext style, Cairo.Context cr, RectangleF rect)
{
style.RenderActivity (cr, rect.X, rect.Y, rect.Width, rect.Height);
}
public static void RenderArrow (this Gtk.StyleContext style, Cairo.Context cr, double angle, PointF location, double size)
{
style.RenderArrow (cr, angle, location.X, location.Y, size);
}
public static void RenderBackground (this Gtk.StyleContext style, Cairo.Context cr, RectangleF rect)
{
style.RenderBackground (cr, rect.X, rect.Y, rect.Width, rect.Height);
}
public static void RenderCheck (this Gtk.StyleContext style, Cairo.Context cr, RectangleF rect)
{
style.RenderCheck (cr, rect.X, rect.Y, rect.Width, rect.Height);
}
public static void RenderExtension (this Gtk.StyleContext style, Cairo.Context cr, RectangleF rect, Gtk.PositionType gap_side)
{
style.RenderExtension (cr, rect.X, rect.Y, rect.Width, rect.Height, gap_side);
}
public static void RenderExpander (this Gtk.StyleContext style, Cairo.Context cr, RectangleF rect)
{
style.RenderExpander (cr, rect.X, rect.Y, rect.Width, rect.Height);
}
public static void RenderFocus (this Gtk.StyleContext style, Cairo.Context cr, RectangleF rect)
{
style.RenderFocus (cr, rect.X, rect.Y, rect.Width, rect.Height);
}
public static void RenderFrame (this Gtk.StyleContext style, Cairo.Context cr, RectangleF rect)
{
style.RenderFrame (cr, rect.X, rect.Y, rect.Width, rect.Height);
}
public static void RenderFrameGap (this Gtk.StyleContext style, Cairo.Context cr, RectangleF rect, Gtk.PositionType gap_side, double xy0_gap, double xy1_gap)
{
style.RenderFrameGap (cr, rect.X, rect.Y, rect.Width, rect.Height, gap_side, xy0_gap, xy1_gap);
}
public static void RenderHandle (this Gtk.StyleContext style, Cairo.Context cr, RectangleF rect)
{
style.RenderHandle (cr, rect.X, rect.Y, rect.Width, rect.Height);
}
public static void RenderLayout (this Gtk.StyleContext style, Cairo.Context cr, PointF location, Pango.Layout layout)
{
style.RenderLayout (cr, location.X, location.Y, layout);
}
public static void RenderLine (this Gtk.StyleContext style, Cairo.Context cr, PointF pt0, PointF pt1)
{
style.RenderLine (cr, pt0.X, pt0.Y, pt1.X, pt1.Y);
}
public static void RenderOption (this Gtk.StyleContext style, Cairo.Context cr, RectangleF rect)
{
style.RenderOption (cr, rect.X, rect.Y, rect.Width, rect.Height);
}
public static void RenderSlider (this Gtk.StyleContext style, Cairo.Context cr, RectangleF rect, Gtk.Orientation orientation)
{
style.RenderSlider (cr, rect.X, rect.Y, rect.Width, rect.Height, orientation);
}
}
}

View File

@@ -0,0 +1,10 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
Name: Gtk.DotNet
Description: .NET Extensions for Gtk
Version: @VERSION@
Requires:gtk-sharp-3.0
Libs: -r:${libdir}/mono/@PACKAGE_VERSION@/gtk-dotnet.dll

View File

@@ -0,0 +1,3 @@
<configuration>
<dllmap dll="libgdk-3-0.dll" target="libgdk-3@LIB_PREFIX@.0@LIB_SUFFIX@"/>
</configuration>

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{CF2BE08F-9354-4CB6-8D49-05DFE1BBCF1F}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Gtk.DotNet</RootNamespace>
<AssemblyName>gtk-dotnet</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<Compile Include="Graphics.cs" />
<Compile Include="StyleContextExtensions.cs" />
<Compile Include="..\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\glib\glib.csproj">
<Project>{3BF1D531-8840-4F15-8066-A9788D8C398B}</Project>
<Name>glib</Name>
</ProjectReference>
<ProjectReference Include="..\gio\gio.csproj">
<Project>{1C3BB17B-336D-432A-8952-4E979BC90867}</Project>
<Name>gio</Name>
</ProjectReference>
<ProjectReference Include="..\cairo\cairo.csproj">
<Project>{364577DB-9728-4951-AC2C-EDF7A6FCC09D}</Project>
<Name>cairo</Name>
</ProjectReference>
<ProjectReference Include="..\pango\pango.csproj">
<Project>{FF422D8C-562F-4EA6-8590-9D1A5CD40AD4}</Project>
<Name>pango</Name>
</ProjectReference>
<ProjectReference Include="..\gdk\gdk.csproj">
<Project>{58346CC6-DE93-45B4-8093-3508BD5DAA12}</Project>
<Name>gdk</Name>
</ProjectReference>
<ProjectReference Include="..\gtk\gtk.csproj">
<Project>{94045F11-4266-40B4-910F-298985AF69D5}</Project>
<Name>gtk</Name>
</ProjectReference>
</ItemGroup>
</Project>