classify more files in wesnoth
[deps.git] / examples / graphincludes / project / wesnoth.pm
blob5782e3b999e0dfd409d261072090ec7335e0a826
1 # This file is part of the graph-includes package
3 # (c) 2005 Yann Dirson <ydirson@altern.org>
4 # Distributed under version 2 of the GNU GPL.
6 package graphincludes::project::wesnoth;
7 use graphincludes::project::default;
8 our @ISA = qw(graphincludes::project::default);
10 sub filelabel {
11 my $self = shift;
12 my ($file,$level) = @_;
13 $level = $main::minshow unless defined $level;
15 $file =~ s/^$self->{PFXSTRIP}// if defined $self->{PFXSTRIP};
17 if ($level == 0) {
18 return $file;
19 } elsif ($level == 1) {
20 $file =~ s/\.[^.]*$//;
21 return 'ai' if $file =~ m/^ai_(move|attack)$/;
22 return $file;
23 } elsif ($level == 2) {
24 if ($file =~ m!^(variable|server/variable|game_events)\.! ) {
25 return 'variable';
26 } elsif ($file =~ m!^(multiplayer|ai).*!) {
27 return $1;
28 } elsif ($file =~ m!^(mapgen|mapgen_dialog|cavegen|map_create)\..*!) {
29 return 'mapcreator';
30 } elsif ($file =~ m!^(array|astarnode|config|filesystem|game_config|gettext|global|language|log|map|pathfind|pathutils|race|random|scoped_resource|terrain|thread|tstring|unit|unit_types|util|variable|wassert|(.*/xcoll))\..*!) {
31 return 'core';
32 } elsif ($file =~ m!^(clipboard|cursor|font|image|sdl_utils|tooltips|video)\..*!) {
33 return 'graphics';
34 } elsif ($file =~ m!^(about|builder|display|events|preferences|show_dialog|sound|theme)\..*!) {
35 return 'uicore';
36 } elsif ($file =~ m!^(game|help|titlescreen)\..*!) {
37 return 'gameclient';
38 } elsif ($file =~ m!^(editor|server|serialization|widgets)/.*!) {
39 return $1;
40 } else {
41 return '<' . $self->filelabel($file, $level - 1) . '>';
44 return undef;
47 sub defaultcolors {
48 my @colors;
49 $colors[2] = {
50 core => 'steelblue3',
51 serialization => 'steelblue1',
52 variable => 'slateblue1',
54 mapcreator => 'gold',
56 graphics => 'peachpuff',
57 widgets => 'linen',
58 uicore => 'lavenderblush',
60 multiplayer => 'palegreen',
62 editor => 'cyan',
63 server => 'pink',
65 return @colors;
68 sub ignored_deps {
69 return {'src/font.cpp' => {'src/team.hpp' => 'team colors' },
70 'src/language.cpp' => {'src/preferences.hpp' => 'split out graph. stuff from preferences'},