Graphics-Framebuffer
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
dist => {COMPRESS => 'gzip -9f', SUFFIX => 'gz',},
clean => {FILES => 'Graphics-Framebuffer* _Inline* examples/_Inline* *.inl *log *bak *old'},
);
print $blink, colored(['yellow on_blue'],sprintf('%-67s',' PLEASE PAY ATTENTION TO THE MESSAGE ABOVE FOR ANY MISSING MODULES BEFORE CONTINUING ')), "\n";
exit(0);
sub slurp_file {
my $file = shift;
return( do { local (@ARGV, $/) = $file; <> } );
}
sub no_framebuffer {
my $fb_absent = TRUE;
my $os = `uname`;
chomp($os);
if ($os eq 'Linux') {
if (exists($ENV{'DISPLAY'}) or exists($ENV{'WAYLAND_DISPLAY'})) {
print colored(['bright_yellow'],' FRAMEBUFFER'), ' ... ', colored(['bright_green'],'FOUND'), ' - ', colored(['cyan'],"Running in X11 or Wayland, will use/dev/shm/gfb_viewer"),"\n";
$fb_absent = FALSE;
lib/Graphics/Framebuffer.pm view on Meta::CPAN
'FBIOGET_GLYPH' => FBIOGET_GLYPH, # 0x4615,
'FBIOGET_HWCINFO' => FBIOGET_HWCINFO, # 0x4616,
'FBIOPUT_MODEINFO' => FBIOPUT_MODEINFO, # 0x4617,
'FBIOGET_DISPINFO' => FBIOGET_DISPINFO, # 0x4618,
};
$self = { %{$self}, %{$garbage} };
} ## end if ($self->{'GARBAGE'})
# In Graphics::Framebuffer::new
$self->{'VBOX'} = (
(-e '/sys/class/dmi/id/product_name' && do {
local (@ARGV, $/) = '/sys/class/dmi/id/product_name';
my $p = <>; defined $p && $p =~ /VirtualBox/i;
}) || ($self->{'fscreeninfo'}->{'id'} =~ /vbox/i) || (`systemd-detect-virt 2>/dev/null` =~ /oracle/i)) ? 1 : 0;
unless (defined($self->{'FB_DEVICE'})) { # We scan for all 32 possible devices at both possible locations
if (-e '/dev/shm/gfb_screen') { # Is GFB running in X-Windows with the gfb_screen? If so, we can use that framebuffer device instead of the real one. This is a hack, but it works.
$self->{'FB_DEVICE'} = '/dev/shm/gfb_screen'; # Detected the GFB viewer
} else {
foreach my $dev (0 .. 31) {
foreach my $prefix (qw(/dev/fb /dev/fb/ /dev/graphics/fb)) {
if (-e "$prefix$dev") {
$self->{'FB_DEVICE'} = "$prefix$dev";
src/Framebuffer.pm view on Meta::CPAN
'FBIOGET_GLYPH' => FBIOGET_GLYPH, # 0x4615,
'FBIOGET_HWCINFO' => FBIOGET_HWCINFO, # 0x4616,
'FBIOPUT_MODEINFO' => FBIOPUT_MODEINFO, # 0x4617,
'FBIOGET_DISPINFO' => FBIOGET_DISPINFO, # 0x4618,
};
$self = { %{$self}, %{$garbage} };
} ## end if ($self->{'GARBAGE'})
# In Graphics::Framebuffer::new
$self->{'VBOX'} = (
(-e '/sys/class/dmi/id/product_name' && do {
local (@ARGV, $/) = '/sys/class/dmi/id/product_name';
my $p = <>; defined $p && $p =~ /VirtualBox/i;
}) || ($self->{'fscreeninfo'}->{'id'} =~ /vbox/i) || (`systemd-detect-virt 2>/dev/null` =~ /oracle/i)) ? 1 : 0;
unless (defined($self->{'FB_DEVICE'})) { # We scan for all 32 possible devices at both possible locations
if (-e '/dev/shm/gfb_screen') { # Is GFB running in X-Windows with the gfb_screen? If so, we can use that framebuffer device instead of the real one. This is a hack, but it works.
$self->{'FB_DEVICE'} = '/dev/shm/gfb_screen'; # Detected the GFB viewer
} else {
foreach my $dev (0 .. 31) {
foreach my $prefix (qw(/dev/fb /dev/fb/ /dev/graphics/fb)) {
if (-e "$prefix$dev") {
$self->{'FB_DEVICE'} = "$prefix$dev";
( run in 1.679 second using v1.01-cache-2.11-cpan-145b269f2f3 )