gtkIOStream
1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
|
#include <DragNDrop.H>
Public Member Functions | |
DragNDrop () | |
DragNDrop (GdkDragContext *context) | |
virtual | ~DragNDrop () |
Destructor. More... | |
void | setUserData (gpointer w) |
gpointer | getUserData () |
void | setDestDefaults (GtkDestDefaults destFlagsIn) |
GtkDestDefaults | getDestDefaults () |
void | setDragAction (GdkDragAction dragActionIn) |
GdkDragAction | getDragAction () |
void | getModifierType (GdkModifierType modifierTypeIn) |
GdkModifierType | getModifierType () |
GtkTargetEntry * | getTargetArray () |
DragNDrop & | operator<< (const GtkTargetEntry >e) |
DragNDrop & | operator>> (const GtkTargetEntry >e) |
DragNDrop & | operator<< (Widget &w) |
Private Member Functions | |
void | addToTargets (GdkAtom targetData) |
void | init () |
Static Private Member Functions | |
static void | addToTargetsStatic (gpointer targetData, gpointer data) |
Private Attributes | |
gpointer | userData |
If we want DND callbacks to operate on different user data, then this will store it here. More... | |
GtkDestDefaults | destFlags |
The drop flags, see setDestDefaults. More... | |
GdkDragAction | dragAction |
Action to take once the data is dropped. More... | |
GdkModifierType | modifierType |
The modifier which initiates the drag and drop process. More... | |
Class to setup a drag and drop set of targets for either a source or a sink. This class does a few things. Firstly it allows you to specify different target data types. Secondly, it allows you to specify custom user data to be used in the drag and drop calbbacks.
The data targets are in the inherited std::vector of GtkTargetEntry structures.
Setup data targets like so :
Set the user data for drag and drop callbacks like so :
An example of how to use this class is as follows :
Definition at line 66 of file DragNDrop.H.
|
inline |
Constructor
Definition at line 111 of file DragNDrop.H.
|
inline |
Construct a set of targets from a drag context.
context | The GdkDragContext which is passed around during a drag and drop process. See Widget::dragDropStatic for more information. |
Definition at line 118 of file DragNDrop.H.
|
inlinevirtual |
Destructor.
Definition at line 126 of file DragNDrop.H.
|
inlineprivate |
Add a GtkTargetEntry to the known list of targets.
Definition at line 83 of file DragNDrop.H.
|
inlinestaticprivate |
Method called on a GList object to add a target pointer to the targets.
targetData | A pointer to the specific instance of the GtkTargetEntry to add to the known target list. |
data | The pointer to the instance of this class to operate on. |
Definition at line 77 of file DragNDrop.H.
|
inline |
Retrieve the current state of the destFlags.
Definition at line 162 of file DragNDrop.H.
|
inline |
Get the current dragAction.
Definition at line 188 of file DragNDrop.H.
|
inline |
Get the modifier which initiates the drag operation.
modifierTypeIn | The modifier to use to start the drag and drop oepration. Known modifiers are : |
GDK_SHIFT_MASK the Shift key.
GDK_LOCK_MASK a Lock key (depending on the modifier mapping of the X server this may either be CapsLock or ShiftLock).
GDK_CONTROL_MASK the Control key.
GDK_MOD1_MASK the fourth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier, but normally it is the Alt key).
GDK_MOD2_MASK the fifth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).
GDK_MOD3_MASK the sixth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).
GDK_MOD4_MASK the seventh modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).
GDK_MOD5_MASK the eighth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).
GDK_BUTTON1_MASK the first mouse button.
GDK_BUTTON2_MASK the second mouse button.
GDK_BUTTON3_MASK the third mouse button.
GDK_BUTTON4_MASK the fourth mouse button.
GDK_BUTTON5_MASK the fifth mouse button.
GDK_SUPER_MASK the Super modifier.
GDK_HYPER_MASK the Hyper modifier.
GDK_META_MASK the Meta modifier.
GDK_MODIFIER_RESERVED_29_MASK A reserved bit flag; do not use in your own code
GDK_RELEASE_MASK not used in GDK itself. GTK+ uses it to differentiate between (keyval, modifiers) pairs from key press and release events.
GDK_MODIFIER_MASK a mask covering all modifier types.
Definition at line 233 of file DragNDrop.H.
|
inline |
Get the modifier which initiates the drag operation.
Definition at line 239 of file DragNDrop.H.
|
inline |
Get the pointer to the array of GtkTargetEntry variables.
Definition at line 246 of file DragNDrop.H.
|
inline |
Find which userData to be used by Widget::operator<< and Widget::operator>> to setup the drag and drop callbacks. NULL implies it will use the widget which executes the Widget::operator<< and Widget::operator>> methods.
Definition at line 138 of file DragNDrop.H.
|
inlineprivate |
Executed in the constructors to set the default member variables. Sets the following :
Definition at line 101 of file DragNDrop.H.
|
inline |
Add a particular type of target to be dragged and dropped.
gte | The GtkTargetEntry to add. |
Definition at line 257 of file DragNDrop.H.
Load in a widget and set as the user data.
Definition at line 278 of file DragNDrop.H.
|
inline |
Remove a particular type of target to be dragged and dropped.
gte | The GtkTargetEntry to remove. |
Definition at line 265 of file DragNDrop.H.
|
inline |
Alter the default set of flags for destination widgets. This only taked effect before the Widget::operator<<(DrageNDrop &) is called.
destFlagsIn | The new set of flags for the dest in. Possibilities are : |
GTK_DEST_DEFAULT_MOTION If set for a widget, GTK+, during a drag over this widget will check if the drag matches this widget’s list of possible targets and actions.
GTK_DEST_DEFAULT_HIGHLIGHT If set for a widget, GTK+ will draw a highlight on this widget as long as a drag is over this widget and the widget drag format and action are acceptable.
GTK_DEST_DEFAULT_DROP If set for a widget, when a drop occurs, GTK+ will will check if the drag matches this widget’s list of possible targets and actions.
GTK_DEST_DEFAULT_ALL If set, specifies that all default actions should be taken.
Definition at line 156 of file DragNDrop.H.
|
inline |
Sets the drag action once dropped.
dragActionIn | The action to take once dropped, possiblities are: |
GDK_ACTION_DEFAULT Means nothing, and should not be used.
GDK_ACTION_COPY Copy the data.
GDK_ACTION_MOVE Move the data, i.e. first copy it, then delete it from the source using the DELETE target of the X selection protocol.
GDK_ACTION_LINK Add a link to the data. Note that this is only useful if source and destination agree on what it means.
GDK_ACTION_PRIVATE Special action which tells the source that the destination will do something that the source doesn't understand.
GDK_ACTION_ASK Ask the user what to do with the data.
Definition at line 181 of file DragNDrop.H.
|
inline |
Use this if you want drag and drop methods to callback using different user data to the Widget instance which has the Widget::operator<< and Widget::operator>> methods.
w | The userData to pass to the drag and drop callbacks. |
Definition at line 131 of file DragNDrop.H.
|
private |
The drop flags, see setDestDefaults.
Definition at line 69 of file DragNDrop.H.
|
private |
Action to take once the data is dropped.
Definition at line 70 of file DragNDrop.H.
|
private |
The modifier which initiates the drag and drop process.
Definition at line 71 of file DragNDrop.H.
|
private |
If we want DND callbacks to operate on different user data, then this will store it here.
Definition at line 67 of file DragNDrop.H.
GTK+ IOStream
Beta
|