Prima

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

 - Support screen grabbing on Mac and Gnome/Wayland

1.53 2018-10-10
 - Image downsampling made consistent; added ict::Posterization;
 - Added images to documentations
 - Support gtk3 (but prefer gtk2)

1.52 2017-06-28
 - Better support for multi-threading
 - Better support of MacOS/XQuartz
 - Aesthetic fixes for scrollbars, spin edits, and sliders
 - Fixes for paths; path demo with PS interpreter
 - Add Widget.clipChildren, Drawable.fillPatternOffset, Timer.toggle
 - Coredump fix for Data::Dumper::GUI usage pattern
 - Support colored cursors on X11

1.51 2017-03-28
 - Add graphic paths support
 - Add spinner widgets by Maximilian Lika
 - Use Region objects for shape and clipping

MANIFEST  view on Meta::CPAN

examples/palette.pl
examples/pbrush.pl
examples/periodic.pl
examples/pitch.pl
examples/pointers.pl
examples/print.pl
examples/progressbar.pl
examples/ps_fonts.pl
examples/ps_setup.pl
examples/rotation.pl
examples/scrollbar.pl
examples/scrollbar2.pl
examples/scrollgroup.pl
examples/sheet.pl
examples/socket.pl
examples/socket_anyevent1.pl
examples/socket_anyevent2.pl
examples/spinner.pl
examples/spline.pl
examples/theme.pl
examples/tiger.pl
examples/tiger.eps

Prima/Application.pm  view on Meta::CPAN

=item get_default_cursor_width

Returns width of the system cursor in pixels.  The method can be called with a
class string instead of an object instance.

=item get_default_font

Returns the default system font.  The method can be called with a class string
instead of an object instance.

=item get_default_scrollbar_metrics

Returns dimensions of the system scrollbars - width of the standard vertical
scrollbar and height of the standard horizon scrollbar.  The method can be
called with a class string instead of an object instance.

=item get_dnd_clipboard

Returns the predefined special clipboard used as a proxy for drag and drop
interactions.

See also: C<Widget/Drag and drop>, C<Clipboard/is_dnd>.

=item get_default_window_borders BORDER_STYLE = bs::Sizeable

Prima/Dialog/ImageDialog.pm  view on Meta::CPAN

		borderWidth=> 2,
		alignment  => ta::Center,
		valignment => ta::Center,
		growMode   => gm::GrowLoX | gm::GrowLoY,
		hScroll    => 0,
		vScroll    => 0,
		zoomPrecision => 1000,
	);
	$pk-> size(($self-> Cancel-> width) x 2); # force square dimension

	$self-> insert( ScrollBar =>
		origin      => [ $pk-> left, $pk-> top + 2],
		width       => $pk-> width,
		selectable  => 1,
		tabStop     => 1,
		name        => 'FrameSelector',
		designScale => undef,
		visible     => 0,
		value       => 0,
		delegations => ['Change'],
		growMode    => gm::GrowLoX | gm::GrowLoY,

Prima/Edit.pm  view on Meta::CPAN

# edit block types
use strict;
use warnings;
package
    bt;
use constant CUA          =>  0;
use constant Vertical     =>  1;
use constant Horizontal   =>  2;

package Prima::Edit;
use Prima qw(ScrollBar Drawable::Glyphs);
use base qw(
	Prima::Widget Prima::Widget::MouseScroller Prima::Widget::GroupScroller
	Prima::Widget::UndoActions Prima::Widget::BidiInput
);

{
my %RNT = (
	%{Prima::Widget-> notification_types()},
	ParseSyntax   => nt::Action,
);

Prima/Grids.pm  view on Meta::CPAN

		gridColor               => cl::Black,
		gridGravity             => 3,
		indentCellBackColor     => cl::Gray,
		indentCellColor         => cl::Black,
		hScroll                 => 0,
		leftCell                => 0,
		multiSelect             => 0,
		rows                    => 1,
		topCell                 => 0,
		scaleChildren           => 0,
		scrollBarClass          => 'Prima::ScrollBar',
		hScrollBarProfile       => {},
		vScrollBarProfile       => {},
		selectable              => 1,
		vScroll                 => 1,
		widgetClass             => wc::ListBox,
	);
	@$def{keys %prf} = values %prf;
	return $def;
}

