Re: Proposed Mac::Pasteboard

2008-02-18 Thread Tom Wyant
Version 0.000_04 just uploaded. This version recognizes restrictions
in the use of pasteboards from (e.g.) ssh sessions and cron jobs, and
fixes a free error when such restrictions are encountered. It has at
least a fighting chance of actually testing without failures, though
the cron job restriction means that really organized CPAN testers
won't actually test much.

Tom Wyant



Re: Proposed Mac::Pasteboard

2008-02-15 Thread Tom Wyant
Version 0.000_03 just uploaded. I don't get the compiler warnings
reported by 'chris' in the test results, but I think I understand them
and have tried to address them. I also don't get the test errors, but
am hoping that if I fix the compiler errors they will go away. We'll
see.

Tom Wyant



Re: Proposed Mac::Pasteboard

2008-02-06 Thread Tom Wyant
On Feb 5, 12:38 pm, [EMAIL PROTECTED] (Tom Wyant) wrote:
 On Jan 31, 9:55 pm, [EMAIL PROTECTED] wrote:



  Since there hasn't been any further discussion for a day or so, I have
  published Mac-Pasteboard-0.000_01 to CPAN. I suspect you'll need to
  download by package name (WYANT/Mac-Pasteboard-0.000_01.tar.gz I
  think; at least, WYANT is the right CPAN username) if you're using the
  'cpan' script.

 There's a problem with this software if you are running Mac OS 10.4 or
 above: the get the real pasteboard name functionality dies with a
 bus error. Unfortunately I found this by having my machine die and
 acquiring a new machine with 10.5, so it'll be a bit before I can put
 full time on sorting this out. The easy thing for me to do is to
 publish an update without the functionality. Until then, disable it by
 doing a 'make realclean' (or './Build realclean'), editing Makefile.PL
 and/or Build.PL to comment out the lines

 $osvers = 10.004
 and push @ld, '-DTIGER';

 and rebuild. This is probably what release 0.000_02 will consist of,
 when it gets made.

I was wrong. The problem was that I didn't dereference a pointer I
should have. So version 0.000_02 has just been uploaded, with the
Tiger (and up) functionality working, instead of causing a bus error
as 0.000_01 did. In addition, a couple compiler complaints were
cleaned up.

Tom Wyant



Re: Proposed Mac::Pasteboard

2008-02-05 Thread Tom Wyant
On Jan 31, 9:55 pm, [EMAIL PROTECTED] wrote:

 Since there hasn't been any further discussion for a day or so, I have
 published Mac-Pasteboard-0.000_01 to CPAN. I suspect you'll need to
 download by package name (WYANT/Mac-Pasteboard-0.000_01.tar.gz I
 think; at least, WYANT is the right CPAN username) if you're using the
 'cpan' script.

There's a problem with this software if you are running Mac OS 10.4 or
above: the get the real pasteboard name functionality dies with a
bus error. Unfortunately I found this by having my machine die and
acquiring a new machine with 10.5, so it'll be a bit before I can put
full time on sorting this out. The easy thing for me to do is to
publish an update without the functionality. Until then, disable it by
doing a 'make realclean' (or './Build realclean'), editing Makefile.PL
and/or Build.PL to comment out the lines

$osvers = 10.004
and push @ld, '-DTIGER';

and rebuild. This is probably what release 0.000_02 will consist of,
when it gets made.

Sorry about that.

Tom Wyant



Re: Proposed Mac::Pasteboard

2008-02-01 Thread harryfmudd
On Jan 28, 8:32 pm, [EMAIL PROTECTED] (Chas. Owens) wrote:
 On Jan 28, 2008 1:45 PM,  [EMAIL PROTECTED] wrote:
 snip That seems to argue that I publish Mac::Pasteboard pretty much as is,
  then follow with Mac::Clipboard. It's lazy, but is it lazy _enough_?

  Would it expedite discussion if I put out a pre-release of the code?
  If so, how should it be done? Mail the tarball to people who ask? Post
  to the newsgroup? Submit to CPAN with a development version number? I
  can't guarantee the documentation to be limpid prose, but the code
  works.

 snip

 I say publish it to CPAN with a dev number and then send an article to
 use.perl.org showing how to use it.  I know I would like to play
 around with it.

