tomboy r2204 - in trunk: . Tomboy Tomboy/panelapplet



Author: sharm
Date: Tue Oct  7 07:12:48 2008
New Revision: 2204
URL: http://svn.gnome.org/viewvc/tomboy?rev=2204&view=rev

Log:
* configure.in, Tomboy/Applet.cs, Tomboy/Tomboy.cs, Tomboy/Makefile.am,
  Tomboy/panelapplet: Rebundling gnome-sharp panel applet code if
  gnome-sharp < 2.23.90 is detected during configure.  Earlier
  versions are generally missing a crucial DllMap in
  gnome-sharp.dll.config (though some distros patch this).  Fix for
  bug #555318.

Added:
   trunk/Tomboy/panelapplet/
   trunk/Tomboy/panelapplet/BonoboUIVerb.cs   (contents, props changed)
   trunk/Tomboy/panelapplet/ChangeBackgroundHandler.cs   (contents, props changed)
   trunk/Tomboy/panelapplet/ChangeSizeHandler.cs   (contents, props changed)
   trunk/Tomboy/panelapplet/GnomeSharp.PanelAppletFactoryCallbackNative.cs   (contents, props changed)
   trunk/Tomboy/panelapplet/MoveFocusOutOfAppletHandler.cs   (contents, props changed)
   trunk/Tomboy/panelapplet/ObjectManager.cs   (contents, props changed)
   trunk/Tomboy/panelapplet/PanelApplet.cs   (contents, props changed)
   trunk/Tomboy/panelapplet/PanelAppletBackgroundType.cs   (contents, props changed)
   trunk/Tomboy/panelapplet/PanelAppletFactory.cs   (contents, props changed)
   trunk/Tomboy/panelapplet/PanelAppletFactoryCallback.cs   (contents, props changed)
   trunk/Tomboy/panelapplet/PanelAppletFlags.cs   (contents, props changed)
Modified:
   trunk/ChangeLog
   trunk/Tomboy/Applet.cs
   trunk/Tomboy/Makefile.am
   trunk/Tomboy/Tomboy.cs
   trunk/configure.in

Modified: trunk/Tomboy/Applet.cs
==============================================================================
--- trunk/Tomboy/Applet.cs	(original)
+++ trunk/Tomboy/Applet.cs	Tue Oct  7 07:12:48 2008
@@ -5,7 +5,12 @@
 using System.Reflection;
 using System.Runtime.InteropServices;
 using Mono.Unix;
+
+#if FIXED_PANELAPPLET
 using Gnome;
