| 1 | # Copyright 2007, 2008, 2009, 2010 Kevin Ryde | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # This file is part of Chart. | ||||||||||||||||||||||||||||
| 4 | # | ||||||||||||||||||||||||||||
| 5 | # Chart is free software; you can redistribute it and/or modify it under the | ||||||||||||||||||||||||||||
| 6 | # terms of the GNU General Public License as published by the Free Software | ||||||||||||||||||||||||||||
| 7 | # Foundation; either version 3, or (at your option) any later version. | ||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||
| 9 | # Chart is distributed in the hope that it will be useful, but WITHOUT ANY | ||||||||||||||||||||||||||||
| 10 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||||||||||||||||||||||||||||
| 11 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||||||||||||||||||||||||||||
| 12 | # details. | ||||||||||||||||||||||||||||
| 13 | # | ||||||||||||||||||||||||||||
| 14 | # You should have received a copy of the GNU General Public License along | ||||||||||||||||||||||||||||
| 15 | # with Chart. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | package App::Chart::Gtk2::Ex::WidgetBits; | ||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use 5.010; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | # allowing gtk pre-2.12... | ||||||||||||||||||||||||||||
| 23 | # | ||||||||||||||||||||||||||||
| 24 | 0 | ▶ | sub error_bell { | ||||||||||||||||||||||||||
|
Subroutine
error_bell: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 25 | 0 | my ($widget) = @_; | |||||||||||||||||||||||||||
| 26 | 0 | my $display; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | if (! Gtk2::Widget->can('get_screen')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 0 | return; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | # actually the 2.12 one doesn't beep if the widget has no display | ||||||||||||||||||||||||||||
| 33 | 0 | ▶ | if ($widget && $widget->has_screen) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$widget and $widget->has_screen
MC/DC0%0/2
$widget and $widget->has_screen
$widget
$widget->has_screen
Truth table0%0/3
A and B
A= $widgetB= $widget->has_screen
| |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | if ($widget->can('error_bell')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | 0 | $widget->error_bell; | |||||||||||||||||||||||||||
| 36 | 0 | return; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | 0 | ▶ | if ($widget->can('get_display')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 39 | 0 | $display->beep; | |||||||||||||||||||||||||||
| 40 | 0 | return; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | # Gtk 2.0.x or widget without a screen | ||||||||||||||||||||||||||||
| 45 | 0 | Gtk2::Gdk->beep; | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 1 | 1; | |||||||||||||||||||||||||||
| 49 | __END__ | ||||||||||||||||||||||||||||