| Cuiterm Reference Manual |
|---|
#include <history.h> enum TargetType; GtkTargetList* dnd_get_file_target_list (void); GtkTargetList* dnd_get_dir_target_list (void); gint dnd_init_destination (GtkWidget *widget); gboolean on_main_widget_drag_motion (GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint time, gpointer user_data); void on_main_widget_drag_data_get (GtkWidget *widget, GdkDragContext *drag_context, GtkSelectionData *data, guint info, guint time, gpointer user_data);
typedef enum {
TargetTextUriList = 0,
TargetFileForInode = 1,
TargetFileForMode = 2,
TargetFileForOwner = 3,
TargetFileForGroupOwner = 4,
TargetFileForLinks = 5,
TargetUserName = 6,
TargetGroupName = 7,
TargetFileForSize = 8,
TargetFileForDate = 9,
TargetFileForName = 10,
TargetStringOption = 11,
TargetStringLongOption = 12,
TargetStringProgram = 13,
TargetUninitialized = 100
} TargetType;GtkTargetList* dnd_get_file_target_list (void);
Returns a GtkTargetList usefull for DND target for regular files.
| Returns : | a GtkTargetList list for file target sources |
GtkTargetList* dnd_get_dir_target_list (void);
Returns a GtkTargetList usefull for DND target for regular directories.
| Returns : | a GtkTargetList list for directory target sources |
gboolean on_main_widget_drag_motion (GtkWidget *widget,
GdkDragContext *drag_context,
gint x,
gint y,
guint time,
gpointer user_data);widget : | the GtkWidget where the motion has been found |
drag_context : | the drag context of the operation |
x : | the x coordinate of the mouse |
y : | the y coordinate of the mouse |
time : | the time when the motion was detected |
user_data : | the data given by the signal connection |
| Returns : | TRUE if the motion could be handled (always returns TRUE) |
void on_main_widget_drag_data_get (GtkWidget *widget,
GdkDragContext *drag_context,
GtkSelectionData *data,
guint info,
guint time,
gpointer user_data);Called when we initialized a DnD as a source widget and the target is asking the data. There are some problems with this function, namely:
(1) We store the DnD source CuiWidget with the main_widget object. This is not a nice solution IMHO.
widget : | the GtkTextView widget where the DnD was initiated |
drag_context : | the GdkDragContext we created at the begin |
data : | the GtkSelectionData we have to fill |
info : | the size of the data units |
time : | what was the time when the data was received |
user_data : | pointer to the data gave by the signal connection command |
| <<< The BASH Parser |