App-Asciio

 view release on metacpan or  search on metacpan

Todo.txt  view on Meta::CPAN


document what ascii_events should contain
	links to gtk doc
	should the content itself be defined in the derived class?

split into two distributions?
	=> easier for those who want to build another interface

setup/actions manipulating asciio object directely move to asciio

transparent background for cmd output
	width > spaces == transparent
	spaces => transparent
	0 => transparent
	
merge arrows and split arrow

arrow merge object
	like a single character text but nicer to use with  arrows
	or merge arrow connections directely (weld them together)
	

Todo.txt  view on Meta::CPAN

#Box added via 'B' shortcut should be selected

#reselect elements after quick link

#select text an focus in text editing window

#error: title has frame when text doesn't

#link to camel box

#background color, grid color

#save file in exit dialog

#continuation _from_ diagonal is not correct

!allow diagonals in setup

#diagonal lines
	#error: connector character is wrong
	#dynamically choose if the arrow allows diagonal or not (keyboard)

Todo.txt  view on Meta::CPAN


#only allow start-end connectors to link for multiwirl
	but allow moving of the intermediate connectors

#shortcut that adds elements but opens the edit dialog directly before inserting the object
	should this be the default for object creation from stencils?
		=> shall we add a EDIT_ON_CREATE fields=

#ctl + shift + arrows => connect arrows as connect boxes does

#color groups when using solid background
	=> through a get_element_background_color

#error shift plus select area doesn't work

#do notshow resize rectangle if attribut is not set

#error after aligning box centers, the connectors are real weird in if_elsif.gpad

#verify all the '* $character_' and '\ $character_'

#editing box breaks the connections

lib/App/Asciio.pm  view on Meta::CPAN

		SELECTION_RECTANGLE =>{START_X => 0, START_Y => 0},
		
		KEYS => {K =>{}, C =>{},},
		ACTIONS => {},
		VALID_SELECT_ACTION => { map {$_, 1} qw(resize move)},
		
		COPY_OFFSET_X => 3,
		COPY_OFFSET_Y => 3,
		COLORS =>
			{
			background => [255, 255, 255],
			grid => [229, 235, 255],
			ruler_line => [85, 155, 225],
			selected_element_background => [180, 244, 255],
			element_background => [251, 251, 254],
			element_foreground => [0, 0, 0] ,
			selection_rectangle => [255, 0, 255],
			test => [0, 255, 255],
			
			group_colors =>
				[
				[[250, 221, 190], [250, 245, 239]],
				[[182, 250, 182], [241, 250, 241]],
				[[185, 219, 250], [244, 247, 250]],
				[[137, 250, 250], [235, 250, 250]],

lib/App/Asciio/GTK/Asciio.pm  view on Meta::CPAN

}

#-----------------------------------------------------------------------------

sub expose_event
{
my ($widget, $event, $self) = @_;

my $gc = Gtk2::Gdk::GC->new($self->{PIXMAP});

# draw background
$gc->set_foreground($self->get_color('background'));

$self->{PIXMAP}->draw_rectangle
		(
		$gc,	TRUE,
		0, 0,
		$widget->allocation->width, $widget->allocation->height
		);

my ($character_width, $character_height) = $self->get_character_size() ;
my ($widget_width, $widget_height) = $self->{PIXMAP}->get_size();

lib/App/Asciio/GTK/Asciio.pm  view on Meta::CPAN

					$gc,
					$vertical * $character_width, 0,
					$vertical * $character_width, $widget_height
					);
		}
	}
	
