mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 08:23:19 +02:00
![Mike Kestner](/assets/img/avatar_default.png)
* gtk/Container.custom : add CallbackInvoke and use it in OnForall. 2004-05-19 Mike Kestner <mkestner@ximian.com> * generator/Makefile.am : add TimeTGen.cs * generator/SymbolTable.cs : use new TimeTGen. * generator/StringGen.cs : s/GLibSharp/GLib * generator/TimeTGen.cs : generatable to marshal time_t. * glib/time_t_CustomMarshaler.cs : kill * glib/Makefile.am : remove time_t_CustomMarshaler.cs * glib/Markup.cs : s/GLibSharp/GLib * glib/Marshaller.cs : move to GLib namespace. Add methods to marshal time_t to and from DateTime. * glib/glue/time_t.c : kill * glib/glue/Makefile.am : remove time_t.c * glib/glue/makefile.win32 : remove time_t.o * gnome/*.custom : use GLib.Marshaller instead of the time_t custom marshaler. * gtk/*.custom : s/GLibSharp/GLib svn path=/trunk/gtk-sharp/; revision=27704
53 lines
1.4 KiB
Plaintext
53 lines
1.4 KiB
Plaintext
[DllImport("gtksharpglue")]
|
|
private static extern int gtksharp_gtk_selection_data_get_format (IntPtr selection_data);
|
|
|
|
public int Format {
|
|
get {
|
|
return gtksharp_gtk_selection_data_get_format (Handle);
|
|
}
|
|
}
|
|
|
|
[DllImport("gtksharpglue")]
|
|
private static extern int gtksharp_gtk_selection_data_get_length (IntPtr selection_data);
|
|
|
|
public int Length {
|
|
get {
|
|
return gtksharp_gtk_selection_data_get_length (Handle);
|
|
}
|
|
}
|
|
|
|
[DllImport("libgtk-win32-2.0-0.dll")]
|
|
private static extern IntPtr gtk_selection_data_get_text (IntPtr selection_data);
|
|
|
|
[DllImport("libgtk-win32-2.0-0.dll")]
|
|
private static extern void gtk_selection_data_set_text (IntPtr selection_data, string str, int len);
|
|
|
|
public string Text {
|
|
get {
|
|
IntPtr text = gtk_selection_data_get_text (Handle);
|
|
if (text == IntPtr.Zero)
|
|
return null;
|
|
return GLib.Marshaller.PtrToStringGFree (text);
|
|
}
|
|
set {
|
|
gtk_selection_data_set_text (Handle, value, value.Length);
|
|
}
|
|
}
|
|
|
|
[DllImport("gtksharpglue")]
|
|
private static extern IntPtr gtksharp_gtk_selection_data_get_data_pointer (IntPtr selection_data);
|
|
|
|
public byte[] Data {
|
|
get {
|
|
IntPtr data_ptr = gtksharp_gtk_selection_data_get_data_pointer (Handle);
|
|
byte[] result = new byte [Length];
|
|
Marshal.Copy (data_ptr, result, 0, Length);
|
|
return result;
|
|
}
|
|
}
|
|
|
|
public void Set(Gdk.Atom type, int format, byte[] data) {
|
|
Set(type, format, data, data.Length);
|
|
}
|
|
|