sub profile_check_in
{

Prima/ScrollBar.pm  view on Meta::CPAN

#
#  Created by:
#     Dmitry Karasik <dk@plab.ku.dk>
#  Modifications by:
#     Anton Berezin  <tobez@tobez.org>
#  Documentation by:
#     Anton Berezin  <tobez@tobez.org>
#
package Prima::ScrollBar;
use vars qw(@ISA @stdMetrics);
use strict;
use warnings;
use Prima;
use base qw(Prima::Widget Prima::Widget::MouseScroller);

@stdMetrics = Prima::Application-> get_default_scrollbar_metrics;
my $win32 = (Prima::Application-> get_system_info-> {apc} == apc::Win32);

sub profile_default
{
	return {
		%{$_[ 0]-> SUPER::profile_default},
		autoTrack     => 1,
		dndAware      => 1,
		growMode      => gm::GrowHiX,
		height        => $stdMetrics[1],

Prima/Stress.pm  view on Meta::CPAN

		};
		*Prima::Application::get_default_font = sub {
			Prima::Drawable-> font_match( { size => $Prima::Stress::stress{fs} }, {});
		};
	}

	if ( $stress{scr}) {
		my $gsv = \&Prima::Application::get_system_value;
		*Prima::Application::get_system_value = sub {
			my ( undef, $val ) = @_;
			return $stress{scr} if $val == sv::XScrollbar || $val == sv::YScrollbar;
			goto $gsv;
		};
		*Prima::Application::get_default_scrollbar_metrics = sub { $stress{scr}, $stress{scr} };
	}
}

1;

=pod

=head1 NAME

Prima::Stress - stress test module

Prima/TextView.pm  view on Meta::CPAN

package Prima::TextView;

use strict;
use warnings;

use Prima;
use Prima::ScrollBar;
use Prima::Drawable::TextBlock;
use base qw(Prima::Widget Prima::Widget::MouseScroller Prima::Widget::GroupScroller);

use constant YMAX => 1000;

