<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi All,<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">    xclip can be used to inspect the clipboard:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">$ xclip -verbose -o -t TARGETS<br>Connected to X server.<br>Using TARGETS.<br>Type is ATOM.<br>TARGETS<br>image/png<br>image/jpeg<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">and the source code is available.  Using it the code in sqUnixX11.c should be fixable.  Good luck!</div><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 28, 2023 at 1:47 PM Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Hilaire, Hi unix/linux bods,<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">    I've got the ClipboardExtendedPlugin to compile and run on linux, but the results are disappointing.  The guts of the implementation is in this interfacer in platforms/unix/vm-display/x11/sqUnixX11.c:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">char **clipboardGetTypeNames();<br>sqInt clipboardSizeWithType(char *typeName, int ntypeName);<br>sqInt clipboardReadIntoAt(sqInt count, sqInt byteArrayIndex, sqInt startIndex);<br>void *firstIndexableField(sqInt oop);<br>void clipboardWriteWithType(char *data, size_t ndata, char *typeName, size_t ntypeName, int isDnd, int isClaiming);<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">At a trivial level the code in platforms/unix/plugins/ClipboardExtendedPlugin/sqUnixExtendedClipboard.c ncould be improved if</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">// TODO: clipboardGetTypeNames() should be cached. And the simplest way to do<br>// this is to have display_clipboardGetTypeNames do the cacheing and freeing,<br>// it freeing the previous invocation's data if the clipboard has changed,<br>// then all the multiple frees below can disappear. Further, the signature can<br>// be changed to include a pointer to the item count and then the indexing<br>// can safely be done directly. eem. '23/3/25<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">But more fundamentally the API implementation in sqUnixX11.c needs extending.  I recommend playing with e.g. firefox and the file finder, copying various items, and observing the state of the clipboard, through a suitable viewer. I prematurely deleted some dubious code from sqUnixExtendedClipboard.c that one might be able to construct a simple viewer/lister from.  In any case, the relevant information does not percolate up from the sqUnixX11.c API to allow the sqUnixExtendedClipboard.c API to pass the desired information up to Squeak.  An X11 maven should be able to get this going quickly.  Any HPI linux users feel like having a go?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default">If so, viel Glück!<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 23, 2023 at 5:58 PM Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="ltr">Hi Hilaire,</div><div dir="ltr"><br><blockquote type="cite">On Mar 23, 2023, at 2:38 PM, Hilaire Fernandes <<a href="mailto:hfern@free.fr" target="_blank">hfern@free.fr</a>> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><span>
  
    
  
  
    <p><font size="4">Hi Eliot,<br>
      </font></p>
    <p><font size="4">I will try to take a deep look as I have also
        interest for tablet support on Linux. This is a completely new
        domain (VM) for me.</font></p></span></div></blockquote><div><br></div>I hope you find it fun!<div><br></div><div>Your job is to implement this interface:</div><div><br></div><div><table style="border-spacing:0px;border-collapse:collapse;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"></tr><tr style="box-sizing:border-box"><td id="m_7638881253131434704m_-6142214859390689667LC39" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre-wrap"><span style="box-sizing:border-box">void</span> <span style="box-sizing:border-box">sqPasteboardClear</span>(<span style="box-sizing:border-box">void</span> *inPasteboard);
sqInt <span style="box-sizing:border-box">sqPasteboardGetItemCount</span>(<span style="box-sizing:border-box">void</span> *inPasteboard);
sqInt <span style="box-sizing:border-box">sqPasteboardCopyItemFlavorsitemNumber</span>(<span style="box-sizing:border-box">void</span> *inPasteboard, sqInt formatNumber);<span style="box-sizing:border-box">
void</span><span> *</span><span style="box-sizing:border-box">sqCreateClipboard</span><span>(</span><span style="box-sizing:border-box">void</span><span>);
</span><span style="box-sizing:border-box">void</span><span> </span><span style="box-sizing:border-box">sqPasteboardPutItemFlavordatalengthformatTypeformatLength</span><span>(</span><span style="box-sizing:border-box">void</span><span> *inPasteboard, </span><span style="box-sizing:border-box">char</span><span> *inData, sqInt dataLength, </span><span style="box-sizing:border-box">char</span><span> *format, sqInt formatLength);</span><span style="box-sizing:border-box">
void</span> <span style="box-sizing:border-box">sqPasteboardPutItemFlavordatalengthformatType</span>(<span style="box-sizing:border-box">void</span> *inPasteboard, <span style="box-sizing:border-box">char</span> *inData, sqInt dataLength, sqInt format);<span>
sqInt </span><span style="box-sizing:border-box">sqPasteboardCopyItemFlavorDataformatformatLength</span><span>(</span><span style="box-sizing:border-box">void</span><span> *inPasteboard, </span><span style="box-sizing:border-box">char</span><span> *format, sqInt formatLength);</span><span>
sqInt </span><span style="box-sizing:border-box">sqPasteboardCopyItemFlavorDataformat</span><span>(</span><span style="box-sizing:border-box">void</span><span> *inPasteboard, sqInt format);</span>
sqInt <span style="box-sizing:border-box">sqPasteboardhasDataInFormatformatLength</span>(<span style="box-sizing:border-box">void</span> *inPasteboard, <span style="box-sizing:border-box">char</span> *format, sqInt formatLength);<span>
sqInt </span><span style="box-sizing:border-box">sqPasteboardhasDataInFormat</span><span>(</span><span style="box-sizing:border-box">void</span><span> *inPasteboard, sqInt format);

