Objetivos

Diferentes aplicaciones contienen diferentes tipos de datos, y podrían hacer esos datos disponibles en una variedad de formatos. gtkmm llama a estos tipos de datos objetivos.

For instance, gedit can supply and receive the "UTF8_STRING" target, so you can paste data into gedit from any application that supplies that target. Or two different image editing applications might supply and receive a variety of image formats as targets. As long as one application can receive one of the targets that the other supplies then you will be able to copy data from one to the other.

Un objetivo puede estar en una variedad de formatos binarios. Este capítulo, y los ejemplos, asumen que los datos están en texto de 8 bits. Esto permite usar un formato XML para los datos del portapapeles. Sin embargo, probablemente no sea apropiado para datos binarios como imágenes. Gtk::Clipboard proporciona sobrecargas que le permiten especificar el formato en mayor detalle si es necesario.

The Drag and Drop API uses the same mechanism. You should probably use the same data targets and formats for both Clipboard and Drag and Drop operations.