Changeset 58470 in webkit
- Timestamp:
- Apr 28, 2010 9:13:23 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r58447 r58470 1 2010-04-28 Martin Robinson <mrobinson@webkit.org> 2 3 Reviewed by Gustavo Noronha. 4 5 [GTK] Enable DOM clipboard and drag-and-drop access 6 https://bugs.webkit.org/show_bug.cgi?id=30623 7 8 Make ClipboardGtk a "live" DataTransfer object, able to modify 9 the clipboard when setData(...) is called. 10 11 * platform/gtk/Skipped: Uncomment tests that are now passing. 12 1 13 2010-04-28 Evan Martin <evan@chromium.org> 2 14 -
trunk/LayoutTests/platform/gtk/Skipped
r58417 r58470 741 741 editing/deleting/type-delete-after-quote-2.html 742 742 editing/execCommand/4128080-2.html 743 editing/execCommand/copy-without-selection.html744 743 editing/execCommand/createLink.html 745 744 editing/execCommand/delete-image-in-anchor.html … … 774 773 editing/pasteboard/4744008.html 775 774 editing/pasteboard/5368833.html 776 editing/pasteboard/5665299.html777 775 editing/pasteboard/5780697-2.html 778 776 editing/pasteboard/copy-in-password-field.html 779 editing/pasteboard/copy-paste-float.html780 777 editing/pasteboard/drag-image-in-about-blank-frame.html 781 778 editing/pasteboard/file-input-files-access.html 782 779 editing/pasteboard/get-data-text-plain-drop.html 783 editing/pasteboard/get-data-text-plain-paste.html784 editing/pasteboard/onpaste-text-html.html785 editing/pasteboard/paste-blockquote-before-blockquote.html786 editing/pasteboard/paste-double-nested-blockquote-before-blockquote.html787 780 editing/pasteboard/paste-into-anchor-text.html 788 781 editing/pasteboard/paste-plaintext-user-select-none.html -
trunk/WebCore/ChangeLog
r58468 r58470 1 2010-04-28 Martin Robinson <mrobinson@webkit.org> 2 3 Reviewed by Gustavo Noronha. 4 5 [GTK] Enable DOM clipboard and drag-and-drop access 6 https://bugs.webkit.org/show_bug.cgi?id=30623 7 8 Make ClipboardGtk a "live" DataTransfer object, able to modify 9 the clipboard when setData(...) is called. 10 11 * platform/gtk/ClipboardGtk.cpp: 12 (WebCore::Editor::newGeneralClipboard): Pass the GtkClipboard into the factory method. 13 (WebCore::ClipboardGtk::ClipboardGtk): Create two separate constructors, one for DnD data and one for clipboard data. 14 (WebCore::dataObjectTypeFromHTMLClipboardType): Added. 15 (WebCore::ClipboardGtk::clearData): Clear the member DataObject, optionally write the clipboard. 16 (WebCore::ClipboardGtk::clearAllData): Ditto. 17 (WebCore::joinURIList): Added. 18 (WebCore::ClipboardGtk::getData): Get the data from the clipboard, if possible. 19 (WebCore::ClipboardGtk::setData): Write data to the DataObject and maybe the clipboard. 20 (WebCore::ClipboardGtk::types): Read the clipboard/DataObject to find applicable types. 21 (WebCore::ClipboardGtk::files): Read the clipboard/DataObject to find the files. 22 (WebCore::ClipboardGtk::writeURL): Write to the DataObject and maybe the clipboard. 23 (WebCore::ClipboardGtk::writeRange): Ditto. 24 (WebCore::ClipboardGtk::writePlainText): Ditto. 25 (WebCore::ClipboardGtk::hasData): Query the clipboard/DataObject. 26 * platform/gtk/ClipboardGtk.h: 27 (WebCore::ClipboardGtk::create): Added one factory for pasteboard-backed DataObjects and one for DnD-backed objects. 28 * platform/gtk/DataObjectGtk.cpp: 29 (WebCore::replaceNonBreakingSpaceWithSpace): Added this helper function to clean from plain text. 30 (WebCore::DataObjectGtk::markup): Actually return the range if it's set. 31 (WebCore::DataObjectGtk::setText): Clean from plain text. 32 (WebCore::DataObjectGtk::clearText): Added. 33 (WebCore::DataObjectGtk::clearMarkup): Added. 34 * platform/gtk/DataObjectGtk.h: 35 (WebCore::DataObjectGtk::clearURIList): Added. 36 (WebCore::DataObjectGtk::clearImage): Added. 37 * platform/gtk/PasteboardHelper.cpp: 38 (WebCore::PasteboardHelper::initializeTargetList): Added target ID's for URI list and Netscape URL targets. 39 (WebCore::urisToKURLVector): Added. 40 (WebCore::PasteboardHelper::getClipboardContents): Added. 41 (WebCore::PasteboardHelper::fillSelectionData): Added logic for URI lists and Netscape URLs. 42 (WebCore::PasteboardHelper::targetListForDataObject): Ditto. 43 * platform/gtk/PasteboardHelper.h: Added default argument to writeClipboardContents and new method. 44 1 45 2010-04-28 Martin Robinson <mrobinson@webkit.org> 2 46 -
trunk/WebCore/platform/gtk/ClipboardGtk.cpp
r56825 r58470 25 25 #include "Image.h" 26 26 #include "NotImplemented.h" 27 #include "Pasteboard.h" 28 #include "PasteboardHelper.h" 27 29 #include "RenderImage.h" 28 30 #include "StringHash.h" … … 33 35 namespace WebCore { 34 36 37 enum ClipboardType { 38 ClipboardTypeText, 39 ClipboardTypeMarkup, 40 ClipboardTypeURIList, 41 ClipboardTypeURL, 42 ClipboardTypeImage, 43 ClipboardTypeUnknown 44 }; 45 35 46 PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) 36 47 { 37 return ClipboardGtk::create(policy, false); 38 } 39 40 ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, bool forDragging) 48 return ClipboardGtk::create(policy, gtk_clipboard_get_for_display(gdk_display_get_default(), GDK_SELECTION_CLIPBOARD), false); 49 } 50 51 ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, GtkClipboard* clipboard) 52 : Clipboard(policy, false) 53 , m_dataObject(DataObjectGtk::forClipboard(clipboard)) 54 , m_clipboard(clipboard) 55 , m_helper(Pasteboard::generalPasteboard()->helper()) 56 { 57 } 58 59 ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, bool forDragging) 41 60 : Clipboard(policy, forDragging) 61 , m_dataObject(dataObject) 62 , m_clipboard(0) 63 , m_helper(Pasteboard::generalPasteboard()->helper()) 42 64 { 43 65 } … … 47 69 } 48 70 49 void ClipboardGtk::clearData(const String&) 50 { 51 notImplemented(); 52 } 71 static ClipboardType dataObjectTypeFromHTMLClipboardType(const String& rawType) 72 { 73 String type(rawType.stripWhiteSpace()); 74 75 // Two special cases for IE compatibility 76 if (type == "Text") 77 return ClipboardTypeText; 78 if (type == "URL") 79 return ClipboardTypeURL; 80 81 // From the Mac port: Ignore any trailing charset - JS strings are 82 // Unicode, which encapsulates the charset issue. 83 if (type == "text/plain" || type.startsWith("text/plain;")) 84 return ClipboardTypeText; 85 if (type == "text/html" || type.startsWith("text/html;")) 86 return ClipboardTypeMarkup; 87 if (type == "Files" || type == "text/uri-list" || type.startsWith("text/uri-list;")) 88 return ClipboardTypeURIList; 89 90 // Not a known type, so just default to using the text portion. 91 return ClipboardTypeUnknown; 92 } 93 94 void ClipboardGtk::clearData(const String& typeString) 95 { 96 if (policy() != ClipboardWritable) 97 return; 98 99 ClipboardType type = dataObjectTypeFromHTMLClipboardType(typeString); 100 switch (type) { 101 case ClipboardTypeURIList: 102 case ClipboardTypeURL: 103 m_dataObject->clearURIList(); 104 break; 105 case ClipboardTypeMarkup: 106 m_dataObject->clearMarkup(); 107 break; 108 case ClipboardTypeText: 109 m_dataObject->clearText(); 110 break; 111 case ClipboardTypeUnknown: 112 default: 113 m_dataObject->clear(); 114 } 115 116 if (m_clipboard) 117 m_helper->writeClipboardContents(m_clipboard); 118 } 119 53 120 54 121 void ClipboardGtk::clearAllData() 55 122 { 56 notImplemented(); 57 } 58 59 String ClipboardGtk::getData(const String&, bool &success) const 60 { 61 notImplemented(); 62 success = false; 123 if (policy() != ClipboardWritable) 124 return; 125 126 m_dataObject->clear(); 127 128 if (m_clipboard) 129 m_helper->writeClipboardContents(m_clipboard); 130 } 131 132 static String joinURIList(Vector<KURL> uriList) 133 { 134 if (uriList.isEmpty()) 135 return String(); 136 137 String joined(uriList[0].string()); 138 for (size_t i = 1; i < uriList.size(); i++) { 139 joined.append("\r\n"); 140 joined.append(uriList[i].string()); 141 } 142 143 return joined; 144 } 145 146 String ClipboardGtk::getData(const String& typeString, bool& success) const 147 { 148 success = false; // Pessimism. 149 if (policy() != ClipboardReadable || !m_dataObject) 150 return String(); 151 152 if (m_clipboard) 153 m_helper->getClipboardContents(m_clipboard); 154 155 ClipboardType type = dataObjectTypeFromHTMLClipboardType(typeString); 156 if (type == ClipboardTypeURIList) { 157 if (!m_dataObject->hasURIList()) 158 return String(); 159 success = true; 160 return joinURIList(m_dataObject->uriList()); 161 } 162 163 if (type == ClipboardTypeURL) { 164 if (!m_dataObject->hasURL()) 165 return String(); 166 success = true; 167 return m_dataObject->url(); 168 } 169 170 if (type == ClipboardTypeMarkup) { 171 if (!m_dataObject->hasMarkup()) 172 return String(); 173 success = true; 174 return m_dataObject->markup(); 175 } 176 177 if (type == ClipboardTypeText) { 178 if (!m_dataObject->hasText()) 179 return String(); 180 success = true; 181 return m_dataObject->text(); 182 } 183 63 184 return String(); 64 185 } 65 186 66 bool ClipboardGtk::setData(const String&, const String&) 67 { 68 notImplemented(); 69 return false; 187 bool ClipboardGtk::setData(const String& typeString, const String& data) 188 { 189 if (policy() != ClipboardWritable) 190 return false; 191 192 bool success = false; 193 ClipboardType type = dataObjectTypeFromHTMLClipboardType(typeString); 194 if (type == ClipboardTypeURIList || type == ClipboardTypeURL) { 195 Vector<KURL> uriList; 196 gchar** uris = g_uri_list_extract_uris(data.utf8().data()); 197 if (uris) { 198 gchar** currentURI = uris; 199 while (*currentURI) { 200 uriList.append(KURL(KURL(), *currentURI)); 201 currentURI++; 202 } 203 g_strfreev(uris); 204 m_dataObject->setURIList(uriList); 205 success = true; 206 } 207 } else if (type == ClipboardTypeMarkup) { 208 m_dataObject->setMarkup(data); 209 success = true; 210 } else if (type == ClipboardTypeText) { 211 m_dataObject->setText(data); 212 success = true; 213 } 214 215 if (success && m_clipboard) 216 m_helper->writeClipboardContents(m_clipboard); 217 218 return success; 70 219 } 71 220 72 221 HashSet<String> ClipboardGtk::types() const 73 222 { 74 notImplemented(); 75 return HashSet<String>(); 223 if (policy() != ClipboardReadable && policy() != ClipboardTypesReadable) 224 return HashSet<String>(); 225 226 if (m_clipboard) 227 m_helper->getClipboardContents(m_clipboard); 228 229 HashSet<String> types; 230 if (m_dataObject->hasText()) { 231 types.add("text/plain"); 232 types.add("Text"); 233 } 234 235 if (m_dataObject->hasMarkup()) 236 types.add("text/html"); 237 238 if (m_dataObject->hasURIList()) { 239 types.add("text/uri-list"); 240 types.add("URL"); 241 types.add("Files"); 242 } 243 244 return types; 76 245 } 77 246 78 247 PassRefPtr<FileList> ClipboardGtk::files() const 79 248 { 80 notImplemented(); 81 return 0; 249 if (policy() != ClipboardReadable) 250 return FileList::create(); 251 252 if (m_clipboard) 253 m_helper->getClipboardContents(m_clipboard); 254 255 RefPtr<FileList> fileList = FileList::create(); 256 Vector<String> fileVector(m_dataObject->files()); 257 258 for (size_t i = 0; i < fileVector.size(); i++) 259 fileList->append(File::create(fileVector[i])); 260 261 return fileList.release(); 82 262 } 83 263 … … 152 332 void ClipboardGtk::writeURL(const KURL& url, const String& label, Frame*) 153 333 { 154 GtkClipboard* textClipboard = gtk_clipboard_get(gdk_atom_intern_static_string("WebKitClipboardText")); 155 GtkClipboard* urlClipboard = gtk_clipboard_get(gdk_atom_intern_static_string("WebKitClipboardUrl")); 156 GtkClipboard* urlLabelClipboard = gtk_clipboard_get(gdk_atom_intern_static_string("WebKitClipboardUrlLabel")); 157 158 gtk_clipboard_clear(textClipboard); 159 gtk_clipboard_clear(urlClipboard); 160 gtk_clipboard_clear(urlLabelClipboard); 161 162 gtk_clipboard_set_text(textClipboard, url.string().utf8().data(), -1); 163 gtk_clipboard_set_text(urlClipboard, url.string().utf8().data(), -1); 164 gtk_clipboard_set_text(urlLabelClipboard, label.utf8().data(), -1); 334 String actualLabel(label); 335 if (actualLabel.isEmpty()) 336 actualLabel = url; 337 338 m_dataObject->setText(url.string()); 339 340 Vector<UChar> markup; 341 append(markup, "<a href=\""); 342 append(markup, url.string()); 343 append(markup, "\">"); 344 append(markup, label); 345 append(markup, "</a>"); 346 m_dataObject->setMarkup(String::adopt(markup)); 347 348 Vector<KURL> uriList; 349 uriList.append(url); 350 m_dataObject->setURIList(uriList); 351 352 if (m_clipboard) 353 m_helper->writeClipboardContents(m_clipboard); 165 354 } 166 355 167 356 void ClipboardGtk::writeRange(Range* range, Frame* frame) 168 357 { 169 GtkClipboard* textClipboard = gtk_clipboard_get(gdk_atom_intern_static_string("WebKitClipboardText")); 170 GtkClipboard* htmlClipboard = gtk_clipboard_get(gdk_atom_intern_static_string("WebKitClipboardHtml")); 171 172 gtk_clipboard_clear(textClipboard); 173 gtk_clipboard_clear(htmlClipboard); 174 175 gtk_clipboard_set_text(textClipboard, frame->selectedText().utf8().data(), -1); 176 gtk_clipboard_set_text(htmlClipboard, createMarkup(range, 0, AnnotateForInterchange).utf8().data(), -1); 358 ASSERT(range); 359 360 m_dataObject->setText(frame->selectedText()); 361 m_dataObject->setMarkup(createMarkup(range, 0, AnnotateForInterchange)); 362 363 if (m_clipboard) 364 m_helper->writeClipboardContents(m_clipboard); 177 365 } 178 366 179 367 void ClipboardGtk::writePlainText(const String& text) 180 368 { 181 GtkClipboard* textClipboard = gtk_clipboard_get(gdk_atom_intern_static_string("WebKitClipboardText")); 182 183 gtk_clipboard_clear(textClipboard); 184 185 gtk_clipboard_set_text(textClipboard, text.utf8().data(), -1); 186 } 187 369 m_dataObject->setText(text); 370 371 if (m_clipboard) 372 m_helper->writeClipboardContents(m_clipboard); 373 } 374 188 375 bool ClipboardGtk::hasData() 189 376 { 190 notImplemented(); 191 return false; 192 } 193 194 } 377 if (m_clipboard) 378 m_helper->getClipboardContents(m_clipboard); 379 380 return m_dataObject->hasText() || m_dataObject->hasMarkup() 381 || m_dataObject->hasURIList() || m_dataObject->hasImage(); 382 } 383 384 } -
trunk/WebCore/platform/gtk/ClipboardGtk.h
r54368 r58470 29 29 30 30 #include "Clipboard.h" 31 #include "DataObjectGtk.h" 32 33 typedef struct _GtkClipboard GtkClipboard; 31 34 32 35 namespace WebCore { 33 36 class CachedImage; 37 class PasteboardHelper; 34 38 35 39 // State available during IE's events for drag and drop and copy/paste … … 37 41 class ClipboardGtk : public Clipboard { 38 42 public: 43 static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, GtkClipboard* clipboard, bool isForDragging) 44 { 45 return adoptRef(new ClipboardGtk(policy, clipboard)); 46 } 47 39 48 static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, bool isForDragging) 40 49 { 41 return adoptRef(new ClipboardGtk(policy, isForDragging));50 return adoptRef(new ClipboardGtk(policy, DataObjectGtk::create(), isForDragging)); 42 51 } 43 52 virtual ~ClipboardGtk(); … … 66 75 67 76 private: 68 ClipboardGtk(ClipboardAccessPolicy, bool); 77 ClipboardGtk(ClipboardAccessPolicy, GtkClipboard*); 78 ClipboardGtk(ClipboardAccessPolicy, PassRefPtr<DataObjectGtk>, bool); 79 80 RefPtr<DataObjectGtk> m_dataObject; 81 GtkClipboard* m_clipboard; 82 PasteboardHelper* m_helper; 69 83 }; 70 84 } -
trunk/WebCore/platform/gtk/DataObjectGtk.cpp
r53264 r58470 25 25 namespace WebCore { 26 26 27 static void replaceNonBreakingSpaceWithSpace(String& str) 28 { 29 static const UChar NonBreakingSpaceCharacter = 0xA0; 30 static const UChar SpaceCharacter = ' '; 31 str.replace(NonBreakingSpaceCharacter, SpaceCharacter); 32 } 33 27 34 String DataObjectGtk::text() 28 35 { … … 35 42 { 36 43 if (m_range) 37 createMarkup(m_range.get(), 0, AnnotateForInterchange);44 return createMarkup(m_range.get(), 0, AnnotateForInterchange); 38 45 return m_markup; 39 46 } … … 43 50 m_range = 0; 44 51 m_text = newText; 52 replaceNonBreakingSpaceWithSpace(m_text); 45 53 } 46 54 … … 49 57 m_range = 0; 50 58 m_markup = newMarkup; 59 } 60 61 void DataObjectGtk::clearText() 62 { 63 m_range = 0; 64 m_text = ""; 65 } 66 67 void DataObjectGtk::clearMarkup() 68 { 69 m_range = 0; 70 m_markup = ""; 51 71 } 52 72 -
trunk/WebCore/platform/gtk/DataObjectGtk.h
r56825 r58470 51 51 bool hasURIList() { return !m_uriList.isEmpty(); } 52 52 bool hasImage() { return m_image; } 53 void clearURIList() { m_uriList.clear(); } 54 void clearImage() { m_image = 0; } 53 55 GdkDragContext* dragContext() { return m_dragContext.get(); } 54 56 … … 62 64 String urlLabel(); 63 65 void clear(); 66 void clearText(); 67 void clearMarkup(); 64 68 65 69 static DataObjectGtk* forClipboard(GtkClipboard*); -
trunk/WebCore/platform/gtk/PasteboardHelper.cpp
r57901 r58470 27 27 #include "Page.h" 28 28 #include "Pasteboard.h" 29 #include "TextResourceDecoder.h" 29 30 #include <gtk/gtk.h> 30 31 #include <wtf/gobject/GOwnPtr.h> … … 33 34 34 35 static GdkAtom gdkMarkupAtom = gdk_atom_intern("text/html", FALSE); 36 static GdkAtom netscapeURLAtom = gdk_atom_intern("_NETSCAPE_URL", FALSE); 37 static GdkAtom uriListAtom = gdk_atom_intern("text/uri-list", FALSE); 35 38 36 39 PasteboardHelper::PasteboardHelper() … … 49 52 gtk_target_list_add_text_targets(m_targetList, getIdForTargetType(TargetTypeText)); 50 53 gtk_target_list_add(m_targetList, gdkMarkupAtom, 0, getIdForTargetType(TargetTypeMarkup)); 54 gtk_target_list_add_uri_targets(m_targetList, getIdForTargetType(TargetTypeURIList)); 55 gtk_target_list_add(m_targetList, netscapeURLAtom, 0, getIdForTargetType(TargetTypeNetscapeURL)); 51 56 } 52 57 … … 85 90 } 86 91 92 static Vector<KURL> urisToKURLVector(gchar** uris) 93 { 94 ASSERT(uris); 95 96 Vector<KURL> uriList; 97 for (int i = 0; *(uris + i); i++) 98 uriList.append(KURL(KURL(), *(uris + i))); 99 100 return uriList; 101 } 102 103 void PasteboardHelper::getClipboardContents(GtkClipboard* clipboard) 104 { 105 DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); 106 ASSERT(dataObject); 107 108 if (gtk_clipboard_wait_is_text_available(clipboard)) { 109 GOwnPtr<gchar> textData(gtk_clipboard_wait_for_text(clipboard)); 110 if (textData) 111 dataObject->setText(String::fromUTF8(textData.get())); 112 } 113 114 if (gtk_clipboard_wait_is_target_available(clipboard, gdkMarkupAtom)) { 115 if (GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard, gdkMarkupAtom)) { 116 RefPtr<TextResourceDecoder> decoder(TextResourceDecoder::create("text/plain", "UTF-8", true)); 117 String markup(decoder->decode(reinterpret_cast<char*>(data->data), data->length)); 118 markup += decoder->flush(); 119 dataObject->setMarkup(markup); 120 gtk_selection_data_free(data); 121 } 122 } 123 124 if (gtk_clipboard_wait_is_target_available(clipboard, uriListAtom)) { 125 if (GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard, uriListAtom)) { 126 gchar** uris = gtk_selection_data_get_uris(data); 127 if (uris) { 128 dataObject->setURIList(urisToKURLVector(uris)); 129 g_strfreev(uris); 130 } 131 gtk_selection_data_free(data); 132 } 133 } 134 } 135 87 136 void PasteboardHelper::fillSelectionData(GtkSelectionData* selectionData, guint info, DataObjectGtk* dataObject) 88 137 { 89 138 if (info == getIdForTargetType(TargetTypeText)) 90 139 gtk_selection_data_set_text(selectionData, dataObject->text().utf8().data(), -1); 140 91 141 else if (info == getIdForTargetType(TargetTypeMarkup)) { 92 142 GOwnPtr<gchar> markup(g_strdup(dataObject->markup().utf8().data())); 93 143 gtk_selection_data_set(selectionData, selectionData->target, 8, 94 reinterpret_cast<const guchar*>(markup.get()), 95 strlen(markup.get())); 144 reinterpret_cast<const guchar*>(markup.get()), strlen(markup.get())); 145 146 } else if (info == getIdForTargetType(TargetTypeURIList)) { 147 Vector<KURL> uriList(dataObject->uriList()); 148 gchar** uris = g_new0(gchar*, uriList.size() + 1); 149 for (size_t i = 0; i < uriList.size(); i++) 150 uris[i] = g_strdup(uriList[i].string().utf8().data()); 151 152 gtk_selection_data_set_uris(selectionData, uris); 153 g_strfreev(uris); 154 155 } else if (info == getIdForTargetType(TargetTypeNetscapeURL) && dataObject->hasURL()) { 156 String url(dataObject->url()); 157 String result(url); 158 result.append("\n"); 159 160 if (dataObject->hasText()) 161 result.append(dataObject->text()); 162 else 163 result.append(url); 164 165 GOwnPtr<gchar> resultData(g_strdup(result.utf8().data())); 166 gtk_selection_data_set(selectionData, selectionData->target, 8, 167 reinterpret_cast<const guchar*>(resultData.get()), strlen(resultData.get())); 96 168 } 97 169 } … … 106 178 if (dataObject->hasMarkup()) 107 179 gtk_target_list_add(list, gdkMarkupAtom, 0, getIdForTargetType(TargetTypeMarkup)); 180 181 if (dataObject->hasURIList()) { 182 gtk_target_list_add_uri_targets(list, getIdForTargetType(TargetTypeURIList)); 183 gtk_target_list_add(list, netscapeURLAtom, 0, getIdForTargetType(TargetTypeNetscapeURL)); 184 } 108 185 109 186 return list; -
trunk/WebCore/platform/gtk/PasteboardHelper.h
r57901 r58470 51 51 GtkTargetList* targetList() const; 52 52 void fillSelectionData(GtkSelectionData*, guint, DataObjectGtk*); 53 void writeClipboardContents(GtkClipboard*, GClosure*); 53 void writeClipboardContents(GtkClipboard*, GClosure* closure = 0); 54 void getClipboardContents(GtkClipboard*); 54 55 55 56 enum PasteboardTargetType { TargetTypeText, TargetTypeMarkup, TargetTypeURIList, TargetTypeNetscapeURL, TargetTypeImage, TargetTypeUnknown };
Note: See TracChangeset
for help on using the changeset viewer.