Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Commit

Permalink
2010-07-09 Miguel de Icaza <miguel@novell.com>
Browse files Browse the repository at this point in the history
	* Sync to the latest version.

svn path=/trunk/monomac/; revision=160132
  • Loading branch information
migueldeicaza committed Jul 9, 2010
1 parent 4d040ee commit 02cfbd6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 45 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -0,0 +1,4 @@
2010-07-09 Miguel de Icaza <miguel@novell.com>

* Sync to the latest version.

4 changes: 2 additions & 2 deletions samples/Hello/Hello.app/Contents/MacOS/Hello
Expand Up @@ -21,6 +21,6 @@ MONO_BIN=`which mono`
MONO_OPTIONS="--debug"
EXEC_PATH="$APP_ROOT"/"$APP_NAME"
if [ -f "$EXEC_PATH" ]; then rm -f "$EXEC_PATH" ; fi
ln -s $MONO_BIN "$EXEC_PATH"
echo $EXEC_PATH >> /tmp/logme
exec -a $APP_NAME "$EXEC_PATH" $MONO_OPTIONS "$RESOURCES_PATH"/"$ASSEMBLY"
EXEC_PATH=/usr/bin/mono
exec "$EXEC_PATH" $MONO_OPTIONS "$RESOURCES_PATH"/"$ASSEMBLY"
1 change: 1 addition & 0 deletions src/Constants.cs
Expand Up @@ -29,5 +29,6 @@ public static partial class Constants {
public const string FoundationLibrary = "/System/Library/Frameworks/Foundation.framework/Foundation";
public const string ObjectiveCLibrary = "/usr/lib/libobjc.dylib";
public const string SystemLibrary = "/usr/lib/libSystem.dylib";
public const string QuartzLibrary = "/System/Library/Frameworks/QuartzCore.framework/QuartzCore";
}
}
8 changes: 8 additions & 0 deletions src/Makefile
Expand Up @@ -43,6 +43,7 @@ DEFINES = -define:NET_2_0
TARGETS = bmac.exe monomac.dll parse.exe

SHARED_SOURCE = \
./CoreAnimation/CATransform3D.cs \
./CoreFoundation/CFArray.cs \
./CoreFoundation/CFBoolean.cs \
./CoreFoundation/CFDictionary.cs \
Expand All @@ -61,6 +62,7 @@ SHARED_SOURCE = \
./CoreGraphics/CGGeometry.cs \
./CoreGraphics/CGGradient.cs \
./CoreGraphics/CGImage.cs \
./CoreGraphics/CGLayer.cs \
./CoreGraphics/CGPDFDocument.cs \
./CoreGraphics/CGPDFPage-2.cs \
./CoreGraphics/CGPDFPage.cs \
Expand Down Expand Up @@ -107,6 +109,7 @@ SHARED_SOURCE = \
./Foundation/RegisterAttribute.cs \
./ObjCRuntime/ArgumentSemantic.cs \
./ObjCRuntime/AlphaAttribute.cs \
./ObjCRuntime/Blocks.cs \
./ObjCRuntime/INativeObject.cs \
./ObjCRuntime/Dlfcn.cs \
./ObjCRuntime/SinceAttribute.cs \
Expand All @@ -117,6 +120,7 @@ SHARED_SOURCE = \
# ./CoreGraphics/CGShading.cs \
SHARED_CORE_SOURCE = \
./CoreAnimation/CATransform3D.cs \
./CoreFoundation/CFString.cs \
./CoreFoundation/CFUrl.cs \
./CoreFoundation/CFRunLoop.cs \
Expand All @@ -131,11 +135,14 @@ SHARED_CORE_SOURCE = \
./CoreGraphics/CGGeometry.cs \
./CoreGraphics/CGGradient.cs \
./CoreGraphics/CGImage.cs \
./CoreGraphics/CGLayer.cs \
./CoreGraphics/CGPDFDocument.cs \
./CoreGraphics/CGPDFPage-2.cs \
./CoreGraphics/CGPDFPage.cs \
./CoreGraphics/CGPath.cs \
./CoreGraphics/CGPattern.cs \
./CoreMedia/CMSampleBuffer.cs \
./CoreMedia/CoreMedia.cs \
./Foundation/ConnectAttribute.cs \
./Foundation/Enum.cs \
./Foundation/ExportAttribute.cs \
Expand All @@ -147,6 +154,7 @@ SHARED_CORE_SOURCE = \
./Foundation/PreserveAttribute.cs \
./ObjCRuntime/ArgumentSemantic.cs \
./ObjCRuntime/AlphaAttribute.cs \
./ObjCRuntime/Blocks.cs \
./ObjCRuntime/INativeObject.cs \
./ObjCRuntime/SinceAttribute.cs \
./ObjCRuntime/TypeConverter.cs \
Expand Down
43 changes: 0 additions & 43 deletions src/ObjCRuntime/Runtime.cs
Expand Up @@ -96,47 +96,4 @@ public static class Runtime {
}
}
}

[StructLayout (LayoutKind.Sequential)]
public struct BlockDescriptor {
public int reserved;
public int size;
public IntPtr copy_helper;
public IntPtr dispose;
}

[StructLayout (LayoutKind.Sequential)]
public struct BlockLiteral {
public IntPtr isa;
public int flags;
public int reserved;
public IntPtr invoke;
public IntPtr block_descriptor;
public IntPtr handle;

internal static IntPtr MonoTouchDescriptor;

//
// trampoline must be static, and someone else needs to keep a ref to it
//
public static unsafe IntPtr CreateBlock (Delegate trampoline, Delegate userDelegate)
{
if (MonoTouchDescriptor == IntPtr.Zero){
var desc = Marshal.AllocHGlobal (sizeof (BlockDescriptor));
Marshal.WriteInt32 (desc, 4, sizeof (BlockLiteral));
MonoTouchDescriptor = desc;
}

var block = (BlockLiteral *) Marshal.AllocHGlobal (sizeof (BlockLiteral));
block->block_descriptor = MonoTouchDescriptor;
block->isa = Class.GetHandle ("__NSConcreteGlobalBlock");
block->invoke = Marshal.GetFunctionPointerForDelegate (trampoline);

// BLOCK_IS_GLOBAL, maybe add later BLOCK_HAS_COPY_DISPOSE (1 << 25)
block->flags = 1 << 28;
block->handle = (IntPtr) GCHandle.Alloc (userDelegate);

return (IntPtr) block;
}
}
}

0 comments on commit 02cfbd6

Please sign in to comment.