FmDndSrc

FmDndSrc — Libfm support for drag&drop source.

Synopsis

struct              FmDndSrc;
struct              FmDndSrcClass;
enum                FmDndSrcTarget;
FmDndSrc *          fm_dnd_src_new                      (GtkWidget *w);
void                fm_dnd_src_set_file                 (FmDndSrc *ds,
                                                         FmFileInfo *file);
void                fm_dnd_src_set_files                (FmDndSrc *ds,
                                                         FmFileInfoList *files);
void                fm_dnd_src_set_widget               (FmDndSrc *ds,
                                                         GtkWidget *w);

Object Hierarchy

  GObject
   +----FmDndSrc

Signals

  "data-get"                                       : Run First

Description

include: libfm/fm-dnd-src.h

The FmDndSrc is used to assign selection for Drag & Drop operations and deliver info about it to target widget when requested.

Details

struct FmDndSrc

struct FmDndSrc;

struct FmDndSrcClass

struct FmDndSrcClass {
	GObjectClass parent_class;
	void (*data_get)(FmDndSrc*);
};

GObjectClass parent_class;

the parent class

data_get ()

the class closure for the "data-get" signal

enum FmDndSrcTarget

typedef enum {
    FM_DND_SRC_TARGET_FM_LIST,
    FM_DND_SRC_TARGET_URI_LIST,
} FmDndSrcTarget;

default targets of drag source

FM_DND_SRC_TARGET_FM_LIST

direct pointer of FmList

FM_DND_SRC_TARGET_URI_LIST

"text/uri-list"

fm_dnd_src_new ()

FmDndSrc *          fm_dnd_src_new                      (GtkWidget *w);

Creates new drag source descriptor.

w :

the widget where source files are selected. [allow-none]

Returns :

a new FmDndSrc object. [transfer full]

Since 0.1.0


fm_dnd_src_set_file ()

void                fm_dnd_src_set_file                 (FmDndSrc *ds,
                                                         FmFileInfo *file);

Sets file as selection in the source descriptor.

ds :

the drag source descriptor

file :

files to set

Since 0.1.0


fm_dnd_src_set_files ()

void                fm_dnd_src_set_files                (FmDndSrc *ds,
                                                         FmFileInfoList *files);

Sets files as selection list in the source descriptor.

ds :

the drag source descriptor

files :

list of files to set

Since 0.1.0


fm_dnd_src_set_widget ()

void                fm_dnd_src_set_widget               (FmDndSrc *ds,
                                                         GtkWidget *w);

Resets drag source widget in ds.

ds :

the drag source descriptor

w :

the widget where source files are selected. [allow-none]

Since 0.1.0

Signal Details

The "data-get" signal

void                user_function                      (FmDndSrc *object,
                                                        gpointer  user_data)      : Run First

The "data-get" signal is emitted when information of source files is needed. Handler of the signal should then call fm_dnd_src_set_files() to provide info of dragged source files.

object :

the object which emitted the signal

user_data :

user data set when the signal handler was connected.

Since 0.1.0