Since there hasn't been any further discussion for a day or so, I have
published Mac-Pasteboard-0.000_01 to CPAN. I suspect you'll need to
download by package name (WYANT/Mac-Pasteboard-0.000_01.tar.gz I
think; at least, WYANT is the right CPAN username) if you're using the
'cpan' script.

I think it's too early to make an announcement; maybe at the 0.001
version. And use.perl.org seems like pretty fast company for something
as piddling as a single-OS interface module. I typically haven't done
announcements even to comp.lang.perl.modules, and in this case I
should think announcement to perl.macosx would be sufficient, even if
it weren't redundant.

Tom Wyant



Re: Proposed Mac::Pasteboard

2008-01-30 Thread harryfmudd
On Jan 29, 10:49 am, [EMAIL PROTECTED] (David Cantrell) wrote:
 On Mon, Jan 28, 2008 at 10:45:56AM -0800, [EMAIL PROTECTED] wrote:
  That seems to argue that I publish Mac::Pasteboard pretty much as is,
  then follow with Mac::Clipboard. It's lazy, but is it lazy _enough_?
  Would it expedite discussion if I put out a pre-release of the code?
  If so, how should it be done? Mail the tarball to people who ask? Post
  to the newsgroup? Submit to CPAN with a development version number? I
  can't guarantee the documentation to be limpid prose, but the code
  works.

 Release early, release often, that's what I do.

 I note, however, that there is already a Clipboard module that claims to
 do the job on OS X.  But the tests don't run properly on OS X.

 So *maybe* Mac::Clipboard isn't necessary.


Yeah. But Clipboard under Mac OS X just shells out to pbcopy or
pbpaste, as the case may be. And then only if you have IO::All
installed (or at least, that's what I assume from the errors I get --
apparantly the author wasn't careful about what his or her
dependencies were).

I _do_ have subroutines called (suprise, suprise) pbcopy and pbpaste;
but also an o-o interface that will do get me the UTF16 text from
pasteboard item 12345 on pasteboard 'my.very.own.pasteboard'.

That's why I was raising the possibility of release, since if I did
that, we'd all be (potentially, anyway) talking about the same code,
instead of just each talking about our own ideas of it.

Tom Wyant



Re: Proposed Mac::Pasteboard

2008-01-29 Thread David Cantrell
On Mon, Jan 28, 2008 at 10:45:56AM -0800, [EMAIL PROTECTED] wrote:

 That seems to argue that I publish Mac::Pasteboard pretty much as is,
 then follow with Mac::Clipboard. It's lazy, but is it lazy _enough_?
 Would it expedite discussion if I put out a pre-release of the code?
 If so, how should it be done? Mail the tarball to people who ask? Post
 to the newsgroup? Submit to CPAN with a development version number? I
 can't guarantee the documentation to be limpid prose, but the code
 works.

Release early, release often, that's what I do.

I note, however, that there is already a Clipboard module that claims to
do the job on OS X.  But the tests don't run properly on OS X.

So *maybe* Mac::Clipboard isn't necessary.

-- 
David Cantrell | London Perl Mongers Deputy Chief Heretic

There are many different types of sausages.  The best are
from the north of England.  The wurst are from Germany.
  -- seen in alt.2eggs...


Re: Proposed Mac::Pasteboard

2008-01-29 Thread Peter N Lewis

  and then write Mac::Clipboard using Mac::Pasteboard to expose only the

 clipboard.  In the SEE ALSO section you can reference Mac::Pasteboard
 and people who need the advanced functionality can find it.


Interesting thought. The straightforward implementation would be to
have Mac::Clipboard depend on Mac::Pasteboard (since there's no
simplified clipboard interface that I have found). But it seems un-
parsimonious to me to use namespace for maybe a dozen lines of Perl,
since right now the clipboard part is on the order of


Given that Pasteboard offers a lot more functionality than just 
pbcopy/pbpaste, I would have though Clipboard would similarly offer 
all the functionality of Pasteboard, except only to the default 
standard clipboard.


So where Mac::Pasteboard might have a function that returns the list 
of flavors of the fifth item in the a specific pasteboard, 
Mac::Clipboard would have a function that returns the list of flavors 
of the fifth item, but only in the default system clipboard.


