2004-10-05 Mike Kestner <mkestner@ximian.com>
* gtk/Gtk.metadata : hide Selection.GetTargets. * gtk/SelectionData.custom : impl Targets prop and add Selection, Target, and Type field accessors. * gtk/glue/selectiondata.c : field accessor glue. svn path=/trunk/gtk-sharp/; revision=34719
This commit is contained in:
parent
36263a9fde
commit
2ac6d65dc2
4 changed files with 83 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2004-10-05 Mike Kestner <mkestner@ximian.com>
|
||||
|
||||
* gtk/Gtk.metadata : hide Selection.GetTargets.
|
||||
* gtk/SelectionData.custom : impl Targets prop and add Selection,
|
||||
Target, and Type field accessors.
|
||||
* gtk/glue/selectiondata.c : field accessor glue.
|
||||
|
||||
2004-09-29 Mike Kestner <mkestner@ximian.com>
|
||||
|
||||
* gtk/Gtk.metadata : hide some ellipsis methods, add pass_as attrs.
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<attr path="/api/namespace/boxed[@cname='GtkBorder']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkIconSet']/method[@name='GetSizes']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkSelectionData']" name="opaque">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkSelectionData']/method[@name='GetTargets']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkSelectionData']/method[@name='GetText']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkSelectionData']/method[@name='SetText']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkSelectionData']/method[@name='Set']/*/*[@name='data']" name="type">guchar</attr>
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
// SelectionData.custom - customizations for Gtk.SelectionData
|
||||
//
|
||||
// Authors: Mike Kestner <mkestner@ximian.com>
|
||||
//
|
||||
// Copyright (c) 2004 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
|
||||
|
@ -65,3 +70,53 @@
|
|||
Set(type, format, data, data.Length);
|
||||
}
|
||||
|
||||
[DllImport("gtksharpglue")]
|
||||
private static extern IntPtr gtksharp_gtk_selection_data_get_selection (IntPtr selection_data);
|
||||
|
||||
public Gdk.Atom Selection {
|
||||
get {
|
||||
return new Gdk.Atom (gtksharp_gtk_selection_data_get_selection (Handle));
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("gtksharpglue")]
|
||||
private static extern IntPtr gtksharp_gtk_selection_data_get_target (IntPtr selection_data);
|
||||
|
||||
public Gdk.Atom Target {
|
||||
get {
|
||||
return new Gdk.Atom (gtksharp_gtk_selection_data_get_target (Handle));
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("libglib-2.0-0.dll")]
|
||||
static extern void g_free (IntPtr ptr);
|
||||
|
||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||
static extern bool gtk_selection_data_get_targets(IntPtr raw, out IntPtr targets, out int n_atoms);
|
||||
|
||||
public Gdk.Atom [] Targets {
|
||||
get {
|
||||
IntPtr target_ptr;
|
||||
int count;
|
||||
if (gtk_selection_data_get_targets (Handle, out target_ptr, out count)) {
|
||||
Gdk.Atom[] result = new Gdk.Atom [count];
|
||||
for (int i = 0; i < count; i++) {
|
||||
IntPtr atom = Marshal.ReadIntPtr (target_ptr, count * IntPtr.Size);
|
||||
result [i] = new Gdk.Atom (atom);
|
||||
}
|
||||
g_free (target_ptr);
|
||||
return result;
|
||||
} else
|
||||
return new Gdk.Atom [0];
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("gtksharpglue")]
|
||||
private static extern IntPtr gtksharp_gtk_selection_data_get_type (IntPtr selection_data);
|
||||
|
||||
public Gdk.Atom Type {
|
||||
get {
|
||||
return new Gdk.Atom (gtksharp_gtk_selection_data_get_type (Handle));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
gint gtksharp_gtk_selection_data_get_length (GtkSelectionData *data);
|
||||
gint gtksharp_gtk_selection_data_get_format (GtkSelectionData *data);
|
||||
guchar *gtksharp_gtk_selection_data_get_data_pointer (GtkSelectionData *data);
|
||||
GdkAtom gtksharp_gtk_selection_data_get_selection (GtkSelectionData *data);
|
||||
GdkAtom gtksharp_gtk_selection_data_get_target (GtkSelectionData *data);
|
||||
GdkAtom gtksharp_gtk_selection_data_get_type (GtkSelectionData *data);
|
||||
|
||||
guchar *
|
||||
gtksharp_gtk_selection_data_get_data_pointer (GtkSelectionData *data)
|
||||
|
@ -44,3 +47,20 @@ gtksharp_gtk_selection_data_get_format (GtkSelectionData *data)
|
|||
return data->format;
|
||||
}
|
||||
|
||||
GdkAtom
|
||||
gtksharp_gtk_selection_data_get_selection (GtkSelectionData *data)
|
||||
{
|
||||
return data->selection;
|
||||
}
|
||||
|
||||
GdkAtom
|
||||
gtksharp_gtk_selection_data_get_target (GtkSelectionData *data)
|
||||
{
|
||||
return data->target;
|
||||
}
|
||||
|
||||
GdkAtom
|
||||
gtksharp_gtk_selection_data_get_type (GtkSelectionData *data)
|
||||
{
|
||||
return data->type;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue