1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>GTK+ Foundation Classes</title>
<link href="gfc.css" rel="stylesheet" type="text/css">
<meta content="The GFC Development Team" name="author">
<meta content="Core Library Reference Manual" name="description">
</head>
<body style="color: rgb(0, 0, 0); background-color: rgb(243, 244, 248);"
alink="#000099" link="#000099" vlink="#990099">
<table style="text-align: left; width: 1227px; height: 117px;"
border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td
style="text-align: center; background-color: rgb(255, 255, 255); width: 220px; vertical-align: top;"><img
alt="GFC Logo" src="../images/gfc.png"
style="width: 207px; height: 92px;"></td>
<td
style="text-align: center; background-color: rgb(87, 107, 152); vertical-align: middle;"><img
alt="GFC Title Logo" src="../images/gfc-title.png"
style="width: 418px; height: 76px;"><br>
</td>
</tr>
<tr>
<td
style="text-align: center; background-color: rgb(65, 77, 104); vertical-align: middle;"><big><span
style="color: rgb(255, 255, 153); font-weight: bold;">Reference Manual</span></big><br>
</td>
<td
style="text-align: center; background-color: rgb(148, 164, 200); vertical-align: middle;"><small
style="font-family: helvetica,arial,sans-serif;"><a
href="../html/index.html">Main Page</a> | <a
href="../html/namespaces.html">Namespace List</a> | <a
href="classes.html">Alphabetical List</a> | <a
href="../html/annotated.html">Class List</a> | <a
href="../html/files.html">File List</a></small><br>
</td>
</tr>
</tbody>
</table>
<small> </small>
</body>
</html>
<!-- Generated by Doxygen 1.3.8 -->
<h1>GFC::Gtk::Clipboard Class Reference</h1>A GtkClipboard C++ wrapper class.
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="clipboard_8hh-source.html">gfc/gtk/clipboard.hh</a>></code>
<p>
<p>Inheritance diagram for GFC::Gtk::Clipboard:
<p><center><img src="classGFC_1_1Gtk_1_1Clipboard.png" usemap="#GFC::Gtk::Clipboard_map" border="0" alt=""></center>
<map name="GFC::Gtk::Clipboard_map">
<area doxygen="gfccore.tag:" href="classGFC_1_1G_1_1Object.html" alt="GFC::G::Object" shape="rect" coords="0,112,134,136">
<area doxygen="gfccore.tag:" href="classGFC_1_1G_1_1TypeInstance.html" alt="GFC::G::TypeInstance" shape="rect" coords="0,56,134,80">
<area doxygen="gfccore.tag:" href="classGFC_1_1Trackable.html" alt="GFC::Trackable" shape="rect" coords="0,0,134,24">
</map>
<a href="classGFC_1_1Gtk_1_1Clipboard-members.html">List of all members.</a><h2>Public Types</h2>
<ul>
<li>typedef sigc::slot< void,<br>
const <a class="el" href="classGFC_1_1Gtk_1_1SelectionData.html">SelectionData</a> & > <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w0">ReceivedSlot</a>
<dl class="el"><dd class="mdescRight">Signature of the callback slot to be called when the results of <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_3">request_contents()</a> are received, or when the request fails. <a href="#w0"></a><br></dl><li>typedef sigc::slot< void,<br>
const <a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1String.html">String</a> & > <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w1">TextReceivedSlot</a>
<dl class="el"><dd class="mdescRight">Signature of the callback slot to be called when the results of <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_4">request_text()</a> are received, or when the request fails. <a href="#w1"></a><br></dl><li>typedef sigc::slot< void,<br>
const std::vector< <a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a> > & > <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w2">TargetsReceivedSlot</a>
<dl class="el"><dd class="mdescRight">Signature of the callback slot to be called when the results of <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_5">request_targets()</a> are received, or when the request fails. <a href="#w2"></a><br></dl><li>typedef sigc::slot< void,<br>
<a class="el" href="classGFC_1_1Gtk_1_1SelectionData.html">SelectionData</a> &, unsigned <br>
int > <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w3">GetSlot</a>
<dl class="el"><dd class="mdescRight">Signature of the callback slot that will be called to provide the contents of the selection. <a href="#w3"></a><br></dl><li>typedef sigc::slot< void > <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w4">ClearSlot</a>
<dl class="el"><dd class="mdescRight">Signature of the callback slot that will be called when the contents of the clipboard are changed or cleared. <a href="#w4"></a><br></dl></ul>
<h2>Public Member Functions</h2>
<tr><td colspan="2"><div class="groupHeader">Constructors</div></td></tr>
<ul>
<li><a class="anchor" name="z421_0" doxytag="GFC::Gtk::Clipboard::~Clipboard" ></a>
virtual <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z421_0">~Clipboard</a> ()
<dl class="el"><dd class="mdescRight">Destructor. <br></dl></ul>
<tr><td colspan="2"><div class="groupHeader">Accessors</div></td></tr>
<ul>
<li><a class="anchor" name="z422_0" doxytag="GFC::Gtk::Clipboard::gtk_clipboard" ></a>
GtkClipboard * <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z422_0">gtk_clipboard</a> () const
<dl class="el"><dd class="mdescRight">Get a pointer to the GtkClipboard structure. <br></dl><li><a class="anchor" name="z422_1" doxytag="GFC::Gtk::Clipboard::operator GtkClipboard *" ></a>
<a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z422_1">operator GtkClipboard *</a> () const
<dl class="el"><dd class="mdescRight">Conversion operator; safely converts a <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html">Clipboard</a> to a GtkClipboard pointer. <br></dl><li><a class="el" href="classGFC_1_1Gdk_1_1Display.html">Gdk::Display</a> * <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z422_2">get_display</a> () const
<dl class="el"><dd class="mdescRight">Gets the <a class="el" href="classGFC_1_1Gdk_1_1Display.html">Gdk::Display</a> associated with the clipboard. <a href="#z422_2"></a><br></dl></ul>
<tr><td colspan="2"><div class="groupHeader">Methods</div></td></tr>
<ul>
<li>bool <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_0">set</a> (const std::vector< <a class="el" href="classGFC_1_1Gtk_1_1TargetEntry.html">TargetEntry</a> > &targets, const <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w3">GetSlot</a> &get, const <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w4">ClearSlot</a> &clear)
<dl class="el"><dd class="mdescRight">Sets the contents of the specified clipboard. <a href="#z423_0"></a><br></dl><li>void <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_1">clear</a> ()
<dl class="el"><dd class="mdescRight">Clears the contents of the clipboard. <a href="#z423_1"></a><br></dl><li>void <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_2">set_text</a> (const <a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1String.html">String</a> &text)
<dl class="el"><dd class="mdescRight">Sets the contents of the clipboard to the given UTF-8 string. <a href="#z423_2"></a><br></dl><li>void <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_3">request_contents</a> (<a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a> target, const <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w0">ReceivedSlot</a> &received) const
<dl class="el"><dd class="mdescRight">Requests the contents of clipboard as the given target. <a href="#z423_3"></a><br></dl><li>void <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_4">request_text</a> (const <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w1">TextReceivedSlot</a> &received) const
<dl class="el"><dd class="mdescRight">Requests the contents of the clipboard as text. <a href="#z423_4"></a><br></dl><li>void <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_5">request_targets</a> (const <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w2">TargetsReceivedSlot</a> &received)
<dl class="el"><dd class="mdescRight">Requests the contents of the clipboard as list of supported targets. <a href="#z423_5"></a><br></dl><li><a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1Pointer.html">Pointer</a>< <a class="el" href="classGFC_1_1Gtk_1_1SelectionData.html">SelectionData</a> > <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_6">wait_for_contents</a> (<a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a> target) const
<dl class="el"><dd class="mdescRight">Requests the contents of the clipboard using the given target. <a href="#z423_6"></a><br></dl><li><a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1String.html">String</a> <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_7">wait_for_text</a> () const
<dl class="el"><dd class="mdescRight">Requests the contents of the clipboard as text and converts the result to UTF-8 if necessary. <a href="#z423_7"></a><br></dl><li>bool <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_8">wait_is_text_available</a> () const
<dl class="el"><dd class="mdescRight">Test to see if there is text available to be pasted. <a href="#z423_8"></a><br></dl><li>bool <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_9">wait_for_targets</a> (std::vector< <a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a> > &targets) const
<dl class="el"><dd class="mdescRight">Returns a vector of targets that are present on the clipboard, or an empty vector if there aren't any targets available. <a href="#z423_9"></a><br></dl></ul>
<h2>Static Public Member Functions</h2>
<ul>
<li><a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html">Clipboard</a> * <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#e0">get</a> (<a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a> selection, const <a class="el" href="classGFC_1_1Gdk_1_1Display.html">Gdk::Display</a> *display=0)
<dl class="el"><dd class="mdescRight">Returns the clipboard object for the given selection. <a href="#e0"></a><br></dl><li><a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html">Clipboard</a> * <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#e1">get_default</a> (const <a class="el" href="classGFC_1_1Gdk_1_1Display.html">Gdk::Display</a> *display=0)
<dl class="el"><dd class="mdescRight">Returns the default clipboard object for <em>display</em> (see <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#e0">get()</a> for details). <a href="#e1"></a><br></dl><li><a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html">Clipboard</a> * <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#e2">get_primary</a> (const <a class="el" href="classGFC_1_1Gdk_1_1Display.html">Gdk::Display</a> *display=0)
<dl class="el"><dd class="mdescRight">Returns the primary clipboard object (see <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#e0">get()</a> for details). <a href="#e2"></a><br></dl></ul>
<h2>Protected Member Functions</h2>
<tr><td colspan="2"><div class="groupHeader">Constructors</div></td></tr>
<ul>
<li><a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z420_0">Clipboard</a> (GtkClipboard *clipboard, bool <a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1Trackable.html#z143_1">owns_reference</a>=false)
<dl class="el"><dd class="mdescRight">Construct a new <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html">Clipboard</a> from an existing GtkClipboard. <a href="#z420_0"></a><br></dl></ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A GtkClipboard C++ wrapper class.
<p>
The <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html">Clipboard</a> object represents a clipboard of data shared between different processes or between different widgets in the same process. Each clipboard is identified by a name encoded as a <a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a>. (Conversion to and from strings can be done with gdk_atom_intern() and gdk_atom_name().) The default clipboard corresponds to the "CLIPBOARD" atom; another commonly used clipboard is the "PRIMARY" clipboard, which, in X, traditionally contains the currently selected text.<p>
To support having a number of different formats on the clipboard at the same time, the clipboard mechanism allows providing callbacks instead of the actual data. When you set the contents of the clipboard, you can either supply the data directly (via functions like <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_2">Gtk::Clipboard::set_text()</a>), or you can supply a <em>slot</em> to be called at a later time when the data is needed (via <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_0">Gtk::Clipboard::set()</a>). Providing a slot also avoids having to make copies of the data when it is not needed. When the clear_slot you provided is called, you simply free any data.<p>
Requesting the data from the clipboard is essentially asynchronous. If the contents of the clipboard are provided within the same process, then a direct function call will be made to retrieve the data, but if they are provided by another process, then the data needs to be retrieved from the other process, which may take some time. To avoid blocking the user interface, the call to request the selection, <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_3">Gtk::Clipboard::request_contents()</a> takes a slot that will be called when the contents are received (or when the request fails.) If you don't want to deal with providing a separate slot, you can also use <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_6">Gtk::Clipboard::wait_for_contents()</a>. What this does is run the main loop recursively waiting for the contents. This can simplify the code flow, but you still have to be aware that other slots in your program can be called while this recursive mainloop is running.<p>
Along with the functions to get the clipboard contents as an arbitrary data chunk, there are also methods to retrieve it as text, <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_4">Gtk::Clipboard::request_text()</a> and <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_7">Gtk::Clipboard::wait_for_text()</a>. These methods take care of determining which formats are advertised by the clipboard provider, asking for the clipboard in the best available format and converting the results into the UTF-8 encoding. (The standard form for representing strings in GTK+.)
<p>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="w4" doxytag="GFC::Gtk::Clipboard::ClearSlot" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef sigc::slot<void> <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w4">GFC::Gtk::Clipboard::ClearSlot</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Signature of the callback slot that will be called when the contents of the clipboard are changed or cleared.
<p>
<b>Example:</b> Method signature for ClearSlot. <div class="fragment"><pre> <span class="keywordtype">void</span> method();
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="w3" doxytag="GFC::Gtk::Clipboard::GetSlot" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef sigc::slot<void, <a class="el" href="classGFC_1_1Gtk_1_1SelectionData.html">SelectionData</a>&, unsigned int> <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w3">GFC::Gtk::Clipboard::GetSlot</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Signature of the callback slot that will be called to provide the contents of the selection.
<p>
If multiple types of data were advertised, the requested type can be determined from the info (unsigned int) parameter or by checking the target field of the <a class="el" href="classGFC_1_1Gtk_1_1SelectionData.html">SelectionData</a>. If the data could successfully be converted into then it should be stored into the selection_data object by calling <a class="el" href="classGFC_1_1Gtk_1_1SelectionData.html#z783_0">Gtk::SelectionData::set()</a> (or related functions such as <a class="el" href="classGFC_1_1Gtk_1_1SelectionData.html#z783_2">Gtk::SelectionData::set_text()</a>). If no data is set, the requestor will be informed that the attempt to get the data failed.<p>
<b>Example:</b> Method signature for GetSlot. <div class="fragment"><pre> <span class="keywordtype">void</span> method(SelectionData& selection_data, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> info);
<span class="comment">// selection_data: contains the data that was received. If retrieving the data failed,</span>
<span class="comment">// then Gtk::SelectionData::is_valid() will be false.</span>
<span class="comment">// info: the info field corresponding to the requested target from the</span>
<span class="comment">// TargetEntry vector passed to set().</span>
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="w0" doxytag="GFC::Gtk::Clipboard::ReceivedSlot" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef sigc::slot<void, const <a class="el" href="classGFC_1_1Gtk_1_1SelectionData.html">SelectionData</a>&> <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w0">GFC::Gtk::Clipboard::ReceivedSlot</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Signature of the callback slot to be called when the results of <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_3">request_contents()</a> are received, or when the request fails.
<p>
<b>Example:</b> Method signature for ReceivedSlot. <div class="fragment"><pre> <span class="keywordtype">void</span> method(<span class="keyword">const</span> SelectionData& selection_data);
<span class="comment">// selection_data: contains the data that was received. If retrieving the data failed,</span>
<span class="comment">// then Gtk::SelectionData::is_valid() will be false.</span>
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="w2" doxytag="GFC::Gtk::Clipboard::TargetsReceivedSlot" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef sigc::slot<void, const std::vector<<a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a>>&> <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w2">GFC::Gtk::Clipboard::TargetsReceivedSlot</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Signature of the callback slot to be called when the results of <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_5">request_targets()</a> are received, or when the request fails.
<p>
<b>Example:</b> Method signature for TargetsReceivedSlot. <div class="fragment"><pre> <span class="keywordtype">void</span> method(<span class="keyword">const</span> std::vector<Gdk::Atom>& targets);
<span class="comment">// targets: The supported targets, as vector of Gdk::Atom, or an empty vector if retrieving the data failed.</span>
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="w1" doxytag="GFC::Gtk::Clipboard::TextReceivedSlot" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef sigc::slot<void, const <a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1String.html">String</a>&> <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w1">GFC::Gtk::Clipboard::TextReceivedSlot</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Signature of the callback slot to be called when the results of <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_4">request_text()</a> are received, or when the request fails.
<p>
<b>Example:</b> Method signature for TextReceivedSlot. <div class="fragment"><pre> <span class="keywordtype">void</span> method(<span class="keyword">const</span> String& text);
<span class="comment">// text: the text received, as a UTF-8 encoded string, or null if retrieving the data failed.</span>
</pre></div> </td>
</tr>
</table>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="z420_0" doxytag="GFC::Gtk::Clipboard::Clipboard" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> GFC::Gtk::Clipboard::Clipboard </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">GtkClipboard * </td>
<td class="mdname" nowrap> <em>clipboard</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>owns_reference</em> = <code>false</code></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [explicit, protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Construct a new <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html">Clipboard</a> from an existing GtkClipboard.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>clipboard</em> </td><td>A pointer to a GtkClipboard. </td></tr>
<tr><td></td><td valign=top><em>owns_reference</em> </td><td>Set false if the initial reference count is floating, set true if it's not.</td></tr>
</table>
</dl>
<br>
The <em>clipboard</em> can be a newly created GtkClipboard or an existing GtkClipboard. (see <a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1G_1_1Object.html#z68_0">G::Object::Object</a>). </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="z423_1" doxytag="GFC::Gtk::Clipboard::clear" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void GFC::Gtk::Clipboard::clear </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Clears the contents of the clipboard.
<p>
Generally this should only be called between the time you call <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_0">set()</a>, and when the <em>clear</em> slot you supplied is called. Otherwise, the clipboard may be owned by someone else. </td>
</tr>
</table>
<a class="anchor" name="e0" doxytag="GFC::Gtk::Clipboard::get" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html">Clipboard</a>* GFC::Gtk::Clipboard::get </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a> </td>
<td class="mdname" nowrap> <em>selection</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="classGFC_1_1Gdk_1_1Display.html">Gdk::Display</a> * </td>
<td class="mdname" nowrap> <em>display</em> = <code>0</code></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the clipboard object for the given selection.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>selection</em> </td><td>A <a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a> which identifies the clipboard to use. </td></tr>
<tr><td></td><td valign=top><em>display</em> </td><td>The display for which the clipboard is to be retrieved or created, or null for the default Display. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The appropriate clipboard object.</dd></dl>
<br>
If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time. GTK+ holds onto a reference to the clipboard and will unreference it when GTK+ is removed from memory.<p>
Cut/copy/paste menu items and keyboard shortcuts should use the default clipboard, returned by passing GDK_SELECTION_CLIPBOARD for selection. (GDK_NONE is supported as a synonym for GDK_SELECTION_CLIPBOARD for backwards compatibility reasons.) The currently-selected object or text should be provided on the clipboard identified by GDK_SELECTION_PRIMARY. Cut/copy/paste menu items conceptually copy the contents of the GDK_SELECTION_PRIMARY clipboard to the default clipboard, i.e. they copy the selection to what the user sees as the clipboard.<p>
Passing GDK_NONE is the same as using gdk_atom_intern("CLIPBOARD", FALSE). See <a href="http://www.freedesktop.org/standards/clipboards.txt">http://www.freedesktop.org/standards/clipboards.txt</a> for a detailed discussion of the "CLIPBOARD" vs. "PRIMARY" selections under the X window system. On Win32 the GDK_SELECTION_PRIMARY clipboard is essentially ignored.<p>
It's possible to have arbitrary named clipboards; if you do invent new clipboards, you should prefix the selection name with an underscore (because the ICCCM requires that nonstandard atoms are underscore-prefixed), and namespace it as well. For example, if your application called "Foo" has a special-purpose clipboard, you might call it "_FOO_SPECIAL_CLIPBOARD".<p>
<b>Note:</b> The default GDK display is the only display in the absence of MultiHead support. </td>
</tr>
</table>
<a class="anchor" name="e1" doxytag="GFC::Gtk::Clipboard::get_default" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html">Clipboard</a>* GFC::Gtk::Clipboard::get_default </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="classGFC_1_1Gdk_1_1Display.html">Gdk::Display</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>display</em> = <code>0</code> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the default clipboard object for <em>display</em> (see <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#e0">get()</a> for details).
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>display</em> </td><td>The display for which the clipboard is to be retrieved or created, or null for the default Display. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The default clipboard object.</dd></dl>
<br>
The default clipboard is the one identified by the atom GDK_SELECTION_CLIPBOARD. Cut/copy/paste menu items and keyboard shortcuts should use the default clipboard.<p>
If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time. GTK+ holds onto a reference to the clipboard and will unreference it when GTK+ is removed from memory.<p>
<b>Note:</b> The default GDK display is the only display in the absence of MultiHead support. </td>
</tr>
</table>
<a class="anchor" name="z422_2" doxytag="GFC::Gtk::Clipboard::get_display" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classGFC_1_1Gdk_1_1Display.html">Gdk::Display</a>* GFC::Gtk::Clipboard::get_display </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Gets the <a class="el" href="classGFC_1_1Gdk_1_1Display.html">Gdk::Display</a> associated with the clipboard.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>The <a class="el" href="classGFC_1_1Gdk_1_1Display.html">Gdk::Display</a> associated with clipboard. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="e2" doxytag="GFC::Gtk::Clipboard::get_primary" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html">Clipboard</a>* GFC::Gtk::Clipboard::get_primary </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="classGFC_1_1Gdk_1_1Display.html">Gdk::Display</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>display</em> = <code>0</code> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the primary clipboard object (see <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#e0">get()</a> for details).
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>display</em> </td><td>The display for which the clipboard is to be retrieved or created, or null for the default Display. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The primary clipboard object.</dd></dl>
<br>
The primary clipboard is the one identified by the atom GDK_SELECTION_PRIMARY. The currently-selected object or text should be provided on the primary clipboard.<p>
If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time. GTK+ holds onto a reference to the clipboard and will unreference it when GTK+ is removed from memory.<p>
<b>Note:</b> The default GDK display is the only display in the absence of MultiHead support. </td>
</tr>
</table>
<a class="anchor" name="z423_3" doxytag="GFC::Gtk::Clipboard::request_contents" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void GFC::Gtk::Clipboard::request_contents </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a> </td>
<td class="mdname" nowrap> <em>target</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w0">ReceivedSlot</a> & </td>
<td class="mdname" nowrap> <em>received</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Requests the contents of clipboard as the given target.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>target</em> </td><td>Atom representing the form into which to convert the selection. </td></tr>
<tr><td></td><td valign=top><em>received</em> </td><td>The slot to call when the results of <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_3">request_contents()</a> are received.</td></tr>
</table>
</dl>
<br>
If the retrieval fails <a class="el" href="classGFC_1_1Gtk_1_1SelectionData.html#z782_1">Gtk::SelectionData::is_valid()</a> will be false. Alternatively, the length field of selection_data will be negative. </td>
</tr>
</table>
<a class="anchor" name="z423_5" doxytag="GFC::Gtk::Clipboard::request_targets" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void GFC::Gtk::Clipboard::request_targets </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w2">TargetsReceivedSlot</a> & </td>
<td class="mdname1" valign="top" nowrap> <em>received</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Requests the contents of the clipboard as list of supported targets.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>received</em> </td><td>A slot to call when the targets are received, or the retrieval fails</td></tr>
</table>
</dl>
When the list is later received, <em>received</em> will be called. The callback slot will contain the resulting targets, as a vector of <a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a>, if the request succeeded, or an empty vector if it failed. This method will always be called one way or the other. </td>
</tr>
</table>
<a class="anchor" name="z423_4" doxytag="GFC::Gtk::Clipboard::request_text" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void GFC::Gtk::Clipboard::request_text </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w1">TextReceivedSlot</a> & </td>
<td class="mdname1" valign="top" nowrap> <em>received</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Requests the contents of the clipboard as text.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>received</em> </td><td>The slot to call when the results of <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_4">request_text()</a> are received.</td></tr>
</table>
</dl>
<br>
When the text is later received, it will be converted to UTF-8 if necessary, and <em>received</em> will be called. The text parameter to slot method will contain the resulting text if the request succeeded, or null if it failed. This could happen for various reasons, in particular if the clipboard was empty or if the contents of the clipboard could not be converted into text form. </td>
</tr>
</table>
<a class="anchor" name="z423_0" doxytag="GFC::Gtk::Clipboard::set" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool GFC::Gtk::Clipboard::set </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const std::vector< <a class="el" href="classGFC_1_1Gtk_1_1TargetEntry.html">TargetEntry</a> > & </td>
<td class="mdname" nowrap> <em>targets</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w3">GetSlot</a> & </td>
<td class="mdname" nowrap> <em>get</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#w4">ClearSlot</a> & </td>
<td class="mdname" nowrap> <em>clear</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sets the contents of the specified clipboard.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>targets</em> </td><td>A vector containing information about the available forms for the clipboard data. </td></tr>
<tr><td></td><td valign=top><em>get</em> </td><td>Slot to call to get the actual clipboard data. </td></tr>
<tr><td></td><td valign=top><em>clear</em> </td><td>When the clipboard contents are set again, this slot will be called, and <em>get</em> will not be subsequently called. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><em>true</em> if setting the clipboard data succeeded.</dd></dl>
<br>
Virtually sets the contents of the specified clipboard by providing a list of supported formats for the clipboard data and a slot to call to get the actual data when it is requested. If setting the clipboard data failed the provided slots will be ignored. </td>
</tr>
</table>
<a class="anchor" name="z423_2" doxytag="GFC::Gtk::Clipboard::set_text" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void GFC::Gtk::Clipboard::set_text </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1String.html">String</a> & </td>
<td class="mdname1" valign="top" nowrap> <em>text</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sets the contents of the clipboard to the given UTF-8 string.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>text</em> </td><td>A UTF-8 string.</td></tr>
</table>
</dl>
<br>
GTK+ will make a copy of the text and take responsibility for responding for requests for the text, and for converting the text into the requested format. </td>
</tr>
</table>
<a class="anchor" name="z423_6" doxytag="GFC::Gtk::Clipboard::wait_for_contents" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1Pointer.html">Pointer</a><<a class="el" href="classGFC_1_1Gtk_1_1SelectionData.html">SelectionData</a>> GFC::Gtk::Clipboard::wait_for_contents </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a> </td>
<td class="mdname1" valign="top" nowrap> <em>target</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Requests the contents of the clipboard using the given target.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>target</em> </td><td>Atom representing the form into which to convert the selection. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>A newly-allocated <a class="el" href="classGFC_1_1Gtk_1_1SelectionData.html">SelectionData</a> object or null if retrieving the target failed.</dd></dl>
<br>
This method waits for the data to be received using the main loop, so events, timeouts, etc, may be dispatched during the wait. </td>
</tr>
</table>
<a class="anchor" name="z423_9" doxytag="GFC::Gtk::Clipboard::wait_for_targets" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool GFC::Gtk::Clipboard::wait_for_targets </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::vector< <a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a> > & </td>
<td class="mdname1" valign="top" nowrap> <em>targets</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns a vector of targets that are present on the clipboard, or an empty vector if there aren't any targets available.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>targets</em> </td><td>A reference to a vector <a class="el" href="namespaceGFC_1_1Gdk.html#a134">Gdk::Atom</a> to hold the list of targets. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><em>true</em> if any targets are present on the clipboard, otherwise <em>false</em>.</dd></dl>
<br>
This method waits for the data to be received using the main loop, so events, timeouts, etc, may be dispatched during the wait. </td>
</tr>
</table>
<a class="anchor" name="z423_7" doxytag="GFC::Gtk::Clipboard::wait_for_text" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1String.html">String</a> GFC::Gtk::Clipboard::wait_for_text </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Requests the contents of the clipboard as text and converts the result to UTF-8 if necessary.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>A UTF-8 <a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1String.html">String</a>, or null if retrieving the selection data failed.</dd></dl>
<br>
This function waits for the data to be received using the main loop, so events, timeouts, etc, may be dispatched during the wait. It could fail for various reasons, in particular if the clipboard was empty or if the contents of the clipboard could not be converted into text form. </td>
</tr>
</table>
<a class="anchor" name="z423_8" doxytag="GFC::Gtk::Clipboard::wait_is_text_available" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool GFC::Gtk::Clipboard::wait_is_text_available </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Test to see if there is text available to be pasted.
<p>
<dl compact><dt><b>Returns:</b></dt><dd><em>true</em> is there is text available, <em>false</em> otherwise.</dd></dl>
<br>
This method requests the TARGETS atom and checks to see if it contains any of the names: STRING, TEXT, COMPOUND_TEXT, UTF8_STRING. It waits for the data to be received using the main loop, so events, timeouts, etc, may be dispatched during the wait. It's a little faster than calling <a class="el" href="classGFC_1_1Gtk_1_1Clipboard.html#z423_7">wait_for_text()</a> since it doesn't need to retrieve the actual text. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="clipboard_8hh-source.html">clipboard.hh</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Aug 24 00:34:38 2004 for GFC-UI by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.8 </small></address>
</body>
</html>
|