perl

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

os2/OS2/OS2-PrfDB/Makefile.PL			System database access module
os2/OS2/OS2-PrfDB/MANIFEST			System database access module
os2/OS2/OS2-PrfDB/PrfDB.pm			System database access module
os2/OS2/OS2-PrfDB/PrfDB.xs			System database access module
os2/OS2/OS2-PrfDB/t/os2_prfdb.t			System database access module
os2/OS2/OS2-Process/Makefile.PL			system() constants in a module
os2/OS2/OS2-Process/MANIFEST			system() constants in a module
os2/OS2/OS2-Process/Process.pm			system() constants in a module
os2/OS2/OS2-Process/Process.xs			system() constants in a module
os2/OS2/OS2-Process/t/os2_atoms.t		Test for OS2::Process
os2/OS2/OS2-Process/t/os2_clipboard.t		Test for OS2::Process
os2/OS2/OS2-Process/t/os2_process.t		Tests
os2/OS2/OS2-Process/t/os2_process_kid.t		Tests
os2/OS2/OS2-Process/t/os2_process_text.t	Tests
os2/OS2/OS2-REXX/Changes			DLL access module
os2/OS2/OS2-REXX/DLL/Changes			DLL access module
os2/OS2/OS2-REXX/DLL/DLL.pm			DLL access module
os2/OS2/OS2-REXX/DLL/DLL.xs			DLL access module
os2/OS2/OS2-REXX/DLL/Makefile.PL		DLL access module
os2/OS2/OS2-REXX/DLL/MANIFEST			DLL access module
os2/OS2/OS2-REXX/Makefile.PL			DLL access module

os2/OS2/OS2-Process/Process.pm  view on Meta::CPAN

=item ActiveDesktopPathname()

gets the path of the directory which corresponds to Desktop.

=item 	InvalidateRect

=item	CreateFrameControls

=back

=head2 Control of the PM clipboard

=over

=item ClipbrdText()

gets the content of the clipboard.  An optional argument is the format
of the data in the clipboard (defaults to C<CF_TEXT>).  May croak with error
C<PMERR_INVALID_HWND> if no data of given $fmt is present.

Note that the usual convention is to have clipboard data with
C<"\r\n"> as line separators.  This function will only work with clipboard
data types which are delimited by C<"\0"> byte (not included in the result).

=item ClipbrdText_2byte

Same as ClipbrdText(), but will only work with clipboard
data types which are collection of C C<shorts> delimited by C<0> short
(not included in the result).

=item ClipbrdTextUCS2le

Same as ClipbrdText_2byte(), but will assume that the shorts represent
an Unicode string in I<UCS-2le> format (little-endian 2-byte representation
of Unicode), and will provide the result in Perl internal C<utf8> format
(one short of input represents one Perl character).

Note that Firefox etc. export their selection in unicode types of this format.

=item ClipbrdText_set($txt, [$no_convert_nl, [$fmt, [$fmtinfo, [$hab] ] ] ] )

sets the text content of the clipboard after removing old contents.  Unless the
optional argument  $no_convert_nl is TRUE, will convert newlines to C<"\r\n">.  Another optional
argument $fmt is the format of the data in the clipboard (should be an
atom, defaults to C<CF_TEXT>).  Other arguments are as for C<ClipbrdData_set>.
Croaks on failure.

=item	ClipbrdFmtInfo( [$fmt, [ $hab ] ])

returns the $fmtInfo flags set by the application which filled the
format $fmt of the clipboard.  $fmt defaults to C<CF_TEXT>.

=item	ClipbrdOwner( [ $hab ] )

Returns window handle of the current clipboard owner.

=item	ClipbrdViewer( [ $hab ] )

Returns window handle of the current clipboard viewer.

=item	ClipbrdData( [$fmt, [ $hab ] ])

Returns a handle to clipboard data of the given format as an integer.
Format defaults to C<CF_TEXT> (in this case the handle is a memory address).

Clipboard should be opened before calling this function.  May croak with error
C<PMERR_INVALID_HWND> if no data of given $fmt is present.

The result should not be used after clipboard is closed.  Hence a return handle 
of type C<CLI_POINTER> may need to be converted to a string and stored for
future usage.  Use MemoryRegionSize() to get a high estimate on the length
of region addressed by this pointer; the actual length inside this region
should be obtained by knowing particular format of data.  E.g., it may be
0-byte terminated for string types, or 0-short terminated for wide-char string
types.

=item	OpenClipbrd( [ $hab ] )

claim read access to the clipboard.  May need a message queue to operate.
May block until other processes finish dealing with clipboard.

=item	CloseClipbrd( [ $hab ] )

Allow other processes access to clipboard.
Clipboard should be opened before calling this function.

=item	ClipbrdData_set($data, [$convert_nl, [$fmt, [$fmtInfo, [ $hab] ] ] ] )

Sets the clipboard data of format given by atom $fmt.  Format defaults to
CF_TEXT.

