lib/WL/fullscreen_shell.pm untested

filter: Statementstmt 0.0% 0 / 89 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 23 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 125 CC 5 SCAR 16.0
CC
5
Cov
0%
callback
20.0
callback
6.0
release
2.0
CRAP 5.0
1 # DO NOT EDIT, PRETTY PLEASE!
2 # This file is automatically generated by wl-scanner.pl
3 #
4  
5 use strict;
6 use warnings;
7 use utf8;
8  
9 =encoding utf8
10 =cut
11  
12 =head1 NAME
13  
14 WL::fullscreen_shell - Perl binding for fullscreen_shell protocol
15  
16 =head1 SYNOPSIS
17  
18 use WL::fullscreen_shell;
19  
20 =head1 DESCRIPTION
21  
22 B<WL::fullscreen_shell> is a package generated from Wayland protocol definition
23 using L<wl-scanner.pl>. It implements L<WL::Base> subclasses with wrappers
24 for requests, event processing and constants for enums.
25  
26 It is not indended to be used directly. Instead, see L<WL::Connection> to see
27 how to obtain the object instances.
28  
29 To see how to attach event callbacks and issue requests, please refer to
30 L<WL::Base> base class.
31  
32 Until proper documentation is finished, please refer to documentation of C
33 bindings of the generated code (it is intended to be readable) to see what
34 arguments to give to requests and expect from events.
35  
36 Please consider this an alpha quality code, whose API can change at any time,
37 until we reach version 1.0.
38  
39 =cut
40  
41 package WL::fullscreen_shell;
42  
43 our $VERSION = 0.92;
44  
45 package WL::_wl_fullscreen_shell;
46  
47 our @ISA = qw/WL::Base/;
48 our $VERSION = 1;
49 our $INTERFACE = '_wl_fullscreen_shell';
50  
51 # Requests
52 use constant REQUEST_RELEASE => 0;
53 use constant REQUEST_PRESENT_SURFACE => 1;
54 use constant REQUEST_PRESENT_SURFACE_FOR_MODE => 2;
55  
56 sub release
57 {
58 my $self = shift;
59 my $file;
60 my $retval;
61  
62 $self->call (REQUEST_RELEASE, pack ('',
63 ), $file);
64  
65 return $retval;
66 }
67  
68 sub present_surface
69 {
70 my $self = shift;
71 my $file;
72 my $retval;
73  
74 $self->call (REQUEST_PRESENT_SURFACE, pack ('L L L',
75 shift->{id},
76 shift,
77 shift->{id}), $file);
78  
79 return $retval;
80 }
81  
82 sub present_surface_for_mode
83 {
84 my $self = shift;
85 my $file;
86 my $retval;
87  
88 $self->call (REQUEST_PRESENT_SURFACE_FOR_MODE, pack ('L L l L',
89 shift->{id},
90 shift->{id},
91 shift,
92 ($retval = new WL::_wl_fullscreen_shell_mode_feedback ($self->{conn}))->{id}), $file);
93  
94 return $retval;
95 }
96  
97 # Events
98 use constant EVENT_CAPABILITY => 0;
99  
100 sub callback
101 {
102 my $self = shift;
103 my $opcode = shift;
104  
105 if ($opcode == EVENT_CAPABILITY) {
106 @_ = unpack ('L', shift);
107 return $self->capability (shift);
108 } else {
109 die 'Bad opcode';
110 }
111 }
112  
113 # Enums
114 use constant CAPABILITY_ARBITRARY_MODES => 1;
115 use constant CAPABILITY_CURSOR_PLANE => 2;
116 use constant PRESENT_METHOD_DEFAULT => 0;
117 use constant PRESENT_METHOD_CENTER => 1;
118 use constant PRESENT_METHOD_ZOOM => 2;
119 use constant PRESENT_METHOD_ZOOM_CROP => 3;
120 use constant PRESENT_METHOD_STRETCH => 4;
121 use constant ERROR_INVALID_METHOD => 0;
122  
123 package WL::_wl_fullscreen_shell_mode_feedback;
124  
125 our @ISA = qw/WL::Base/;
126 our $VERSION = 1;
127 our $INTERFACE = '_wl_fullscreen_shell_mode_feedback';
128  
129 # Events
130 use constant EVENT_MODE_SUCCESSFUL => 0;
131 use constant EVENT_MODE_FAILED => 1;
132 use constant EVENT_PRESENT_CANCELLED => 2;
133  
134 sub callback
135 {
136 my $self = shift;
137 my $opcode = shift;
138  
139 if ($opcode == EVENT_MODE_SUCCESSFUL) {
140 return $self->mode_successful ();
141 } elsif ($opcode == EVENT_MODE_FAILED) {
142 return $self->mode_failed ();
143 } elsif ($opcode == EVENT_PRESENT_CANCELLED) {
144 return $self->present_cancelled ();
145 } else {
146 die 'Bad opcode';
147 }
148 }
149  
150  
151 =head1 BUGS
152  
153 The interface documentation for the bindings is lacking.
154  
155 Only client part implemented, not server.
156  
157 =head1 SEE ALSO
158  
159 =over
160  
161 =item *
162  
163 L<http://wayland.freedesktop.org/> -- Wayland project web site
164  
165 =item *
166  
167 L<wl-draw.pl> -- Example Wayland client
168  
169 =item *
170  
171 L<wl-scanner.pl> -- Tool that generated this module
172  
173 =item *
174  
175 L<WL::Base> -- Base class for Wayland objects
176  
177 =item *
178  
179 L<WL::Connection> -- Estabilish a Wayland connection
180  
181 =back
182  
183 =head1 COPYRIGHT
184  
185 Copyright 2013, 2014 Lubomir Rintel
186  
187 This program is free software; you can redistribute it and/or modify it
188 under the same terms as Perl itself.
189  
190 =head1 AUTHORS
191  
192 Lubomir Rintel C<lkundrak@v3.sk>
193  
194 =cut
195