2003-11-27 Miguel de Icaza <miguel@ximian.com>

* glib/Log.cs: Make LogLevelFlags CLS compliant.

	* glib/SignalCallback.cs: Set the constructor protection level to
	protected, since it can not be instantiate.d

	* glib/Marshaller.cs: Do not allow instances of this class as it
	only exposes static methods.

	* glib/Source.cs, glib/FileUtils.cs, glib/Timeout.cs,
	glib/Thread.cs, glib/Markup.cs, glib/TypeConverter.cs: Ditto.

svn path=/trunk/gtk-sharp/; revision=20573
This commit is contained in:
Miguel de Icaza 2003-11-28 05:29:34 +00:00
parent c2d44cbb6a
commit f1e095a87b
11 changed files with 22 additions and 6 deletions

View File

@ -25,5 +25,7 @@ namespace GLib {
return Marshal.PtrToStringAnsi (contents, length); return Marshal.PtrToStringAnsi (contents, length);
} }
private FileUtils () {}
} }
} }

View File

@ -20,7 +20,7 @@ namespace GLib {
public delegate void PrintFunc (string message); public delegate void PrintFunc (string message);
[Flags] [Flags]
public enum LogLevelFlags : uint public enum LogLevelFlags : int
{ {
/* log flags */ /* log flags */
FlagRecursion = 1 << 0, FlagRecursion = 1 << 0,
@ -40,7 +40,7 @@ namespace GLib {
All = 255, All = 255,
FlagMask = 3, FlagMask = 3,
LevelMask = (uint) 0xFFFFFFFC LevelMask = unchecked ((int) 0xFFFFFFFC)
} }
public class Log { public class Log {

View File

@ -13,6 +13,8 @@ namespace GLib {
public class Markup { public class Markup {
private Markup () {}
[DllImport("libglib-2.0-0.dll")] [DllImport("libglib-2.0-0.dll")]
static extern IntPtr g_markup_escape_text (string text, int len); static extern IntPtr g_markup_escape_text (string text, int len);

View File

@ -17,7 +17,12 @@ namespace GLibSharp {
/// </remarks> /// </remarks>
public class Marshaller { public class Marshaller {
//
// Do not allow instances of this
//
private Marshaller () {}
[DllImport("libglib-2.0-0.dll")] [DllImport("libglib-2.0-0.dll")]
static extern void g_free (IntPtr mem); static extern void g_free (IntPtr mem);

View File

@ -16,7 +16,7 @@ namespace GLib {
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
[AttributeUsage(AttributeTargets.All)] [AttributeUsage(AttributeTargets.All)]
public class WrapperClassAttribute : Attribute { public sealed class WrapperClassAttribute : Attribute {
public WrapperClassAttribute () : base () {} public WrapperClassAttribute () : base () {}
} }

View File

@ -20,7 +20,7 @@ namespace GLib {
/// and allows obtaining its original name. /// and allows obtaining its original name.
/// </remarks> /// </remarks>
[Serializable] [Serializable]
public class SignalAttribute : Attribute public sealed class SignalAttribute : Attribute
{ {
private string cname; private string cname;

View File

@ -40,7 +40,7 @@ namespace GtkSharp {
/// Initializes instance data. /// Initializes instance data.
/// </remarks> /// </remarks>
public SignalCallback (GLib.Object obj, Delegate eh, System.Type argstype) protected SignalCallback (GLib.Object obj, Delegate eh, System.Type argstype)
{ {
_key = _NextKey++; _key = _NextKey++;
_obj = obj; _obj = obj;

View File

@ -10,6 +10,7 @@ namespace GLib {
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
public class Source { public class Source {
private Source () {}
[DllImport("libglib-2.0-0.dll")] [DllImport("libglib-2.0-0.dll")]
static extern bool g_source_remove (uint tag); static extern bool g_source_remove (uint tag);

View File

@ -11,6 +11,8 @@ namespace GLib
public class Thread public class Thread
{ {
private Thread () {}
[DllImport("libgthread-2.0-0.dll")] [DllImport("libgthread-2.0-0.dll")]
static extern void g_thread_init (IntPtr i); static extern void g_thread_init (IntPtr i);

View File

@ -32,6 +32,7 @@ namespace GLib {
public class Timeout { public class Timeout {
private Timeout () {}
[DllImport("libglib-2.0-0.dll")] [DllImport("libglib-2.0-0.dll")]
static extern uint g_timeout_add (uint interval, TimeoutHandler d, IntPtr data); static extern uint g_timeout_add (uint interval, TimeoutHandler d, IntPtr data);

View File

@ -17,6 +17,9 @@ namespace GLibSharp {
/// Utilities for converting between TypeFundamentals and System.Type /// Utilities for converting between TypeFundamentals and System.Type
/// </remarks> /// </remarks>
public class TypeConverter { public class TypeConverter {
private TypeConverter () {}
public static TypeFundamentals LookupType (System.Type type) public static TypeFundamentals LookupType (System.Type type)
{ {
if (type.Equals (typeof (string))) if (type.Equals (typeof (string)))