gdk.DragContext.DragContext Class Reference

List of all members.

Detailed Description

Description These functions provide a low level interface for drag and drop.

The X backend of GDK supports both the Xdnd and Motif drag and drop protocols transparently, the Win32 backend supports the WM_DROPFILES protocol. GTK+ provides a higher level abstraction based on top of these functions, and so they are not normally needed in GTK+ applications. See the Drag and Drop section of the GTK+ documentation for more information.


Public Member Functions

GdkDragContextgetDragContextStruct ()
 this (GdkDragContext *gdkDragContext)
 Sets our main struct and passes it to the parent class.
GdkAtom gdkDragGetSelection ()
 Returns the selection atom for the current source window.
void gdkDragAbort (uint time)
 Aborts a drag without dropping.
void gdkDropReply (int ok, uint time)
 Accepts or rejects a drop.
void gdkDragDrop (uint time)
 Drops on the current destination.
void gdkDragFindWindow (Window dragWindow, int xRoot, int yRoot, GdkWindow **destWindow, GdkDragProtocol *protocol)
 Finds the destination window and DND protocol to use at the given pointer position.
void gdkDragFindWindowForScreen (Window dragWindow, Screen screen, int xRoot, int yRoot, GdkWindow **destWindow, GdkDragProtocol *protocol)
 Finds the destination window and DND protocol to use at the given pointer position.
void gdkDragContextRef ()
 Warning gdk_drag_context_ref is deprecated and should not be used in newly-written code.
int gdkDragMotion (Window destWindow, GdkDragProtocol protocol, int xRoot, int yRoot, GdkDragAction suggestedAction, GdkDragAction possibleActions, uint time)
 Updates the drag context when the pointer moves or the set of actions changes.
void gdkDropFinish (int success, uint time)
 Ends the drag operation after a drop.
void gdkDragContextUnref ()
 Warning gdk_drag_context_unref is deprecated and should not be used in newly-written code.
void gdkDragStatus (GdkDragAction action, uint time)
 Selects one of the actions offered by the drag source.
int gdkDragDropSucceeded ()
 Returns wether the dropped data has been successfully transferred.

Static Public Member Functions

static DragContext gdkDragContextNew ()
 Creates a new GdkDragContext.
static DragContext gdkDragBegin (Window window, ListG targets)
 Starts a drag and creates a new drag context for it.
static uint gdkDragGetProtocol (uint xid, GdkDragProtocol *protocol)
 Finds out the DND protocol supported by a window.
static uint gdkDragGetProtocolForDisplay (Display display, uint xid, GdkDragProtocol *protocol)
 Finds out the DND protocol supported by a window.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GdkDragContextgdkDragContext
 the main Gtk struct


Constructor & Destructor Documentation

gdk.DragContext.DragContext.this ( GdkDragContext gdkDragContext  ) 

Sets our main struct and passes it to the parent class.


Member Function Documentation

void gdk.DragContext.DragContext.gdkDragAbort ( uint  time  ) 

Aborts a drag without dropping.

This function is called by the drag source. context: a GdkDragContext. time_: the timestamp for this operation.

static DragContext gdk.DragContext.DragContext.gdkDragBegin ( Window  window,
ListG  targets 
) [static]

Starts a drag and creates a new drag context for it.

This function is called by the drag source. window: the source window for this drag. targets: the list of offered targets. Returns: a newly created GdkDragContext.

static DragContext gdk.DragContext.DragContext.gdkDragContextNew (  )  [static]

Creates a new GdkDragContext.

Returns: the newly created GdkDragContext.

void gdk.DragContext.DragContext.gdkDragContextRef (  ) 

Warning gdk_drag_context_ref is deprecated and should not be used in newly-written code.

Deprecated function; use g_object_ref() instead. context: a GdkDragContext.

void gdk.DragContext.DragContext.gdkDragContextUnref (  ) 

Warning gdk_drag_context_unref is deprecated and should not be used in newly-written code.

Deprecated function; use g_object_unref() instead. context: a GdkDragContext.

void gdk.DragContext.DragContext.gdkDragDrop ( uint  time  ) 

Drops on the current destination.

This function is called by the drag source. context: a GdkDragContext. time_: the timestamp for this operation.

int gdk.DragContext.DragContext.gdkDragDropSucceeded (  ) 

Returns wether the dropped data has been successfully transferred.

This function is intended to be used while handling a GDK_DROP_FINISHED event, its return value is meaningless at other times. context: a GdkDragContext Returns: TRUE if the drop was successful. Since 2.6

