On Sat, 26 Feb 2011, Ivica Ico Bukvic wrote:
On Wed, 23 Feb 2011, Ivica Ico Bukvic wrote:
Not as comprehensive (no web browser and between instances of PDF
PD ?
Yep, typo courtesy of android auto-complete trying to be smart...
Ok, is that what is called « intelligent phones » ?
I figured as much when I read your email. I am kind of torn at this point because we now have dual clipboard--one for patch clipboard and another for text and the two are interchangeably used depending on the context. Going your route is quite convenient as that allows interaction with apps outside Pd but at the same time limits one to having only one buffer. Still, I think yours is better and as such should be implemented instead.
It doesn't exclude having your own buffer system either. What you need to do, is to use polymorphism : a common clipboard protocol, for two different kinds of clipboards. DesireData has that in its implementation, and it temporarily replaces the global clipboard variable in order to switch to a private clipboard because Ctrl+d is implemented as Ctrl+c Ctrl+v yet shouldn't modify any normally visible clipboard.
class_new Clipboard {Observable Thing} class_new Clipboard1 {Clipboard} class_new Clipboard2 {Clipboard}
def Clipboard init {{value ""}} {super; $self value= $value}
def Clipboard1 value= {value} {clipboard clear; clipboard append $value; $self changed} def Clipboard1 << {value} { clipboard append $value; $self changed} def Clipboard1 value {} {clipboard get}
def Clipboard2 value= {value} {set @value $value; $self changed} def Clipboard2 << {value} {append @value $value; $self changed} def Clipboard2 value {} {return $@value}
if {$tk} { set clipboard [Clipboard1 new] } else { set clipboard [Clipboard2 new] }
def Canvas do_duplicate {offset} { global clipboard set backup $clipboard set clipboard [Clipboard2 new] $self copy $self do_paste $offset $clipboard delete set clipboard $backup }
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC