2005-01-25 18:09:20 +00:00
|
|
|
// Gnome.About.custom - Gnome About class customizations
|
|
|
|
//
|
|
|
|
// Author: Mike Kestner <mkestner@novell.com>
|
|
|
|
//
|
|
|
|
// Copyright (C) 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.
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("gnomeui-2")]
|
2005-03-09 20:32:24 +00:00
|
|
|
static extern IntPtr gnome_about_new(IntPtr name, IntPtr version, IntPtr copyright, IntPtr comments, IntPtr[] authors, IntPtr[] documenters, IntPtr translator_credits, IntPtr logo_pixbuf);
|
|
|
|
|
|
|
|
IntPtr[] NullTerm (string[] src)
|
|
|
|
{
|
2005-05-17 14:30:19 +00:00
|
|
|
if (src == null || src.Length == 0)
|
2005-03-09 20:32:24 +00:00
|
|
|
return null;
|
|
|
|
IntPtr[] result = new IntPtr [src.Length + 1];
|
|
|
|
for (int i = 0; i < src.Length; i++)
|
|
|
|
result [i] = GLib.Marshaller.StringToPtrGStrdup (src [i]);
|
|
|
|
result [src.Length] = IntPtr.Zero;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ReleaseArray (IntPtr[] ptrs)
|
|
|
|
{
|
|
|
|
if (ptrs == null)
|
|
|
|
return;
|
|
|
|
foreach (IntPtr p in ptrs)
|
|
|
|
GLib.Marshaller.Free (p);
|
|
|
|
}
|
2005-01-25 18:09:20 +00:00
|
|
|
|
|
|
|
public About (string name, string version, string copyright, string comments, string[] authors, string[] documenters, string translator_credits, Gdk.Pixbuf logo_pixbuf) : base (IntPtr.Zero)
|
|
|
|
{
|
2005-03-09 20:32:24 +00:00
|
|
|
IntPtr nname = GLib.Marshaller.StringToPtrGStrdup (name);
|
|
|
|
IntPtr nversion = GLib.Marshaller.StringToPtrGStrdup (version);
|
|
|
|
IntPtr ncopyright = GLib.Marshaller.StringToPtrGStrdup (copyright);
|
|
|
|
IntPtr ncomments = GLib.Marshaller.StringToPtrGStrdup (comments);
|
|
|
|
IntPtr ntranslator_credits = GLib.Marshaller.StringToPtrGStrdup (translator_credits);
|
|
|
|
IntPtr[] nauthors = NullTerm (authors);
|
|
|
|
IntPtr[] ndocumenters = NullTerm (documenters);
|
2006-01-31 20:56:51 +00:00
|
|
|
|
|
|
|
if (GetType () != typeof (About)) {
|
|
|
|
CreateNativeObject (new string[0], new GLib.Value[0]);
|
|
|
|
gnome_about_construct (Handle, nname, nversion, ncopyright, ncomments, nauthors, ndocumenters, ntranslator_credits, logo_pixbuf == null ? IntPtr.Zero : logo_pixbuf.Handle);
|
|
|
|
} else
|
|
|
|
Raw = gnome_about_new (nname, nversion, ncopyright, ncomments, nauthors, ndocumenters, ntranslator_credits, (logo_pixbuf != null) ? logo_pixbuf.Handle : IntPtr.Zero);
|
|
|
|
|
2005-03-09 20:32:24 +00:00
|
|
|
GLib.Marshaller.Free (nname);
|
|
|
|
GLib.Marshaller.Free (nversion);
|
|
|
|
GLib.Marshaller.Free (ncopyright);
|
|
|
|
GLib.Marshaller.Free (ncomments);
|
|
|
|
GLib.Marshaller.Free (ntranslator_credits);
|
|
|
|
ReleaseArray (nauthors);
|
|
|
|
ReleaseArray (ndocumenters);
|
2005-01-25 18:09:20 +00:00
|
|
|
}
|
|
|
|
|