+#else
+using _Gnome;
+#endif
 
 namespace Tomboy
 {

Modified: trunk/Tomboy/Makefile.am
==============================================================================
--- trunk/Tomboy/Makefile.am	(original)
+++ trunk/Tomboy/Makefile.am	Tue Oct  7 07:12:48 2008
@@ -17,12 +17,20 @@
 FIXED_GTKSPELL_CSFLAGS = -define:FIXED_GTKSPELL
 endif
 
+if FIXED_PANELAPPLET
+FIXED_PANELAPPLET_CSFLAGS = -define:FIXED_PANELAPPLET
+else
+PANELAPPLET_CSFILES =			\
+	$(srcdir)/panelapplet/*.cs
+endif
+
 CSFLAGS = 				\
 	-debug				\
 	-define:DEBUG 			\
 	-unsafe 			\
 	-target:exe 			\
 	$(DBUS_CSFLAGS) 		\
+	$(FIXED_PANELAPPLET_CSFLAGS)	\
 	$(FIXED_GTKSPELL_CSFLAGS) \
 	$(CSC_DEFINES)
 
@@ -63,6 +71,8 @@
 	$(srcdir)/Notebooks/*.cs		\
 	$(srcdir)/Synchronization/*.cs		\
 	\
+	$(PANELAPPLET_CSFILES)			\
+	\
 	$(srcdir)/Gnome.Keyring/*.cs		\
 	\
 	$(DBUS_CSFILES)	

Modified: trunk/Tomboy/Tomboy.cs
==============================================================================
--- trunk/Tomboy/Tomboy.cs	(original)
+++ trunk/Tomboy/Tomboy.cs	Tue Oct  7 07:12:48 2008
@@ -4,6 +4,12 @@
 using System.Xml;
 using Mono.Unix;
 
+#if FIXED_PANELAPPLET
+using Gnome;
+#else
+using _Gnome;
+#endif
+
 using Tomboy.Sync;
 
 namespace Tomboy
@@ -105,7 +111,7 @@
 		static void RegisterPanelAppletFactory ()
 		{
 			// This will block if there is no existing instance running
-			Gnome.PanelAppletFactory.Register (typeof (TomboyApplet));
+			PanelAppletFactory.Register (typeof (TomboyApplet));
 		}
 
 		static void StartTrayIcon ()

Added: trunk/Tomboy/panelapplet/BonoboUIVerb.cs
==============================================================================
--- (empty file)
+++ trunk/Tomboy/panelapplet/BonoboUIVerb.cs	Tue Oct  7 07:12:48 2008
@@ -0,0 +1,28 @@
+
+#pragma warning disable 169 // Unused private members
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace _Gnome
+{
+
+	public delegate void ContextMenuItemCallback ();
+
+	[StructLayout (LayoutKind.Sequential)]
+	public struct BonoboUIVerb
+	{
+		string verb;
+		ContextMenuItemCallback callback;
+		IntPtr user_data;
+		IntPtr dummy;
+
+		public BonoboUIVerb (string name, ContextMenuItemCallback cb)
+		{
+			verb = name;
+			callback = cb;
+			user_data = IntPtr.Zero;
+			dummy = IntPtr.Zero;
+		}
+	}
+}

Added: trunk/Tomboy/panelapplet/ChangeBackgroundHandler.cs
==============================================================================
--- (empty file)
+++ trunk/Tomboy/panelapplet/ChangeBackgroundHandler.cs	Tue Oct  7 07:12:48 2008
@@ -0,0 +1,30 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace _Gnome {
+
+	using System;
+
+	public delegate void ChangeBackgroundHandler(object o, ChangeBackgroundArgs args);
+
+	public class ChangeBackgroundArgs : GLib.SignalArgs {
+		public Gnome.PanelAppletBackgroundType Type{
+			get {
+				return (Gnome.PanelAppletBackgroundType) Args[0];
+			}
+		}
+
+		public Gdk.Color Color{
+			get {
+				return (Gdk.Color) Args[1];
+			}
+		}
+
+		public Gdk.Pixmap Pixmap{
+			get {
+				return (Gdk.Pixmap) Args[2];
+			}
+		}
+
+	}
+}

Added: trunk/Tomboy/panelapplet/ChangeSizeHandler.cs
==============================================================================
--- (empty file)
+++ trunk/Tomboy/panelapplet/ChangeSizeHandler.cs	Tue Oct  7 07:12:48 2008
@@ -0,0 +1,18 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace _Gnome {
+
+	using System;
+
+	public delegate void ChangeSizeHandler(object o, ChangeSizeArgs args);
+
+	public class ChangeSizeArgs : GLib.SignalArgs {
+		public uint Size{
+			get {
+				return (uint) Args[0];
+			}
+		}
+
+	}
+}

Added: trunk/Tomboy/panelapplet/GnomeSharp.PanelAppletFactoryCallbackNative.cs
==============================================================================
--- (empty file)
+++ trunk/Tomboy/panelapplet/GnomeSharp.PanelAppletFactoryCallbackNative.cs	Tue Oct  7 07:12:48 2008
@@ -0,0 +1,42 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace _GnomeSharp {
+
+	using System;
+
+	#region Autogenerated code
+	[GLib.CDeclCallback]
+	internal delegate bool PanelAppletFactoryCallbackNative(IntPtr applet, IntPtr iid, IntPtr user_data);
+
+	internal class PanelAppletFactoryCallbackWrapper {
+
+		public bool NativeCallback (IntPtr applet, IntPtr iid, IntPtr user_data)
+		{
+			_Gnome.PanelApplet _arg0 = GLib.Object.GetObject(applet) as _Gnome.PanelApplet;
+			string _arg1 = GLib.Marshaller.Utf8PtrToString (iid);
+			return (bool) (managed ( _arg0,  _arg1));
+		}
+
+		internal PanelAppletFactoryCallbackNative NativeDelegate;
+		_Gnome.PanelAppletFactoryCallback managed;
+
+		public PanelAppletFactoryCallbackWrapper (_Gnome.PanelAppletFactoryCallback managed)
+		{
+			this.managed = managed;
+			if (managed != null)
+				NativeDelegate = new PanelAppletFactoryCallbackNative (NativeCallback);
+		}
+
+		public static _Gnome.PanelAppletFactoryCallback GetManagedDelegate (PanelAppletFactoryCallbackNative native)
+		{
+			if (native == null)
+				return null;
+			PanelAppletFactoryCallbackWrapper wrapper = (PanelAppletFactoryCallbackWrapper) native.Target;
+			if (wrapper == null)
+				return null;
+			return wrapper.managed;
+		}
+	}
+	#endregion
+}

Added: trunk/Tomboy/panelapplet/MoveFocusOutOfAppletHandler.cs
==============================================================================
--- (empty file)
+++ trunk/Tomboy/panelapplet/MoveFocusOutOfAppletHandler.cs	Tue Oct  7 07:12:48 2008
@@ -0,0 +1,18 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace _Gnome {
+
+	using System;
+
+	public delegate void MoveFocusOutOfAppletHandler(object o, MoveFocusOutOfAppletArgs args);
+
+	public class MoveFocusOutOfAppletArgs : GLib.SignalArgs {
+		public Gtk.DirectionType Direction{
+			get {
+				return (Gtk.DirectionType) Args[0];
+			}
+		}
+
+	}
+}

Added: trunk/Tomboy/panelapplet/ObjectManager.cs
==============================================================================
--- (empty file)
+++ trunk/Tomboy/panelapplet/ObjectManager.cs	Tue Oct  7 07:12:48 2008
@@ -0,0 +1,19 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace _GtkSharp.GnomeSharp {
+
+	public class ObjectManager {
+
+		static bool initialized = false;
+		// Call this method from the appropriate module init function.
+		public static void Initialize ()
+		{
+			if (initialized)
+				return;
+
+			initialized = true;
+			GLib.GType.Register (_Gnome.PanelApplet.GType, typeof (_Gnome.PanelApplet));
+		}
+	}
+}

Added: trunk/Tomboy/panelapplet/PanelApplet.cs
==============================================================================
--- (empty file)
+++ trunk/Tomboy/panelapplet/PanelApplet.cs	Tue Oct  7 07:12:48 2008
@@ -0,0 +1,470 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+#pragma warning disable 169 // Unused private members
+
+namespace _Gnome {
+
+	using System;
+	using System.Collections;
+	using System.Runtime.InteropServices;
+
+	#region Autogenerated code
+	public abstract class PanelApplet : Gtk.EventBox {
+
+		~PanelApplet()
+		{
+			Dispose();
+		}
+
+		[Obsolete]
+protected PanelApplet(GLib.GType gtype) : base(gtype) {}
+public PanelApplet(IntPtr raw) : base(raw) {}
+
+		[DllImport("panel-applet-2")]
+		static extern IntPtr panel_applet_new();
+
+public PanelApplet () : base (IntPtr.Zero)
+		{
+			if (GetType () != typeof (PanelApplet)) {
+				CreateNativeObject (new string [0], new GLib.Value[0]);
+				return;
+			}
+			Raw = panel_applet_new();
+		}
+
+		[GLib.CDeclCallback]
+		delegate void ChangeBackgroundSignalDelegate (IntPtr arg0, int arg1, ref Gdk.Color arg2, IntPtr arg3, IntPtr gch);
+
+		static void ChangeBackgroundSignalCallback (IntPtr arg0, int arg1, ref Gdk.Color arg2, IntPtr arg3, IntPtr gch)
+		{
+			GLib.Signal sig = ((GCHandle) gch).Target as GLib.Signal;
+			if (sig == null)
+				throw new Exception("Unknown signal GC handle received " + gch);
+
+			_Gnome.ChangeBackgroundArgs args = new _Gnome.ChangeBackgroundArgs ();
+			args.Args = new object[3];
+			args.Args[0] = (_Gnome.PanelAppletBackgroundType) arg1;
+			args.Args[1] = arg2;
+			args.Args[2] = GLib.Object.GetObject(arg3) as Gdk.Pixmap;
+			_Gnome.ChangeBackgroundHandler handler = (_Gnome.ChangeBackgroundHandler) sig.Handler;
+			handler (GLib.Object.GetObject (arg0), args);
+
+		}
+
+		[GLib.CDeclCallback]
+		delegate void ChangeBackgroundVMDelegate (IntPtr applet, int type, ref Gdk.Color color, IntPtr pixmap);
+
+		static ChangeBackgroundVMDelegate ChangeBackgroundVMCallback;
+
+		static void changebackground_cb (IntPtr applet, int type, ref Gdk.Color color, IntPtr pixmap)
+		{
+			PanelApplet applet_managed = GLib.Object.GetObject (applet, false) as PanelApplet;
+			switch ((PanelAppletBackgroundType)type) {
+			case PanelAppletBackgroundType.ColorBackground:
+				applet_managed.OnChangeBackground ((PanelAppletBackgroundType)type, color, null);
+				break;
+			case PanelAppletBackgroundType.PixmapBackground:
+				applet_managed.OnChangeBackground ((PanelAppletBackgroundType)type, Gdk.Color.Zero, (Gdk.Pixmap) GLib.Object.GetObject(pixmap));
+				break;
+			default:
+				applet_managed.OnChangeBackground ((PanelAppletBackgroundType)type, Gdk.Color.Zero, null);
+				break;
+			}
+		}
+
+		private static void OverrideChangeBackground (GLib.GType gtype)
+		{
+			if (ChangeBackgroundVMCallback == null)
+				ChangeBackgroundVMCallback = new ChangeBackgroundVMDelegate (changebackground_cb);
+			OverrideVirtualMethod (gtype, "change_background", ChangeBackgroundVMCallback);
+		}
+
+		[GLib.DefaultSignalHandler(Type=typeof(_Gnome.PanelApplet), ConnectionMethod="OverrideChangeBackground")]
+		protected virtual void OnChangeBackground (_Gnome.PanelAppletBackgroundType type, Gdk.Color color, Gdk.Pixmap pixmap)
+		{
+			GLib.Value ret = GLib.Value.Empty;
+			GLib.ValueArray inst_and_params = new GLib.ValueArray (4);
+			GLib.Value[] vals = new GLib.Value [4];
+			vals [0] = new GLib.Value (this);
+			inst_and_params.Append (vals [0]);
+			vals [1] = new GLib.Value (type);
+			inst_and_params.Append (vals [1]);
+			vals [2] = new GLib.Value (color);
+			inst_and_params.Append (vals [2]);
+			vals [3] = new GLib.Value (pixmap);
+			inst_and_params.Append (vals [3]);
+			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
+			foreach (GLib.Value v in vals)
+			v.Dispose ();
+		}
+
+		[GLib.Signal("change_background")]
+		public event _Gnome.ChangeBackgroundHandler ChangeBackground {
+			add {
+				GLib.Signal sig = GLib.Signal.Lookup (this, "change_background", new ChangeBackgroundSignalDelegate(ChangeBackgroundSignalCallback));
+				sig.AddDelegate (value);
+			}
+			remove {
+				GLib.Signal sig = GLib.Signal.Lookup (this, "change_background", new ChangeBackgroundSignalDelegate(ChangeBackgroundSignalCallback));
+				sig.RemoveDelegate (value);
+			}
+		}
+
+		[GLib.CDeclCallback]
+		delegate void MoveFocusOutOfAppletSignalDelegate (IntPtr arg0, int arg1, IntPtr gch);
+
+		static void MoveFocusOutOfAppletSignalCallback (IntPtr arg0, int arg1, IntPtr gch)
+		{
+			GLib.Signal sig = ((GCHandle) gch).Target as GLib.Signal;
+			if (sig == null)
+				throw new Exception("Unknown signal GC handle received " + gch);
+
+			_Gnome.MoveFocusOutOfAppletArgs args = new _Gnome.MoveFocusOutOfAppletArgs ();
+			args.Args = new object[1];
+			args.Args[0] = (Gtk.DirectionType) arg1;
+			_Gnome.MoveFocusOutOfAppletHandler handler = (_Gnome.MoveFocusOutOfAppletHandler) sig.Handler;
+			handler (GLib.Object.GetObject (arg0), args);
+
+		}
+
+		[GLib.CDeclCallback]
+		delegate void MoveFocusOutOfAppletVMDelegate (IntPtr frame, int direction);
+
+		static MoveFocusOutOfAppletVMDelegate MoveFocusOutOfAppletVMCallback;
+
+		static void movefocusoutofapplet_cb (IntPtr frame, int direction)
+		{
+			PanelApplet frame_managed = GLib.Object.GetObject (frame, false) as PanelApplet;
+			frame_managed.OnMoveFocusOutOfApplet ((Gtk.DirectionType) direction);
+		}
+
+		private static void OverrideMoveFocusOutOfApplet (GLib.GType gtype)
+		{
+			if (MoveFocusOutOfAppletVMCallback == null)
+				MoveFocusOutOfAppletVMCallback = new MoveFocusOutOfAppletVMDelegate (movefocusoutofapplet_cb);
+			OverrideVirtualMethod (gtype, "move_focus_out_of_applet", MoveFocusOutOfAppletVMCallback);
+		}
+
+		[GLib.DefaultSignalHandler(Type=typeof(_Gnome.PanelApplet), ConnectionMethod="OverrideMoveFocusOutOfApplet")]
+		protected virtual void OnMoveFocusOutOfApplet (Gtk.DirectionType direction)
+		{
+			GLib.Value ret = GLib.Value.Empty;
+			GLib.ValueArray inst_and_params = new GLib.ValueArray (2);
+			GLib.Value[] vals = new GLib.Value [2];
+			vals [0] = new GLib.Value (this);
+			inst_and_params.Append (vals [0]);
+			vals [1] = new GLib.Value (direction);
+			inst_and_params.Append (vals [1]);
+			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
+			foreach (GLib.Value v in vals)
+			v.Dispose ();
+		}
+
+		[GLib.Signal("move_focus_out_of_applet")]
+		public event _Gnome.MoveFocusOutOfAppletHandler MoveFocusOutOfApplet {
+			add {
+				GLib.Signal sig = GLib.Signal.Lookup (this, "move_focus_out_of_applet", new MoveFocusOutOfAppletSignalDelegate(MoveFocusOutOfAppletSignalCallback));
+				sig.AddDelegate (value);
+			}
+			remove {
+				GLib.Signal sig = GLib.Signal.Lookup (this, "move_focus_out_of_applet", new MoveFocusOutOfAppletSignalDelegate(MoveFocusOutOfAppletSignalCallback));
+				sig.RemoveDelegate (value);
+			}
+		}
+
+		[GLib.CDeclCallback]
+		delegate void ChangeSizeSignalDelegate (IntPtr arg0, uint arg1, IntPtr gch);
+
+		static void ChangeSizeSignalCallback (IntPtr arg0, uint arg1, IntPtr gch)
+		{
+			GLib.Signal sig = ((GCHandle) gch).Target as GLib.Signal;
+			if (sig == null)
+				throw new Exception("Unknown signal GC handle received " + gch);
+
+			_Gnome.ChangeSizeArgs args = new _Gnome.ChangeSizeArgs ();
+			args.Args = new object[1];
+			args.Args[0] = arg1;
+			_Gnome.ChangeSizeHandler handler = (_Gnome.ChangeSizeHandler) sig.Handler;
+			handler (GLib.Object.GetObject (arg0), args);
+
+		}
+
+		[GLib.CDeclCallback]
+		delegate void ChangeSizeVMDelegate (IntPtr applet, uint size);
+
+		static ChangeSizeVMDelegate ChangeSizeVMCallback;
+
+		static void changesize_cb (IntPtr applet, uint size)
+		{
+			PanelApplet applet_managed = GLib.Object.GetObject (applet, false) as PanelApplet;
+			applet_managed.OnChangeSize (size);
+		}
+
+		private static void OverrideChangeSize (GLib.GType gtype)
+		{
+			if (ChangeSizeVMCallback == null)
+				ChangeSizeVMCallback = new ChangeSizeVMDelegate (changesize_cb);
+			OverrideVirtualMethod (gtype, "change_size", ChangeSizeVMCallback);
+		}
+
+		[GLib.DefaultSignalHandler(Type=typeof(_Gnome.PanelApplet), ConnectionMethod="OverrideChangeSize")]
+		protected virtual void OnChangeSize (uint size)
+		{
+			GLib.Value ret = GLib.Value.Empty;
+			GLib.ValueArray inst_and_params = new GLib.ValueArray (2);
+			GLib.Value[] vals = new GLib.Value [2];
+			vals [0] = new GLib.Value (this);
+			inst_and_params.Append (vals [0]);
+			vals [1] = new GLib.Value (size);
+			inst_and_params.Append (vals [1]);
+			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
+			foreach (GLib.Value v in vals)
+			v.Dispose ();
+		}
+
+		[GLib.Signal("change_size")]
+		public event _Gnome.ChangeSizeHandler ChangeSize {
+			add {
+				GLib.Signal sig = GLib.Signal.Lookup (this, "change_size", new ChangeSizeSignalDelegate(ChangeSizeSignalCallback));
+				sig.AddDelegate (value);
+			}
+			remove {
+				GLib.Signal sig = GLib.Signal.Lookup (this, "change_size", new ChangeSizeSignalDelegate(ChangeSizeSignalCallback));
+				sig.RemoveDelegate (value);
+			}
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern void panel_applet_set_size_hints(IntPtr raw, out int size_hints, int n_elements, int base_size);
+
+		public int SetSizeHints(int n_elements, int base_size) {
+			int size_hints;
+			panel_applet_set_size_hints(Handle, out size_hints, n_elements, base_size);
+			return size_hints;
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern IntPtr panel_applet_get_type();
+
+		public static new GLib.GType GType {
+			get {
+				IntPtr raw_ret = panel_applet_get_type();
+				GLib.GType ret = new GLib.GType(raw_ret);
+				return ret;
+			}
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern unsafe int panel_applet_gconf_get_int(IntPtr raw, IntPtr key, out IntPtr opt_error);
+
+		public unsafe int GconfGetInt(string key) {
+			IntPtr key_as_native = GLib.Marshaller.StringToPtrGStrdup (key);
+			IntPtr error = IntPtr.Zero;
+			int raw_ret = panel_applet_gconf_get_int(Handle, key_as_native, out error);
+			int ret = raw_ret;
+			GLib.Marshaller.Free (key_as_native);
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+			return ret;
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern unsafe void panel_applet_gconf_set_float(IntPtr raw, IntPtr key, double the_float, out IntPtr opt_error);
+
+		public unsafe void GconfSetFloat(string key, double the_float) {
+			IntPtr key_as_native = GLib.Marshaller.StringToPtrGStrdup (key);
+			IntPtr error = IntPtr.Zero;
+			panel_applet_gconf_set_float(Handle, key_as_native, the_float, out error);
+			GLib.Marshaller.Free (key_as_native);
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern bool panel_applet_get_locked_down(IntPtr raw);
+
+		public bool LockedDown {
+			get {
+				bool raw_ret = panel_applet_get_locked_down(Handle);
+				bool ret = raw_ret;
+				return ret;
+			}
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern IntPtr panel_applet_get_preferences_key(IntPtr raw);
+
+		public string PreferencesKey {
+			get {
+				IntPtr raw_ret = panel_applet_get_preferences_key(Handle);
+				string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
+				return ret;
+			}
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern int panel_applet_get_background(IntPtr raw, ref Gdk.Color color, IntPtr pixmap);
+
+		public _Gnome.PanelAppletBackgroundType GetBackground(Gdk.Color color, Gdk.Pixmap pixmap) {
+			int raw_ret = panel_applet_get_background(Handle, ref color, pixmap == null ? IntPtr.Zero : pixmap.Handle);
+			_Gnome.PanelAppletBackgroundType ret = (_Gnome.PanelAppletBackgroundType) raw_ret;
+			return ret;
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern unsafe IntPtr panel_applet_gconf_get_string(IntPtr raw, IntPtr key, out IntPtr opt_error);
+
+		public unsafe string GconfGetString(string key) {
+			IntPtr key_as_native = GLib.Marshaller.StringToPtrGStrdup (key);
+			IntPtr error = IntPtr.Zero;
+			IntPtr raw_ret = panel_applet_gconf_get_string(Handle, key_as_native, out error);
+			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
+			GLib.Marshaller.Free (key_as_native);
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+			return ret;
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern unsafe void panel_applet_gconf_set_int(IntPtr raw, IntPtr key, int the_int, out IntPtr opt_error);
+
+		public unsafe void GconfSetInt(string key, int the_int) {
+			IntPtr key_as_native = GLib.Marshaller.StringToPtrGStrdup (key);
+			IntPtr error = IntPtr.Zero;
+			panel_applet_gconf_set_int(Handle, key_as_native, the_int, out error);
+			GLib.Marshaller.Free (key_as_native);
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern unsafe void panel_applet_add_preferences(IntPtr raw, IntPtr schema_dir, out IntPtr opt_error);
+
+		public unsafe void AddPreferences(string schema_dir) {
+			IntPtr schema_dir_as_native = GLib.Marshaller.StringToPtrGStrdup (schema_dir);
+			IntPtr error = IntPtr.Zero;
+			panel_applet_add_preferences(Handle, schema_dir_as_native, out error);
+			GLib.Marshaller.Free (schema_dir_as_native);
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern uint panel_applet_get_size(IntPtr raw);
+
+		public uint Size {
+			get {
+				uint raw_ret = panel_applet_get_size(Handle);
+				uint ret = raw_ret;
+				return ret;
+			}
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern IntPtr panel_applet_gconf_get_full_key(IntPtr raw, IntPtr key);
+
+		public string GconfGetFullKey(string key) {
+			IntPtr key_as_native = GLib.Marshaller.StringToPtrGStrdup (key);
+			IntPtr raw_ret = panel_applet_gconf_get_full_key(Handle, key_as_native);
+			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
+			GLib.Marshaller.Free (key_as_native);
+			return ret;
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern unsafe void panel_applet_gconf_set_string(IntPtr raw, IntPtr key, IntPtr the_string, out IntPtr opt_error);
+
+		public unsafe void GconfSetString(string key, string the_string) {
+			IntPtr key_as_native = GLib.Marshaller.StringToPtrGStrdup (key);
+			IntPtr the_string_as_native = GLib.Marshaller.StringToPtrGStrdup (the_string);
+			IntPtr error = IntPtr.Zero;
+			panel_applet_gconf_set_string(Handle, key_as_native, the_string_as_native, out error);
+			GLib.Marshaller.Free (key_as_native);
+			GLib.Marshaller.Free (the_string_as_native);
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern int panel_applet_get_flags(IntPtr raw);
+
+		[DllImport("panel-applet-2")]
+		static extern void panel_applet_set_flags(IntPtr raw, int flags);
+
+		public new _Gnome.PanelAppletFlags Flags {
+			get {
+				int raw_ret = panel_applet_get_flags(Handle);
+				_Gnome.PanelAppletFlags ret = (_Gnome.PanelAppletFlags) raw_ret;
+				return ret;
+			}
+			set {
+				panel_applet_set_flags(Handle, (int) value);
+			}
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern unsafe bool panel_applet_gconf_get_bool(IntPtr raw, IntPtr key, out IntPtr opt_error);
+
+		public unsafe bool GconfGetBool(string key) {
+			IntPtr key_as_native = GLib.Marshaller.StringToPtrGStrdup (key);
+			IntPtr error = IntPtr.Zero;
+			bool raw_ret = panel_applet_gconf_get_bool(Handle, key_as_native, out error);
+			bool ret = raw_ret;
+			GLib.Marshaller.Free (key_as_native);
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+			return ret;
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern unsafe double panel_applet_gconf_get_float(IntPtr raw, IntPtr key, out IntPtr opt_error);
+
+		public unsafe double GconfGetFloat(string key) {
+			IntPtr key_as_native = GLib.Marshaller.StringToPtrGStrdup (key);
+			IntPtr error = IntPtr.Zero;
+			double raw_ret = panel_applet_gconf_get_float(Handle, key_as_native, out error);
+			double ret = raw_ret;
+			GLib.Marshaller.Free (key_as_native);
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+			return ret;
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern unsafe void panel_applet_gconf_set_bool(IntPtr raw, IntPtr key, bool the_bool, out IntPtr opt_error);
+
+		public unsafe void GconfSetBool(string key, bool the_bool) {
+			IntPtr key_as_native = GLib.Marshaller.StringToPtrGStrdup (key);
+			IntPtr error = IntPtr.Zero;
+			panel_applet_gconf_set_bool(Handle, key_as_native, the_bool, out error);
+			GLib.Marshaller.Free (key_as_native);
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+		}
+
+
+		static PanelApplet ()
+		{
+			_GtkSharp.GnomeSharp.ObjectManager.Initialize ();
+		}
+		#endregion
+		#region Customized extensions
+		#line 1 "PanelApplet.custom"
+		[DllImport ("panel-applet-2")]
+		static extern void panel_applet_setup_menu (IntPtr handle, IntPtr xml, BonoboUIVerb[] items, IntPtr user_data);
+
+		public void SetupMenu (string xml, BonoboUIVerb[] items)
+		{
+			BonoboUIVerb[] nulled_items = new BonoboUIVerb[items.Length + 1];
+			Array.Copy (items, nulled_items, items.Length);
+			nulled_items[items.Length] = new BonoboUIVerb (null, null);
+			IntPtr native = GLib.Marshaller.StringToPtrGStrdup (xml);
+			panel_applet_setup_menu (Handle, native, nulled_items, IntPtr.Zero);
+			GLib.Marshaller.Free (native);
+		}
+
+		public abstract void Creation ();
+
+		public abstract string IID {
+			get;
+		}
+
+		public abstract string FactoryIID {
+			get;
+		}
+
+		#endregion
+	}
+}

Added: trunk/Tomboy/panelapplet/PanelAppletBackgroundType.cs
==============================================================================
--- (empty file)
+++ trunk/Tomboy/panelapplet/PanelAppletBackgroundType.cs	Tue Oct  7 07:12:48 2008
@@ -0,0 +1,17 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace _Gnome {
+
+	using System;
+	using System.Runtime.InteropServices;
+
+	#region Autogenerated code
+	public enum PanelAppletBackgroundType {
+
+		NoBackground,
+		ColorBackground,
+		PixmapBackground,
+	}
+	#endregion
+}

Added: trunk/Tomboy/panelapplet/PanelAppletFactory.cs
==============================================================================
--- (empty file)
+++ trunk/Tomboy/panelapplet/PanelAppletFactory.cs	Tue Oct  7 07:12:48 2008
@@ -0,0 +1,60 @@
+// Gnome.PanelAppletFactory.cs - PanelAppletFactory class impl
+//
+// Copyright (c) 2004-2005 Novell, Inc.
+//
+// This code is inserted after the automatically generated code.
+//
+// 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.Reflection;
+using System.Runtime.InteropServices;
+
+namespace _Gnome
+{
+	public class PanelAppletFactory
+	{
+		private PanelAppletFactory () {}
+
+		private static string _IID;
+		private static string _factoryIID;
+		private static _GnomeSharp.PanelAppletFactoryCallbackWrapper cb_wrapper;
+
+		public static void Register (Type applet_type)
+		{
+			PanelApplet applet = (PanelApplet) Activator.CreateInstance (applet_type, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance, null, new object[] {IntPtr.Zero}, null);
+
+			cb_wrapper = new _GnomeSharp.PanelAppletFactoryCallbackWrapper (new PanelAppletFactoryCallback (Creation));
+			_IID = applet.IID;
+			_factoryIID = applet.FactoryIID;
+			IntPtr native_iid = GLib.Marshaller.StringToPtrGStrdup (_factoryIID);
+			panel_applet_factory_main (native_iid, ((GLib.GType) applet_type).Val, cb_wrapper.NativeDelegate, IntPtr.Zero);
+			GLib.Marshaller.Free (native_iid);
+		}
+
+		private static bool Creation (PanelApplet applet, string iid)
+		{
+			if (_IID != iid)
+				return false;
+			applet.Creation ();
+			return true;
+		}
+
+		[DllImport("panel-applet-2")]
+		static extern int panel_applet_factory_main(IntPtr iid, IntPtr applet_type, _GnomeSharp.PanelAppletFactoryCallbackNative cb, IntPtr data);
+	}
+}

Added: trunk/Tomboy/panelapplet/PanelAppletFactoryCallback.cs
==============================================================================
--- (empty file)
+++ trunk/Tomboy/panelapplet/PanelAppletFactoryCallback.cs	Tue Oct  7 07:12:48 2008
@@ -0,0 +1,10 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace _Gnome {
+
+	using System;
+
+	public delegate bool PanelAppletFactoryCallback(_Gnome.PanelApplet applet, string iid);
+
+}

Added: trunk/Tomboy/panelapplet/PanelAppletFlags.cs
==============================================================================
--- (empty file)
+++ trunk/Tomboy/panelapplet/PanelAppletFlags.cs	Tue Oct  7 07:12:48 2008
@@ -0,0 +1,19 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace _Gnome {
+
+	using System;
+	using System.Runtime.InteropServices;
+
+	#region Autogenerated code
+	[Flags]
+	public enum PanelAppletFlags {
+
+		FlagsNone,
+		ExpandMajor = 1 << 0,
+		ExpandMinor = 1 << 1,
+		HasHandle = 1 << 2,
+	}
+	#endregion
+}

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Tue Oct  7 07:12:48 2008
@@ -145,7 +145,10 @@
 	                  gnome-sharp-2.0
 	                  gconf-sharp-2.0
 	                  gconf-sharp-peditors-2.0
-	                  gnome-panel-sharp-2.24)
+	                  gnome-panel-sharp-2.24,
+	                  has_fixed_panelapplet="yes",
+	                  has_fixed_panelapplet="no")
+
 else
 	if pkg-config --atleast-version=2.16.1 gconf-sharp-2.0; then
 		PKG_CHECK_MODULES(TOMBOY,
@@ -160,6 +163,7 @@
 			          gconf-sharp-2.0)
 	fi
 fi
+AM_CONDITIONAL(FIXED_PANELAPPLET, test "x$has_fixed_panelapplet" = "xyes")
 AC_SUBST(TOMBOY_LIBS)
 
 #



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]