# draw elements
for my $element (@{$self->{ELEMENTS}})
	{
	my ($background_color, $foreground_color) =  $element->get_colors() ;
	
	if($self->is_element_selected($element))
		{
		if(exists $element->{GROUP} and defined $element->{GROUP}[-1])
			{
			$background_color = 
				$self->get_color
					(
					$self->{COLORS}{group_colors}[$element->{GROUP}[-1]{GROUP_COLOR}][0]
					) ;
			}
		else
			{
			$background_color = $self->get_color('selected_element_background');
			}
		}
	else
		{
		if(defined $background_color)
			{
			$background_color = $self->get_color($background_color) ;
			}
		else
			{
			if(exists $element->{GROUP} and defined $element->{GROUP}[-1])
				{
				$background_color = 
					$self->get_color
						(
						$self->{COLORS}{group_colors}[$element->{GROUP}[-1]{GROUP_COLOR}][1]
						) ;
				}
			else
				{
				$background_color = $self->get_color('element_background') ;
				}
			}
		}
			
	$foreground_color = 
		defined $foreground_color
			? $self->get_color($foreground_color)
			: $self->get_color('element_foreground') ;
			
	$gc->set_foreground($foreground_color);
	
	for my $mask_and_element_strip ($element->get_mask_and_element_stripes())
		{
		$gc->set_foreground($background_color);
			
		$self->{PIXMAP}->draw_rectangle
					(
					$gc,
					$self->{OPAQUE_ELEMENTS},
					($element->{X} + $mask_and_element_strip->{X_OFFSET}) * $character_width,
					($element->{Y} + $mask_and_element_strip->{Y_OFFSET}) * $character_height,
					$mask_and_element_strip->{WIDTH} * $character_width,
					$mask_and_element_strip->{HEIGHT} * $character_height,
					);

lib/App/Asciio/stripes/stripes.pm  view on Meta::CPAN

#-----------------------------------------------------------------------------

sub get_colors
{
my ($self) = @_ ;
return  $self->{COLORS}{BACKGROUND}, $self->{COLORS}{FOREGROUND} ;
}

#-----------------------------------------------------------------------------

sub set_background_color
{
my ($self, $background_color) = @_ ;
	
$self->{COLORS}{BACKGROUND} = $background_color ;
}

#-----------------------------------------------------------------------------

sub set_foreground_color
{
my ($self, $foreground_color) = @_ ;
	
$self->{COLORS}{FOREGROUND} = $foreground_color ;
}

#-----------------------------------------------------------------------------

sub set_colors
{
my ($self, $background_color, $foreground_color) = @_ ;
	
$self->{COLORS}{BACKGROUND} = $background_color ;
$self->{COLORS}{FOREGROUND} = $foreground_color ;
}

#-----------------------------------------------------------------------------

sub get_text
{
}

#-----------------------------------------------------------------------------

setup/actions/colors.pl  view on Meta::CPAN


#----------------------------------------------------------------------------------------------

register_action_handlers
	(
	'Change elements background color' => ['000-c', \&change_elements_colors, 0],
	'Change elements foreground color' => ['00S-C', \&change_elements_colors, 1],
	'Change AsciiO background color' => ['0A0-c', \&change_asciio_background_color],
	'Change grid color' => ['0AS-C', \&change_grid_color],
	) ;
	
#----------------------------------------------------------------------------------------------

sub change_elements_colors
{
my ($self, $is_background) = @_ ;

my ($color) = $self->get_color_from_user([0, 0, 0]) ;

$self->create_undo_snapshot() ;

for my $element($self->get_selected_elements(1))
	{
	$is_background
		? $element->set_background_color($color) 
		: $element->set_foreground_color($color) ;
		
	}
	
$self->update_display() ;
}

#----------------------------------------------------------------------------------------------

sub change_asciio_background_color
{
my ($self) = @_ ;

my ($color) = $self->get_color_from_user([0, 0, 0]) ;

$self->create_undo_snapshot() ;

$self->flush_color_cache() ;
$self->{COLORS}{background} = $color ;
	
$self->update_display() ;
}

#----------------------------------------------------------------------------------------------

sub change_grid_color
{
my ($self) = @_ ;

setup/actions/unsorted.pl  view on Meta::CPAN


use strict ;
use warnings ;

#----------------------------------------------------------------------------------------------

register_action_handlers
	(
	'Create multiple box elements from a text description' => ['C00-m', \&insert_multiple_boxes_from_text_description, 1],
	'Create multiple text elements from a text description' => ['C0S-M', \&insert_multiple_boxes_from_text_description, 0],
	'Flip transparent element background' => ['C00-t', \&transparent_elements],
	'Flip grid display' => ['000-g', \&flip_grid_display],
	'Flip color scheme' => ['CA0-c', \&flip_color_scheme],
	'Undo' => ['C00-z', \&undo],
	'Display undo stack statistics' => ['C0S-Z', \&display_undo_stack_statistics],
	'Redo' => ['C00-y', \&redo],
	'Display keyboard mapping' => ['000-k', \&display_keyboard_mapping],
	'Display commands' => ['C00-k', \&display_commands],
	'Display action files' => ['C0S-K', \&display_action_files],
	'Zoom in' => ['000-KP_Add', \&zoom, 1],
	'Zoom out' => ['000-minus', \&zoom, -1],

setup/actions/unsorted.pl  view on Meta::CPAN

my ($self) = @_ ;

$self->{COLOR_SCHEME} = 'system' unless exists $self->{COLOR_SCHEME} ;

if($self->{COLOR_SCHEME} eq 'system')
	{
	$self->flush_color_cache() ;
	$self->{COLOR_SCHEME} = 'linux' ;
	$self->{COLORS} =
		{
		background => [10, 10, 10],
		grid => [30, 30, 30],
		ruler_line => [25, 60, 80],
		selected_element_background => [25, 40, 50],
		element_background => [25, 25, 25],
		element_foreground => [150, 150, 150] ,
		selection_rectangle => [110, 0, 110],
		test => [0, 255, 255],
		group_colors =>
			[
			[[0x41, 0x32, 0x23], [0x2B, 0x21, 0x17]],
			[[0x21, 0x3C, 0x23], [0x15, 0x27, 0x17]],
			[[0x23, 0x32, 0x3C], [0x18, 0x22, 0x29]],
			[[0x10, 0x44, 0x44], [0x0A, 0x2C, 0x2C]],
			[[0x50, 0x28, 0x20], [0x2E, 0x17, 0x13]],

setup/actions/unsorted.pl  view on Meta::CPAN

		} ;
		
	$self->update_display() ;
	}
else
	{
	$self->flush_color_cache() ;
	$self->{COLOR_SCHEME} = 'system' ;
	$self->{COLORS} =
		{
		background => [255, 255, 255],
		grid => [229, 235, 255],
		ruler_line => [85, 155, 225],
		selected_element_background => [180, 244, 255],
		element_background => [251, 251, 254],
		element_foreground => [0, 0, 0] ,
		selection_rectangle => [255, 0, 255],
		test => [0, 255, 255],
		
		group_colors =>
			[
			[[250, 221, 190], [250, 245, 239]],
			[[182, 250, 182], [241, 250, 241]],
			[[185, 219, 250], [244, 247, 250]],
			[[137, 250, 250], [235, 250, 250]],

setup/asciio_object/basic.pl  view on Meta::CPAN

FONT_FAMILY => 'Monospace',
FONT_SIZE => '14',
TAB_AS_SPACES => '    ',
DISPLAY_GRID => 1,
COPY_OFFSET_X => 4,
COPY_OFFSET_Y => 4,
COLORS =>
	{
	background => [255, 255, 255],
	grid => [229, 235, 255],
	ruler_line => [85, 155, 225],
	selected_element_background => [180, 244, 255],
	element_background => [251, 251, 254],
	element_foreground => [0, 0, 0] ,
	selection_rectangle => [255, 0, 255],
	test => [0, 255, 255],
	
	group_colors =>
		[
		[[250, 221, 190], [250, 245, 239]],
		[[182, 250, 182], [241, 250, 241]],
		[[185, 219, 250], [244, 247, 250]],
		[[137, 250, 250], [235, 250, 250]],



( run in 1.806 second using v1.01-cache-2.11-cpan-d8267643d1d )