#!/usr/local/bin/perl

## This script is used to create a template from which to start building
## borders in Edje
## Ben Rockwood - July 27th 2003	The Enlightenment Project

$ARGS = @ARGV;

if ($ARGS < 1){
  print("EDC Template Script: Usage: $0 <templatename.edc>\n\n"); 
  exit(0);
}

print("EDC Template Script: Writing output to $ARGV[0]\n\n");


### Print Header to file from first arg
open(EDJE, ">$ARGV[0]");

print("Writing images out......\n");

#######################################
print(EDJE "images {\n");
		

while(<*.png>){
	print(EDJE "\timage, \"$_\" LOSSY 95\;\n");
}
#######################################

print("Writing collections header....\n");

#######################################
print EDJE "
}


collections {
   group {
        min, 32 32;
        max, 1024 768;
      name, \"test\";
      parts {
";
#######################################

print("Writing out dummy parts....\n");

$i = 0;
while(<*.png>){

####################
 print EDJE "
         part {
            name,          \"image$i\";
            color_class,   \"bg\";
            mouse_events,  0;
            description {
               state,    \"default\" 0.0;
               rel1 {
                  relative, 0.0  0.0;
                  offset,   0    0;
               }
               rel2 {
                  relative, 1.0  1.0;
                  offset,   -1   -1;
               }
               image {
                  normal, \"$_\";
               }
               border, 1 1 1 1;
            }
	 }
 ";
################
$i++;
}

#########################
print EDJE "
     } 	   
   } 
} 
";
########################



close(EDJE);

print("Done!  Go edit your ass off now.\n");