Obviously, you want some nice easy routines to extract the clipboard 
flavours as text (getting the unicode text if possible, the plain 
text if not), but you want that same functionality for all 
Pasteboards as well as for the system clipboard, so you would again 
have a function in Mac::Pasteboard that returns the text of the top 
item of a specified pasteboard and a function in Mac::Clipboard that 
returns the text of the top item in the system clipboard.


If Mac::Pasteboard is implemented in a functional manner, then you 
could use undef as the pasteboard parameter to specify the system 
pasteboard.


If Mac::Pasteboard is implemented in an OO manner, then 
Mac::Clipboard would be essentially identical, except instead of a 
factory function that takes a pasteboard name, it has just a factory 
function that returns the Mac::Pasteboard object for the system 
clipboard.


But regardless of the details, I think Mac::Clipboard would want to 
be far more than just an interface equivalent of pbcopy/pbpaste.


Enjoy
   Peter.

--
Keyboard Maestro http://www.keyboardmaestro.com/ Macros for your Mac
http://www.stairways.com/   http://download.stairways.com/


Re: Proposed Mac::Pasteboard

2008-01-28 Thread harryfmudd
On Jan 27, 9:11 pm, [EMAIL PROTECTED] (Bruce Van Allen) wrote:
 On Jan 27, 2008, at 10:53 AM, [EMAIL PROTECTED] wrote:



  On Jan 27, 10:49 am, [EMAIL PROTECTED] (Chas. Owens) wrote:

snip /

  Why choose?  Write Mac::Pasteboard with all of the bells and whistles
  and then write Mac::Clipboard using Mac::Pasteboard to expose only
  the
  clipboard.  In the SEE ALSO section you can reference Mac::Pasteboard
  and people who need the advanced functionality can find it.

  Interesting thought. The straightforward implementation would be to
  have Mac::Clipboard depend on Mac::Pasteboard (since there's no
  simplified clipboard interface that I have found). But it seems un-
  parsimonious to me to use namespace for maybe a dozen lines of Perl,

 [snip]

 Maybe that's not a bad thing. And it wouldn't really limit the
 potential of the namespace. Starting with your Mac::Clipboard (which
 would inherit from Mac::Pasteboard) we might see:
 Mac::Clipboard::Persistent - provide the ability to cache the
 clipboard;
 M::C::History - store clipboard values cumulatively with meta-data
 (time-stamp, ...);
 M::C::Multiple - provide multiple clipboards a la some GUI apps
 M::C::Calculate - provide a stack for calculations with multiple
 copied values
 ...
 All of these would work in the functionality-space of The
 Clipboard, which isn't quite the same as accessing other features of
 the Pasteboard, from the user's POV.

Persistent? I hadn't thought of that one. Though it seems to me that
YAML and friends could handle most of the functionality there. Or
Storable, or ...

Cumulative? It seems to me that you can get that with multiple
pasteboard items, though you'd have to provide your own metadata.

Multiple I think is already in the pasteboard functionality.

Calculations? Another that I hadn't thought of. Clipboard/pasteboard
management would be interesting, since you can put things on readily
enough, but the only way to remove them is to clear the sucker, and
then repopulate it minus the stuff you don't want.


 Regardless of the name, thanks for alerting me and others to the
 interesting capabilities of the OS X Pasteboard.


Well, to be honest I went to this forum for two purposes:

1) Make sure I wasn't re-inventing the wheel, and
2) See what people thought about the name.

I've gotten a lot more feedback than I expected, and I'm not sure what
I'm going to do with it all, but better this than nothing.

Thanks,
Tom Wyant



Re: Proposed Mac::Pasteboard

2008-01-28 Thread brian d foy
In article
[EMAIL PROTECTED],
[EMAIL PROTECTED] wrote:

 But it seems un-
 parsimonious to me to use namespace for maybe a dozen lines of Perl,
 since right now the clipboard part is on the order of

It's the idea that counts, not the actual implementation. Namespaces
separate ideas into their own parts of the world and hide all of the
details from the user. It doesn't matter what the code is or how long
it is. :)


Re: Proposed Mac::Pasteboard

