// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // List the contents of the macOS pasteboard // Build with: clang++ -g -Wall -o pasteboard pasteboard.mm -framework AppKit -framework UniformTypeIdentifiers #import #import #import #import static void usage() { std::cout << "Usage: pasteboard\n" " List the types on the pasteboard and in each pasteboard item.\n" " pasteboard -a\n" " Output the data for all types to stdout. Note: output will\n" " in many cases be binary. The different types are separated by a textual header.\n" " pasteboard -t type\n" " Output the data for the type in question to stdout. Note: output will\n" " in many cases be binary.\n"; } int main(int argc, char** argv) { NSString* requestedType = @""; int ch; while ((ch = getopt(argc, argv, "at:")) != -1) { switch (ch) { case 'a': requestedType = @"*"; break; case 't': requestedType = [NSString stringWithUTF8String:optarg]; break; case '?': usage(); return 0; } } argc -= optind; argv += optind; if (argc > 0) { usage(); return 1; } NSPasteboard* pb = [NSPasteboard generalPasteboard]; if ([requestedType isEqualToString:@"*"]) { NSArray* types = [pb types]; for (unsigned i = 0; i < [types count]; i++) { NSData* data = [pb dataForType:types[i]]; std::cout << i << ": " << [types[i] UTF8String] << ": " << std::to_string([data length]) << " bytes:\n"; if (data != nil) { std::cout.write((const char*)[data bytes], [data length]); std::cout << "\n"; } } return 0; } if ([requestedType length] > 0) { NSData* data = [pb dataForType:requestedType]; if (data == nil) std::cerr << "No data for " << [requestedType UTF8String] << std::endl; else std::cout.write((const char*)[data bytes], [data length]); return 0; } { NSArray* types = [pb types]; std::cout << "Types directly on pasteboard:\n"; for (unsigned i = 0; i < [types count]; i++) { std::cout << " " << i << ": " << [types[i] UTF8String] << "\n"; } } NSArray* items = [pb pasteboardItems]; std::cout << "New-style items on pasteboard:\n"; for (unsigned i = 0; i < [items count]; i++) { std::cout << " Item " << i << ", types:\n"; NSArray* types = [items[i] types]; for (unsigned j = 0; j < [types count]; j++) { std::cout << " " << j << ": " << [types[j] UTF8String] << std::flush; if ([types[j] isEqualToString:[UTTypePlainText identifier]] || [types[j] isEqualToString:[UTTypeUTF8PlainText identifier]] || [types[j] isEqualToString:[UTTypeText identifier]] || [types[j] isEqualToString:[UTTypeHTML identifier]] || [types[j] isEqualToString:[UTTypeRTF identifier]] || [types[j] isEqualToString:[UTTypeUTF16ExternalPlainText identifier]]) { NSString* string = [items[i] stringForType:NSPasteboardTypeString]; if ([string length] > 500) string = [[string substringToIndex:501] stringByAppendingString:@"..."]; std::cout << ": '" << [string UTF8String] << "'"; } std::cout << "\n"; } } return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ abora/cp-6.4'>distro/collabora/cp-6.4 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2023-03-07Resolves tdf#153344 - Resize Save icon in statusbar to 16pxHeiko Tietze
2023-03-04Related tdf#153344 - Resize Selection Mode icon in statusbar to 16pxHeiko Tietze
2023-03-01Related tdf#153344 - Resize Save icon in statusbar to 18pxHeiko Tietze
2023-02-23Revert "Resolves tdf#152947 - Accessibility for save status icon"Heiko Tietze
2023-01-25Resolves tdf#152947 - Accessibility for save status iconHeiko Tietze
2021-08-24elementary: tdf#143300 add criss-cross borderRizal Muttaqin
2021-07-22elementary tdf#143300 add diagonal border line iconsRizal Muttaqin
2021-03-28elementary: tdf#141285 new icons for status bar selection typeRizal Muttaqin
2021-01-31Breeze & elementary: tdf#140026 new List View iconRizal Muttaqin
2021-01-20elementary: tdf#125779, tdf#139056 update color to follow upstream brandRizal Muttaqin
2021-01-17tdf#139056 update ORANGE color to follow upstream brandRizal Muttaqin
2021-01-13elementary: tdf#139056 update VIOLET color to follow upstream brandRizal Muttaqin
2021-01-06elementary: tdf#139056 update GREEN color to follow upstream brandRizal Muttaqin
2021-01-03elementary: tdf#139056 update color to follow upstream brandRizal Muttaqin
2021-01-03elementary: tdf#139056 update BLUE color to follow upstream brandRizal Muttaqin
2020-12-27elementary: tdf#139056 update color to follow upstream brandRizal Muttaqin
2020-12-26elementary: tdf#139020 update arrow color to be more coherentRizal Muttaqin
2020-12-22elementary: various icon updatesRizal Muttaqin
2020-12-22elementary: tdf#139056 Update color to follow upstream's branding (2)Rizal Muttaqin
2020-12-21elementary: tdf#139056 Update color to follow upstream's brandingRizal Muttaqin
2020-12-07elementary: Update save icons & icons with multiple linesRizal Muttaqin
2020-09-12Breeze,Colibre,elementary,KJ,Sukapura: tdf#136593 icon for new Distribution u...Rizal Muttaqin
2020-07-13Icon themes: Fix for tdf#134768Rizal Muttaqin
2020-06-09Icon theme: tdf#133582 missing checkbox and radio button in gen envRizal Muttaqin
2020-04-27elementary: fix for tdf#125779: object handlers are too faintRizal Muttaqin
2020-04-08elementary: Update Gallery folders and DB record iconsRizal Muttaqin
2020-01-28elementary: Move wrong placed icons, delete unnessary iconsrizmut
2019-06-22elementary & KJ Updaterizmut
2019-06-18Colibre, elementary, KJ: Fix for tdf#107144rizmut
2019-06-17KJ & elementary: Fix for tdf#89884, tdf#124127rizmut
2019-06-13elementary: tdf#125794, fix Show Draw function iconsrizmut
2019-06-12KJ & elementary: tdf#125879, change wrapthrough iconsrizmut
2019-06-12elementary: tdf#120065, differentiate contour on/off wrap iconsrizmut
2019-06-10 tdf#125368, KJ: vcl, radio; elementary: res, snaprizmut
2019-06-06KJ & elementary: +/^ svx dir, elementary: ^ bezier & mimerizmut
2019-05-25KJ&elementary:+Impress place holder, etcRizal Muttaqin
2018-11-03elementary: ^mail merge, cell border color (related to tdf#120185),conditiona...Rizal Muttaqin
2018-11-01elementary: fix for tdf#111950, update Calc sidebar, add condition icon, dist...Rizal Muttaqin
2018-10-28elementary: Refix for tdf#119731, update presentation/slide related icons, ad...Rizal Muttaqin
2018-10-27elementary: fix for tdf#120831 & tdf#120300, related to tdf#119731, etcRizal Muttaqin
2018-10-22elementary: Finalize chart graphics, separate dbtable & regulaaaaaaaaaaaaar t...Rizal Muttaqin
2018-10-20elementary: fix for tdf#119073, + 32px chart configuration,3D setting, headin...Rizal Muttaqin
2018-10-17elementary: fix for tdf#120192, add more 32px, etcRizal Muttaqin
2018-09-24Remove accidental addition of executable bit under icon-themes/*Adolfo Jayme Barrientos
2018-09-24elementary: improve many icons, add more 32 pxRizal Muttaqin
2017-12-29Elementary-icons: fix table border iconsandreas kainz
2017-12-14Elementary-icons: remove font from svg filesandreas kainz
2017-12-11Elementary-icons 1.0 beta release svg files of ALL iconsandreas kainz