$fmtInfo should declare what type of handle $data is; it should be either
C<CFI_POINTER>, or C<CFI_HANDLE> (possibly qualified by C<CFI_OWNERFREE>
and C<CFI_OWNERDRAW> flags).  It defaults to C<CFI_HANDLE> for $fmt being
standard bitmap, metafile, and palette (undocumented???) formats;
otherwise defaults to C<CFI_POINTER>.  If format is C<CFI_POINTER>, $data
should contain the string to copy to clipboard; otherwise it should be an
integer handle.

If $convert_nl is TRUE (the default), C<"\n"> in $data are converted to
C<"\r\n"> pairs if $fmt is C<CFI_POINTER> (as is the convention for text
format of the clipboard) unless they are already in such a pair.

=item	_ClipbrdData_set($data, [$fmt, [$fmtInfo, [ $hab] ] ] )

Sets the clipboard data of format given by atom $fmt.  Format defaults to
CF_TEXT.  $data should be an address (in givable unnamed shared memory which
should not be accessed or manipulated after this call) or a handle in a form
of an integer.

$fmtInfo has the same semantic as for ClipbrdData_set().

=item	ClipbrdOwner_set( $hwnd, [ $hab ] )

Sets window handle of the current clipboard owner (window which gets messages
when content of clipboard is retrieved).

=item	ClipbrdViewer_set( $hwnd, [ $hab ] )

Sets window handle of the current clipboard owner (window which gets messages
when content of clipboard is changed).

=item	ClipbrdFmtNames()

Returns list of names of formats currently available in the clipboard.

=item	ClipbrdFmtAtoms()

Returns list of atoms of formats currently available in the clipboard.

=item	EnumClipbrdFmts($fmt [, $hab])

Low-level access to the list of formats currently available in the clipboard.
Returns the atom for the format of clipboard after $fmt.  If $fmt is 0, returns
the first format of clipboard.  Returns 0 if $fmt is the last format.  Example:

  {
    my $h = OS2::localClipbrd->new('nomorph');
    my $fmt = 0;
    push @formats, AtomName $fmt
      while $fmt = EnumClipbrdFmts $fmt;
  }

Clipboard should be opened before calling this function.  May croak if
no format is present.

=item	EmptyClipbrd( [ $hab ] )

Remove all the data handles in the clipboard.  croak()s on failure.
Clipboard should be opened before calling this function.

Recommended before assigning a value to clipboard to remove extraneous
formats of data from clipboard.

=item ($size, $flags) = MemoryRegionSize($addr, [$size_lim, [ $interrupt ]])

$addr should be a memory address (encoded as integer).  This call finds
the largest continuous region of memory belonging to the same memory object
as $addr, and having the same memory flags as $addr. $flags is the value of
the memory flag of $addr (see docs of DosQueryMem(3) for details).  If
optional argument $size_lim is given, the search is restricted to the region
this many bytes long (after $addr).

($addr and $size are rounded so that all the memory pages containing
the region are inspected.)  Optional argument $interrupt (defaults to 1)
specifies whether region scan should be interruptible by signals.

=back

Use class C<OS2::localClipbrd> to ensure that clipboard is closed even if
the code in the block made a non-local exit.

See the L</OS2::localMorphPM, OS2::localFlashWindow, and OS2::localClipbrd classes>

=head2 Control of the PM atom tables

Low-level methods to access the atom table(s).  $atomtable defaults to 
the SystemAtomTable().

=over

os2/OS2/OS2-Process/Process.pm  view on Meta::CPAN

the given scope.

  {
    my $h = OS2::localMorphPM->new(0);
    # Do something
  }

The argument has the same meaning as one to OS2::MorphPM().  Calls can
nest with internal ones being NOPs.

Likewise, C<OS2::localClipbrd> class opens the clipboard for the duration
of the current scope; if TRUE optional argument is given, it would not
morph the application into PM:

  {
    my $handle = OS2::localClipbrd->new(1);	# Do not morph into PM
    # Do something with clipboard here...
  }

C<OS2::localFlashWindow> behaves similarly; see
L<FlashWindow($hwnd, $doFlash)>.

=head1 EXAMPLES

The test suite for this module contains an almost comprehensive collection
of examples of using the API of this module.

os2/OS2/OS2-Process/t/os2_clipboard.t  view on Meta::CPAN

$v = ClipbrdViewer;
ok((!$v || IsWindow $v), "ClipbrdViewer is not defined or a valid window");

is(ClipbrdFmtInfo, 0, 'ClipbrdFmtInfo is 0');

@f = ClipbrdFmtAtoms;
is(scalar @f, 0, "No formats available");

{
  my $h = OS2::localClipbrd->new;
  ok(EmptyClipbrd, 'EmptyClipbrd when clipboard is empty succeeds');
}

ok(ClipbrdText_set($raw, 1), 'ClipbrdText_set() raw');
is(ClipbrdText, $raw, "ClipbrdText it back");

{
  my $h = OS2::localClipbrd->new;
  ok(EmptyClipbrd, 'EmptyClipbrd again');
}



( run in 0.732 second using v1.01-cache-2.11-cpan-84e82930d8c )