2008-01-28 Thread harryfmudd
On Jan 28, 9:32 am, [EMAIL PROTECTED] (Brian D Foy) wrote:
 In article
 [EMAIL PROTECTED],

 [EMAIL PROTECTED] wrote:
  But it seems un-
  parsimonious to me to use namespace for maybe a dozen lines of Perl,
  since right now the clipboard part is on the order of

 It's the idea that counts, not the actual implementation. Namespaces
 separate ideas into their own parts of the world and hide all of the
 details from the user. It doesn't matter what the code is or how long
 it is. :)

That seems to argue that I publish Mac::Pasteboard pretty much as is,
then follow with Mac::Clipboard. It's lazy, but is it lazy _enough_?

Would it expedite discussion if I put out a pre-release of the code?
If so, how should it be done? Mail the tarball to people who ask? Post
to the newsgroup? Submit to CPAN with a development version number? I
can't guarantee the documentation to be limpid prose, but the code
works.

Tom Wyant



Re: Proposed Mac::Pasteboard

2008-01-28 Thread Chas. Owens
On Jan 28, 2008 1:45 PM,  [EMAIL PROTECTED] wrote:
snip
 That seems to argue that I publish Mac::Pasteboard pretty much as is,
 then follow with Mac::Clipboard. It's lazy, but is it lazy _enough_?

 Would it expedite discussion if I put out a pre-release of the code?
 If so, how should it be done? Mail the tarball to people who ask? Post
 to the newsgroup? Submit to CPAN with a development version number? I
 can't guarantee the documentation to be limpid prose, but the code
 works.
snip

I say publish it to CPAN with a dev number and then send an article to
use.perl.org showing how to use it.  I know I would like to play
around with it.


Re: Proposed Mac::Pasteboard

2008-01-27 Thread harryfmudd
On Jan 22, 2:31 am, [EMAIL PROTECTED] (Brian D Foy) wrote:
 [[ This message was both posted and mailed: see
the To, Cc, and Newsgroups headers for details. ]]

 In article
 012120080315.17779.47940E4B0005B034457322007507440B0B9A0300979D9D0E

 [EMAIL PROTECTED], [EMAIL PROTECTED] wrote:
  Is there a module that will let one manipulate a Mac OS X pasteboard? There
  does not seem to be anything on CPAN that strikes me as being for that
  purpose.

 I'd like to have such a thing, although you should call it
 Mac::Clipboard :)

I dithered about this. The arguments as I see them are:

For Mac::Clipboard

1) That's what most people call the thing.

For Mac::Pasteboard

1) It's what the Apple documentation calls it.

2) There's a lot more to it than (e.g.) Win32::Clipboard. For one
thing, there's more than one of them -- in fact, as many as you like.
Each can have multiple data items, with data in multiple flavors.

The thing is, it's not the number of arguments that counts, its their
force. At this point I'm leaning toward Mac::Clipboard, since it is
easier to find by browsing or searching (see the one and only argument
I gave in its favor). But it appears to me that the docs are going to
adhere to Apple's terminology, with clipboard referring to the
system clipboard, and pasteboard refering to other, well,
pasteboards, or to pasteboards in general. There will probably be a
paragraph or two early in DETAILS about terminology, but it seems less
a wart to me to use Apple's terminology as early as possible, rather
than to ask the reader to shift terminology gears as soon as he or she
actually follows the SEE ALSO links into Apple's docs.

Tom Wyant



Re: Proposed Mac::Pasteboard

2008-01-27 Thread Chas. Owens
On Jan 26, 2008 10:46 PM,  [EMAIL PROTECTED] wrote:
 On Jan 22, 2:31 am, [EMAIL PROTECTED] (Brian D Foy) wrote:
  [[ This message was both posted and mailed: see
 the To, Cc, and Newsgroups headers for details. ]]
 
  In article
  012120080315.17779.47940E4B0005B034457322007507440B0B9A0300979D9D0E
 
  [EMAIL PROTECTED], [EMAIL PROTECTED] wrote:
   Is there a module that will let one manipulate a Mac OS X pasteboard? 
   There
   does not seem to be anything on CPAN that strikes me as being for that
   purpose.
 
  I'd like to have such a thing, although you should call it
  Mac::Clipboard :)

 I dithered about this. The arguments as I see them are:

 For Mac::Clipboard

 1) That's what most people call the thing.

 For Mac::Pasteboard

 1) It's what the Apple documentation calls it.

 2) There's a lot more to it than (e.g.) Win32::Clipboard. For one
 thing, there's more than one of them -- in fact, as many as you like.
 Each can have multiple data items, with data in multiple flavors.
