|
Packit Service |
999d52 |
#!/usr/bin/env perl
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
# Author : Simos Xenitellis <simos at gnome dot org>.
|
|
Packit Service |
999d52 |
# Author : Bastien Nocera <hadess@hadess.net>
|
|
Packit Service |
999d52 |
# Version : 1.2
|
|
Packit Service |
999d52 |
#
|
|
Packit Service |
999d52 |
# Input : gsd-power-constants.h
|
|
Packit Service |
999d52 |
# Output : gsdpowerconstants.py
|
|
Packit Service |
999d52 |
#
|
|
Packit Service |
999d52 |
use strict;
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
# Used for reading the keysymdef symbols.
|
|
Packit Service |
999d52 |
my @constantselements;
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
(scalar @ARGV >= 2) or die "Usage: $0 <input> <output>\n";
|
|
Packit Service |
999d52 |
my ($input, $output) = @ARGV;
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
die "Could not open file gsd-power-constants.h: $!\n" unless open(IN_CONSTANTS, "<:utf8", $input);
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
# Output: gtk+/gdk/gdkkeysyms.h
|
|
Packit Service |
999d52 |
die "Could not open file gsdpowerconstants.py: $!\n" unless open(OUT_CONSTANTS, ">:utf8", $output);
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
print OUT_CONSTANTS<
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
# File auto-generated from script http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/power/gsd-power-constants-update.pl
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
# Modified by the GTK+ Team and others 1997-2012. See the AUTHORS
|
|
Packit Service |
999d52 |
# file for a list of people on the GTK+ Team. See the ChangeLog
|
|
Packit Service |
999d52 |
# files for a list of changes. These files are distributed with
|
|
Packit Service |
999d52 |
# GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
EOF
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
while (<IN_CONSTANTS>)
|
|
Packit Service |
999d52 |
{
|
|
Packit Service |
999d52 |
next if ( ! /^#define / );
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
@constantselements = split(/\s+/);
|
|
Packit Service |
999d52 |
die "Internal error, no \@constantselements: $_\n" unless @constantselements;
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
my $constant = $constantselements[1];
|
|
Packit Service |
999d52 |
my $value = $constantselements[2];
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
printf OUT_CONSTANTS "%s = %s;\n", $constant, $value;
|
|
Packit Service |
999d52 |
}
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
close IN_CONSTANTS;
|
|
Packit Service |
999d52 |
|
|
Packit Service |
999d52 |
printf "We just finished converting $input to $output\nThank you\n";
|