</span><span style="color:rgb(0,0,0);font-family:UICTFontTextStyleBody;font-size:17px;white-space:normal">which is present only in src/plugins/ClipboardExtendedPlugin/</span><span style="color:rgb(0,0,0);font-family:UICTFontTextStyleBody;font-size:17px;white-space:normal">ClipboardExtendedPlugin.c, a departure from the house style which would have put it in platforms/Cross/</span><span style="color:rgb(0,0,0);font-family:UICTFontTextStyleBody;font-size:17px;white-space:normal">plugins/ClipboardExtendedPlugin/</span><span style="color:rgb(0,0,0);font-family:UICTFontTextStyleBody;font-size:17px;white-space:normal">ClipboardExtendedPlugin.h; no doubt John had his reasons.<br><br>Use </span><span style="color:rgb(0,0,0);font-family:UICTFontTextStyleBody;font-size:17px;white-space:normal">platforms/iOS/</span><span style="color:rgb(0,0,0);font-family:UICTFontTextStyleBody;font-size:17px;white-space:normal">plugins/ClipboardExtendedPlugin/</span><span style="font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:16px;white-space:normal">sqMacExtendedClipboard.m & </span><span style="color:rgb(0,0,0);font-family:UICTFontTextStyleBody;font-size:17px;white-space:normal">platforms/win32/</span><span style="color:rgb(0,0,0);font-family:UICTFontTextStyleBody;font-size:17px;white-space:normal">plugins/ClipboardExtendedPlugin/</span><span style="font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:16px;white-space:normal">sqWin32ExtendedClipboard.c as guides. The Mac uses strings to identify clipboard types (the </span><span style="box-sizing:border-box">char</span><span> *format, sqInt formatLength)</span><span style="color:rgb(0,0,0);font-family:UICTFontTextStyleBody;font-size:17px;white-space:normal"> variant, as opposed to win32, which uses integers (the sqInt format variant). Whichever works.<br><br>You’ll implement it in </span><span style="color:rgb(0,0,0);font-family:UICTFontTextStyleBody;font-size:17px;white-space:normal">platforms/unix/</span><span style="color:rgb(0,0,0);font-family:UICTFontTextStyleBody;font-size:17px;white-space:normal">plugins/ClipboardExtendedPlugin/</span><span style="font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:16px;white-space:normal">sqUnixExtendedClipboard.c</span></td></tr></tbody></table><blockquote type="cite"><div dir="ltr"><span>
    <p><font size="4">Thanks</font></p>
    <p><font size="4">Hilaire</font><br>
    </p>
    <div>Le 23/03/2023 à 21:05, Eliot Miranda a
      écrit :<br>
    </div>
    <blockquote type="cite">As
      John said it doesn't appear to exist for Linux.  But X11 has a
      clipboard and implementing the innards for X11 shouldn't be that
      difficult.  The only complication is that if one wants to do the
      job "properly" one has to extend the indirection scheme Ian
      Piumarta came up with so that it can work on the other graphical
      back-ends such as the raw frame buffer.  Hillaire, if you're
      interested in implementing the X11 ExtendedClipboard internals I'm
      happy to answer any questions you have.</blockquote>
    <pre cols="72">-- 
GNU Dr. Geo
<a href="http://drgeo.eu" target="_blank">http://drgeo.eu</a>
<a href="http://blog.drgeo.eu" target="_blank">http://blog.drgeo.eu</a></pre>
  

</span></div></blockquote></div></div></blockquote></div><br clear="all"><div><br></div><span>-- </span><br><div dir="ltr"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>