lib/WL/gtk.pm untested

filter: Statementstmt 0.0% 0 / 47 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 63 CC 2 SCAR 9.8
CC
2
Cov
0%
callback
6.0
get_gtk_surface
2.0
set_dbus_properties
2.0
CRAP 2.7
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::gtk - Perl binding for gtk protocol
15  
16 =head1 SYNOPSIS
17  
18 use WL::gtk;
19  
20 =head1 DESCRIPTION
21  
22 B<WL::gtk> 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::gtk;
42  
43 our $VERSION = 0.92;
44  
45 package WL::gtk_shell;
46  
47 our @ISA = qw/WL::Base/;
48 our $VERSION = 1;
49 our $INTERFACE = 'gtk_shell';
50  
51 # Requests
52 use constant REQUEST_GET_GTK_SURFACE => 0;
53  
54 sub get_gtk_surface
55 {
56 my $self = shift;
57 my $file;
58 my $retval;
59  
60 $self->call (REQUEST_GET_GTK_SURFACE, pack ('L L',
61 ($retval = new WL::gtk_surface ($self->{conn}))->{id},
62 shift->{id}), $file);
63  
64 return $retval;
65 }
66  
67 # Events
68 use constant EVENT_CAPABILITIES => 0;
69  
70 sub callback
71 {
72 my $self = shift;
73 my $opcode = shift;
74  
75 if ($opcode == EVENT_CAPABILITIES) {
76 @_ = unpack ('L', shift);
77 return $self->capabilities (shift);
78 } else {
79 die 'Bad opcode';
80 }
81 }
82  
83 # Enums
84 use constant CAPABILITY_GLOBAL_APP_MENU => 1;
85 use constant CAPABILITY_GLOBAL_MENU_BAR => 2;
86  
87 package WL::gtk_surface;
88  
89 our @ISA = qw/WL::Base/;
90 our $VERSION = 1;
91 our $INTERFACE = 'gtk_surface';
92  
93 # Requests
94 use constant REQUEST_SET_DBUS_PROPERTIES => 0;
95  
96 sub set_dbus_properties
97 {
98 my $self = shift;
99 my $file;
100 my $retval;
101  
102 $self->call (REQUEST_SET_DBUS_PROPERTIES, pack ('L/ax!4 L/ax!4 L/ax!4 L/ax!4 L/ax!4 L/ax!4',
103 shift."\x00",
104 shift."\x00",
105 shift."\x00",
106 shift."\x00",
107 shift."\x00",
108 shift."\x00"), $file);
109  
110 return $retval;
111 }
112  
113  
114 =head1 BUGS
115  
116 The interface documentation for the bindings is lacking.
117  
118 Only client part implemented, not server.
119  
120 =head1 SEE ALSO
121  
122 =over
123  
124 =item *
125  
126 L<http://wayland.freedesktop.org/> -- Wayland project web site
127  
128 =item *
129  
130 L<wl-draw.pl> -- Example Wayland client
131  
132 =item *
133  
134 L<wl-scanner.pl> -- Tool that generated this module
135  
136 =item *
137  
138 L<WL::Base> -- Base class for Wayland objects
139  
140 =item *
141  
142 L<WL::Connection> -- Estabilish a Wayland connection
143  
144 =back
145  
146 =head1 COPYRIGHT
147  
148 Copyright 2013, 2014 Lubomir Rintel
149  
150 This program is free software; you can redistribute it and/or modify it
151 under the same terms as Perl itself.
152  
153 =head1 AUTHORS
154  
155 Lubomir Rintel C<lkundrak@v3.sk>
156  
157 =cut
158