mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 08:23:19 +02:00
2003-12-26 Mike Kestner <mkestner@ximian.com>
* glue/selectiondata.c : new glue to make SelectionData opaque * glue/Makefile.am : add file * glue/makefile.win32 : add file * gtk/Gtk.metadata : mark SelectionData opaque, unhide Set method * gtk/SelectionData.custom : invoke glue methods for opaque fields. * gtk/gtk-api.xml : regen * sample/TestDnd.cs : update to new SelectionData API. svn path=/trunk/gtk-sharp/; revision=21502
This commit is contained in:
parent
7e9700901f
commit
9f3cd6ae80
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2003-12-26 Mike Kestner <mkestner@ximian.com>
|
||||||
|
|
||||||
|
* glue/selectiondata.c : new glue to make SelectionData opaque
|
||||||
|
* glue/Makefile.am : add file
|
||||||
|
* glue/makefile.win32 : add file
|
||||||
|
* gtk/Gtk.metadata : mark SelectionData opaque, unhide Set method
|
||||||
|
* gtk/SelectionData.custom : invoke glue methods for opaque fields.
|
||||||
|
* gtk/gtk-api.xml : regen
|
||||||
|
* sample/TestDnd.cs : update to new SelectionData API.
|
||||||
|
|
||||||
2003-12-21 John Luke <jluke@cfl.rr.com>
|
2003-12-21 John Luke <jluke@cfl.rr.com>
|
||||||
|
|
||||||
* glib/Idle.cs: add Remove method found in Alp Toker's platano
|
* glib/Idle.cs: add Remove method found in Alp Toker's platano
|
||||||
|
@ -17,6 +17,7 @@ BASESOURCES = \
|
|||||||
object.c \
|
object.c \
|
||||||
paned.c \
|
paned.c \
|
||||||
selection.c \
|
selection.c \
|
||||||
|
selectiondata.c \
|
||||||
slist.c \
|
slist.c \
|
||||||
style.c \
|
style.c \
|
||||||
type.c \
|
type.c \
|
||||||
|
@ -19,6 +19,7 @@ GLUE_OBJS = \
|
|||||||
object.o \
|
object.o \
|
||||||
paned.o \
|
paned.o \
|
||||||
selection.o \
|
selection.o \
|
||||||
|
selectiondata.o \
|
||||||
slist.o \
|
slist.o \
|
||||||
style.o \
|
style.o \
|
||||||
type.o \
|
type.o \
|
||||||
|
25
glue/selectiondata.c
Normal file
25
glue/selectiondata.c
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/* selectiondata.c : Glue to access fields of GtkSelectionData
|
||||||
|
*
|
||||||
|
* Author: Mike Kestner <mkestner@speakeasy.net>
|
||||||
|
*
|
||||||
|
* <c> 2003 Novell, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <gtk/gtkwidget.h>
|
||||||
|
#include <gtk/gtkselection.h>
|
||||||
|
|
||||||
|
gint gtksharp_gtk_selection_data_get_length (GtkSelectionData *data);
|
||||||
|
gint gtksharp_gtk_selection_data_get_format (GtkSelectionData *data);
|
||||||
|
|
||||||
|
gint
|
||||||
|
gtksharp_gtk_selection_data_get_length (GtkSelectionData *data)
|
||||||
|
{
|
||||||
|
return data->length;
|
||||||
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
gtksharp_gtk_selection_data_get_format (GtkSelectionData *data)
|
||||||
|
{
|
||||||
|
return data->format;
|
||||||
|
}
|
||||||
|
|
@ -2,8 +2,8 @@
|
|||||||
<metadata>
|
<metadata>
|
||||||
<attr path="/api/namespace/boxed[@cname='GtkBorder']" name="hidden">1</attr>
|
<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='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='GetText']" 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='Set']" 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='SetText']" name="hidden">1</attr>
|
||||||
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='BackwardSearch']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
|
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='BackwardSearch']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
|
||||||
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='BackwardToTagToggle']/*/*[@type='GtkTextTag*']" name="null_ok">1</attr>
|
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='BackwardToTagToggle']/*/*[@type='GtkTextTag*']" name="null_ok">1</attr>
|
||||||
|
@ -1,29 +1,33 @@
|
|||||||
|
[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")]
|
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||||
private static extern IntPtr gtk_selection_data_get_text (ref Gtk.SelectionData selection_data);
|
private static extern IntPtr gtk_selection_data_get_text (IntPtr selection_data);
|
||||||
|
|
||||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||||
private static extern void gtk_selection_data_set_text (ref Gtk.SelectionData selection_data, string str, int len);
|
private static extern void gtk_selection_data_set_text (IntPtr selection_data, string str, int len);
|
||||||
|
|
||||||
public string Text {
|
public string Text {
|
||||||
get {
|
get {
|
||||||
return GLibSharp.Marshaller.PtrToStringGFree (gtk_selection_data_get_text (ref this));
|
return GLibSharp.Marshaller.PtrToStringGFree (gtk_selection_data_get_text (Handle));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
gtk_selection_data_set_text (ref this, value, value.Length);
|
gtk_selection_data_set_text (Handle, value, value.Length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
|
||||||
static extern void gtk_selection_data_set (ref Gtk.SelectionData raw, IntPtr type, int format, byte[] data, int length);
|
|
||||||
|
|
||||||
public byte[] Data {
|
|
||||||
get {
|
|
||||||
byte[] ret = new byte[length];
|
|
||||||
Marshal.Copy (_data, ret, 0, length);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
gtk_selection_data_set (ref this, _type, format, value, value.Length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -11428,7 +11428,7 @@
|
|||||||
<field cname="ruler_scale" array_len="10" type="gdouble" />
|
<field cname="ruler_scale" array_len="10" type="gdouble" />
|
||||||
<field cname="subdivide" array_len="5" type="gint" />
|
<field cname="subdivide" array_len="5" type="gint" />
|
||||||
</struct>
|
</struct>
|
||||||
<boxed name="SelectionData" cname="GtkSelectionData">
|
<boxed name="SelectionData" cname="GtkSelectionData" opaque="1">
|
||||||
<field cname="selection" type="GdkAtom" />
|
<field cname="selection" type="GdkAtom" />
|
||||||
<field cname="target" type="GdkAtom" />
|
<field cname="target" type="GdkAtom" />
|
||||||
<field cname="type" type="GdkAtom" />
|
<field cname="type" type="GdkAtom" />
|
||||||
@ -11455,7 +11455,7 @@
|
|||||||
<method name="GetType" cname="gtk_selection_data_get_type" shared="true">
|
<method name="GetType" cname="gtk_selection_data_get_type" shared="true">
|
||||||
<return-type type="GType" />
|
<return-type type="GType" />
|
||||||
</method>
|
</method>
|
||||||
<method name="Set" cname="gtk_selection_data_set" hidden="1">
|
<method name="Set" cname="gtk_selection_data_set">
|
||||||
<return-type type="void" />
|
<return-type type="void" />
|
||||||
<parameters>
|
<parameters>
|
||||||
<parameter type="GdkAtom" name="type" />
|
<parameter type="GdkAtom" name="type" />
|
||||||
|
@ -331,7 +331,7 @@ public class TestDnd {
|
|||||||
|
|
||||||
private static void HandleTargetDragDataReceived (object sender, DragDataReceivedArgs args)
|
private static void HandleTargetDragDataReceived (object sender, DragDataReceivedArgs args)
|
||||||
{
|
{
|
||||||
if (args.SelectionData.length >=0 && args.SelectionData.format == 8) {
|
if (args.SelectionData.Length >=0 && args.SelectionData.Format == 8) {
|
||||||
Console.WriteLine ("Received {0} in trashcan", args.SelectionData);
|
Console.WriteLine ("Received {0} in trashcan", args.SelectionData);
|
||||||
Gtk.Drag.Finish (args.Context, true, false, args.Time);
|
Gtk.Drag.Finish (args.Context, true, false, args.Time);
|
||||||
}
|
}
|
||||||
@ -341,7 +341,7 @@ public class TestDnd {
|
|||||||
|
|
||||||
private static void HandleLabelDragDataReceived (object sender, DragDataReceivedArgs args)
|
private static void HandleLabelDragDataReceived (object sender, DragDataReceivedArgs args)
|
||||||
{
|
{
|
||||||
if (args.SelectionData.length >=0 && args.SelectionData.format == 8) {
|
if (args.SelectionData.Length >=0 && args.SelectionData.Format == 8) {
|
||||||
Console.WriteLine ("Received {0} in label", args.SelectionData);
|
Console.WriteLine ("Received {0} in label", args.SelectionData);
|
||||||
Gtk.Drag.Finish (args.Context, true, false, args.Time);
|
Gtk.Drag.Finish (args.Context, true, false, args.Time);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user