snip

Why choose?  Write Mac::Pasteboard with all of the bells and whistles
and then write Mac::Clipboard using Mac::Pasteboard to expose only the
clipboard.  In the SEE ALSO section you can reference Mac::Pasteboard
and people who need the advanced functionality can find it.


Re: Proposed Mac::Pasteboard

2008-01-27 Thread harryfmudd
On Jan 27, 10:49 am, [EMAIL PROTECTED] (Chas. Owens) wrote:
 On Jan 26, 2008 10:46 PM,  [EMAIL PROTECTED] wrote:

  On Jan 22, 2:31 am, [EMAIL PROTECTED] (Brian D Foy) wrote:
   [[ This message was both posted and mailed: see
  the To, Cc, and Newsgroups headers for details. ]]

   In article
   012120080315.17779.47940E4B0005B034457322007507440B0B9A0300979D9D0E

   [EMAIL PROTECTED], [EMAIL PROTECTED] wrote:
Is there a module that will let one manipulate a Mac OS X pasteboard? 
There
does not seem to be anything on CPAN that strikes me as being for that
purpose.

   I'd like to have such a thing, although you should call it
   Mac::Clipboard :)

  I dithered about this. The arguments as I see them are:

  For Mac::Clipboard

  1) That's what most people call the thing.

  For Mac::Pasteboard

  1) It's what the Apple documentation calls it.

  2) There's a lot more to it than (e.g.) Win32::Clipboard. For one
  thing, there's more than one of them -- in fact, as many as you like.
  Each can have multiple data items, with data in multiple flavors.

 snip

 Why choose?  Write Mac::Pasteboard with all of the bells and whistles
 and then write Mac::Clipboard using Mac::Pasteboard to expose only the
 clipboard.  In the SEE ALSO section you can reference Mac::Pasteboard
 and people who need the advanced functionality can find it.

Interesting thought. The straightforward implementation would be to
have Mac::Clipboard depend on Mac::Pasteboard (since there's no
simplified clipboard interface that I have found). But it seems un-
parsimonious to me to use namespace for maybe a dozen lines of Perl,
since right now the clipboard part is on the order of

my %pb_cache;

sub pbcopy {
my $pb = $pb_cache{kPasteboardClipboard} ||= __PACKAGE__-new
(kPasteboardClipboard);
$pb-copy (@_);
}

sub pbpaste {
my $pb = $pb_cache{kPasteboardClipboard} ||= __PACKAGE__-new
(kPasteboardClipboard);
$pb-paste (@_);
}

But thanks for the suggestion.

Tom Wyant



Re: Proposed Mac::Pasteboard

2008-01-27 Thread Bruce Van Allen


On Jan 27, 2008, at 10:53 AM, [EMAIL PROTECTED] wrote:


On Jan 27, 10:49 am, [EMAIL PROTECTED] (Chas. Owens) wrote:

On Jan 26, 2008 10:46 PM,  [EMAIL PROTECTED] wrote:


On Jan 22, 2:31 am, [EMAIL PROTECTED] (Brian D Foy) wrote:

[[ This message was both posted and mailed: see
  the To, Cc, and Newsgroups headers for details. ]]



In article

012120080315.17779.47940E4B0005B034457322007507440B0B9A0300979D9D0E



[EMAIL PROTECTED], [EMAIL PROTECTED] wrote:
Is there a module that will let one manipulate a Mac OS X  
pasteboard? There
does not seem to be anything on CPAN that strikes me as being  
for that

purpose.



I'd like to have such a thing, although you should call it
Mac::Clipboard :)



I dithered about this. The arguments as I see them are:



For Mac::Clipboard



1) That's what most people call the thing.



For Mac::Pasteboard



1) It's what the Apple documentation calls it.



