| 1 | # Copyright 2011, 2012, 2013, 2014, 2017 Kevin Ryde | ||||||||||
| 2 | |||||||||||
| 3 | # This file is part of X11-Protocol-Other. | ||||||||||
| 4 | # | ||||||||||
| 5 | # X11-Protocol-Other is free software; you can redistribute it and/or | ||||||||||
| 6 | # modify it under the terms of the GNU General Public License as published | ||||||||||
| 7 | # by the Free Software Foundation; either version 3, or (at your option) any | ||||||||||
| 8 | # later version. | ||||||||||
| 9 | # | ||||||||||
| 10 | # X11-Protocol-Other is distributed in the hope that it will be useful, | ||||||||||
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||||||||||
| 13 | # Public License for more details. | ||||||||||
| 14 | # | ||||||||||
| 15 | # You should have received a copy of the GNU General Public License along | ||||||||||
| 16 | # with X11-Protocol-Other. If not, see <http://www.gnu.org/licenses/>. | ||||||||||
| 17 | |||||||||||
| 18 | 1 | ▶ | BEGIN { require 5 } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | package X11::Protocol::Ext::MIT_SUNDRY_NONSTANDARD; | ||||||||||
| 20 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | |||||||||||
| 23 | 1 | ▶ | use vars '$VERSION', '@CARP_NOT'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 1 | $VERSION = 31; | |||||||||
| 25 | 1 | @CARP_NOT = ('X11::Protocol'); | |||||||||
| 26 | |||||||||||
| 27 | # uncomment this to run the ### lines | ||||||||||
| 28 | #use Smart::Comments; | ||||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | # /usr/include/X11/extensions/mitmiscproto.h | ||||||||||
| 32 | # /usr/include/X11/extensions/mitmiscconst.h | ||||||||||
| 33 | # Protocol. | ||||||||||
| 34 | # | ||||||||||
| 35 | # /usr/include/X11/extensions/MITMisc.h | ||||||||||
| 36 | # Xlib. | ||||||||||
| 37 | |||||||||||
| 38 | |||||||||||
| 39 | my $reqs = | ||||||||||
| 40 | [ | ||||||||||
| 41 | ["MitSundryNonstandardSetBugMode", # 0 | ||||||||||
| 42 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 43 | 0 | my ($X, $onoff) = @_; | |||||||||
| 44 | 0 | return pack 'Cxxx', $onoff; | |||||||||
| 45 | } ], | ||||||||||
| 46 | |||||||||||
| 47 | ["MitSundryNonstandardGetBugMode", # 1 | ||||||||||
| 48 | \&_request_empty, | ||||||||||
| 49 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 50 | 0 | my ($X, $data) = @_; | |||||||||
| 51 | 0 | return unpack 'xC', $data; | |||||||||
| 52 | 1 | }], | |||||||||
| 53 | ]; | ||||||||||
| 54 | |||||||||||
| 55 | 0 | ▶ | sub _request_empty { | ||||||||
|
Subroutine
_request_empty: not called CC=2 SCAR=17.9
| |||||||||||
| 56 | 0 | ▶ | if (@_ > 1) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 57 | 0 | croak "No parameters in this request"; | |||||||||
| 58 | } | ||||||||||
| 59 | 0 | return ''; | |||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 63 | 0 | my ($class, $X, $request_num, $event_num, $error_num) = @_; | |||||||||
| 64 | ### MIT-SUNDRY-NONSTANDARD new() | ||||||||||
| 65 | |||||||||||
| 66 | 0 | _ext_requests_install ($X, $request_num, $reqs); | |||||||||
| 67 | 0 | return bless { }, $class; | |||||||||
| 68 | } | ||||||||||
| 69 | |||||||||||
| 70 | 0 | ▶ | sub _ext_requests_install { | ||||||||
|
Subroutine
_ext_requests_install: not called CC=2 SCAR=17.9
| |||||||||||
| 71 | 0 | my ($X, $request_num, $reqs) = @_; | |||||||||
| 72 | |||||||||||
| 73 | 0 | $X->{'ext_request'}->{$request_num} = $reqs; | |||||||||
| 74 | 0 | my $href = $X->{'ext_request_num'}; | |||||||||
| 75 | 0 | my $i; | |||||||||
| 76 | 0 | foreach $i (0 .. $#$reqs) { | |||||||||
| 77 | 0 | $href->{$reqs->[$i]->[0]} = [$request_num, $i]; | |||||||||
| 78 | } | ||||||||||
| 79 | } | ||||||||||
| 80 | |||||||||||
| 81 | 1 | 1; | |||||||||
| 82 | __END__ | ||||||||||