2006-08-07 Mike Kestner <mkestner@novell.com>

* gtk/Gtk.metadata : remainder of new API massaging for existing 
	types.
	* gtk/Printer.custom : new static method.
	* gtk/TextBuffer.custom : serialization API implementations.

svn path=/trunk/gtk-sharp/; revision=63448
This commit is contained in:
Mike Kestner 2006-08-07 20:45:47 +00:00
parent 8868687755
commit 7c0a6a4f9b
5 changed files with 101 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2006-08-07 Mike Kestner <mkestner@novell.com>
* gtk/Gtk.metadata : remainder of new API massaging for existing
types.
* gtk/Printer.custom : new static method.
* gtk/TextBuffer.custom : serialization API implementations.
2006-08-07 Mike Kestner <mkestner@novell.com>
* gtk/Gtk.metadata : mark an out param in Style.LookupColor.

View file

@ -62,6 +62,7 @@
<attr path="/api/namespace/class[@cname='GtkGlobal']/method[@name='CheckVersion']/return-type" name="type">const-gchar*</attr>
<attr path="/api/namespace/class[@cname='GtkGlobal']/method[@name='ClistDragPosGetType']" name="hidden">1</attr>
<attr path="/api/namespace/class[@cname='GtkGlobal']/method[@name='DebugFlagGetType']" name="hidden">1</attr>
<attr path="/api/namespace/class[@cname='GtkGlobal']/method[@name='EnumeratePrinters']" name="hidden">1</attr>
<attr path="/api/namespace/class[@cname='GtkGlobal']/method[@name='IdentifierGetType']" name="hidden">1</attr>
<attr path="/api/namespace/class[@cname='GtkGlobal']/method[@name='PaintPolygon']/*/*[@name='points']" name="array">1</attr>
<attr path="/api/namespace/class[@cname='GtkGlobal']/method[@name='PaintPolygon']/*/*[@name='npoints']" name="name">n_points</attr>
@ -470,7 +471,9 @@
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method/*/*[@type='GtkTextIter*']" name="pass_as">ref</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='ApplyTagByName']" name="name">ApplyTag</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='DeleteMarkByName']" name="name">DeleteMark</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='Deserialize']/*/*[@name='data']" name="array">1</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetBounds']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetDeserializeFormats']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetEndIter']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetInsert']" name="name">GetInsertMark</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetIterAtChildAnchor']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
@ -480,6 +483,7 @@
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetIterAtMark']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetIterAtOffset']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetSelectionBounds']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetSerializeFormats']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetStartIter']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='Insert']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='InsertAtCursor']" name="hidden">1</attr>
@ -489,6 +493,7 @@
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='InsertWithTagsByName']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='MoveMarkByName']" name="name">MoveMark</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='RemoveTagByName']" name="name">RemoveTag</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='Serialize']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='SetText']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/signal[@name='ApplyTag']" name="name">TagApplied</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/signal[@name='BeginUserAction']" name="name">UserActionBegun</attr>

View file

@ -80,6 +80,7 @@ customs = \
Notebook.custom \
Object.custom \
Plug.custom \
Printer.custom \
RadioButton.custom \
RadioMenuItem.custom \
RadioToolButton.custom \

40
gtk/Printer.custom Normal file
View file

@ -0,0 +1,40 @@
// Printer.custom - customizations to Gtk.Printer
//
// Authors: Mike Kestner <mkestner@ximian.com>
//
// Copyright (c) 2006 Novell, Inc.
//
// 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("libgtk-win32-2.0-0.dll")]
static extern void gtk_enumerate_printers (GtkSharp.PrinterFuncNative func, IntPtr func_data, GLib.DestroyNotify destroy, bool wait);
public static void EnumeratePrinters (Gtk.PrinterFunc func, bool wait)
{
GtkSharp.PrinterFuncWrapper func_wrapper;
IntPtr func_data;
GLib.DestroyNotify destroy;
if (func == null) {
func_wrapper = null;
func_data = IntPtr.Zero;
destroy = null;
} else {
func_wrapper = new GtkSharp.PrinterFuncWrapper (func);
func_data = (IntPtr) GCHandle.Alloc (func_wrapper);
destroy = GLib.DestroyHelper.NotifyHandler;
}
gtk_enumerate_printers (func_wrapper.NativeDelegate, func_data, destroy, wait);
}

View file

@ -2,7 +2,7 @@
//
// Authors: Mike Kestner <mkestner@ximian.com>
//
// Copyright (c) 2004 Novell, Inc.
// Copyright (c) 2004-2006 Novell, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
@ -151,3 +151,50 @@ public void InsertAtCursor(string text)
GLib.Marshaller.Free (native);
}
[DllImport("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_text_buffer_serialize (IntPtr raw, IntPtr content_buffer, IntPtr format, ref Gtk.TextIter start, ref Gtk.TextIter end, out UIntPtr length);
public byte[] Serialize(Gtk.TextBuffer content_buffer, Gdk.Atom format, Gtk.TextIter start, Gtk.TextIter end)
{
UIntPtr length;
IntPtr raw_ret = gtk_text_buffer_serialize (Handle, content_buffer == null ? IntPtr.Zero : content_buffer.Handle, format == null ? IntPtr.Zero : format.Handle, ref start, ref end, out length);
if (raw_ret == IntPtr.Zero)
return new byte [0];
int sz = (int) (uint) length;
byte[] ret = new byte [sz];
Marshal.Copy (ret, 0, raw_ret, sz);
return ret;
}
[DllImport("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_text_buffer_get_serialize_formats(IntPtr raw, out int n_formats);
[DllImport("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_text_buffer_get_deserialize_formats(IntPtr raw, out int n_formats);
public Gdk.Atom[] DeserializeFormats {
get {
int n_formats;
IntPtr raw_ret = gtk_text_buffer_get_deserialize_formats(Handle, out n_formats);
Gdk.Atom[] result = new Gdk.Atom [n_formats];
for (int i = 0; i < n_formats; i++) {
IntPtr format = Marshal.ReadIntPtr (raw_ret, i * IntPtr.Size);
result [i] = format == IntPtr.Zero ? null : (Gdk.Atom) GLib.Opaque.GetOpaque (format, typeof (Gdk.Atom), false);
}
return result;
}
}
public Gdk.Atom[] SerializeFormats {
get {
int n_formats;
IntPtr raw_ret = gtk_text_buffer_get_serialize_formats(Handle, out n_formats);
Gdk.Atom[] result = new Gdk.Atom [n_formats];
for (int i = 0; i < n_formats; i++) {
IntPtr format = Marshal.ReadIntPtr (raw_ret, i * IntPtr.Size);
result [i] = format == IntPtr.Zero ? null : (Gdk.Atom) GLib.Opaque.GetOpaque (format, typeof (Gdk.Atom), false);
}
return result;
}
}