sub profile_default
{
	my $def = $_[ 0]-> SUPER::profile_default;
	my %prf = (
		autoHScroll       => 1,

Prima/Tie.pm  view on Meta::CPAN

C<Prima::Outline>.

=head2 Prima::Tie::text

The class is applicable to any widget.

=head2 Prima::Tie::value

The class is applicable to C<Prima::GroupBox>, C<Prima::Dialog::ColorDialog>,
C<Prima::SpinEdit>, C<Prima::Gauge>, C<Prima::Slider>, C<Prima::CircularSlider>,
and C<Prima::ScrollBar>.

=head1 COPYRIGHT

Copyright 2004 Teo Sankaro

This program is distributed under the BSD License.
(Although a credit would be nice.)

=head1 AUTHORS

Prima/VB/Classes.pm  view on Meta::CPAN

	return $self-> {A}-> text;
}

package Prima::VB::Types::color;
use strict;
use vars qw(@ISA);
@ISA = qw(Prima::VB::Types::generic);

my @uColors  = qw(Fore Back HiliteText Hilite DisabledText Disabled Light3DColor Dark3DColor);
my @uClasses = qw(Button CheckBox Combo Dialog Edit InputLine Label ListBox Menu
	Popup Radio ScrollBar Slider Custom Window);

sub open
{
	my $self = $_[0];
	my $h = $self-> {container}-> height;
	$self-> {A} = $self-> {container}-> insert( ColorComboBox =>
		origin   => [ 85, $h - 36],
		onChange => sub {
			return if $self-> {sync};
			$self-> {sync} = 1;

Prima/VB/CoreClasses.pm  view on Meta::CPAN

			class  => 'Prima::VB::Radio',
			page   => 'General',
			icon   => 'VB::classes.gif:18',
		},
		'Prima::GroupBox' => {
			RTModule => 'Prima::Buttons',
			class  => 'Prima::VB::GroupBox',
			page   => 'General',
			icon   => 'VB::classes.gif:10',
		},
		'Prima::ScrollBar' => {
			RTModule => 'Prima::ScrollBar',
			class  => 'Prima::VB::ScrollBar',
			page   => 'General',
			icon   => 'VB::classes.gif:20',
		},
		'Prima::ComboBox' => {
			RTModule => 'Prima::ComboBox',
			class    => 'Prima::VB::ComboBox',
			page     => 'General',
			icon     => 'VB::classes.gif:3',
		},
		'Prima::DriveComboBox' => {

Prima/VB/VB.pl  view on Meta::CPAN

This code is executed when the form is run or loaded via C<Prima::VB::VBLoader>
interface.

The full explanation of properties and events is not provided here. It is
not even the goal of this document, because the builder can work with the
widgets irrespective of their property or event capabilities; this information
is extracted by native toolkit functionality. To read on what each property or
event means, use the documentation on the class of interest; L<Prima::Widget> is a good
start because it encompasses the ground C<Prima::Widget> functionality.
The other widgets are ( hopefully ) documented in their modules, for example,
C<Prima::ScrollBar> documentation can be found in L<Prima::ScrollBar>.

=head1 SEE ALSO

L<Prima>, L<Prima::VB::VBLoader>

=head1 AUTHOR

Dmitry Karasik, E<lt>dmitry@karasik.eu.orgE<gt>.

=head1 COPYRIGHT

Prima/Widget/GroupScroller.pm  view on Meta::CPAN

package Prima::Widget::GroupScroller;
use base qw(Prima::Widget::IntIndents);

use strict;
use warnings;
use Prima;
use Prima::ScrollBar;

sub setup_indents
{
	my ($self) = @_;
	$self-> {indents} = [ 0,0,0,0];
	my $bw = $self-> {borderWidth};
	$self-> {indents}-> [$_] += $bw for 0..3;
	$self-> {indents}-> [1] += $self-> {hScrollBar}-> height - 1 if $self-> {hScroll};
	$self-> {indents}-> [2] += $self-> {vScrollBar}-> width - 1 if $self-> {vScroll};
}

sub set_border_width
{
	my ( $self, $bw) = @_;

	my @size = $self-> size;
	$bw = 0 if $bw < 0;
	$bw = 1 if $bw > $size[1] / 2;
	$bw = 1 if $bw > $size[0] / 2;
	return if $bw == $self-> {borderWidth};

	my $obw  = $self-> {borderWidth};
	$self-> {borderWidth} = $bw;

	$self-> {hScrollBar}-> set(
		left   => $bw - 1,
		bottom => $bw - 1,
		width  => $size[0] -
			$bw * 2 +
			2 -
			( $self-> {vScroll} ?
				$self-> {vScrollBar}-> width - 2 :
				0
			),
	) if $self-> {hScroll};

	$self-> {vScrollBar}-> set(
		top    => $size[1] - $bw + 1,
		right  => $size[0] - $bw + 1,
		bottom => $bw + ( $self-> {hScroll} ?
			$self-> {hScrollBar}-> height - 2 :
			0
		),
	) if $self-> {vScroll};

	$self-> insert_bone if defined $self-> {bone};

	$self-> setup_indents;
	$self-> reset_indents;
}

Prima/Widget/MouseScroller.pm  view on Meta::CPAN

Stops the internal timer.

=back

=head1 AUTHOR

Dmitry Karasik, E<lt>dmitry@karasik.eu.orgE<gt>.

=head1 SEE ALSO

L<Prima>, L<Prima::Widget>, L<Prima::ScrollBar>.

=cut

Prima/Widget/ScrollWidget.pm  view on Meta::CPAN

	my %prf = (
		autoHScroll    => 1,
		autoVScroll    => 1,
		borderWidth    => 0,
		hScroll        => 0,
		vScroll        => 0,
		deltaX         => 0,
		deltaY         => 0,
		limitX         => 0,
		limitY         => 0,
		scrollBarClass => 'Prima::ScrollBar',
		hScrollBarProfile=>{},
		vScrollBarProfile=>{},
	);
	@$def{keys %prf} = values %prf;
	return $def;
}

sub profile_check_in
{
	my ( $self, $p, $default) = @_;
	$self-> SUPER::profile_check_in( $p, $default);
	$p-> {autoHScroll} = 0 if exists $p-> {hScroll};

Prima/themes/round3d.pm  view on Meta::CPAN

}

my %wrap_paint = (
	onPaint => sub {
		$_[0]-> on_paint( Prima::Themes::Round3D-> new($_[1]));
	}
);

Prima::Themes::register( 'Prima::themes::round3d', 'round3d', [
		'Prima::Button' => \%wrap_paint,
		'Prima::ScrollBar' => \%wrap_paint,
		'Prima::InputLine' => \%wrap_paint,
		],
);

class/Application.c  view on Meta::CPAN

}


int
Application_get_default_cursor_width( char * dummy)
{
	return apc_sys_get_value( svXCursor);
}

Point
Application_get_default_scrollbar_metrics( char * dummy)
{
	Point ret;
	ret. x = apc_sys_get_value( svXScrollbar);
	ret. y = apc_sys_get_value( svYScrollbar);
	return ret;
}

Point
Application_get_default_window_borders( char * dummy, int borderStyle)
{
	Point ret = { 0,0};
	switch ( borderStyle) {
	case bsNone:
		ret.x = svXbsNone;

class/Application.cls  view on Meta::CPAN

	method void   detach( Handle objectHandle, Bool kill);
	method void   end_paint();
	method void   end_paint_info();
	method SV*    fonts( char * name = "", char * encoding = "");
	method SV*    font_encodings( char * encoding = "");
	static SV*    font_mapper_action( char * dummy, HV * profile);
	method Handle get_active_window();
	static Font   get_caption_font( char * dummy = "");
	static int    get_default_cursor_width( char * dummy = "");
	static Font   get_default_font( char * dummy = "");
	static Point  get_default_scrollbar_metrics( char * dummy = "");
	static Point  get_default_window_borders( char * dummy = "", int borderStyle = bsSizeable);
	method Handle get_dnd_clipboard() => apc_dnd_get_clipboard;
	method Handle get_focused_widget();
	method Handle get_widget_from_handle( SV * handle);
	method Handle get_hint_widget();
	method Rect   get_indents() => apc_application_get_indents;
	static Font   get_message_font( char * dummy = "");
	method SV *   get_monitor_rects();
	method Handle get_modal_window( int modalFlag = mtExclusive, Bool topMost = true);
	method Point  get_scroll_rate();

examples/canvas.pl  view on Meta::CPAN

use strict;
use warnings;

use Prima qw(Widget::ScrollWidget);
# A widget with two scrollbars. Contains set of objects, that know
# how to draw themselves. The graphic objects hierarchy starts
# from Prima::CanvasObject:: class

package Prima::Canvas;
use vars qw(@ISA);
@ISA = qw(Prima::Widget::ScrollWidget);

sub profile_default
{
	return {

examples/editor.pl  view on Meta::CPAN

				['~Redo' => 'Ctrl+R'        => kb::NoKey   , sub {$_[0]-> {editor}-> redo}],
			]],
			['~Options' => [
				[ '@syx' => '~Syntax hilite' => sub{ $_[0]-> {editor}-> syntaxHilite( $_[2] )}],
				[ '@*aid' => '~Auto indent' => sub{ $_[0]-> {editor}-> autoIndent( $_[2] )}],
				[ '@wwp' => '~Word wrap' => sub{ $_[0]-> {editor}-> wordWrap( $_[2] )}],
				[ '@cwp' => '~Cursor wrap' => sub{ $_[0]-> {editor}-> cursorWrap( $_[2] )}],
				[ '@tab' => 'Enter ~tabs in text' => sub{ $_[0]-> {editor}-> wantTabs( $_[2] )}],
				[ '@psb' => '~Persistent blocks' => sub{ $_[0]-> {editor}-> persistentBlock( $_[2] )}],
				[],
				[ '@*hsc' => '~Horizontal scrollbar' => sub{ $_[0]-> {editor}-> hScroll( $_[2])}],
				[ '@*vsc' => '~Vertical scrollbar'   => sub{ $_[0]-> {editor}-> vScroll( $_[2])}],
				[],
				(
					['utf'  => 'UTF-8 mode' => sub {
						my $utf8_mode = $_[0]-> menu-> utf-> toggle;
						$_[0]-> {utf8} = $utf8_mode;
						$::application-> wantUnicodeInput($utf8_mode);
					}]
				),
				[ '@'.($::application->textDirection ? '*' : '').'rtl' => 
					'~Right-to-left' => sub{ $_[0]-> {editor}-> textDirection( $_[2] )}],

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 3.945 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-3b7f77b76a6c )