void gdk.DragContext.DragContext.gdkDragFindWindow ( Window  dragWindow,
int  xRoot,
int  yRoot,
GdkWindow **  destWindow,
GdkDragProtocol protocol 
)

Finds the destination window and DND protocol to use at the given pointer position.

This function is called by the drag source to obtain the dest_window and protocol parameters for gdk_drag_motion(). context: a GdkDragContext. drag_window: a window which may be at the pointer position, but should be ignored, since it is put up by the drag source as an icon. x_root: the x position of the pointer in root coordinates. y_root: the y position of the pointer in root coordinates. dest_window: location to store the destination window in. protocol: location to store the DND protocol in.

void gdk.DragContext.DragContext.gdkDragFindWindowForScreen ( Window  dragWindow,
Screen  screen,
int  xRoot,
int  yRoot,
GdkWindow **  destWindow,
GdkDragProtocol protocol 
)

Finds the destination window and DND protocol to use at the given pointer position.

This function is called by the drag source to obtain the dest_window and protocol parameters for gdk_drag_motion(). context: a GdkDragContext drag_window: a window which may be at the pointer position, but should be ignored, since it is put up by the drag source as an icon. screen: the screen where the destination window is sought. x_root: the x position of the pointer in root coordinates. y_root: the y position of the pointer in root coordinates. dest_window: location to store the destination window in. protocol: location to store the DND protocol in. Since 2.2

static uint gdk.DragContext.DragContext.gdkDragGetProtocol ( uint  xid,
GdkDragProtocol protocol 
) [static]

Finds out the DND protocol supported by a window.

xid: the X id of the destination window. protocol: location where the supported DND protocol is returned. Returns: the X id of the window where the drop should happen. This may be xid or the X id of a proxy window, or None if xid doesn't support Drag and Drop.

static uint gdk.DragContext.DragContext.gdkDragGetProtocolForDisplay ( Display  display,
uint  xid,
GdkDragProtocol protocol 
) [static]

Finds out the DND protocol supported by a window.

display: the GdkDisplay where the destination window resides xid: the X id of the destination window. protocol: location where the supported DND protocol is returned. Returns: the X id of the window where the drop should happen. This may be xid or the X id of a proxy window, or None if xid doesn't support Drag and Drop. Since 2.2

GdkAtom gdk.DragContext.DragContext.gdkDragGetSelection (  ) 

Returns the selection atom for the current source window.

context: a GdkDragContext. Returns: the selection atom.

int gdk.DragContext.DragContext.gdkDragMotion ( Window  destWindow,
GdkDragProtocol  protocol,
int  xRoot,
int  yRoot,
GdkDragAction  suggestedAction,
GdkDragAction  possibleActions,
uint  time 
)

Updates the drag context when the pointer moves or the set of actions changes.

This function is called by the drag source. context: a GdkDragContext. dest_window: the new destination window, obtained by gdk_drag_find_window(). protocol: the DND protocol in use, obtained by gdk_drag_find_window(). x_root: the x position of the pointer in root coordinates. y_root: the y position of the pointer in root coordinates. suggested_action: the suggested action. possible_actions: the possible actions. time_: the timestamp for this operation. Returns: FIXME

void gdk.DragContext.DragContext.gdkDragStatus ( GdkDragAction  action,
uint  time 
)

Selects one of the actions offered by the drag source.

This function is called by the drag destination in response to gdk_drag_motion() called by the drag source. context: a GdkDragContext. action: the selected action which will be taken when a drop happens, or 0 to indicate that a drop will not be accepted. time_: the timestamp for this operation.

void gdk.DragContext.DragContext.gdkDropFinish ( int  success,
uint  time 
)

Ends the drag operation after a drop.

This function is called by the drag destination. context: a GtkDragContext. success: TRUE if the data was successfully received. time_: the timestamp for this operation.

void gdk.DragContext.DragContext.gdkDropReply ( int  ok,
uint  time 
)

Accepts or rejects a drop.

This function is called by the drag destination in response to a drop initiated by the drag source. context: a GdkDragContext. ok: TRUE if the drop is accepted. time_: the timestamp for this operation.

GdkDragContext* gdk.DragContext.DragContext.getDragContextStruct (  ) 

void* gdk.DragContext.DragContext.getStruct (  )  [protected]

the main Gtk struct as a void*


Member Data Documentation

GdkDragContext* gdk.DragContext.DragContext.gdkDragContext [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo