From cf022facd6634131aee65d57ba6fff2688b280b9 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Tue, 11 Mar 2003 02:26:25 +0000 Subject: [PATCH] 2003-03-10 Miguel de Icaza * gtk/Application.cs: Do not allow instances of Application to be created. (InitCheck): new method, wraps gtk_init_check. Removed inline docs from here. Put them on the documentation file. svn path=/trunk/gtk-sharp/; revision=12418 --- ChangeLog | 7 +++++ gtk/Application.cs | 77 ++++++++++++++++------------------------------ 2 files changed, 33 insertions(+), 51 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a3bf3e08..601f49986 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-03-10 Miguel de Icaza + + * gtk/Application.cs: Do not allow instances of Application to be + created. + + (InitCheck): new method, wraps gtk_init_check. + 2003-03-08 Miguel de Icaza * glib/Idle.cs: Add private constructor. diff --git a/gtk/Application.cs b/gtk/Application.cs index 5204e1657..2470809ee 100755 --- a/gtk/Application.cs +++ b/gtk/Application.cs @@ -9,20 +9,15 @@ namespace Gtk { using System; using System.Runtime.InteropServices; - /// - /// Application Class - /// - /// - /// - /// Provides the initialization and event loop iteration related - /// methods for the GTK widget library. Since GTK is an event - /// driven toolkit, Applications register callbacks against various - /// events to handle user input. These callbacks are invoked from - /// the main event loop when events are detected. - /// - public class Application { + // + // Disables creation of instances. + // + private Application () + { + } + [DllImport("libgtk-win32-2.0-0.dll")] static extern void gtk_init (int argc, IntPtr argv); @@ -33,14 +28,8 @@ namespace Gtk { [DllImport("libgtk-win32-2.0-0.dll")] static extern void gtk_init (ref int argc, ref String[] argv); - - /// - /// Init Method - /// - /// - /// - /// Initializes GTK resources. - /// + [DllImport("libgtk-win32-2.0-0.dll")] + static extern bool gtk_init_check (ref int argc, ref String[] argv); public static void Init (ref string[] args) { @@ -48,17 +37,15 @@ namespace Gtk { gtk_init (ref argc, ref args); } + public static bool InitCheck (ref string[] args) + { + int argc = args.Length; + return gtk_init_check (ref argc, ref args); + } + [DllImport("libgtk-win32-2.0-0.dll")] static extern void gtk_main (); - /// - /// Run Method - /// - /// - /// - /// Begins the event loop iteration. - /// - public static void Run () { gtk_main (); @@ -67,13 +54,6 @@ namespace Gtk { [DllImport("libgtk-win32-2.0-0.dll")] static extern bool gtk_events_pending (); - /// - /// EventsPending Method - /// - /// - /// - /// Returns true if Gtk+ events are pending in the queue. - /// public static bool EventsPending () { @@ -83,34 +63,29 @@ namespace Gtk { [DllImport("libgtk-win32-2.0-0.dll")] static extern void gtk_main_iteration (); - /// - /// RunIteration Method - /// - /// - /// - /// Runs a single iteration of the event loop. - /// + [DllImport("libgtk-win32-2.0-0.dll")] + static extern bool gtk_main_iteration_do (bool blocking); public static void RunIteration () { gtk_main_iteration (); } + public static bool RunIteration (bool blocking) + { + return gtk_main_iteration_do (blocking); + } + [DllImport("libgtk-win32-2.0-0.dll")] static extern void gtk_main_quit (); - /// - /// Quit Method - /// - /// - /// - /// Terminates the event loop iteration. - /// - public static void Quit () { gtk_main_quit (); } - + + + [DllImport("libgtk-win32-2.0-0.dll")] + static extern IntPtr gtk_get_current_event (); } }