sdkcreationmw/sdkexamples/cppexamples/Doxyfiles/doxy.pl
author rajpuroh
Wed, 21 Apr 2010 09:56:53 +0530
changeset 1 ac50fd48361b
parent 0 b26acd06ea60
permissions -rw-r--r--
Second Contribution
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     1
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     2
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     3
# All rights reserved.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     4
# This component and the accompanying materials are made available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     5
# under the terms of "Eclipse Public License v1.0"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     6
# which accompanies this distribution, and is available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     8
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     9
# Initial Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    11
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    12
# Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    13
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    14
# Description: 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    15
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    16
#!/usr/local/bin/perl
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    17
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    18
# doxy.pl
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    19
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    20
# THis script generates doxygen formatted documentation from source code
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    21
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    22
# ***********************************************************************
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    23
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    24
#  Change history:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    25
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    26
#                 13.06.2005 This could be v.1.0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    27
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    28
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    29
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    30
# ***********************************************************************
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    31
use strict;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    32
use Tk;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    33
use Tk::NoteBook;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    34
use Tk::DirTree;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    35
use Tk::DialogBox;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    36
use Cwd;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    37
use File::Copy;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    38
my ($TOP_GIF);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    39
$TOP_GIF='top.gif';
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    40
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    41
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    42
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    43
# finds doc-dirs where is Mainpage.dox
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    44
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    45
sub find_doc {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    46
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    47
	my ($rdir_list, $cf, $path, $last_dir, $dir);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    48
	$rdir_list = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    49
	$cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    50
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    51
	$path = cwd();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    52
	$last_dir=$path;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    53
	$last_dir=~s/.*\///;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    54
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    55
	if ($last_dir=~m/^$$cf{'document_dir'}$/) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    56
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    57
		$path=~s/\/$$cf{'document_dir'}.*//;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    58
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    59
		if (-s $$cf{'mainpage'}) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    60
			push(@$rdir_list, $path);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    61
		}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    62
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    63
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    64
    	foreach $dir (<*>) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    65
		if (-d $dir) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    66
			chdir $dir;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    67
			&find_doc($rdir_list, $cf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    68
			chdir "..";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    69
		}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    70
    	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    71
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    72
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    73
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    74
# rips class hierarchy from hierarchy.html
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    75
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    76
sub rip_hierarchy {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    77
	my ($rlines, $line, $l_count, $page);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    78
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    79
	$rlines = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    80
	$page = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    81
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    82
	$l_count = 0;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    83
	open (HIERARCHY, $page);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    84
	while ($line = <HIERARCHY>) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    85
		chomp($line);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    86
		if ($line=~m/\<\/ul\>/) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    87
			if ($l_count==1) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    88
			push (@$rlines, $line."\n");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    89
			}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    90
			$l_count--;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    91
		}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    92
		if ($line=~m/\<ul\>/) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    93
			$l_count++;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    94
		}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    95
		if ($l_count > 0) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    96
			$line=~s/\<h1\>.*\<\/h1\>//;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    97
			push (@$rlines, $line."\n");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    98
		}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    99
		#if ($line=~m/\<h1\>.*\<ul\>/) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   100
		#	$line=~s/\<h1\>.*\<\/h1\>//;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   101
		#	push (@$rlines, $line."\n");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   102
		#	$l_count++;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   103
		#}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   104
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   105
	close (HIERARCHY);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   106
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   107
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   108
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   109
# rips class hierarchy from annotated.html
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   110
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   111
sub rip_annotated {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   112
	my ($rlines, $line, $page);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   113
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   114
	$rlines = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   115
	$page = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   116
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   117
	open (ANNOTATED, $page);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   118
	#$line = "<h1>Class Hierarchy</h1>This inheritance list is sorted roughly, but not completely, alphabetically:<ul>\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   119
	$line = "This inheritance list is sorted roughly, but not completely, alphabetically:<ul>\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   120
	push (@$rlines, $line);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   121
	while ($line = <ANNOTATED>) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   122
		chomp($line);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   123
		if ($line=~m/.*<tr.*indexkey.*indexvalue.*tr>/) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   124
			$line=~s/^.*<tr>.*<a//;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   125
			$line=~s/<\/td>.*$//;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   126
			$line=~s/^/<li><a/;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   127
			push (@$rlines, $line."\n");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   128
		}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   129
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   130
	close (ANNOTATED);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   131
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   132
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   133
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   134
# finds right place from Mainpage.dox and inserts
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   135
# ripped lines
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   136
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   137
sub find_replace {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   138
	my ($rlines, $infile, $tmpfile, $cf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   139
	$rlines = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   140
	$cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   141
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   142
	$infile = $$cf{'document_dir'}.'/'.$$cf{'mainpage'};
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   143
	$tmpfile = $infile.'.tmp';
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   144
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   145
	open (IN_F, $infile) or die "Cannot open input file $infile : $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   146
	open (TMP_F, "> $tmpfile") or die "Cannot open tmp file $tmpfile : $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   147
	while (<IN_F>) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   148
		unless ((/\s*\<h1\>.*\<ul\>/) ||
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   149
			(/\s*\<li\>/) ||
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   150
			(/\s*\<ul\>/) ||
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   151
			(/\s*\<\/ul\>/) ||
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   152
			(/\s*\*\//))
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   153
		{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   154
			print TMP_F $_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   155
		}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   156
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   157
	print TMP_F @$rlines;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   158
	print TMP_F ' */';
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   159
	close (IN_F);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   160
	close (TMP_F);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   161
	unlink $infile or die "Cannot unlink file : $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   162
	rename $tmpfile, $infile or die "Cannot rename file : $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   163
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   164
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   165
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   166
# Decides from what file class hierarchy should be taken
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   167
# routes hierarchy lines to replace-function
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   168
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   169
sub update_mainpage {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   170
	my ($cf, @lines, $hierarchy, $annotated);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   171
	$cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   172
	@lines = ();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   173
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   174
	$hierarchy = $$cf{'document_dir'}.'/hierarchy.html';
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   175
	$annotated = $$cf{'document_dir'}.'/annotated.html';
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   176
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   177
	if (-s $hierarchy) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   178
		&rip_hierarchy(\@lines, $hierarchy);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   179
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   180
	elsif (-s $annotated) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   181
		&rip_annotated(\@lines, $annotated);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   182
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   183
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   184
	if (-s $$cf{'document_dir'}.'/'.$$cf{'mainpage'}) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   185
		&find_replace(\@lines, $cf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   186
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   187
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   188
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   189
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   190
# runs doxygen in each dir from where Mainpage.dox is found
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   191
# updates class hierarchy in Mainpage.dox
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   192
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   193
sub do_doxy {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   194
	my ($dir, $list, $cf, $doxy_com, $path);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   195
	$list = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   196
	$cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   197
	$path = shift() .'/'."$TOP_GIF";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   198
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   199
	$doxy_com = $$cf{'doxy_command'}.' '.$$cf{'doxyfile'};
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   200
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   201
	foreach $dir (@$list) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   202
		chdir $dir;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   203
		copy($path, $$cf{'document_dir'}.'/');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   204
		system($doxy_com) == 0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   205
			or die "Cannot execute command $doxy_com : $?";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   206
#		&update_mainpage($cf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   207
#		system($doxy_com) == 0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   208
#			or die "Cannot execute command $doxy_com : $?";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   209
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   210
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   211
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   212
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   213
# checks that configuration file item exist and is defined
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   214
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   215
sub check_conf_item {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   216
	my $cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   217
	my $prop = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   218
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   219
	die "$prop not found from configuration file." if !exists $$cf{$prop};
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   220
	die "$prop not defined in configuration file." if !defined $$cf{$prop};
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   221
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   222
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   223
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   224
# checks configuration file items
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   225
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   226
sub check_configuration {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   227
	my $cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   228
	check_conf_item ($cf, 'mainpage');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   229
	check_conf_item ($cf, 'document_dir');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   230
	check_conf_item ($cf, 'doxyfile');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   231
	check_conf_item ($cf, 'doxy_command');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   232
	check_conf_item ($cf, 'root_path');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   233
	check_conf_item ($cf, 'footer');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   234
	check_conf_item ($cf, 'header');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   235
	check_conf_item ($cf, 'stylesheet');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   236
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   237
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   238
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   239
# loads configuration file and validates it
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   240
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   241
sub conf {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   242
	my $cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   243
	my $c_file = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   244
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   245
	open (CONFF, $c_file) or die "Cannot open configuration file : $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   246
	while (<CONFF>) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   247
		chomp;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   248
		s/#.*//;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   249
		s/^\s+//;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   250
		s/\s+$//;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   251
		next unless length;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   252
		my ($var, $value) = split (/\s*=\s*/, $_, 2);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   253
		$$cf{$var} = $value;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   254
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   255
	close(CONFF);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   256
	check_configuration($cf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   257
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   258
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   259
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   260
# GUI : opens file browse window
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   261
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   262
sub gui_browse_file {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   263
	my $mp = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   264
	my $top = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   265
	my $ext = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   266
	my $typelabel = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   267
	my $type = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   268
	my $initialfile = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   269
	my $title = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   270
	my $fi;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   271
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   272
	$fi = $$top->getOpenFile(	-defaultextension => "$ext",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   273
					-filetypes =>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   274
					  [["$typelabel", "$type"],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   275
					   ['All files', '*']
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   276
					  ],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   277
					-initialdir => Cwd::cwd(),
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   278
					-initialfile => "$initialfile",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   279
					-title => "$title"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   280
					);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   281
	$fi=~s/^.*\///;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   282
	$$mp = $fi;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   283
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   284
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   285
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   286
# GUI : opens directory tree browser
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   287
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   288
sub gui_browse_root_path {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   289
	my $mp = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   290
	my $top = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   291
	my $fi = 0;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   292
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   293
	my $dir = Cwd::cwd();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   294
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   295
	my $popup = $$top->Toplevel(-title=>'Browse');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   296
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   297
	$popup->Scrolled('DirTree',
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   298
		  -scrollbars => 'osoe',
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   299
		  -width => 50,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   300
		  -height => 30,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   301
		  -selectmode => 'browse',
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   302
		  -exportselection => 1,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   303
		  -browsecmd => sub{$dir=shift;},
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   304
		  -command   => sub{$fi=1;}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   305
		 )->pack(-fill => "both", -expand => 1);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   306
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   307
	$popup->waitVariable(\$fi);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   308
	if ($fi==1) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   309
		$dir=~s/\//\\/g;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   310
		$$mp = $dir;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   311
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   312
	$popup->destroy();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   313
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   314
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   315
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   316
# GUI : Returns constant text when pressing doxycommand default button
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   317
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   318
sub gui_browse_doxycommand {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   319
	my $mp = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   320
	my $top = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   321
	$$mp = "doxygen";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   322
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   323
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   324
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   325
# GUI : Returns constant text when pressing docdir default button
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   326
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   327
sub gui_browse_docdir {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   328
	my $mp = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   329
	my $top = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   330
	$$mp = "doc";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   331
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   332
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   333
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   334
# GUI : Opens configuration file browse window
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   335
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   336
sub gui_browse_open_conf {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   337
	my $cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   338
	my $top = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   339
	my $bk = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   340
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   341
	my $fi;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   342
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   343
	$fi = $$top->getOpenFile(	-defaultextension => ".conf",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   344
					-filetypes =>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   345
					  [['Doxy configurationfile', '.conf'],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   346
					   ['All files', '*']
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   347
					  ],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   348
					-initialdir => Cwd::cwd(),
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   349
					-initialfile => '',
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   350
					-title => 'Select doxy.pl configuration file'
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   351
					);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   352
	&conf($cf, $fi);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   353
	$fi=~s/^.*\///;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   354
	$$bk->pageconfigure("tab1", -label => $fi);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   355
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   356
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   357
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   358
# GUI : saves configuration file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   359
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   360
sub gui_save_conf {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   361
	my $cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   362
	my $file = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   363
	my $key;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   364
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   365
	open (SAVE_FILE, "> $file")
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   366
		or die "Cannot open file $file to save : $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   367
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   368
	foreach $key (keys %$cf) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   369
		print SAVE_FILE "$key=$$cf{$key}\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   370
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   371
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   372
	close (SAVE_FILE);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   373
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   374
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   375
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   376
# GUI : opens file save dialog for configuration file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   377
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   378
sub gui_browse_save_conf {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   379
	my $cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   380
	my $top = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   381
	my $bk = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   382
	my $fi;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   383
	my $le = $$bk->pagecget("tab1", -label);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   384
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   385
	$fi = $$top->getSaveFile(	-defaultextension => ".conf",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   386
					-filetypes =>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   387
					  [['Doxy configuration', '.conf'],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   388
					   ['All files', '*']
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   389
					  ],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   390
					-initialdir => Cwd::cwd(),
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   391
					-initialfile => $le,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   392
					-title => 'Save doxy configuration file'
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   393
					);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   394
	&gui_save_conf($cf, $fi);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   395
	$fi=~s/^.*\///;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   396
	$$bk->pageconfigure("tab1", -label => $fi);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   397
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   398
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   399
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   400
# GUI : creates menu resource
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   401
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   402
sub gui_create_menu {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   403
	my $top = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   404
	my $cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   405
	my $bk = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   406
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   407
	my $menu =
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   408
    		[
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   409
     		 [Cascade => "~File", -tearoff => 0, -menuitems =>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   410
      		  [
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   411
       		   [Button => "~Open", -command => [\&gui_browse_open_conf, \%$cf, \$$top, \$$bk]],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   412
       		   [Button => "~Save", -command => [\&gui_browse_save_conf, \%$cf, \$$top, \$$bk]],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   413
       		   [Button => "~Quit", -command => sub{exit();}],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   414
      		  ]
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   415
     		 ],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   416
    		];
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   417
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   418
	my $menub = $$top->Menu(-menuitems => $menu);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   419
	$$top->configure(-menu => $menub);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   420
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   421
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   422
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   423
# GUI : handles what happens when pressing run button
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   424
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   425
sub gui_run {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   426
	my $cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   427
	&check_configuration($cf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   428
	&update_doxyfile($cf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   429
	my (@dir_list, $path);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   430
	$path = cwd();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   431
	chdir $$cf{root_path};
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   432
	&find_doc(\@dir_list, $cf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   433
	&do_doxy(\@dir_list, $cf, $path);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   434
	chdir $path;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   435
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   436
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   437
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   438
# GUI : creates dialog inside tab folder
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   439
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   440
sub gui_create_tab {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   441
	my $book = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   442
	my $top = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   443
	my $configuration = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   444
	my $tab = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   445
	my $label = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   446
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   447
	my $conf_tab;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   448
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   449
	$conf_tab = $$book->add( $tab, -label=>$label );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   450
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   451
	my $frame = $conf_tab->Frame()->pack(-anchor=>'n');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   452
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   453
	$frame->Label(-text=>'')->grid(-column=>0,-row=>0,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   454
	$frame->Label(-text=>'')->grid(-column=>1,-row=>0,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   455
	$frame->Label(-text=>'')->grid(-column=>2,-row=>0,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   456
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   457
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   458
	$frame->Label(-text=>'Mainpage:',-anchor=>'w')->grid(-column=>0,-row=>1,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   459
	$frame->Entry(-textvariable=>\$$configuration{mainpage})->grid(-column=>1,-row=>1,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   460
    	$frame->Button(	-text     => "Browse",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   461
			-command  => [\&gui_browse_file, \$$configuration{mainpage}, \$$top, '.dox','Doxygen mainpage', '.dox', 'Mainpage.dox', 'Select mainpage filename'],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   462
			-width    => 5)->
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   463
				grid(-column=>2,-row=>1,-sticky=>'ew', -padx=>5, -pady=>5);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   464
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   465
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   466
	$frame->Label(-text=>'Doxyfile:',-anchor=>'w')->grid(-column=>0,-row=>2,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   467
	$frame->Entry(-textvariable=>\$$configuration{doxyfile})->grid(-column=>1,-row=>2,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   468
    	$frame->Button(	-text     => "Browse",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   469
			-command  => [\&gui_browse_file, \$$configuration{doxyfile}, \$$top,'','Doxygen configurationfile','Doxyfile','Doxyfile', 'Select doxygen configuration filename'],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   470
			-width    => 5)->
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   471
				grid(-column=>2,-row=>2,-sticky=>'ew', -padx=>5, -pady=>5);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   472
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   473
	$frame->Label(-text=>'Doxy command:',-anchor=>'w')->grid(-column=>0,-row=>3,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   474
	$frame->Entry(-textvariable=>\$$configuration{doxy_command})->grid(-column=>1,-row=>3,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   475
    	$frame->Button(	-text     => "Default",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   476
			-command  => [\&gui_browse_doxycommand, \$$configuration{doxy_command}, \$$top],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   477
			-width    => 5)->
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   478
				grid(-column=>2,-row=>3,-sticky=>'ew', -padx=>5, -pady=>5);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   479
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   480
	$frame->Label(-text=>'Document dir:',-anchor=>'w')->grid(-column=>0,-row=>4,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   481
	$frame->Entry(-textvariable=>\$$configuration{document_dir})->grid(-column=>1,-row=>4,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   482
    	$frame->Button(	-text     => "Default",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   483
			-command  => [\&gui_browse_docdir, \$$configuration{document_dir}, \$$top],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   484
			-width    => 5)->
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   485
				grid(-column=>2,-row=>4,-sticky=>'ew', -padx=>5, -pady=>5);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   486
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   487
	$frame->Label(-text=>'Header file:',-anchor=>'w')->grid(-column=>0,-row=>5,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   488
	$frame->Entry(-textvariable=>\$$configuration{header})->grid(-column=>1,-row=>5,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   489
    	$frame->Button(	-text     => "Browse",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   490
			-command  => [\&gui_browse_file, \$$configuration{header}, \$$top, '.html', 'Header file', '.html', 'header.html', 'Select header filename'],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   491
			-width    => 5)->
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   492
				grid(-column=>2,-row=>5,-sticky=>'ew', -padx=>5, -pady=>5);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   493
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   494
	$frame->Label(-text=>'Footer file:',-anchor=>'w')->grid(-column=>0,-row=>6,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   495
	$frame->Entry(-textvariable=>\$$configuration{footer})->grid(-column=>1,-row=>6,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   496
    	$frame->Button(	-text     => "Browse",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   497
			-command  => [\&gui_browse_file, \$$configuration{footer}, \$$top, '.html', 'Footer file', '.html', 'footer.html', 'Select footer filename'],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   498
			-width    => 5)->
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   499
				grid(-column=>2,-row=>6,-sticky=>'ew', -padx=>5, -pady=>5);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   500
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   501
	$frame->Label(-text=>'Stylesheet:',-anchor=>'w')->grid(-column=>0,-row=>7,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   502
	$frame->Entry(-textvariable=>\$$configuration{stylesheet})->grid(-column=>1,-row=>7,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   503
    	$frame->Button(	-text     => "Browse",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   504
			-command  => [\&gui_browse_file, \$$configuration{stylesheet}, \$$top,'.css','Stylesheet', '.css', 'stylesheet.css','Select stylesheet filename'],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   505
			-width    => 5)->
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   506
				grid(-column=>2,-row=>7,-sticky=>'ew', -padx=>5, -pady=>5);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   507
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   508
	$frame->Label(-text=>'Root path:',-anchor=>'w')->grid(-column=>0,-row=>8,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   509
	$frame->Entry(-textvariable=>\$$configuration{root_path})->grid(-column=>1,-row=>8,-sticky=>'ew');
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   510
    	$frame->Button(	-text     => "Browse",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   511
			-command  => [\&gui_browse_root_path, \$$configuration{root_path}, \$$top],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   512
			-width    => 5)->
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   513
				grid(-column=>2,-row=>8,-sticky=>'ew', -padx=>5, -pady=>5);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   514
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   515
    	$frame->Button(	-text     => "Run",
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   516
			-command  => [\&gui_run, \%$configuration],
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   517
			-width    => 5)->
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   518
				grid(-column=>1,-row=>9,-sticky=>'ew', -padx=>5, -pady=>5);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   519
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   520
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   521
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   522
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   523
# GUI : Creates GUI
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   524
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   525
sub gui {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   526
	my ($mw, @dir_list, $book, $tab);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   527
	my (%configuration);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   528
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   529
	$mw = new MainWindow;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   530
	$mw->geometry( "450x400" );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   531
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   532
	&gui_create_menu(\$mw, \%configuration, \$book);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   533
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   534
	$book = $mw->NoteBook()->pack( -fill=>'both', -expand=>1 );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   535
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   536
	&gui_create_tab(\$book, \$mw, \%configuration, "tab1", "Configuration");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   537
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   538
	MainLoop;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   539
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   540
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   541
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   542
# Updates property in doxygen configuration file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   543
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   544
sub update_doxyfile_item {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   545
	my $fi = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   546
	my $file = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   547
	my $doxfile = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   548
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   549
	my $find = "($fi)(\\s*)(=)(\\s*)(.*)";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   550
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   551
	$file=~s/\\/\\\\/g;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   552
	my $replace = "\\1\\2\\3\\4$file";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   553
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   554
	system ("perl -p -i.ftr -e \"s/$find/$replace/\" $doxfile") == 0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   555
		or die "Cannot update $fi to $doxfile : $?";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   556
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   557
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   558
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   559
# List of properties to update in doxygen configuration
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   560
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   561
sub update_doxyfile {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   562
	my $cf = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   563
	update_doxyfile_item("HTML_HEADER", $$cf{header}, $$cf{doxyfile});
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   564
	update_doxyfile_item("HTML_FOOTER", $$cf{footer}, $$cf{doxyfile});
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   565
	update_doxyfile_item("HTML_STYLESHEET", $$cf{stylesheet}, $$cf{doxyfile});
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   566
	update_doxyfile_item("HTML_OUTPUT", $$cf{document_dir}, $$cf{doxyfile});
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   567
	#update_doxyfile_item("INCLUDE_PATH", $$cf{include_path}, $$cf{doxyfile});
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   568
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   569
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   570
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   571
# commandline mode
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   572
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   573
sub batch {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   574
	my ($c_file) = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   575
	if (-s $c_file) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   576
		my (%conf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   577
		&conf(\%conf, $c_file);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   578
		&update_doxyfile(\%conf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   579
		my (@dir_list, $path);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   580
		$path = cwd();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   581
		chdir $conf{root_path};
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   582
		&find_doc(\@dir_list, \%conf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   583
		&do_doxy(\@dir_list, \%conf, $path);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   584
		chdir $path;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   585
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   586
	else {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   587
		die "Configuration file \"$c_file\" not found : $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   588
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   589
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   590
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   591
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   592
# Main program :
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   593
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   594
# if no arguments -> run gui
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   595
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   596
if (0 == scalar(@ARGV)) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   597
	gui();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   598
	exit();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   599
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   600
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   601
# with arguments -> run cmdline version
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   602
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   603
batch(@ARGV[0]);