Don't add progress ticks to the statusbar when creating progress data.
[anjuta-git-plugin.git] / scripts / glade2schema.pl
blobe4c2f079622e0281511333a993b50f23a04f35cd
1 #!/usr/bin/perl
3 use XML::Parser;
5 %datatypes = (
6 "bool" => "bool",
7 "int" => "int",
8 "string" => "string",
9 "text" => "string",
10 "float" => "float",
11 "color" => "string",
12 "font" => "string"
15 %boolean = (
16 0 => "FALSE",
17 1 => "TRUE"
20 $schema_path = "/schemas/apps/anjuta/preferences/";
21 $key_path ="/apps/anjuta/preferences/";
23 my $parser = new XML::Parser(Style => "Stream");
24 print "<gconfschemafile>\n";
25 print "\t<schemalist>\n";
27 $parser->parsefile($ARGV[0]);
29 print "\t</schemalist>\n";
30 print "</gconfschemafile>\n";
32 sub StartTag {
33 my $parser = shift;
34 my $key = shift;
35 if ($key =~ /widget/) {
36 my $k = $_{"id"};
37 if ($k =~ /(preferences_color|entry|font|spin|text|toggle|menu):(.*):(.*):(\d):(.*)/) {
39 my $type = $2;
40 my $default = $3;
41 my $flags = $4;
42 my $propkey = $5;
45 if ($type =~ /bool/) {
46 $default = $boolean{$default};
51 print "\t\t<schema>\n";
52 print "\t\t\t<key>$schema_path$propkey</key>\n";
53 print "\t\t\t<applyto>$key_path$propkey</applyto>\n";
54 print "\t\t\t<owner>anjuta</owner>\n";
55 print "\t\t\t<type>$datatypes{$type}</type>\n";
56 print "\t\t\t<default>$default</default>\n";
58 # Hack to keep gconftool happy
59 print "\t\t\t<locale name=\"C\" />\n";
61 print "\t\t</schema>\n\n";
66 sub EndTag {}
68 sub Text {}