Hi Juan, Hi All,

On Thu, Mar 23, 2023 at 6:19 PM Juan Vuletich <juan@cuis.st> wrote:
Hi Folks,

I was pretty sure I had seen _something_ about a ClipboardExtendedPlugin for Linux at some time.

Found it. It seems it was part of an OLPC Etoys specific branch of the old interpreter vm. I don't know how complete this was, or if it was actually used. Anyway, in case it is of any use, see http://squeakvm.org/svn/squeak/branches/olpc/platforms/unix/src/plugins/ClipboardExtendedPlugin/

Alas this isn't unix specific.  It is the generated plugin, which in this case  (and in several other plugins, such as the FilePlugin and the SocketPlugin) is just the platform-independent wrapper around the platform-specific functionality.  The source doesn't really belong there.  In OpenSmalltalk you'll find it only in src/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.c. So...

The upper level of a plugin which is generated from VMMaker source  is in
        <root>/src/plugins/<PluginName>/<PluginName>.c
It is generated from a class called <PluginName> that inherits from InterpreterPlugin in category VMMaker-Plugins.
The header file that defines the interface between the plugin and any platform-specific code is typically in
        <root>/platforms/Cross/plugins/<PluginName>/<PluginName>.h
and in this case is missing (which should be fixed).
The various implementations of platform-specific code are often in
        <root>/platforms/{iOS,unix,win32,etc}/plugins/<PluginName>/sq[Mac,Unix,Win32,etc}<PluginName>.{c,cc,m,etc}
but sometimes more than one file is required to implement the plugin internals.
For example, the SoundPlugin typically requires a handful of source files and occasionally a specific makefile.

HTH

Thanks,

On 3/23/2023 9:58 PM, Eliot Miranda wrote:
 


Hi Hilaire,

On Mar 23, 2023, at 2:38 PM, Hilaire Fernandes <hfern@free.fr> wrote:



Hi Eliot,

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.


I hope you find it fun!

Your job is to implement this interface:

void sqPasteboardClear(void *inPasteboard);
sqInt sqPasteboardGetItemCount(void *inPasteboard);
sqInt sqPasteboardCopyItemFlavorsitemNumber(void *inPasteboard, sqInt formatNumber);
void
*sqCreateClipboard(void);
void sqPasteboardPutItemFlavordatalengthformatTypeformatLength(void *inPasteboard, char *inData, sqInt dataLength, char *format, sqInt formatLength);
void
sqPasteboardPutItemFlavordatalengthformatType(void *inPasteboard, char *inData, sqInt dataLength, sqInt format);
sqInt
sqPasteboardCopyItemFlavorDataformatformatLength(void *inPasteboard, char *format, sqInt formatLength);
sqInt
sqPasteboardCopyItemFlavorDataformat(void *inPasteboard, sqInt format);
sqInt sqPasteboardhasDataInFormatformatLength(void *inPasteboard, char *format, sqInt formatLength);
sqInt
sqPasteboardhasDataInFormat(void *inPasteboard, sqInt format);

which is present only in src/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.c, a departure from the house style which would have put it in platforms/Cross/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.h; no doubt John had his reasons.

Use 
platforms/iOS/plugins/ClipboardExtendedPlugin/sqMacExtendedClipboard.m & platforms/win32/plugins/ClipboardExtendedPlugin/sqWin32ExtendedClipboard.c as guides. The Mac uses strings to identify clipboard types (the char *format, sqInt formatLength) variant, as opposed to win32, which uses integers (the sqInt format variant). Whichever works.

You’ll implement it in 
platforms/unix/plugins/ClipboardExtendedPlugin/sqUnixExtendedClipboard.c

Thanks

Hilaire

Le 23/03/2023 à 21:05, Eliot Miranda a écrit :
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.
-- 
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu


-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich


--
_,,,^..^,,,_
best, Eliot