2) There's a lot more to it than (e.g.) Win32::Clipboard. For one
thing, there's more than one of them -- in fact, as many as you  
like.

Each can have multiple data items, with data in multiple flavors.


snip

Why choose?  Write Mac::Pasteboard with all of the bells and whistles
and then write Mac::Clipboard using Mac::Pasteboard to expose only  
the

clipboard.  In the SEE ALSO section you can reference Mac::Pasteboard
and people who need the advanced functionality can find it.


Interesting thought. The straightforward implementation would be to
have Mac::Clipboard depend on Mac::Pasteboard (since there's no
simplified clipboard interface that I have found). But it seems un-
parsimonious to me to use namespace for maybe a dozen lines of Perl,


[snip]

Maybe that's not a bad thing. And it wouldn't really limit the  
potential of the namespace. Starting with your Mac::Clipboard (which  
would inherit from Mac::Pasteboard) we might see:
	Mac::Clipboard::Persistent - provide the ability to cache the  
clipboard;
	M::C::History - store clipboard values cumulatively with meta-data  
(time-stamp, ...);

M::C::Multiple - provide multiple clipboards a la some GUI apps
	M::C::Calculate - provide a stack for calculations with multiple  
copied values

...
All of these would work in the functionality-space of The  
Clipboard, which isn't quite the same as accessing other features of  
the Pasteboard, from the user's POV.


Regardless of the name, thanks for alerting me and others to the  
interesting capabilities of the OS X Pasteboard.


Best,

- Bruce

__bruce__van_allen__santa_cruz__ca__





Re: Proposed Mac::Pasteboard

2008-01-26 Thread harryfmudd
On Jan 21, 9:04 am, [EMAIL PROTECTED] (Claes Jakobsson) wrote:
 Hi,

Hi. My apologies for taking so long to get back to you. After fiddling
with going through my ISP and not having anything show up in the
newsgroup (the original post was mailed to macosx@perl.org), I decided
to try Google Groups.

 I assume with pasteboard you mean the clipboard?

Well, I include the clipboard, which isn't quite the same thing. Mac
OS X allows multiple pasteboards, one of which is the system clipboard
(a.k.a. 'com.apple.pasteboard.clipboard'). You can create your own,
which go away when the last accessor does.

