aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xkeyboard-config/tests/xkbTestFunc.pm
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-11-19 10:38:33 +0100
committermarha <marha@users.sourceforge.net>2012-11-19 10:38:33 +0100
commit24635abae6008bef13e30d798b3f33abab412770 (patch)
treee799fbde24e0fd935af76b0bc48d30ef69f75d54 /xorg-server/xkeyboard-config/tests/xkbTestFunc.pm
parente0844ae8b5ef87049537a7e0ebff81acc2695256 (diff)
parent6ce1d8f0f8c23e186175a7c84c21d7bfbe168dc5 (diff)
downloadvcxsrv-24635abae6008bef13e30d798b3f33abab412770.tar.gz
vcxsrv-24635abae6008bef13e30d798b3f33abab412770.tar.bz2
vcxsrv-24635abae6008bef13e30d798b3f33abab412770.zip
Merge remote-tracking branch 'origin/released'
* origin/released: Changed file permissions dos -> unix Conflicts: libX11/include/X11/Xregion.h libX11/src/ConvSel.c libX11/src/CrGlCur.c libX11/src/CrWindow.c libX11/src/GetDflt.c libX11/src/StrKeysym.c libX11/src/Window.c libX11/src/xkb/XKBBind.c libX11/src/xkb/XKBGetMap.c libX11/src/xkb/XKBSetGeom.c libX11/src/xkb/XKBUse.c libX11/src/xlibi18n/XimProto.h libX11/src/xlibi18n/lcDynamic.c libXdmcp/Key.c libXdmcp/Write.c libxcb/src/xcb_windefs.h xkbcomp/keycodes.c xkbcomp/xkbpath.c xorg-server/hw/xwin/glx/winpriv.h xorg-server/xkeyboard-config/rules/bin/ml1_s.sh xorg-server/xkeyboard-config/rules/bin/ml1v1_s.sh xorg-server/xkeyboard-config/rules/bin/ml1v_s.sh xorg-server/xkeyboard-config/rules/bin/ml_s.sh xorg-server/xkeyboard-config/rules/bin/mln_s.sh xorg-server/xkeyboard-config/rules/bin/mlnvn_s.sh xorg-server/xkeyboard-config/rules/bin/mlv_s.sh xorg-server/xkeyboard-config/rules/compat/.gitignore
Diffstat (limited to 'xorg-server/xkeyboard-config/tests/xkbTestFunc.pm')
-rw-r--r--xorg-server/xkeyboard-config/tests/xkbTestFunc.pm330
1 files changed, 165 insertions, 165 deletions
diff --git a/xorg-server/xkeyboard-config/tests/xkbTestFunc.pm b/xorg-server/xkeyboard-config/tests/xkbTestFunc.pm
index 77f03144f..0ec3ada23 100644
--- a/xorg-server/xkeyboard-config/tests/xkbTestFunc.pm
+++ b/xorg-server/xkeyboard-config/tests/xkbTestFunc.pm
@@ -1,165 +1,165 @@
-package xkbTestFunc;
-
-use strict;
-use warnings;
-
-our $VERSION='1.00';
-
-our $origXkbRules;
-our $origXkbModel;
-our $origXkbLayouts;
-our $origXkbOptions;
-our $origXkbVariants;
-
-sub backupXkbSettings
-{
- ( $origXkbRules, $origXkbModel, $origXkbLayouts, $origXkbVariants, $origXkbOptions ) = getXkbSettings();
-}
-
-sub getXkbSettings
-{
- my ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions );
-
- open (XPROP, "xprop -root |") or die "Could not start xprop";
- PROP: while (<XPROP>)
- {
- if (/_XKB_RULES_NAMES\(STRING\) = \"(.*)\", \"(.*)\", \"(.*)\", \"(.*)\", \"(.*)\"/)
- {
- ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions ) =
- ( $1, $2, $3, $4, $5 ) ;
- last PROP;
- }
- }
- close XPROP;
-
- return ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions );
-}
-
-sub setXkbSettings
-{
- my ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions ) = @_;
- my $outfile = ".test.out.xkb";
- ( system ( "setxkbmap -rules \"$xkbRules\" " .
- "-model \"$xkbModel\" " .
- "-layout \"$xkbLayouts\" " .
- "-variant \"$xkbVariants\" " .
- "-option \"$xkbOptions\" " .
- "-print | xkbcomp - -xkb $outfile" ) == 0 ) or die "Could not set xkb configuration";
- unlink($outfile);
-}
-
-sub restoreXkbSettings
-{
- setXkbSettings( $origXkbRules, $origXkbModel, $origXkbLayouts, $origXkbVariants, $origXkbOptions );
-}
-
-sub defaultXkbSettings
-{
- return ( "base", "pc105", "us", "", "" );
-}
-
-sub dumpXkbSettings
-{
- my ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions ) = @_;
- print "rules: [$xkbRules]\n" ;
- print "model: [$xkbModel]\n" ;
- print "layouts: [$xkbLayouts]\n" ;
- print "variants: [$xkbVariants]\n" ;
- print "options: [$xkbOptions]\n" ;
-}
-
-sub dumpXkbSettingsBackup
-{
- dumpXkbSettings( $origXkbRules, $origXkbModel, $origXkbLayouts, $origXkbVariants, $origXkbOptions );
-}
-
-sub testLevel1
-{
- my ( $type, $idx ) = @_;
-
- open ( XSLTPROC, "xsltproc --stringparam type $type listCIs.xsl ../rules/base.xml.in |" ) or
- die ( "Could not start xsltproc" );
- while (<XSLTPROC>)
- {
- chomp();
- if (/(\S+)/)
- {
- my $paramValue=$1;
- print "--- setting $type: [$paramValue]\n";
- my @params = defaultXkbSettings();
- $params[$idx] = $paramValue;
- dumpXkbSettings ( @params );
- setXkbSettings ( @params );
- #print "--- dump:\n";
- #dumpXkbSettings( getXkbSettings() );
- }
- }
- close XSLTPROC;
-}
-
-sub testLevel2
-{
- my ( $type, $subtype, $idx, $delim1, $delim2, $ifCheckLevel1, $ifAddLevel1, $ifResetToDefault ) = @_;
-
- open ( XSLTPROC, "xsltproc --stringparam type $type listCIs.xsl ../rules/base.xml.in |" ) or
- die ( "Could not start xsltproc" );
- while (<XSLTPROC>)
- {
- chomp();
- if (/(\S+)/)
- {
- my $paramValue=$1;
- print "--- scanning $type: [$paramValue]\n";
-
- if ( $ifCheckLevel1 )
- {
- my @params = defaultXkbSettings();
- if ( $ifResetToDefault )
- {
- setXkbSettings ( @params );
- }
- $params[$idx] = "$paramValue";
- dumpXkbSettings ( @params );
- setXkbSettings ( @params );
- #print "--- dump:\n";
- #dumpXkbSettings( getXkbSettings() );
- }
-
- open ( XSLTPROC2, "xsltproc --stringparam type $subtype --stringparam parentId $paramValue listCI2.xsl ../rules/base.xml.in |" ) or
- die ( "Could not start xsltproc" );
- while (<XSLTPROC2>)
- {
- chomp();
- if (/(\S+)/)
- {
- my $paramValue2=$1;
- print " --- $subtype: [$paramValue2]\n";
- my @params = defaultXkbSettings();
- if ( $ifResetToDefault )
- {
- setXkbSettings ( @params );
- }
- if ( $ifAddLevel1 )
- {
- $params[$idx] = "$paramValue$delim1$paramValue2$delim2";
- }
- else
- {
- $params[$idx] = "$paramValue2";
- }
- dumpXkbSettings ( @params );
- setXkbSettings ( @params );
- #print "--- dump:\n";
- #dumpXkbSettings( getXkbSettings() );
- }
- }
- close XSLTPROC2;
- }
- }
- close XSLTPROC;
-}
-
-1;
-__END__
-
-No docs yet
+package xkbTestFunc;
+
+use strict;
+use warnings;
+
+our $VERSION='1.00';
+
+our $origXkbRules;
+our $origXkbModel;
+our $origXkbLayouts;
+our $origXkbOptions;
+our $origXkbVariants;
+
+sub backupXkbSettings
+{
+ ( $origXkbRules, $origXkbModel, $origXkbLayouts, $origXkbVariants, $origXkbOptions ) = getXkbSettings();
+}
+
+sub getXkbSettings
+{
+ my ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions );
+
+ open (XPROP, "xprop -root |") or die "Could not start xprop";
+ PROP: while (<XPROP>)
+ {
+ if (/_XKB_RULES_NAMES\(STRING\) = \"(.*)\", \"(.*)\", \"(.*)\", \"(.*)\", \"(.*)\"/)
+ {
+ ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions ) =
+ ( $1, $2, $3, $4, $5 ) ;
+ last PROP;
+ }
+ }
+ close XPROP;
+
+ return ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions );
+}
+
+sub setXkbSettings
+{
+ my ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions ) = @_;
+ my $outfile = ".test.out.xkb";
+ ( system ( "setxkbmap -rules \"$xkbRules\" " .
+ "-model \"$xkbModel\" " .
+ "-layout \"$xkbLayouts\" " .
+ "-variant \"$xkbVariants\" " .
+ "-option \"$xkbOptions\" " .
+ "-print | xkbcomp - -xkb $outfile" ) == 0 ) or die "Could not set xkb configuration";
+ unlink($outfile);
+}
+
+sub restoreXkbSettings
+{
+ setXkbSettings( $origXkbRules, $origXkbModel, $origXkbLayouts, $origXkbVariants, $origXkbOptions );
+}
+
+sub defaultXkbSettings
+{
+ return ( "base", "pc105", "us", "", "" );
+}
+
+sub dumpXkbSettings
+{
+ my ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions ) = @_;
+ print "rules: [$xkbRules]\n" ;
+ print "model: [$xkbModel]\n" ;
+ print "layouts: [$xkbLayouts]\n" ;
+ print "variants: [$xkbVariants]\n" ;
+ print "options: [$xkbOptions]\n" ;
+}
+
+sub dumpXkbSettingsBackup
+{
+ dumpXkbSettings( $origXkbRules, $origXkbModel, $origXkbLayouts, $origXkbVariants, $origXkbOptions );
+}
+
+sub testLevel1
+{
+ my ( $type, $idx ) = @_;
+
+ open ( XSLTPROC, "xsltproc --stringparam type $type listCIs.xsl ../rules/base.xml.in |" ) or
+ die ( "Could not start xsltproc" );
+ while (<XSLTPROC>)
+ {
+ chomp();
+ if (/(\S+)/)
+ {
+ my $paramValue=$1;
+ print "--- setting $type: [$paramValue]\n";
+ my @params = defaultXkbSettings();
+ $params[$idx] = $paramValue;
+ dumpXkbSettings ( @params );
+ setXkbSettings ( @params );
+ #print "--- dump:\n";
+ #dumpXkbSettings( getXkbSettings() );
+ }
+ }
+ close XSLTPROC;
+}
+
+sub testLevel2
+{
+ my ( $type, $subtype, $idx, $delim1, $delim2, $ifCheckLevel1, $ifAddLevel1, $ifResetToDefault ) = @_;
+
+ open ( XSLTPROC, "xsltproc --stringparam type $type listCIs.xsl ../rules/base.xml.in |" ) or
+ die ( "Could not start xsltproc" );
+ while (<XSLTPROC>)
+ {
+ chomp();
+ if (/(\S+)/)
+ {
+ my $paramValue=$1;
+ print "--- scanning $type: [$paramValue]\n";
+
+ if ( $ifCheckLevel1 )
+ {
+ my @params = defaultXkbSettings();
+ if ( $ifResetToDefault )
+ {
+ setXkbSettings ( @params );
+ }
+ $params[$idx] = "$paramValue";
+ dumpXkbSettings ( @params );
+ setXkbSettings ( @params );
+ #print "--- dump:\n";
+ #dumpXkbSettings( getXkbSettings() );
+ }
+
+ open ( XSLTPROC2, "xsltproc --stringparam type $subtype --stringparam parentId $paramValue listCI2.xsl ../rules/base.xml.in |" ) or
+ die ( "Could not start xsltproc" );
+ while (<XSLTPROC2>)
+ {
+ chomp();
+ if (/(\S+)/)
+ {
+ my $paramValue2=$1;
+ print " --- $subtype: [$paramValue2]\n";
+ my @params = defaultXkbSettings();
+ if ( $ifResetToDefault )
+ {
+ setXkbSettings ( @params );
+ }
+ if ( $ifAddLevel1 )
+ {
+ $params[$idx] = "$paramValue$delim1$paramValue2$delim2";
+ }
+ else
+ {
+ $params[$idx] = "$paramValue2";
+ }
+ dumpXkbSettings ( @params );
+ setXkbSettings ( @params );
+ #print "--- dump:\n";
+ #dumpXkbSettings( getXkbSettings() );
+ }
+ }
+ close XSLTPROC2;
+ }
+ }
+ close XSLTPROC;
+}
+
+1;
+__END__
+
+No docs yet