Curie/Component/MainWindow.pm untested

filter: Statementstmt 0.0% 0 / 55 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 69 CC 1 SCAR 6.9
CC
1
Cov
0%
_build_loop
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use Renard::Incunabula::Common::Setup;
2 package Renard::Curie::Component::MainWindow;
3 # ABSTRACT: Main window of the application
4 $Renard::Curie::Component::MainWindow::VERSION = '0.005';
5 use Intertangle::API::Gtk3::Helper;
6  
7 use Gtk3;
8 use Cairo;
9 use Glib::Object::Introspection;
10 use Glib 'TRUE', 'FALSE';
11  
12 use Moo 2.001001;
13  
14 use MooX::Role::Logger ();
15 use MooX::ShortHas;
16  
17 use Renard::Incunabula::Common::Types qw(InstanceOf Path Str);
18 use Renard::Incunabula::Document::Types qw(DocumentModel);
19  
20 use IO::Async::Loop::Glib;
21  
22 has loop => ( is => 'lazy' );
23  
24 sub _build_loop {
25 IO::Async::Loop::Glib->new;
26 }
27  
28 lazy window => method() {
29 (InstanceOf['Gtk3::Window'])->(
30 $self->builder->get_object('main-window')
31 );
32 }, isa => InstanceOf['Gtk3::Window'];
33  
34 lazy content_box => method() {
35 (InstanceOf['Gtk3::Box'])->(
36 Gtk3::Box->new( 'horizontal', 0 )
37 );
38 }, isa => InstanceOf['Gtk3::Box'];
39  
40 method setup_window() {
41 $self->builder->get_object('application-vbox')
42 ->pack_start( $self->content_box, TRUE, TRUE, 0 );
43 }
44  
45 method show_all() {
46 $self->window->show_all;
47 }
48  
49 method BUILD(@) {
50 $self->setup_window;
51  
52 $self->window->signal_connect(
53 destroy => \&on_application_quit_cb, $self );
54 $self->window->set_default_size( 800, 600 );
55 }
56  
57 # Callbacks {{{
58 callback on_application_quit_cb( $event, $self ) {
59 Gtk3::main_quit;
60 }
61 # }}}
62  
63 with qw(
64 Intertangle::API::Gtk3::Component::Role::FromBuilder
65 Intertangle::API::Gtk3::Component::Role::UIFileFromPackageName
66 MooX::Role::Logger
67  
68 Renard::Curie::Component::MainWindow::Role::PageDrawingArea
69  
70 Renard::Curie::Component::MainWindow::Role::DragAndDrop
71 Renard::Curie::Component::MainWindow::Role::LogWindow
72 Renard::Curie::Component::MainWindow::Role::AccelMap
73 Renard::Curie::Component::MainWindow::Role::MenuBar
74 Renard::Curie::Component::MainWindow::Role::Outline
75 Renard::Curie::Component::MainWindow::Role::TTSWindow
76 Renard::Curie::Component::MainWindow::Role::ExceptionHandler
77 );
78  
79 1;
80  
81 __END__