-
- if (format.GetType() == wxDF_TEXT)
- {
- wxTextDataObject *text_object = (wxTextDataObject*) data;
- wxString text( text_object->GetText() );
-
-#if wxUSE_UNICODE
- const wxWX2MBbuf s = text.mbc_str();
- int len = strlen(s);
-#else // more efficient in non-Unicode
- const char *s = text.c_str();
- int len = (int) text.Length();
-#endif
- gtk_selection_data_set(
- selection_data,
- GDK_SELECTION_TYPE_STRING,
- 8*sizeof(gchar),
- (unsigned char*) (const char*) s,
- len );
-
- return;
- }
-
- if (format.GetType() == wxDF_BITMAP)
- {
- wxBitmapDataObject *bitmap_object = (wxBitmapDataObject*) data;
-
- if (bitmap_object->GetDataSize() == 0) return;
-
- gtk_selection_data_set(
- selection_data,
- GDK_SELECTION_TYPE_STRING,
- 8*sizeof(gchar),
- (unsigned char*) bitmap_object->GetPngData(),
- (int) bitmap_object->GetDataSize() );
-
- return;
- }