| 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::wl_test - Perl binding for wl_test protocol | ||
| 15 | |||
| 16 | =head1 SYNOPSIS | ||
| 17 | |||
| 18 | use WL::wl_test; | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | B<WL::wl_test> 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::wl_test; | ||
| 42 | |||
| 43 | our $VERSION = 0.92; | ||
| 44 | |||
| 45 | package WL::wl_test; | ||
| 46 | |||
| 47 | our @ISA = qw/WL::Base/; | ||
| 48 | our $VERSION = 1; | ||
| 49 | our $INTERFACE = 'wl_test'; | ||
| 50 | |||
| 51 | # Requests | ||
| 52 | use constant REQUEST_MOVE_SURFACE => 0; | ||
| 53 | use constant REQUEST_MOVE_POINTER => 1; | ||
| 54 | use constant REQUEST_SEND_BUTTON => 2; | ||
| 55 | use constant REQUEST_ACTIVATE_SURFACE => 3; | ||
| 56 | use constant REQUEST_SEND_KEY => 4; | ||
| 57 | use constant REQUEST_GET_N_EGL_BUFFERS => 5; | ||
| 58 | |||
| 59 | sub move_surface | ||
| 60 | { | ||
| 61 | my $self = shift; | ||
| 62 | my $file; | ||
| 63 | my $retval; | ||
| 64 | |||
| 65 | $self->call (REQUEST_MOVE_SURFACE, pack ('L l l', | ||
| 66 | shift->{id}, | ||
| 67 | shift, | ||
| 68 | shift), $file); | ||
| 69 | |||
| 70 | return $retval; | ||
| 71 | } | ||
| 72 | |||
| 73 | sub move_pointer | ||
| 74 | { | ||
| 75 | my $self = shift; | ||
| 76 | my $file; | ||
| 77 | my $retval; | ||
| 78 | |||
| 79 | $self->call (REQUEST_MOVE_POINTER, pack ('l l', | ||
| 80 | shift, | ||
| 81 | shift), $file); | ||
| 82 | |||
| 83 | return $retval; | ||
| 84 | } | ||
| 85 | |||
| 86 | sub send_button | ||
| 87 | { | ||
| 88 | my $self = shift; | ||
| 89 | my $file; | ||
| 90 | my $retval; | ||
| 91 | |||
| 92 | $self->call (REQUEST_SEND_BUTTON, pack ('l L', | ||
| 93 | shift, | ||
| 94 | shift), $file); | ||
| 95 | |||
| 96 | return $retval; | ||
| 97 | } | ||
| 98 | |||
| 99 | sub activate_surface | ||
| 100 | { | ||
| 101 | my $self = shift; | ||
| 102 | my $file; | ||
| 103 | my $retval; | ||
| 104 | |||
| 105 | $self->call (REQUEST_ACTIVATE_SURFACE, pack ('L', | ||
| 106 | shift->{id}), $file); | ||
| 107 | |||
| 108 | return $retval; | ||
| 109 | } | ||
| 110 | |||
| 111 | sub send_key | ||
| 112 | { | ||
| 113 | my $self = shift; | ||
| 114 | my $file; | ||
| 115 | my $retval; | ||
| 116 | |||
| 117 | $self->call (REQUEST_SEND_KEY, pack ('L L', | ||
| 118 | shift, | ||
| 119 | shift), $file); | ||
| 120 | |||
| 121 | return $retval; | ||
| 122 | } | ||
| 123 | |||
| 124 | sub get_n_egl_buffers | ||
| 125 | { | ||
| 126 | my $self = shift; | ||
| 127 | my $file; | ||
| 128 | my $retval; | ||
| 129 | |||
| 130 | $self->call (REQUEST_GET_N_EGL_BUFFERS, pack ('', | ||
| 131 | ), $file); | ||
| 132 | |||
| 133 | return $retval; | ||
| 134 | } | ||
| 135 | |||
| 136 | # Events | ||
| 137 | use constant EVENT_POINTER_POSITION => 0; | ||
| 138 | use constant EVENT_N_EGL_BUFFERS => 1; | ||
| 139 | |||
| 140 | sub callback | ||
| 141 | { | ||
| 142 | my $self = shift; | ||
| 143 | my $opcode = shift; | ||
| 144 | |||
| 145 | if ($opcode == EVENT_POINTER_POSITION) { | ||
| 146 | @_ = unpack ('L L', shift); | ||
| 147 | return $self->pointer_position ($self->fixed2nv (shift), | ||
| 148 | $self->fixed2nv (shift)); | ||
| 149 | } elsif ($opcode == EVENT_N_EGL_BUFFERS) { | ||
| 150 | @_ = unpack ('L', shift); | ||
| 151 | return $self->n_egl_buffers (shift); | ||
| 152 | } else { | ||
| 153 | die 'Bad opcode'; | ||
| 154 | } | ||
| 155 | } | ||
| 156 | |||
| 157 | |||
| 158 | =head1 BUGS | ||
| 159 | |||
| 160 | The interface documentation for the bindings is lacking. | ||
| 161 | |||
| 162 | Only client part implemented, not server. | ||
| 163 | |||
| 164 | =head1 SEE ALSO | ||
| 165 | |||
| 166 | =over | ||
| 167 | |||
| 168 | =item * | ||
| 169 | |||
| 170 | L<http://wayland.freedesktop.org/> -- Wayland project web site | ||
| 171 | |||
| 172 | =item * | ||
| 173 | |||
| 174 | L<wl-draw.pl> -- Example Wayland client | ||
| 175 | |||
| 176 | =item * | ||
| 177 | |||
| 178 | L<wl-scanner.pl> -- Tool that generated this module | ||
| 179 | |||
| 180 | =item * | ||
| 181 | |||
| 182 | L<WL::Base> -- Base class for Wayland objects | ||
| 183 | |||
| 184 | =item * | ||
| 185 | |||
| 186 | L<WL::Connection> -- Estabilish a Wayland connection | ||
| 187 | |||
| 188 | =back | ||
| 189 | |||
| 190 | =head1 COPYRIGHT | ||
| 191 | |||
| 192 | Copyright 2013, 2014 Lubomir Rintel | ||
| 193 | |||
| 194 | This program is free software; you can redistribute it and/or modify it | ||
| 195 | under the same terms as Perl itself. | ||
| 196 | |||
| 197 | Copyright notice from the protocol definition file: | ||
| 198 | |||
| 199 | Copyright © 2012 Intel Corporation | ||
| 200 | |||
| 201 | Permission to use, copy, modify, distribute, and sell this | ||
| 202 | software and its documentation for any purpose is hereby granted | ||
| 203 | without fee, provided that the above copyright notice appear in | ||
| 204 | all copies and that both that copyright notice and this permission | ||
| 205 | notice appear in supporting documentation, and that the name of | ||
| 206 | the copyright holders not be used in advertising or publicity | ||
| 207 | pertaining to distribution of the software without specific, | ||
| 208 | written prior permission. The copyright holders make no | ||
| 209 | representations about the suitability of this software for any | ||
| 210 | purpose. It is provided "as is" without express or implied | ||
| 211 | warranty. | ||
| 212 | |||
| 213 | THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS | ||
| 214 | SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
| 215 | FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
| 216 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 217 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN | ||
| 218 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | ||
| 219 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF | ||
| 220 | THIS SOFTWARE. | ||
| 221 | |||
| 222 | =head1 AUTHORS | ||
| 223 | |||
| 224 | Lubomir Rintel C<lkundrak@v3.sk> | ||
| 225 | |||
| 226 | =cut | ||
| 227 |