view release on metacpan or search on metacpan
emacs/chartprog.el view on Meta::CPAN
;; customizations
;;;###autoload
(defgroup chartprog nil
"Chart program interface."
:prefix "chartprog-"
:group 'applications
:link '(custom-manual "(chart)Emacs"))
(defface chartprog-up
`(;; plain "green" is too light to see against a white background
(((class color) (background light))
(:foreground "green4"))
(((class color))
(:foreground "green")))
"Face for a Chart quote which is up."
:group 'chartprog)
(defface chartprog-down
`((((class color))
(:foreground "red")))
"Face for a Chart quote which is down."
:group 'chartprog)
(defface chartprog-in-progress
`((((class color) (background dark))
(:foreground "cyan"))
(((class color) (background light))
(:foreground "blue")))
"Face for Chart quote fetch in progress."
:group 'chartprog)
(defcustom chartprog-watchlist-hook nil
"*Hook called by `chart-watchlist'."
:type 'hook
:group 'chartprog)
;;-----------------------------------------------------------------------------
lib/App/Chart/Barchart.pm view on Meta::CPAN
# LOW
# this combines with data period for how much is shown
# 5min 10min 15min
# HIGH 3.5day 7day 10day ... etc
# MEDHI 2day 4.5day 7day
# MED 1.5day 3day 4day
# MEDLO 1day 2day 3day
# LOW 0.5day 1.5day 2day
# evnt=ADV events
# off
# grid=Y/N background green grid
# sky=Y/N fine grid lines
# jav=ADV prices on, gif file
# [other options for subscribers]
# size=A 504 by 288
# E 576 by 360
# B 612 by 360
# C 720 by 432
# D 864 by 504
# sly=N linear
# L log
lib/App/Chart/Gtk2/GUI.pm view on Meta::CPAN
# gives a region to clip to, or undef to draw everything.
#
# =cut
#
# =item App::Chart::Gtk2::GUI::chart_style_class ($class)
#
# =item App::Chart::Gtk2::GUI::chart_style_widget ($widgetname)
#
# Setup package C<$class> or widget C<$widgetname> (per
# C<< $widget->set_name >>) to get the Chart graph style settings, which means
# black background and white foreground and text.
#
# C<$class> can include colons like C<"App::Chart::Gtk2::HAxis"> and they're turned
# into underscores like C<"App__Chart__Gtk2__HAxis"> which is the Gtk class
# name.
#
# =cut
#
# =back
lib/App/Chart/Gtk2/IntradayDialog.pm view on Meta::CPAN
my $timezone = App::Chart::TZ->for_symbol ($symbol);
$str .= ' ' . POSIX::strftime ($App::Chart::option{'d_fmt'} . ' %H:%M',
$timezone->localtime($timet));
}
$str .= "\n\n"; # blank line
my $pixbuf = $self->{'image'}->_load_pixbuf;
# $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file
# ('/usr/share/emacs/23.2/etc/images/splash.png');
# $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file
# ('/usr/share/games/gav/themes/classic/background_big.png');
if (! ref $pixbuf) {
$str .= $pixbuf; # error message
}
my $pwidth = $pcontext->get_width;
### $pwidth
my $layout = $pcontext->create_pango_layout;
$layout->set_width ($pwidth * Gtk2::Pango::PANGO_SCALE);
$layout->set_text ($str);
lib/App/Chart/Gtk2/IntradayImage.pm view on Meta::CPAN
$self->{$pname} = $newval; # per default GET_PROPERTY
### stored to: ''.\$self->{$pname}
if ($oldval eq $newval) {
return;
}
if ($pname eq 'symbol' || $pname eq 'mode') {
# new image (or new no image)
delete $self->{'xor_background'}; # new colour scheme
$self->queue_resize;
$self->queue_draw;
}
}
# 'size-request' class closure
sub _do_size_request {
my ($self, $req) = @_;
### IntradayImage _do_size_request()
my $pixbuf = _load_pixbuf ($self);
lib/App/Chart/Gtk2/IntradayImage.pm view on Meta::CPAN
unless (utf8::is_utf8($err)) { $err = Encode::decode('locale',$err); }
return $err;
}
}
sub _do_intraday_changed {
my ($self, $symbol, $mode) = @_;
### IntradayImage _do_intraday_changed(): "\"$symbol\" \"$mode\"\n"
if ($self->{'symbol'} eq $symbol && $self->{'mode'} eq $mode) {
# new image (or new no image)
delete $self->{'xor_background'}; # new colour scheme
$self->queue_resize;
$self->queue_draw;
}
}
#-----------------------------------------------------------------------------
# pixbuf background
sub Gtk2_Ex_Xor_background {
my ($self) = @_;
return ($self->{'xor_background'} ||= do {
require Gtk2::Ex::PixbufBits;
my $pixbuf = _load_pixbuf ($self);
if (! ref $pixbuf) {
# error loading, treat as widget background
return $self->get_style->bg($self->state);
}
my $rgbstr = Gtk2::Ex::PixbufBits::sampled_majority_color ($pixbuf);
### IntradayImage xor background: $rgbstr
require App::Chart::Gtk2::Ex::GdkColorAlloc;
App::Chart::Gtk2::Ex::GdkColorAlloc->new (widget => $self,
color => $rgbstr);
});
}
1;
__END__
=for stopwords intraday PNG JPEG GIF
lib/App/Chart/Gtk2/TickerModel.pm view on Meta::CPAN
use Glib::Object::Subclass
'Gtk2::Ex::TreeModelFilter::Draggable';
# uncomment this to run the ### lines
# use Smart::Comments;
use constant { UP_SPAN => '<span foreground="green">',
# a brightish red, for contrast against a black background
DOWN_SPAN => '<span foreground="#FF7070">',
INPROGRESS_SPAN => '<span foreground="light blue">' };
sub new {
my ($class, $symlist) = @_;
# FIXME: As of Gtk2-Perl 1.201 Gtk2::TreeModelFilter::new() leaks a
# reference (its returned object is never destroyed), so go through
# Glib::Object::new() instead. Can switch to SUPER::new when ready to
lib/App/Chart/Pango/Ex/ANSItoMarkup.pm view on Meta::CPAN
} elsif ($num >= 30 && $num <= 37) {
$attr->[_A_FOREGROUND] = 'foreground=' . $colour[$num-30];
# 38 reserved (for foreground colour)
} elsif ($num == 39) {
# default foreground colour
$attr->[_A_FOREGROUND] = undef;
} elsif ($num >= 40 && $num <= 47) {
$attr->[_A_BACKGROUND] = 'background=' . $colour[$num-40];
# 48 reserved (for background colour)
} elsif ($num == 49) {
# default background colour
$attr->[_A_BACKGROUND] = undef;
# 50 reserved (for cancelling 26 proportional spacing)
# 51 framed
# 52 encircled
# 53 overlined
# no overline in pango markup
# 54 not framed or encircled
# 55 not overlined
# 56-59 reserved
misc/gcfree.pl view on Meta::CPAN
{
my $style = $toplevel->get_style;
my $style_black_gc = $style->black_gc;
my $black = $style->black;
my $white = $style->white;
my $gc = Gtk2::Ex::GtkGCobj->new (widget => $toplevel,
foreground => $black,
background => $white);
print $gc+0, " ", $style_black_gc+0, "\n";
my $gc2 = Gtk2::Ex::GtkGCobj->new (widget => $toplevel,
foreground => $black,
background => $white);
$gc = undef;
$gc2 = undef;
print Dumper($style_black_gc);
$style_black_gc = undef;
print "exit\n";
exit 0;
}
{
foreach my $line_width (0 .. 32767) {
misc/temp-window.pl view on Meta::CPAN
my $tempwin = Gtk2::Gdk::Window->new ($root,
{ window_type => 'temp',
width => 40,
height => 30,
wmclass_name => 'Temporary window',
wmclass_class => 'Temporary window',
window_class => 'input-output',
override_redirect => 1
});
# $tempwin->set_background ($tempwin, $color);
$display->flush;
system ('xwininfo', '-id', $tempwin->get_xid);
system ('xprop', '-id', $tempwin->get_xid, "WM_CLASS");
print "\n";
$area->add_events (['button-press-mask',
'button-motion-mask',
'button-release-mask']);
$area->signal_connect
xtools/my-check-copyright-years.sh view on Meta::CPAN
| tools/configurations-gfs-generated.gp \
| devel/configurations-t-generated.gp \
| test-symbols.txt | test-funcs.txt \
| tests/test-symbols.txt | tests/test-funcs.txt \
| devel/minimal-domsets-max-even2.c \
| devel/a002251-Wythoff-LU-swap.txt \
| devel/a159917-Zeckendorf-low2digits.txt \
| devel/devel/a341258-lazy-reverse.txt \
| devel/a341258-lazy-reverse.txt \
| oeis/a002251-Wythoff-LU-swap.txt \
| debian/user-background-jobs.conf \
| */*/b3*.txt \
| */*/saved-state.txt \
| oeis/a159917-Zeckendorf-low2digits.txt \
| */_whizzy*)
continue ;;
*.gz)
GREP=zgrep
esac; \
if test -e "$srcdir/$i"