| 1 | package X11::XRandR::Mode; | ||
| 2 | |||
| 3 | # ABSTRACT: A Video Mode | ||
| 4 | |||
| 5 | 1 | ▶ | use Types::Standard qw[ ArrayRef InstanceOf Bool Str ]; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Types::Common::Numeric qw[ PositiveOrZeroInt ]; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use X11::XRandR::Types -types; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 1 | ▶ | use MooX::StrictConstructor; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 1 | our $VERSION = '0.01'; | |
| 14 | |||
| 15 | 1 | ▶ | use overload '""' => \&to_string; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | #pod =attr name | ||
| 18 | #pod | ||
| 19 | #pod =cut | ||
| 20 | |||
| 21 | 1 | has name => ( | |
| 22 | is => 'ro', | ||
| 23 | isa => Str, | ||
| 24 | required => 1, | ||
| 25 | ); | ||
| 26 | |||
| 27 | #pod =attr current | ||
| 28 | #pod | ||
| 29 | #pod I<Boolean> is this the current mode? | ||
| 30 | #pod | ||
| 31 | #pod =cut | ||
| 32 | |||
| 33 | 1 | has current => ( | |
| 34 | is => 'ro', | ||
| 35 | isa => Bool, | ||
| 36 | ); | ||
| 37 | |||
| 38 | #pod =attr preferred | ||
| 39 | #pod | ||
| 40 | #pod I<Boolean> is this the preferred mode? | ||
| 41 | #pod | ||
| 42 | #pod =cut | ||
| 43 | |||
| 44 | 1 | has preferred => ( | |
| 45 | is => 'ro', | ||
| 46 | isa => Bool, | ||
| 47 | ); | ||
| 48 | |||
| 49 | #pod =attr modeFlags | ||
| 50 | #pod | ||
| 51 | #pod Video Mode Flags; see L<X11::XRandR::Types/ModeFlag> | ||
| 52 | #pod | ||
| 53 | #pod =cut | ||
| 54 | |||
| 55 | 1 | has modeFlags => ( | |
| 56 | is => 'ro', | ||
| 57 | isa => ArrayRef [ModeFlag], | ||
| 58 | required => 1, | ||
| 59 | ); | ||
| 60 | |||
| 61 | #pod =attr width | ||
| 62 | #pod | ||
| 63 | #pod =attr height | ||
| 64 | #pod | ||
| 65 | #pod =attr hSyncStart | ||
| 66 | #pod | ||
| 67 | #pod =attr hSyncEnd | ||
| 68 | #pod | ||
| 69 | #pod =attr hTotal | ||
| 70 | #pod | ||
| 71 | #pod =attr hSkew | ||
| 72 | #pod | ||
| 73 | #pod =attr vSyncStart | ||
| 74 | #pod | ||
| 75 | #pod =attr vSyncEnd | ||
| 76 | #pod | ||
| 77 | #pod =attr vTotal | ||
| 78 | #pod | ||
| 79 | #pod =cut | ||
| 80 | |||
| 81 | has $_ => ( | ||
| 82 | is => 'ro', | ||
| 83 | isa => PositiveOrZeroInt, | ||
| 84 | required => 1 | ||
| 85 | ) | ||
| 86 | 1 | for qw[ | |
| 87 | width | ||
| 88 | height | ||
| 89 | hSyncStart | ||
| 90 | hSyncEnd | ||
| 91 | hTotal | ||
| 92 | hSkew | ||
| 93 | vSyncStart | ||
| 94 | vSyncEnd | ||
| 95 | vTotal | ||
| 96 | ]; | ||
| 97 | |||
| 98 | #pod =attr id | ||
| 99 | #pod | ||
| 100 | #pod =cut | ||
| 101 | |||
| 102 | 1 | has id => ( | |
| 103 | is => 'ro', | ||
| 104 | isa => PositiveOrZeroInt, | ||
| 105 | required => 1, | ||
| 106 | ); | ||
| 107 | |||
| 108 | #pod =attr dotClock | ||
| 109 | #pod | ||
| 110 | #pod The refresh rate. An instance of L<X11::XRandR::Frequency>. | ||
| 111 | #pod | ||
| 112 | #pod =cut | ||
| 113 | |||
| 114 | 1 | has dotClock => ( | |
| 115 | is => 'ro', | ||
| 116 | isa => InstanceOf ['X11::XRandR::Frequency'], | ||
| 117 | required => 1, | ||
| 118 | ); | ||
| 119 | |||
| 120 | #pod =attr hSync | ||
| 121 | #pod | ||
| 122 | #pod The horizontal sync rate. An instance of L<X11::XRandR::Frequency>. | ||
| 123 | #pod | ||
| 124 | #pod =cut | ||
| 125 | |||
| 126 | 1 | has hSync => ( | |
| 127 | is => 'ro', | ||
| 128 | isa => InstanceOf ['X11::XRandR::Frequency'], | ||
| 129 | required => 1, | ||
| 130 | ); | ||
| 131 | |||
| 132 | #pod =attr vSync | ||
| 133 | #pod | ||
| 134 | #pod The vertical sync rate. An instance of L<X11::XRandR::Frequency>. | ||
| 135 | #pod | ||
| 136 | #pod =cut | ||
| 137 | |||
| 138 | 1 | has vSync => ( | |
| 139 | is => 'ro', | ||
| 140 | isa => InstanceOf ['X11::XRandR::Frequency'], | ||
| 141 | required => 1, | ||
| 142 | ); | ||
| 143 | |||
| 144 | #pod =method to_string | ||
| 145 | #pod | ||
| 146 | #pod Return a string rendition of the object just as B<xrandr> would. | ||
| 147 | #pod | ||
| 148 | #pod =cut | ||
| 149 | |||
| 150 | #pod =method to_XRRModeInfo | ||
| 151 | #pod | ||
| 152 | #pod Create an XRRModeInfo object | ||
| 153 | #pod | ||
| 154 | #pod =cut | ||
| 155 | |||
| 156 | 0 | ▶ | sub to_XRRModeInfo { |
|
Subroutine
to_XRRModeInfo: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 157 | |||
| 158 | 0 | require X11::XRandR::XRRModeInfo; | |
| 159 | 0 | my $self = shift; | |
| 160 | |||
| 161 | 0 | return X11::XRandR::XRRModeInfo->new( | |
| 162 | width => $self->width, | ||
| 163 | height => $self->height, | ||
| 164 | dotClock => $self->dotClock->to_Hz, | ||
| 165 | hSyncStart => $self->hSyncStart, | ||
| 166 | hSyncEnd => $self->hSyncEnd, | ||
| 167 | hTotal => $self->hTotal, | ||
| 168 | hSkew => $self->hSkew, | ||
| 169 | vSyncStart => $self->vSyncStart, | ||
| 170 | vSyncEnd => $self->vSyncEnd, | ||
| 171 | vTotal => $self->vTotal, | ||
| 172 | ); | ||
| 173 | |||
| 174 | |||
| 175 | } | ||
| 176 | |||
| 177 | 1 | 1; | |
| 178 | |||
| 179 | # | ||
| 180 | # This file is part of X11-XRandR | ||
| 181 | # | ||
| 182 | # This software is Copyright (c) 2018 by Diab Jerius. | ||
| 183 | # | ||
| 184 | # This is free software, licensed under: | ||
| 185 | # | ||
| 186 | # The GNU General Public License, Version 3, June 2007 | ||
| 187 | # | ||
| 188 | |||
| 189 | __END__ | ||