view release on metacpan or search on metacpan
lib/Win32/AutoItX.pm view on Meta::CPAN
### AutoItX native methods ###
my $pid = $a->Run('calc.exe');
my $clipboard_text = $a->ClipGet;
$a->ClipPut("Win32::AutoItX rulez!");
my $color = $a->PixelGetColor(42, 42);
### Perlish methods ###
view all matches for this distribution
view release on metacpan or search on metacpan
Clipboard.pm view on Meta::CPAN
package Win32::Clipboard;
#######################################################################
#
# Win32::Clipboard - Interaction with the Windows clipboard
#
# Version: 0.58
# Author: Aldo Calpini <dada@perl.it>
#
# Modified by: Hideyo Imazu <himazu@gmail.com>
Clipboard.pm view on Meta::CPAN
__END__
=head1 NAME
Win32::Clipboard - Interaction with the Windows clipboard
=head1 SYNOPSIS
use Win32::Clipboard;
$CLIP = Win32::Clipboard();
print "Clipboard contains: ", $CLIP->Get(), "\n";
$CLIP->Set("some text to copy into the clipboard");
$CLIP->Empty();
$CLIP->WaitForChange();
print "Clipboard has changed!\n";
=head1 DESCRIPTION
This module lets you interact with the Windows clipboard: you can get
its content, set it, empty it, or let your script sleep until it
changes. This version supports 3 formats for clipboard data:
=over 4
=item * text (C<CF_TEXT>)
The clipboard contains some text; this is the B<only> format you can
use to set clipboard data; you get it as a single string.
Example:
$text = Win32::Clipboard::GetText();
print $text;
=item * bitmap (C<CF_DIB>)
The clipboard contains an image, either a bitmap or a picture copied
in the clipboard from a graphic application. The data you get is a
binary buffer ready to be written to a bitmap (BMP format) file.
Example:
$image = Win32::Clipboard::GetBitmap();
Clipboard.pm view on Meta::CPAN
print BITMAP $image;
close BITMAP;
=item * list of files (C<CF_HDROP>)
The clipboard contains files copied or cutted from an Explorer-like
application; you get a list of filenames.
Example:
@files = Win32::Clipboard::GetFiles();
Clipboard.pm view on Meta::CPAN
=head2 REFERENCE
All the functions can be used either with their full name
(eg. B<Win32::Clipboard::Get>) or as methods of a C<Win32::Clipboard>
object. For the syntax, refer to L</SYNOPSIS> above. Note also that
you can create a clipboard object and set its content at the same time
with:
$CLIP = Win32::Clipboard("blah blah blah");
or with the more common form:
Clipboard.pm view on Meta::CPAN
tie $CLIP, 'Win32::Clipboard';
print "Clipboard content: $CLIP\n";
$CLIP = "some text to copy to the clipboard...";
In this case, you can still access other methods using the tied()
function:
tied($CLIP)->Empty;
Clipboard.pm view on Meta::CPAN
=over 4
=item Empty()
Empty the clipboard.
=item EnumFormats()
Returns an array of identifiers describing the format for the data
currently in the clipboard. Formats can be standard ones (described in
the L</CONSTANTS> section) or application-defined custom ones. See
also IsFormatAvailable().
=item Get()
Returns the clipboard content; note that the result depends on the
nature of clipboard data; to ensure that you get only the desired
format, you should use GetText(), GetBitmap() or GetFiles()
instead. Get() is in fact implemented as:
if( IsBitmap() ) { return GetBitmap(); }
elsif( IsFiles() ) { return GetFiles(); }
else { return GetText(); }
See also IsBitmap(), IsFiles(), IsText(), EnumFormats() and
IsFormatAvailable() to check the clipboard format before getting data.
=item GetAs(FORMAT)
Returns the clipboard content in the desired FORMAT (can be one of the
constants defined in the L</CONSTANTS> section or a custom
format). Note that the only meaningful identifiers are CF_TEXT,
CF_UNICODETEXT, CF_DIB and CF_HDROP; any other format is treated as a
string.
Clipboard.pm view on Meta::CPAN
$text = $clip->GetAs(CF_UNICODETEXT);
$text = Encode::decode("UTF16-LE", $text);
=item GetBitmap()
Returns the clipboard content as an image, or C<undef> on errors.
=item GetFiles()
Returns the clipboard content as a list of filenames, or C<undef> on
errors.
=item GetFormatName(FORMAT)
Returns the name of the specified custom clipboard format, or C<undef>
on errors; note that you cannot get the name of the standard formats
(described in the L</CONSTANTS> section).
=item GetText()
Returns the clipboard content as a string, or C<undef> on errors.
=item IsBitmap()
Returns a boolean value indicating if the clipboard contains an image.
See also GetBitmap().
=item IsFiles()
Returns a boolean value indicating if the clipboard contains a list of
files. See also GetFiles().
=item IsFormatAvailable(FORMAT)
Checks if the clipboard data matches the specified FORMAT (one of the
constants described in the L</CONSTANTS> section); returns zero if the
data does not match, a nonzero value if it matches.
=item IsText()
Returns a boolean value indicating if the clipboard contains text.
See also GetText().
=item Set(VALUE)
Set the clipboard content to the specified string.
=item WaitForChange([TIMEOUT])
This function halts the script until the clipboard content changes. If
you specify a C<TIMEOUT> value (in milliseconds), the function will
return when this timeout expires, even if the clipboard hasn't
changed. If no value is given, it will wait indefinitely. Returns 1 if
the clipboard has changed, C<undef> on errors.
=back
=head2 CONSTANTS
These constants are the standard clipboard formats recognized by
Win32::Clipboard:
CF_TEXT 1
CF_DIB 8
CF_HDROP 15
view all matches for this distribution
view release on metacpan or search on metacpan
Scintilla.pm view on Meta::CPAN
# Undo one action in the undo history.
sub Undo {
my $self = shift;
return $self->SendMessage (2176, 0, 0);
}
# Cut the selection to the clipboard.
sub Cut {
my $self = shift;
return $self->SendMessage (2177, 0, 0);
}
# Copy the selection to the clipboard.
sub Copy {
my $self = shift;
return $self->SendMessage (2178, 0, 0);
}
# Paste the contents of the clipboard into the document replacing the selection.
sub Paste {
my $self = shift;
return $self->SendMessage (2179, 0, 0);
}
# Clear the selection.
Scintilla.pm view on Meta::CPAN
# page into account. Maximum value returned is the last position in the document.
sub PositionAfter {
my ($self, $pos) = @_;
return $self->SendMessage (2418, $pos, 0);
}
# Copy a range of text to the clipboard. Positions are clipped into the document.
sub CopyRange {
my ($self, $start, $end) = @_;
return $self->SendMessage (2419, $start, $end);
}
# Copy argument text to the clipboard.
# CopyText(text)
sub CopyText {
my ($self, $text) = @_;
my $length = length $text;
return $self->SendMessageNP (2420, $length, $text);
Scintilla.pm view on Meta::CPAN
Undo one action in the undo history.
=item C<Cut>
Cut the selection to the clipboard.
=item C<Copy>
Copy the selection to the clipboard.
=item C<Paste>
Paste the contents of the clipboard into the document replacing the selection.
=item C<Clear>
Clear the selection.
Scintilla.pm view on Meta::CPAN
Given a valid document position, return the next position taking code
page into account. Maximum value returned is the last position in the document.
=item C<CopyRange>(start, end)
Copy a range of text to the clipboard. Positions are clipped into the document.
=item C<CopyText> (length, text)
Copy argument text to the clipboard.
=item C<SetSelectionMode> (mode)
Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE) or by lines (SC_SEL_LINES).
view all matches for this distribution
view release on metacpan or search on metacpan
Win32-GUI_AxWindow/demos/UnComplete/MsFlexGrid.pm view on Meta::CPAN
## [id(0x0000002a), propget, helpstring("Returns/sets an image to be displayed in the current cell or in a range of cells."), helpcontext(0x000591e9)]
## IPictureDisp* CellPicture();
## [id(0x0000002a), propputref, helpstring("Returns/sets an image to be displayed in the current cell or in a range of cells."), helpcontext(0x000591e9)]
## void CellPicture([in] IPictureDisp* rhs);
##
## [id(0x00000031), propget, helpstring("Returns a picture of the FlexGrid control, suitable for printing, saving to disk, copying to the clipboard, or assigning to a different control."), helpcontext(0x00059207)]
## IPictureDisp* Picture();
##
## [id(0x00000036), propget, helpstring("Returns/sets a custom mouse icon."), helpcontext(0x000591cd)]
## IPictureDisp* MouseIcon();
## [id(0x00000036), propputref, helpstring("Returns/sets a custom mouse icon."), helpcontext(0x000591cd)]
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Win32/GUITaskAutomate.pm view on Meta::CPAN
);
$robot->find_do( 'pic1', # wait for loaded pic to appear
[
{ save => 1 }, # save mouse cursor position
\ "ZOMG!!!!.pl", # put this text into clipboard
{ rmb => 1, x => 10, y => 20 }, # click right mouse button
"{UP}{UP}~^v", # press UP arrow twice, ENTER and CTRL+V
{ lmb => 1, x => 100, y => 100 }, # click left mouse button
{ restore => 1 }, # restore original mouse cursor position
]
);
my $clipboard_contents = $robot->get_clip;
$robot->set_clip( "New clipboard contents" );
=head1 DESCRIPTION
I wrote this module because I needed to automate certain GUI tasks in a limited amount of time. Win32::GUIRobot was very helpful to me
with that, however I wanted some interface that would allow me to
lib/Win32/GUITaskAutomate.pm view on Meta::CPAN
{ lmb => 1, x => 10, y => 10 }, # click left mouse
{ rmb => 1, x => -10, y => -10 }, # right click
{ lmbd => 1, x => 10, y => 10 }, # left double click
{ mw => 2 }, # move mouse wheel.
"{UP}{DOWN}~", # press Up, Down and Enter keys
\ "Clip!", # copy text 'Clip!' into the clipboard
[ 2 ], # wait for 2 seconds
], 400, 500 );
This method instructs your robot to do some "stuff". The first
argument is an arrayref with instructions (See ROBOT INSTRUCTIONS below for descriptions). The second and third arguments are "x origin" and "y origin" respectively. Those two values will be basically added to any 'x' and 'y' values in the
lib/Win32/GUITaskAutomate.pm view on Meta::CPAN
=head2 A scalar reference
\ "Clipper"
When an element is a scalar reference, the content will be stuffed
into the clipboard. If you want your robot to type up a large chunk
of text, it will be significantly faster to drop that text into the
clipboard and then issue a "^v" (CTRL+V) to paste it instead of
asking the robot to type it all out key by key.
=head2 An arrayref
[10]
lib/Win32/GUITaskAutomate.pm view on Meta::CPAN
to press the button, which defaults to C<1> if not specified.
C<$x> and C<$y> default to C<0>.
=head2 set_clip
$robot->set_clip( 'Text to put into the clipboard' );
Takes one argument which will be put into the clipboard. Technically this
can be anything accepted by the L<Win32::Clipboard> C<Set()> method, but
was tested only with textual content.
=head2 get_clip
my $clipboard_stuff = $robot->get_clip;
Takes no arguments. Returns clipboard contents. Technically this may be
anything returned by L<Win32::Clipboard> C<Get()> method, but was tested
only with textual content.
=head2 clip
my $clipboard = $robot->clip;
Returns Win32::Clipboard object if you'll ever need it.
=head2 pics
lib/Win32/GUITaskAutomate.pm view on Meta::CPAN
When found -- press C<CTRL+T> key, wait for 1.1 seconds.
=item *
Push string "Hello World!" intro the clipboard, paste it
with C<CTRL+V> and press C<ENTER> key.
=back
view all matches for this distribution
view release on metacpan or search on metacpan
eg/winbmp.pl view on Meta::CPAN
#!/usr/bin/perl
# $Id: winbmp.pl,v 1.2 2004/03/21 08:05:06 ctrondlp Exp $
# This script has been written by Jarek Jurasz jurasz@imb.uni-karlsruhe.de
# Save a given window as BMP file
# Copy the contents to the clipboard
use Win32::GuiTest qw(:ALL);
($w) = FindWindowLike(0, "^Calc");
view all matches for this distribution
view release on metacpan or search on metacpan
examples/pasteSpecial.pl view on Meta::CPAN
#!/usr/bin/env perl
################################################
# PasteSpecial for Notepad++
# List formats currently on the clipboard
# Allows you to choose one of those formats
# Will paste the selected type (UTF8-encoded)
# at the current location in the active file
################################################
# HISTORY
examples/pasteSpecial.pl view on Meta::CPAN
}
return @f;
}
sub runDialog {
my $clipboard;
my $persist = 1;
my $dlg = Win32::GUI::Window->new(
-title => sprintf('Notepad++ Paste Special %s', $VERSION),
-left => CW_USEDEFAULT,
examples/pasteSpecial.pl view on Meta::CPAN
my $update_preview = sub {
my $self = shift // return -1;
my $value = $self->GetText($self->GetCurSel());
my $f=$rmap{$value};
$clipboard = $CLIP->GetAs($f);
$clipboard = Encode::decode('UTF16-LE', $clipboard) if $f == CF_UNICODETEXT();
(my $preview = $clipboard) =~ s/([^\x20-\x7F\r\n])/sprintf '\x{%02X}', ord $1/ge;
$preview =~ s/\R/\r\n/g;
$self->GetParent()->PREVIEW->Text( $preview );
return 1;
};
my $lb = $dlg->AddListbox(
examples/pasteSpecial.pl view on Meta::CPAN
-text => 'Paste',
-size => [80,25],
-left => $dlg->ScaleWidth()-90*2,
-top => $button_top,
-onClick => sub{ # v1.3: allow to persist after paste: TODO: move the editor->addText here
editor->addText( Encode::encode("UTF8", $clipboard) ) if defined $clipboard;
return $persist ? 1 : -1;
},
);
$dlg->AddButton(
-name => 'CANCEL',
-text => 'Cancel',
-size => [80,25],
-left => $dlg->ScaleWidth()-90*1,
-top => $button_top,
-onClick => sub{ $clipboard=undef; -1; },
);
$dlg->AddGroupbox(
-name => 'GB',
-title => 'Preview',
examples/pasteSpecial.pl view on Meta::CPAN
$dlg->CB->SetCheck($persist);
$refresh_formats->();
$dlg->Show();
Win32::GUI::Dialog();
return $clipboard;
}
view all matches for this distribution
view release on metacpan or search on metacpan
###
###########################################################################
my $twain_select_image_source;
my $twain_acquire_to_file;
my $twain_acquire_to_clipboard;
my $twain_is_available;
my $twain_easy_version;
###########################################################################
if(defined $parms{-dll}) { $path_to_dll = $parms{-dll}; }
$twain_select_image_source = new Win32::API("${path_to_dll}eztw32.dll", "TWAIN_SelectImageSource", ['N'], 'N') || croak "Importing API call TWAIN_SelectImageSource failed";
$twain_acquire_to_file = new Win32::API("${path_to_dll}eztw32.dll", "TWAIN_AcquireToFilename", ['N', 'P'], 'N') || croak "Importing API call TWAIN_AcquireToFilename failed";
$twain_acquire_to_clipboard = new Win32::API("${path_to_dll}eztw32.dll", "TWAIN_AcquireToClipboard", ['N', 'I'], 'N') || croak "Importing API call TWAIN_AcquireToClipboard failed";
$twain_is_available = new Win32::API("${path_to_dll}eztw32.dll", "TWAIN_IsAvailable", undef, 'N') || croak "Importing API call TWAIN_IsAvailable failed";
$twain_easy_version = new Win32::API("${path_to_dll}eztw32.dll", "TWAIN_EasyVersion", undef, 'N') || croak "Importing API call TWAIN_EasyVersion failed";
%{$self} = %parms;
bless $self, $class;
###
### Methods.
###
###########################################################################
# select_image_source, acquire_to_file and acquire_to_clipboard don't need
# a windows handle. TWAIN wants to defocus and disable the application
# window that called him. According to the documented source file of
# eztw32.dll you may omit the handle. If you omit the handle, eztw32.dll
# will create an invisible proxy window. But what ever you do, don't pass
# the handle of your console window, if you do this anyway, it can really
if(defined $self->{-hwnd}) { $hwnd = $self->{-hwnd}; }
if(!defined $file) { $file = ""; }
return $twain_acquire_to_file->Call($hwnd, $file);
}
sub acquire_to_clipboard
{
my($self, $pixtype) = @_; my $hwnd = 0;
if(defined $self->{-hwnd}) { $hwnd = $self->{-hwnd}; }
if(!defined $pixtype) { $pixtype = TWAIN_ANYTYPE; }
return $twain_acquire_to_clipboard->Call($hwnd, $pixtype);
}
sub is_available { return $twain_is_available->Call(); }
sub easy_version { return sprintf("%.2f", ($twain_easy_version->Call() / 100)); }
Writing bitmap to file failed, device full?
=back
=item acquire_to_clipboard($pix_type)
This method starts the scanner user interface and pastes the scanned image
as a bitmap to the windows clipboard. You can force the user interface to
scan the image in a specified pixel type.
Possible pixel types:
=over 4
TWAIN service of my Pinnacle Sys TV card caused some problems. Don't say
I didn't warn you.
=head1 SEE ALSO
C<Win32::Clipboard>, get the scanned image from the clipboard.
=head1 AUTHOR
Lennert Ouwerkerk <lennert@kabelfoon.nl>
view all matches for this distribution
view release on metacpan or search on metacpan
ShellExt/CtxtMenu.pm view on Meta::CPAN
use strict;
use Win32::ShellExt;
use Win32::Clipboard;
$Win32::ShellExt::CopyPath::VERSION='0.1';
$Win32::ShellExt::CopyPath::TEXT="Copy path to clipboard";
@Win32::ShellExt::CopyPath::ISA=qw(Win32::ShellExt);
sub query_context_menu() {
"Win32::ShellExt::CopyPath";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Win32/Shortkeys.pm view on Meta::CPAN
The shortkeys.xml file should be utf-8 encoded, even if the encoding can be defined in the properties.
With the key <, the script enter a "search mode" for a shortkey sequence. This key is hard coded and can't be changed (unless you edit the code).
The text from the shortkeys file is sent to the keyboard using the send_input API function. With using the C<use.ctrl_v='1'> attribute in a data element, the text will be place in the clipboard and paste (with sending the keys ctlr + v) at the cursor...
<data k= 'a' use.ctrl_v= '1'>
This text will be copied and paste.
And the new line will be preserved.
</data>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WordList/EN/Corncob.pm view on Meta::CPAN
clink
clinked
clinker
clinking
clip
clipboard
clipboards
clipped
clipper
clippers
clipping
clippings
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WordList/EN/Enable.pm view on Meta::CPAN
cliometric
cliometrician
cliometricians
cliometrics
clip
clipboard
clipboards
clipped
clipper
clippers
clipping
clippings
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Wrangler/Wx/Dialog/ListingToText.pm view on Meta::CPAN
## element 2: a text field for diplaying
$self->{text} = Wx::TextCtrl->new($self, -1, '', wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
## element 3: some buttons
my $btn_clipboard = new Wx::Button($self, -1, 'Copy to Clipboard');
my $btn_save = new Wx::Button($self, -1, 'Save as...');
my $btn_sizer = new Wx::BoxSizer(wxHORIZONTAL);
$btn_sizer->Add($btn_clipboard, 0, wxRIGHT, 15);
$btn_sizer->Add($btn_save, 0, wxRIGHT, 2);
$btn_sizer->Add(new Wx::Button($self, wxID_CANCEL, 'Cancel'), 0, wxRIGHT, 5);
my $sizer = Wx::FlexGridSizer->new(3, 1, 0, 0); # rows,cols,vgap,hgap
$sizer->AddGrowableCol(0); # zerobased
lib/Wrangler/Wx/Dialog/ListingToText.pm view on Meta::CPAN
EVT_RADIOBUTTON($self, $btn_radio1, sub { $self->{mode} = 1; $self->populate_display(); });
EVT_RADIOBUTTON($self, $btn_radio2, sub { $self->{mode} = 2; $self->populate_display(); });
EVT_RADIOBUTTON($self, $btn_radio3, sub { $self->{mode} = 3; $self->populate_display(); });
EVT_BUTTON($self, $btn_save, \&collect_path );
EVT_BUTTON($self, $btn_clipboard, sub {
Wrangler::debug("ListingToText: copy to clipboard");
my $tdo = Wx::TextDataObject->new();
$tdo->SetText( $self->{text}->GetValue() );
wxTheClipboard->Open();
view all matches for this distribution
view release on metacpan or search on metacpan
cpp/wxactivex.h view on Meta::CPAN
/// Main class for embedding a ActiveX control.
/// Use by itself or derive from it
/// \note The utility program (wxie) can generate a list of events, methods & properties
/// for a control.
/// First display the control (File|Display),
/// then get the type info (ActiveX|Get Type Info) - these are copied to the clipboard.
/// Eventually this will be expanded to autogenerate
/// wxWindows source files for a control with all methods etc encapsulated.
/// \par Usage:
/// construct using a ProgId or class id
/// \code new wxActiveX(parent, CLSID_WebBrowser, id, pos, size, style, name)\endcode
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Wx/DemoModules/wxClipboard.pm view on Meta::CPAN
}
$this->image->SetBitmap( $bitmap );
# testing the perl data object
my $data = get_perl_data_object();
Wx::LogMessage( "Testing if clipboard supports: " . $data->GetFormat->GetId() );
if( wxTheClipboard->IsSupported( $data->GetFormat ) ) {
Wx::LogMessage( "It does: get data from clipboard" );
my $ok = wxTheClipboard->GetData( $data );
if( $ok ) {
Wx::LogMessage( "Pasted perl data object" );
my $PerlData = $data->GetPerlData();
foreach (keys %$PerlData) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Wx/Perl/PodBrowser.pm view on Meta::CPAN
# {
# my $item
# = $self->{'edit_copy_menuitem'}
# = $menu->Append (Wx::wxID_COPY(),
# '',
# Wx::GetTranslation('Copy selected text to the clipboard.'));
# EVT_MENU ($self, $item, 'edit_copy');
# Wx::Event::EVT_UPDATE_UI ($self, $item, \&_update_can_copy);
# }
# {
# my $item = $menu->Append (Wx::wxID_SELECTALL(),
view all matches for this distribution
view release on metacpan or search on metacpan
wx-scintilla/include/WxScintilla.h view on Meta::CPAN
void EmptyUndoBuffer();
// Undo one action in the undo history.
void Undo();
// Cut the selection to the clipboard.
void Cut();
// Copy the selection to the clipboard.
void Copy();
// Paste the contents of the clipboard into the document replacing the selection.
void Paste();
// Clear the selection.
void Clear();
wx-scintilla/include/WxScintilla.h view on Meta::CPAN
// Given a valid document position, return the next position taking code
// page into account. Maximum value returned is the last position in the document.
int PositionAfter(int pos);
// Copy a range of text to the clipboard. Positions are clipped into the document.
void CopyRange(int start, int end);
// Copy argument text to the clipboard.
void CopyText(int length, const wxString& text);
// Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or
// by lines (SC_SEL_LINES).
void SetSelectionMode(int mode);
view all matches for this distribution
view release on metacpan or search on metacpan
ext/dnd/lib/Wx/DND.pm view on Meta::CPAN
use vars qw($_df_invalid $_df_bitmap $_df_text $_df_unicodetext $_df_metafile $_df_filename);
# !parser: sub { $_[0] =~ m/^\s*\#\s*sub\s+(wx\w+)/ }
# !package: Wx
# !tag: dnd clipboard
# sub wxDF_INVALID
# sub wxDF_TEXT
# sub wxDF_UNICODETEXT
# sub wxDF_BITMAP
view all matches for this distribution
view release on metacpan or search on metacpan
lib/XAO/DO/Config.pm view on Meta::CPAN
my $odb=$config->odb;
=head1 DESCRIPTION
This object provides storage for project specific configuration
variables and clipboard mechanism.
It can ``embed'' other configuration objects that describe specific
parts of the system -- such as database, web or something else. This is
done by using method embed() -- see below.
view all matches for this distribution
view release on metacpan or search on metacpan
cache_time => for how long to keep retrieved content in memory cache,
default is 5 minutes
cache_size => the size of memory cache in KB, default is 1024
flag_cb_uri => location of a flag in clipboard that indicates whether
or not the preview mode is on
=head1 INSTALLATION AND USE
The easiest way to install XAO Content is to use CPAN. Usually you would
name => Name of content
data_id => ID of a specific version (optional, rarely used)
preview => if non-zero then unpublished version of content will
be used. If that argument is not present then the
clipboard preview flag is used (see flag_cb_uri above)
The following list of methods also shows 'mode' as the first element
(order alphabetically).
=over
###############################################################################
=item 'content-data' => content_data (%)
Displays data text by name according to preview argument or clipboard
flag.
By default it just outputs the content literally without any
processing. If 'parse' argument is true then the content will be parsed
as if it were a template. Arguments given to 'content-data' will be
my $args=get_args(\@_);
my $config=$self->siteconfig('/content');
my $flag_cb_uri=$config->{flag_cb_uri} || '/content/preview_flag';
my $preview=$args->{preview} ||
$self->clipboard->get($flag_cb_uri) ||
'';
my $text;
if($preview) {
if($args->{'default.path'} || defined($args->{'default.template'})) {
my $args=get_args(\@_);
my $config=$self->siteconfig('/content');
my $flag_cb_uri=$config->{flag_cb_uri} || '/content/preview_flag';
if($self->clipboard->get($flag_cb_uri)) {
$self->object->display(template => $args->{template},
path => $args->{path});
}
elsif($args->{'default.path'} || defined($args->{'default.template'})) {
$self->object->display(template => $args->{'default.template'},
###############################################################################
=item 'content-set-preview' => content_set_preview (%)
Sets or drop preview flag in the clipboard indicating whether all
subsequent calls to the Content should return current or preview
content.
Usually this is used somewhere in the page header on all pages to check
for a specific cookie or a CGI parameter to turn on site 'preview' mode.
my $args=get_args(\@_);
my $config=$self->siteconfig('/content');
my $flag_cb_uri=$config->{flag_cb_uri} || '/content/preview_flag';
$self->clipboard->put($flag_cb_uri => $args->{value} ? 1 : 0);
}
###############################################################################
=item 'content-show' => content_show (%)
name => Name of content (required)
data_id => ID of a specific version (optional, rarely used)
preview => if non-zero then unpublished version of content will
be used. If that argument is not present then the
clipboard preview flag is used (see flag_cb_uri above)
=cut
sub get_content ($%) {
my $self=shift;
my $flag_cb_uri=$config->{flag_cb_uri} || '/content/preview_flag';
my $name=$args->{name};
my $data_id=$args->{data_id} || '';
my $preview=$args->{preview} ||
$self->clipboard->get($flag_cb_uri) ||
'';
my $content=$self->odb->fetch("$list_uri/$name");
return $content unless wantarray;
view all matches for this distribution
view release on metacpan or search on metacpan
$web->execute(cgi => $cgi,
path => '/index.html');
my $config=$web->config;
$config->clipboard->put(foo => 'bar');
=head1 DESCRIPTION
Please read L<XAO::Web::Intro> for general overview and setup
instructions, and please read L<XAO::DO::Web::Page> for an overview
is just a XAO::SimpleHash object and most of its methods get embedded -
get, put, getref, delete, defined, exists, keys, values, contains.
=item web
Web configuration embeds methods that allow cookie, clipboard and
cgi manipulations -- add_cookie, cgi, clipboard, cookies, header,
header_args.
=back
After that XAO::Web calls init() method on the Config object which
=cut
###############################################################################
sub analyze ($$;$$);
sub clipboard ($);
sub config ($);
sub execute ($%);
sub new ($%);
sub set_current ($);
sub sitename ($);
};
}
###############################################################################
=item clipboard ()
Returns site clipboard object.
=cut
sub clipboard ($) {
my $self=shift;
return $self->config->clipboard;
}
###############################################################################
=item config ()
-Status => '500 Internal Error',
-expires => 'now',
-cache_control => 'no-cache',
);
my $edata=$self->clipboard->get('/internal_error') || { };
my $path=$edata->{'display_path'} || '/internal-error/index.html';
my $pd=$self->analyze($path);
if($pd && $pd->{'type'} eq 'xaoweb' && $pd->{'objname'} ne 'Default') {
eprint "$e";
$edata->{'message'}||="$e";
$edata->{'code'}||='UNKNOWN';
$edata->{'path'}||=$args->{'path'};
$edata->{'pagedesc'}||=$self->clipboard->get('pagedesc');
$self->clipboard->put(internal_error => $edata);
$pagetext=$self->process($args,{
path => $path,
template => undef,
pagedesc => $pd,
if(!$autolist) {
return '';
}
elsif(ref($autolist) eq 'ARRAY') {
my $clipboard=$self->config->clipboard;
for(my $i=0; $i<@$autolist; $i+=2) {
my ($objname,$objargs)=@{$autolist}[$i,$i+1];
my $obj=XAO::Objects->new(objname => $objname);
$content.=$obj->expand($objargs);
# Not processing any more if there was a final output.
#
last if $clipboard->get('_no_more_output');
}
}
elsif(ref($autolist) eq 'HASH') {
eprint "Using HASH auto-list is deprecated, use an ordered array";
foreach my $objname (keys %{$autolist}) {
sub process ($%) {
my $self=shift;
my $args=get_args(\@_);
my $siteconfig=$self->config;
my $clipboard=$siteconfig->clipboard;
my $sitename=$self->sitename;
# Making sure path starts from a slash
#
my $path=$args->{'path'} || throw XAO::E::Web "process - no 'path' given";
$active_url_secure=$active_url;
}
# Storing active URLs
#
$clipboard->put(active_url => $active_url);
$clipboard->put(active_url_secure => $active_url_secure);
# Checking if we have base_url, assuming active_url if not.
# Ensuring that URL does not end with '/'.
#
if($siteconfig->defined('base_url')) {
}
# Checking if we're running under mod_perl
#
my $mod_perl=($apache || $ENV{'MOD_PERL'}) ? 1 : 0;
$clipboard->put(mod_perl => $mod_perl);
$clipboard->put(mod_perl_request => $apache);
# Checking if a charset is known for the site. If it is, setting
# it up for CGI-params decoding and for output.
#
my $charset=$siteconfig->get('charset');
undef(@d);
dprint "============ date=$date, mod_perl=$mod_perl, " .
"path='$path', translated='$pd->{path}'";
}
# Putting path decription into the site clipboard
#
$clipboard->put(pagedesc => $pd);
# Setting expiration time in the page header to immediate
# expiration. If that's not what the page wants -- it can override
# these.
#
# If the header issued a final output (commonly a redirect), then
# nothing else needs to be done.
#
my $pagebody='';
my $pagefooter='';
if(!$clipboard->get('_no_more_output')) {
# Preparing object arguments out of standard ones, object specific
# once from template paths and supplied hash (in that order of
# preference).
#
view all matches for this distribution
view release on metacpan or search on metacpan
web/root/yaml/docs/assets/js/snippet/jquery.snippet.js view on Meta::CPAN
transparent:false,
collapse:false,
menu:true,
showMsg:"Expand Code",
hideMsg:"Collapse Code",
clipboard:"",
startCollapsed:true,
startText:false,
box:"",
boxColor:"",
boxFill:""
web/root/yaml/docs/assets/js/snippet/jquery.snippet.js view on Meta::CPAN
o.parent().append(txtOnly);
o.parent().prepend(controls);
o.parent().hover(function(){$(this).find('.snippet-menu').fadeIn("fast");},function(){$(this).find('.snippet-menu').fadeOut("fast");});
// builds clipboard
if(defaults.clipboard!="" && defaults.clipboard!=false){
var cpy = o.parent().find('a.snippet-copy');
cpy.show();
cpy.parents('.snippet-menu').show();
var txt = o.parents('.snippet-wrap').find('.snippet-textonly').text();
ZeroClipboard.setMoviePath(defaults.clipboard);
var clip = new ZeroClipboard.Client();
clip.setText(txt);
clip.glue(cpy[0], cpy.parents('.snippet-menu')[0]);
clip.addEventListener( 'complete', function(client, text) {
if(text.length > 500){
text = text.substr(0,500)+"...\n\n("+(text.length-500)+" characters not shown)";
}
alert("Copied text to clipboard:\n\n " + text );
});
cpy.parents('.snippet-menu').hide();
} else {
web/root/yaml/docs/assets/js/snippet/jquery.snippet.js view on Meta::CPAN
return false;
});
// disables menu
if(!defaults.menu){
o.prev('.snippet-menu').find('pre,.snippet-clipboard').hide();
}
// collapse functionality
if(defaults.collapse){
var styleClass = o.parent().attr('class');
web/root/yaml/docs/assets/js/snippet/jquery.snippet.js view on Meta::CPAN
sh_highlightDocument();
// show/hide hover menu
if(!defaults.menu){
o.prev('.snippet-menu').find('pre,.snippet-clipboard').hide();
} else {
o.prev('.snippet-menu').find('pre,.snippet-clipboard').show();
}
}
} else {
web/root/yaml/docs/assets/js/snippet/jquery.snippet.js view on Meta::CPAN
ZeroClipboard.Client.prototype = {
id: 0, // unique ID for us
ready: false, // whether movie is ready to receive events or not
movie: null, // reference to movie object
clipText: '', // text to copy to clipboard
handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
cssEffects: true, // enable CSS mouse effects on dom container
handlers: null, // user event handlers
glue: function(elem, appendElem, stylesToAdd) {
web/root/yaml/docs/assets/js/snippet/jquery.snippet.js view on Meta::CPAN
// find X/Y position of domElement
var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem);
// create floating DIV above element
this.div = document.createElement('div');
this.div.className = "snippet-clipboard";
var style = this.div.style;
style.position = 'absolute';
style.left = '' + box.left + 'px';
style.top = '' + box.top + 'px';
style.width = '' + box.width + 'px';
web/root/yaml/docs/assets/js/snippet/jquery.snippet.js view on Meta::CPAN
style.top = '' + box.top + 'px';
}
},
setText: function(newText) {
// set text to be copied to clipboard
this.clipText = newText;
if (this.ready){ this.movie.setText(newText);}
},
addEventListener: function(eventName, func) {
view all matches for this distribution
view release on metacpan or search on metacpan
examples/Xacobeo/Ex/ClipboardLoad.pm view on Meta::CPAN
Xacobeo::Ex::ClipboardLoad - Test plugin
=head1 DESCRIPTION
Sample plugin that allows to load an XML document based on the contents of the
clipboard.
The plugin adds the entry I<Load from clipboard> under the I<File> main menu.
The plugin can also be activated through the shortcut I<CTRL SHIFT L>.
=head1 USAGE
Copy the file examples/cliboard.plugin into $HOME/.config/xacobeo/plugins/ and
examples/Xacobeo/Ex/ClipboardLoad.pm view on Meta::CPAN
$actions->add_actions([
# Entries (name, stock id, label, accelerator, tooltip, callback)
[
'FileNewFromClipboard',
'gtk-paste',
"_Load from clipboard",
'<control><shift>L',
"Load a file from the clipboard",
sub { $self->load_from_clipboard(@_, $window) }
],
]);
# Inject our new actions into the existing application
examples/Xacobeo/Ex/ClipboardLoad.pm view on Meta::CPAN
FALSE
);
}
sub load_from_clipboard {
my $self = shift;
my ($action, $window) = @_;
# Prepare the system clipboard
my $selection = Gtk2::Gdk::Atom->new('CLIPBOARD');
my $clipboard = Gtk2::Clipboard->get($selection);
# Get the xml from clipboard
my $xml = $clipboard->wait_for_text;
return unless defined $xml;
# Load the temporary xml file
my $document = Xacobeo::Document->new_from_string($xml, 'xml');
$window->set_title('clipboard');
$window->load_document($document);
}
__PACKAGE__->load();
view all matches for this distribution
view release on metacpan or search on metacpan
DEMOS/clipboard.pl view on Meta::CPAN
#!/usr/bin/perl -w
#-*-perl-*-
# Autogenerated by fd2pl from fdesign file /root/clipboard.c
#
use X11::Xforms;
#
$clipboard = undef;
$TextBox = undef;
$SelectButton = undef;
$PasteButton = undef;
$DoneButton = undef;
$form_frozen = 0;
fl_initialize("ClipBoard");
create_the_forms();
fl_show_form($clipboard, FL_PLACE_FREE, FL_FULLBORDER, "Clipboard");
fl_do_forms();
exit(0);
sub create_form_clipboard {
$obj = undef;
$clipboard = fl_bgn_form(FL_NO_BOX, 280, 140);
$obj = fl_add_box(FL_UP_BOX, 0, 0, 280, 140, "");
$obj = fl_add_text(FL_NORMAL_TEXT, 10, 10, 260, 80, "This Text can be selected using the 'Select' button,\nor overwritten with the primary X selection\nusing the 'Paste' button");
$TextBox = $obj;
fl_set_object_boxtype($obj, FL_DOWN_BOX);
fl_set_object_lalign($obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
DEMOS/clipboard.pl view on Meta::CPAN
fl_set_object_callback($obj, "process_done", 0);
fl_end_form();
}
sub create_the_forms {
create_form_clipboard();
}
sub process_select {
my($obj, $val) = @_;
fl_set_object_color($TextBox, FL_BLACK, FL_WHITE);
fl_set_object_lcolor($TextBox, FL_WHITE);
fl_stuff_clipboard($obj, $TextBox->label, "selection_lost");
}
sub process_paste {
my($obj, $val) = @_;
if (fl_request_clipboard($obj, "selection_obtained") == 0)
{
$form_frozen = 1;
fl_freeze_form($clipboard);
}
}
sub process_done {
exit(0);
DEMOS/clipboard.pl view on Meta::CPAN
fl_set_object_lcolor($TextBox, FL_TEXT_LCOL);
fl_set_object_label($TextBox, $data);
if ($form_frozen)
{
fl_unfreeze_form($clipboard);
$form_frozen = 0;
}
return 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Yancy/resources/public/yancy/font-awesome/css/font-awesome.css view on Meta::CPAN
/*!
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('...
view all matches for this distribution
view release on metacpan or search on metacpan
skel/root/style/lib/jquery/jquery-ui-1.8.21.custom.css view on Meta::CPAN
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
view all matches for this distribution
view release on metacpan or search on metacpan
src/dlib/gui_core/gui_core_kernel_1.cpp view on Meta::CPAN
ImmReleaseContext(hwnd, hImc);
}
// ----------------------------------------------------------------------------------------
void put_on_clipboard (
const std::string& str
)
{
put_on_clipboard(convert_mbstring_to_wstring(str));
}
void put_on_clipboard (
const dlib::ustring& str
)
{
put_on_clipboard(convert_utf32_to_wstring(str));
}
void put_on_clipboard (
const std::wstring& str
)
{
using namespace gui_core_kernel_1_globals;
using namespace std;
src/dlib/gui_core/gui_core_kernel_1.cpp view on Meta::CPAN
}
}
// ----------------------------------------------------------------------------------------
void get_from_clipboard (
std::string& str
)
{
std::wstring wstr;
get_from_clipboard(wstr);
str = convert_wstring_to_mbstring(wstr);
}
void get_from_clipboard (
dlib::ustring& str
)
{
std::wstring wstr;
get_from_clipboard(wstr);
str = convert_wstring_to_utf32(wstr);
}
void get_from_clipboard (
std::wstring& str
)
{
using namespace gui_core_kernel_1_globals;
using namespace std;
view all matches for this distribution
view release on metacpan or search on metacpan
src/dlib/gui_core/gui_core_kernel_1.cpp view on Meta::CPAN
ImmReleaseContext(hwnd, hImc);
}
// ----------------------------------------------------------------------------------------
void put_on_clipboard (
const std::string& str
)
{
put_on_clipboard(convert_mbstring_to_wstring(str));
}
void put_on_clipboard (
const dlib::ustring& str
)
{
put_on_clipboard(convert_utf32_to_wstring(str));
}
void put_on_clipboard (
const std::wstring& str
)
{
using namespace gui_core_kernel_1_globals;
using namespace std;
src/dlib/gui_core/gui_core_kernel_1.cpp view on Meta::CPAN
}
}
// ----------------------------------------------------------------------------------------
void get_from_clipboard (
std::string& str
)
{
std::wstring wstr;
get_from_clipboard(wstr);
str = convert_wstring_to_mbstring(wstr);
}
void get_from_clipboard (
dlib::ustring& str
)
{
std::wstring wstr;
get_from_clipboard(wstr);
str = convert_wstring_to_utf32(wstr);
}
void get_from_clipboard (
std::wstring& str
)
{
using namespace gui_core_kernel_1_globals;
using namespace std;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/dbMan/Extension/Clipboard.pm view on Meta::CPAN
sub known_actions { return [ qw/SQL_RESULT/ ]; }
sub init {
my $obj = shift;
$obj->{prompt_title} = $obj->{-config}->prompt_clipboard || '[clip]';
}
sub handle_action {
my ($obj,%action) = @_;
$action{processed} = 1;
if ($action{action} eq 'SQL_RESULT' and $action{copy_to_clipboard} and ref $action{result} eq 'ARRAY') {
delete $action{copy_to_clipboard};
if ($action{union_clipboard}) {
my $clip = $obj->{-mempool}->get('clipboard');
if (exists $clip->{-result}) {
if (scalar @{$action{result}->[0]} != scalar @{$clip->{-result}->[0]}) {
$action{output_info} = "Cannot union copy results with different number of columns.\n";
} else {
my @res = map { [ @$_ ] } @{$action{result}};
$clip->{-result} = [ @{$clip->{-result}}, @res ];
$obj->{-mempool}->set('clipboard',$clip);
$action{output_info} = "Union copy to clipboard done.\n";
}
} else {
delete $action{union_clipboard};
}
}
unless ($action{union_clipboard}) {
my $res; $res = [ map { [ @$_ ] } @{$action{result}} ];
$obj->{-mempool}->set('clipboard',{ -result => $res, -fieldnames => $action{fieldnames}, -fieldtypes => $action{fieldtypes}});
$action{output_info} = "Copy to clipboard done.\n";
}
delete $action{processed};
$obj->{-interface}->prompt($action{clipboard_prompt_num},$obj->{prompt_title});
$obj->{-interface}->rebuild_menu();
}
return %action;
}
view all matches for this distribution