Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions
Xfc::Gtk::TargetList Class Reference

A GtkTargetList C++ wrapper class. More...

#include <xfc/gtk/selection.hh>

Inheritance diagram for Xfc::Gtk::TargetList:
Xfc::Object Xfc::Trackable

List of all members.

Public Member Functions

Constructors

Detailed Description

A GtkTargetList C++ wrapper class.

The selection mechanism provides the basis for different types of communication between processes. In particular, drag-and-drop and Clipboard work via selections. You will very seldom or never need to use most of the functions in this section directly; Clipboard provides a nicer interface to the same functionality. Some of the datatypes defined this section are used in the Clipboard and drag-and-drop API's as well.

The TargetList structure represents a list of data types that are supported when sending or receiving data. TargetList is only useful when you want to manually initiate drag and drop to have dynamic control.

Note: dynamically allocated objects must either be unreferenced or assigned to a smart pointer. Stack objects are automatically unreferenced when they go out of scope.

See also: the Selection HOWTO and example.


Constructor & Destructor Documentation

Xfc::Gtk::TargetList::TargetList ( const std::vector< TargetEntry > &  targets)

Construct a target list that contains the target entries in targets.

Parameters:
targetsThe vector of TargetEntry to add into the target list.

The TargetList is created with a reference count of 1 that the caller owns.

Xfc::Gtk::TargetList::TargetList ( GtkTargetList *  target_list)

Constructs a new TargetList from an existing GtkTargetList.

Parameters:
target_listA newly created GtkTargetList with a reference count of 1.

TargetList takes over the ownership of the GtkTargetList reference count, unreferencing the GtkTargetList when it is destroyed.


Member Function Documentation

void Xfc::Gtk::TargetList::add ( Gdk::Atom  target,
unsigned int  flags,
unsigned int  info 
)

Adds a target to the TargetList.

Parameters:
targetThe interned atom representing the target.
flagsThe flags for this target.
infoAn ID that will be passed back to the application.
void Xfc::Gtk::TargetList::add ( const TargetEntry entry)

Adds a TargetEntry to the target list.

Parameters:
entryThe TargetEntry to add.
void Xfc::Gtk::TargetList::add ( const std::vector< TargetEntry > &  targets)

Adds a vector of TargetEntry to the target list.

Parameters:
targetsThe vector of TargetEntry to add.
void Xfc::Gtk::TargetList::add_image_targets ( unsigned int  info,
bool  writable 
)

Adds the image targets supported by GTK+ selection to the target list.

Parameters:
infoAn ID that will be passed back to the application.
writableWhether to add only targets for which GTK+ knows how to convert a pixbuf into the format.

All targets are added with the same info.

void Xfc::Gtk::TargetList::add_text_targets ( unsigned int  info)

Adds the text targets supported by GTK+ selection to the target list.

Parameters:
infoAn ID that will be passed back to the application.

All targets are added with the same info.

void Xfc::Gtk::TargetList::add_uri_targets ( unsigned int  info)

Adds the URI targets supported by GTK+ selection to the target list.

Parameters:
infoAn ID that will be passed back to the application.

All targets are added with the same info.

bool Xfc::Gtk::TargetList::find ( Gdk::Atom  target,
unsigned int *  info 
)

Looks up a given target in the target list.

Parameters:
targetAn interned atom representing the target to search for.
infoA pointer to the location to store application info for target.
Returns:
true if the target was found, otherwise false.

Removes a target from a target list.

Parameters:
targetThe interned atom representing the target.

The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC