/packages/gtk2/src/gtk+/gdk/gdkdnd.inc
Pascal | 143 lines | 84 code | 31 blank | 28 comment | 0 complexity | a96f665f5e465dcebd5f6bbc889bea9d MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
1// included by gdk2.pp 2 3{$IFDEF read_interface_types} 4 PGdkDragAction = ^TGdkDragAction; 5 TGdkDragAction = longint; // see below for possible values 6 7{ A root window with nobody claiming drags } 8{ Not a valid drag window } 9{ The simple WM_DROPFILES dnd } 10{ The complex OLE2 dnd (not implemented) } 11{ Intra-app } 12 PGdkDragProtocol = ^TGdkDragProtocol; 13 TGdkDragProtocol = (GDK_DRAG_PROTO_MOTIF,GDK_DRAG_PROTO_XDND, 14 GDK_DRAG_PROTO_ROOTWIN,GDK_DRAG_PROTO_NONE, 15 GDK_DRAG_PROTO_WIN32_DROPFILES,GDK_DRAG_PROTO_OLE2, 16 GDK_DRAG_PROTO_LOCAL); 17 18{< public > } 19{< private > } 20 PGdkDragContext = ^TGdkDragContext; 21 TGdkDragContext = record 22 parent_instance : TGObject; 23 protocol : TGdkDragProtocol; 24 is_source : gboolean; 25 source_window : PGdkWindow; 26 dest_window : PGdkWindow; 27 targets : PGList; 28 actions : TGdkDragAction; 29 suggested_action : TGdkDragAction; 30 action : TGdkDragAction; 31 start_time : guint32; 32 windowing_data : gpointer; 33 end; 34 35 PGdkDragContextClass = ^TGdkDragContextClass; 36 TGdkDragContextClass = record 37 parent_class : TGObjectClass; 38 end; 39 40{$ENDIF read_interface_types} 41 42//------------------------------------------------------------------------------ 43 44{$IFDEF read_interface_rest} 45const 46 // values for TGdkDragAction 47 GDK_ACTION_DEFAULT = 1 shl 0; 48 GDK_ACTION_COPY = 1 shl 1; 49 GDK_ACTION_MOVE = 1 shl 2; 50 GDK_ACTION_LINK = 1 shl 3; 51 GDK_ACTION_PRIVATE = 1 shl 4; 52 GDK_ACTION_ASK = 1 shl 5; 53 54 55{ Object that holds information about a drag in progress. 56 this is used on both source and destination sides. 57 } 58function GDK_TYPE_DRAG_CONTEXT : GType; 59function GDK_DRAG_CONTEXT(anObject : Pointer) : PGdkDragContext; 60function GDK_DRAG_CONTEXT_CLASS(klass : Pointer) : PGdkDragContextClass; 61function GDK_IS_DRAG_CONTEXT(anObject : Pointer) : boolean; 62function GDK_IS_DRAG_CONTEXT_CLASS(klass : Pointer) : boolean; 63function GDK_DRAG_CONTEXT_GET_CLASS(obj : Pointer) : PGdkDragContextClass; 64 65 66{ Drag and Drop } 67 68function gdk_drag_context_get_type:GType; cdecl; external gdklib; 69function gdk_drag_context_new:PGdkDragContext; cdecl; external gdklib; 70 71{$ifndef GDK_DISABLE_DEPRECATED} 72procedure gdk_drag_context_ref(context:PGdkDragContext); cdecl; external gdklib; 73procedure gdk_drag_context_unref(context:PGdkDragContext); cdecl; external gdklib; 74{$endif} 75 76 77{ Destination side } 78 79procedure gdk_drag_status(context:PGdkDragContext; action:TGdkDragAction; time:guint32); cdecl; external gdklib; 80function gdk_drag_drop_succeeded(context:PGdkDragContext):gboolean; cdecl; external gdklib; 81procedure gdk_drop_reply(context:PGdkDragContext; ok:gboolean; time:guint32); cdecl; external gdklib; 82procedure gdk_drop_finish(context:PGdkDragContext; success:gboolean; time:guint32); cdecl; external gdklib; 83function gdk_drag_get_selection(context:PGdkDragContext):TGdkAtom; cdecl; external gdklib; 84 85 86{ Source side } 87 88function gdk_drag_begin(window:PGdkWindow; targets:PGList):PGdkDragContext; cdecl; external gdklib; 89function gdk_drag_get_protocol_for_display(display:PGdkDisplay; xid:guint32; protocol:PGdkDragProtocol):guint32; cdecl; external gdklib; 90 91{$ifndef GDK_MULTIHEAD_SAFE} 92function gdk_drag_get_protocol(xid:guint32; protocol:PGdkDragProtocol):guint32; cdecl; external gdklib; 93{$endif} 94 95 96{ GDK_MULTIHEAD_SAFE } 97 98procedure gdk_drag_find_window(context:PGdkDragContext; drag_window:PGdkWindow; x_root:gint; y_root:gint; var dest_window:PGdkWindow; 99 protocol:PGdkDragProtocol); cdecl; external gdklib; 100procedure gdk_drag_find_window_for_screen(context:PGdkDragContext; drag_window:PGdkWindow; screen:PGdkScreen; x_root:gint; y_root:gint; var dest_window:PGdkWindow; 101 protocol:PGdkDragProtocol); cdecl; external gdklib; 102function gdk_drag_motion(context:PGdkDragContext; dest_window:PGdkWindow; protocol:TGdkDragProtocol; x_root:gint; y_root:gint; 103 suggested_action:TGdkDragAction; possible_actions:TGdkDragAction; time:guint32):gboolean; cdecl; external gdklib; 104procedure gdk_drag_drop(context:PGdkDragContext; time:guint32); cdecl; external gdklib; 105procedure gdk_drag_abort(context:PGdkDragContext; time:guint32); cdecl; external gdklib; 106{$endif read_interface_rest} 107 108//------------------------------------------------------------------------------ 109 110{$IFDEF read_implementation} 111function GDK_TYPE_DRAG_CONTEXT : GType; 112begin 113 GDK_TYPE_DRAG_CONTEXT:=gdk_drag_context_get_type; 114end; 115 116function GDK_DRAG_CONTEXT(anObject : Pointer) : PGdkDragContext; 117begin 118 GDK_DRAG_CONTEXT:=PGdkDragContext(G_TYPE_CHECK_INSTANCE_CAST(anObject, 119 GDK_TYPE_DRAG_CONTEXT)); 120end; 121 122function GDK_DRAG_CONTEXT_CLASS(klass : Pointer) : PGdkDragContextClass; 123begin 124 GDK_DRAG_CONTEXT_CLASS:=PGdkDragContextClass(G_TYPE_CHECK_CLASS_CAST(klass,GDK_TYPE_DRAG_CONTEXT)); 125end; 126 127function GDK_IS_DRAG_CONTEXT(anObject : Pointer) : boolean; 128begin 129 GDK_IS_DRAG_CONTEXT:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,GDK_TYPE_DRAG_CONTEXT); 130end; 131 132function GDK_IS_DRAG_CONTEXT_CLASS(klass : Pointer) : boolean; 133begin 134 GDK_IS_DRAG_CONTEXT_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,GDK_TYPE_DRAG_CONTEXT); 135end; 136 137function GDK_DRAG_CONTEXT_GET_CLASS(obj : Pointer) : PGdkDragContextClass; 138begin 139 GDK_DRAG_CONTEXT_GET_CLASS:=PGdkDragContextClass(G_TYPE_INSTANCE_GET_CLASS( 140 obj,GDK_TYPE_DRAG_CONTEXT)); 141end; 142 143{$ENDIF}