Each pasteboard can contain multiple items, and each item multiple
flavors (Apple's technical term) of data. Yes, I expect most users
to be popping text on and off the system clipboard, but there's more
to it than that.

 There seems to be an attempt of a generic cliboard interface on CPAN 
 (http://search.cpan.org/dist/Clipboard/
 ) which according to the readme says it works on OS X. I suppose it
 just uses the 'pbcopy' and 'pbpaste' command line tools.


Yes, it just shells out to pbcopy and pbpaste, which means you can
only access plain text -- specifically, flavor 'com.apple.traditional-
mac-plain-text'. I was planning to access any flavor of data, though
the only testing I have done other than with text is to copy a graphic
to the clipboard with Graphic Converter, pull it back off with my
code, open the output file, and see if it looked like the same
picture.

Tom Wyant



Re: Proposed Mac::Pasteboard

2008-01-25 Thread Doug McNutt
At 03:15 + 1/21/08, [EMAIL PROTECTED] wrote:
Is there a module that will let one manipulate a Mac OS X pasteboard? There  
does not seem to be anything on CPAN that strikes me as being for that purpose.

Have a look at the tools pbcopy and pbpaste that are delivered with OS neXt.

There is a subtle difference between pasteboard and clipboard. NeXt has a 
pasteboard which sometimes refers to the current selection and not just to 
something that has been copied. That allows services to do things like 
execute selected text as a terminal command.

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --


Proposed Mac::Pasteboard

2008-01-21 Thread harryfmudd
Dear All,

I don't know if I'm re-inventing the wheel here, so I thought I'd ask.

Is there a module that will let one manipulate a Mac OS X pasteboard? There  
does not seem to be anything on CPAN that strikes me as being for that purpose. 
I kind of expected something in Mac::Carbon to do the job, but if it's there I 
can't find it. Of course, I'm perfectly capable of not seeing my nose in front 
of my face ...

I have been hacking around with a .xs module based on the Pasteboard interface. 
This means it requires at least Mac OS 10.3 (Panther). So my questions for the 
mailing list are:

Have I re-invented the wheel? If so, where should I have looked that I didn't 
for this functionality?

Is there any interest in publication of this module? Putting data on and taking 
data off the pasteboard appear to work now. I haven't looked into promised data 
at all, and can't promise to support it in the future. I also don't anticipate 
the module being smart enough to figure out the appropriate flavor for a given 
datum, or other flavor-aware functionality. Also, I haven't yet figured out 
where to put everything to support Module::Build, so it's ExtUtils::MakeMaker 
for now. It's an o-o interface, with an object representing a pasteboard. There 
are a couple convenience routines exported by default (should they be?) called 
pbcopy() and pbpaste(), which instantiate an object to access the system 
clipboard, access it, and then throw the object away. The flavor and synch 
flags would be exportable as constants.

If I end up publishing, what name should I use? It appears that most Mac OS 
specific things have been dumped into the Mac:: name space, Dan Kogai's 
MacOSX::Files being the exception. The proposal was Mac::Pasteboard because 
that's the interface used (rather than the scrap manager).

And a meta-question: what other information do I need to supply for people to 
be able to comment meaningfully?

Thank you very much,
Tom Wyant (mailing address to the contrary notwithstanding)


Re: Proposed Mac::Pasteboard

2008-01-21 Thread Claes Jakobsson

Hi,

I assume with pasteboard you mean the clipboard?

There seems to be an attempt of a generic cliboard interface on CPAN (http://search.cpan.org/dist/Clipboard/ 
) which according to the readme says it works on OS X. I suppose it  
just uses the 'pbcopy' and 'pbpaste' command line tools.


Cheers,
Claes

On 21 jan 2008, at 04.15, [EMAIL PROTECTED] wrote:


Dear All,

I don't know if I'm re-inventing the wheel here, so I thought I'd ask.

Is there a module that will let one manipulate a Mac OS X  
pasteboard? There  does not seem to be anything on CPAN that strikes  
me as being for that purpose. I kind of expected something in  
Mac::Carbon to do the job, but if it's there I can't find it. Of  
course, I'm perfectly capable of not seeing my nose in front of my  
face ...


I have been hacking around with a .xs module based on the Pasteboard  
interface. This means it requires at least Mac OS 10.3 (Panther). So  
my questions for the mailing list are:


Have I re-invented the wheel? If so, where should I have looked that  
I didn't for this functionality?


Is there any interest in publication of this module? Putting data on  
and taking data off the pasteboard appear to work now. I haven't  
looked into promised data at all, and can't promise to support it in  
the future. I also don't anticipate the module being smart enough to  
figure out the appropriate flavor for a given datum, or other  
flavor-aware functionality. Also, I haven't yet figured out where  
to put everything to support Module::Build, so it's  
ExtUtils::MakeMaker for now. It's an o-o interface, with an object  
representing a pasteboard. There are a couple convenience routines  
exported by default (should they be?) called pbcopy() and pbpaste(),  
which instantiate an object to access the system clipboard, access  
it, and then throw the object away. The flavor and synch flags would  
be exportable as constants.


If I end up publishing, what name should I use? It appears that most  
Mac OS specific things have been dumped into the Mac:: name space,  
Dan Kogai's MacOSX::Files being the exception. The proposal was  
Mac::Pasteboard because that's the interface used (rather than the  
scrap manager).


And a meta-question: what other information do I need to supply for  
people to be able to comment meaningfully?


Thank you very much,
Tom Wyant (mailing address to the contrary notwithstanding)


Re: Proposed Mac::Pasteboard

2008-01-21 Thread brian d foy
[[ This message was both posted and mailed: see
   the To, Cc, and Newsgroups headers for details. ]]

In article
012120080315.17779.47940E4B0005B034457322007507440B0B9A0300979D9D0E
[EMAIL PROTECTED], [EMAIL PROTECTED] wrote:


 Is there a module that will let one manipulate a Mac OS X pasteboard? There 
 does not seem to be anything on CPAN that strikes me as being for that
 purpose.

I'd like to have such a thing, although you should call it
Mac::Clipboard :)