summaryrefslogtreecommitdiff
path: root/font-conf.in
blob: c3fbb361c2006f454a25ef44caaa4cced1be23b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/env perl
#-*- Mode: perl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-

# Display configurator. Designed to be architecture and distribution independent.
#
# Copyright (C) 2000-2001 Ximian, Inc.
#
# Authors: Tambet Ingo <tambet@ximian.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

# Best viewed with 100 columns of width.

# Configuration files affected:
#
# /etc/X11/XF86Config

# Running programs affected:
#

BEGIN {
  $SCRIPTSDIR = "@scriptsdir@";
  if ($SCRIPTSDIR =~ /^@scriptsdir[@]/)
  {
      $SCRIPTSDIR = ".";
      $DOTIN = ".in";
  }
  
  require "$SCRIPTSDIR/general.pl$DOTIN";
  require "$SCRIPTSDIR/platform.pl$DOTIN";
  require "$SCRIPTSDIR/file.pl$DOTIN";
  require "$SCRIPTSDIR/font.pl$DOTIN";
}

use Benchmark;

# --- Tool information --- #

$name = 'font';
$version = "@VERSION@";
@platforms = qw(redhat-6.2 redhat-7.0 redhat-7.1 redhat-7.2 turbolinux-7.0
                mandrake-7.2 mandrake-8.0);

$description =<<"end_of_description;";
       Configures fonts.
end_of_description;


sub xml_print
{
  my $font_list = shift;

  &gst_xml_print_begin ();
  &gst_xml_print_vspace ();

  &font_xml_print ($font_list);

  &gst_xml_print_end ();
}

# Top-level actions.

sub get
{
  my $font_list = &font_get_all ();

  &gst_report_end ();
  &xml_print ($font_list);
}

sub set
{
  my $font_list = &font_xml_parse ();

  &font_set ($font_list);
  &gst_report_end ();
}

sub filter
{
  my $font_list = &font_xml_parse ();

  &gst_report_end ();
  &xml_print ($font_list);
}

sub test
{
  my ($tool, @dir) = @_;
  my $font_list = &font_test (\@dir);

  &gst_report_end ();
  &xml_print ($font_list);
}


# --- Main --- #

# get, set and filter are special cases that don't need more parameters than a ref to their function.
# Read general.pl.in:gst_run_directive to know about the format of this hash.

$directives = {
  "get"    => [ \&get,    [], "" ],
  "set"    => [ \&set,    [], "" ],
  "filter" => [ \&filter, [], "" ],
  "test"   => [ \&test,   [ "dir*" ], "Get font information on specified file or directory." ],
};


$tool = &gst_init ($name, $version, $description, $directives, @ARGV);
&gst_platform_ensure_supported ($tool, @platforms);
&gst_run ($tool);