From 2147d5f788d36ebccb7981c427b7e430b1e4e8cd Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sat, 28 Jan 2006 10:36:25 +0000 Subject: fixed line endings, now for real svn path=/trunk/externals/clr/; revision=4513 --- pd/AssemblyInfo.cs | 116 +++++++++++++++++----------------- pd/Atom.cs | 178 ++++++++++++++++++++++++++--------------------------- pd/PureData.cs | 92 +++++++++++++-------------- 3 files changed, 193 insertions(+), 193 deletions(-) (limited to 'pd') diff --git a/pd/AssemblyInfo.cs b/pd/AssemblyInfo.cs index a9f1b83..93484d8 100755 --- a/pd/AssemblyInfo.cs +++ b/pd/AssemblyInfo.cs @@ -1,58 +1,58 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// Le informazioni generali relative a un assembly sono controllate dal seguente -// insieme di attributi. Per modificare le informazioni associate a un assembly -// occorre quindi modificare i valori di questi attributi. -// -[assembly: AssemblyTitle("PureData")] -[assembly: AssemblyDescription("bridge between C sharp externals and pd")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("Davide Morelli, Thomas Grill")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori: -// -// Numero di versione principale -// Numero di versione secondario -// Numero revisione -// Numero build -// -// È possibile specificare tutti i valori o impostare come predefiniti i valori Numero revisione e Numero build -// utilizzando l'asterisco (*) come illustrato di seguito: - -[assembly: AssemblyVersion("1.0.*")] - -// -// Per firmare l'assembly è necessario specificare una chiave da utilizzare. -// Fare riferimento alla documentazione di Microsoft .NET Framework per ulteriori informazioni sulla firma degli assembly. -// -// Utilizzare gli attributi elencati di seguito per verificare la chiave utilizzata per la firma. -// -// Note: -// (*) Se non è specificata alcuna chiave, non sarà possibile firmare l'assembly. -// (*) KeyName fa riferimento a una chiave installata nel provider di servizi di -// crittografia (CSP) sul computer in uso. KeyFile fa riferimento a un file che contiene -// una chiave. -// (*) Se entrambi i valori KeyFile e KeyName sono specificati, si -// verificherà il seguente processo: -// (1) Se KeyName è presente in CSP, verrà utilizzata tale chiave. -// (2) Se KeyName non esiste e KeyFile esiste, la chiave -// di KeyFile verrà installata nel CSP e utilizzata. -// (*) Per creare un KeyFile, è possibile utilizzare l'utilità sn.exe (Strong Name). -// Quando si specifica il KeyFile, il percorso dovrà essere -// relativo alla directory di output del progetto, ovvero -// %Project Directory%\obj\. Se ad esempio il KeyFile si -// trova nella directory del progetto, occorre specificare l'attributo AssemblyKeyFile -// come [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) La firma ritardata è un'opzione avanzata. Vedere la documentazione di Microsoft -// .NET Framework per ulteriori informazioni. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// Le informazioni generali relative a un assembly sono controllate dal seguente +// insieme di attributi. Per modificare le informazioni associate a un assembly +// occorre quindi modificare i valori di questi attributi. +// +[assembly: AssemblyTitle("PureData")] +[assembly: AssemblyDescription("bridge between C sharp externals and pd")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("Davide Morelli, Thomas Grill")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori: +// +// Numero di versione principale +// Numero di versione secondario +// Numero revisione +// Numero build +// +// È possibile specificare tutti i valori o impostare come predefiniti i valori Numero revisione e Numero build +// utilizzando l'asterisco (*) come illustrato di seguito: + +[assembly: AssemblyVersion("1.0.*")] + +// +// Per firmare l'assembly è necessario specificare una chiave da utilizzare. +// Fare riferimento alla documentazione di Microsoft .NET Framework per ulteriori informazioni sulla firma degli assembly. +// +// Utilizzare gli attributi elencati di seguito per verificare la chiave utilizzata per la firma. +// +// Note: +// (*) Se non è specificata alcuna chiave, non sarà possibile firmare l'assembly. +// (*) KeyName fa riferimento a una chiave installata nel provider di servizi di +// crittografia (CSP) sul computer in uso. KeyFile fa riferimento a un file che contiene +// una chiave. +// (*) Se entrambi i valori KeyFile e KeyName sono specificati, si +// verificherà il seguente processo: +// (1) Se KeyName è presente in CSP, verrà utilizzata tale chiave. +// (2) Se KeyName non esiste e KeyFile esiste, la chiave +// di KeyFile verrà installata nel CSP e utilizzata. +// (*) Per creare un KeyFile, è possibile utilizzare l'utilità sn.exe (Strong Name). +// Quando si specifica il KeyFile, il percorso dovrà essere +// relativo alla directory di output del progetto, ovvero +// %Project Directory%\obj\. Se ad esempio il KeyFile si +// trova nella directory del progetto, occorre specificare l'attributo AssemblyKeyFile +// come [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) La firma ritardata è un'opzione avanzata. Vedere la documentazione di Microsoft +// .NET Framework per ulteriori informazioni. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/pd/Atom.cs b/pd/Atom.cs index 532956e..e3b6f3c 100755 --- a/pd/Atom.cs +++ b/pd/Atom.cs @@ -1,104 +1,104 @@ -using System; -using System.Runtime.InteropServices; // for structures - -namespace PureData -{ - public enum AtomType {Null = 0, Float = 1, Symbol = 2, Pointer = 3}; +using System; +using System.Runtime.InteropServices; // for structures - [StructLayout (LayoutKind.Sequential)] +namespace PureData +{ + public enum AtomType {Null = 0, Float = 1, Symbol = 2, Pointer = 3}; + + [StructLayout (LayoutKind.Sequential)] sealed public class Symbol - { - // this should NOT be public - readonly private IntPtr ptr; - - public Symbol(IntPtr p) - { - ptr = p; - } - - public Symbol(Symbol s) - { - ptr = s.ptr; - } - - public Symbol(string s) - { - ptr = Core.GenSym(s); - } - - override public string ToString() - { - return Core.EvalSym(this); - } - } + { + // this should NOT be public + readonly private IntPtr ptr; + + public Symbol(IntPtr p) + { + ptr = p; + } + + public Symbol(Symbol s) + { + ptr = s.ptr; + } + + public Symbol(string s) + { + ptr = Core.GenSym(s); + } + + override public string ToString() + { + return Core.EvalSym(this); + } + } - [StructLayout (LayoutKind.Sequential)] + [StructLayout (LayoutKind.Sequential)] sealed public class Pointer - { - public IntPtr ptr; + { + public IntPtr ptr; } - [StructLayout (LayoutKind.Explicit)] - public struct Word - { - [FieldOffset(0)] public float w_float; - [FieldOffset(0)] public Symbol w_symbol; - [FieldOffset(0)] public Pointer w_pointer; - } + [StructLayout (LayoutKind.Explicit)] + public struct Word + { + [FieldOffset(0)] public float w_float; + [FieldOffset(0)] public Symbol w_symbol; + [FieldOffset(0)] public Pointer w_pointer; + } - //[StructLayout (LayoutKind.Explicit)] - [StructLayout (LayoutKind.Sequential)] + //[StructLayout (LayoutKind.Explicit)] + [StructLayout (LayoutKind.Sequential)] sealed public class Atom - { - - public AtomType type; - public Word word; - - public Atom(float f) - { - type = AtomType.Float; - word.w_float = f; - } - - public Atom(int i) - { - type = AtomType.Float; - word.w_float = (float)i; - } - - public Atom(Symbol s) - { - type = AtomType.Symbol; - word.w_symbol = s; - } - - public Atom(string s) - { - type = AtomType.Symbol; - word.w_symbol = new Symbol(s); - } - } - - - // this struct is relative to this c struct, see clr.c - - /* - // simplyfied atom - typedef struct atom_simple atom_simple; + { + + public AtomType type; + public Word word; + + public Atom(float f) + { + type = AtomType.Float; + word.w_float = f; + } + + public Atom(int i) + { + type = AtomType.Float; + word.w_float = (float)i; + } + + public Atom(Symbol s) + { + type = AtomType.Symbol; + word.w_symbol = s; + } + + public Atom(string s) + { + type = AtomType.Symbol; + word.w_symbol = new Symbol(s); + } + } + + + // this struct is relative to this c struct, see clr.c + + /* + // simplyfied atom + typedef struct atom_simple atom_simple; typedef enum { A_S_NULL=0, A_S_FLOAT=1, A_S_SYMBOL=2, - } t_atomtype_simple; - typedef struct atom_simple - { - t_atomtype_simple a_type; - union{ + } t_atomtype_simple; + typedef struct atom_simple + { + t_atomtype_simple a_type; + union{ float float_value; - MonoString *string_value; - } stuff; - }; - */ - + MonoString *string_value; + } stuff; + }; + */ + } \ No newline at end of file diff --git a/pd/PureData.cs b/pd/PureData.cs index 2ff8cfe..2d6cf16 100644 --- a/pd/PureData.cs +++ b/pd/PureData.cs @@ -1,46 +1,46 @@ -using System; -using System.Runtime.CompilerServices; // for extern import - -namespace PureData -{ - // PD core functions - public class Core - { - [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static void Post(string message); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static void PostError(string message); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static void PostBug(string message); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static void PostVerbose(string message); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static IntPtr GenSym(string sym); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static string EvalSym(Symbol sym); - } - - // This is the base class for a PD/CLR external - public class External - : Core - { - private readonly IntPtr ptr; - - protected virtual void MethodBang() { Post("No bang handler"); } - - protected virtual void MethodFloat(float f) { Post("No float handler"); } - - protected virtual void MethodSymbol(Symbol s) { Post("No symbol handler"); } - - protected virtual void MethodPointer(Pointer p) { Post("No pointer handler");} - - protected virtual void MethodList(Atom[] lst) { Post("No list handler"); } - - protected virtual void MethodAnything(Atom[] lst) { Post("No list handler"); } - } -} +using System; +using System.Runtime.CompilerServices; // for extern import + +namespace PureData +{ + // PD core functions + public class Core + { + [MethodImplAttribute (MethodImplOptions.InternalCall)] + public extern static void Post(string message); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + public extern static void PostError(string message); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + public extern static void PostBug(string message); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + public extern static void PostVerbose(string message); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + public extern static IntPtr GenSym(string sym); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + public extern static string EvalSym(Symbol sym); + } + + // This is the base class for a PD/CLR external + public class External + : Core + { + private readonly IntPtr ptr; + + protected virtual void MethodBang() { Post("No bang handler"); } + + protected virtual void MethodFloat(float f) { Post("No float handler"); } + + protected virtual void MethodSymbol(Symbol s) { Post("No symbol handler"); } + + protected virtual void MethodPointer(Pointer p) { Post("No pointer handler");} + + protected virtual void MethodList(Atom[] lst) { Post("No list handler"); } + + protected virtual void MethodAnything(Atom[] lst) { Post("No list handler"); } + } +} -- cgit v1.2.1