2
#-*- Mode: perl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4
# Pointing Device configurator : Manage your mouse etc
6
# Copyright (C) 2000-2001 Ximian, Inc.
8
# Authors: Ravi Pratap <ravi@che.iitm.ac.in>
10
# This program is free software; you can redistribute it and/or modify
11
# it under the terms of the GNU Library General Public License as published
12
# by the Free Software Foundation; either version 2 of the License, or
13
# (at your option) any later version.
15
# This program is distributed in the hope that it will be useful,
16
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
# GNU Library General Public License for more details.
20
# You should have received a copy of the GNU Library General Public License
21
# along with this program; if not, write to the Free Software
22
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
24
# Best viewed with 100 columns of width.
26
# Configuration files affected:
30
# Running programs affected:
36
$SCRIPTSDIR = "@scriptsdir@";
37
if ($SCRIPTSDIR =~ /^@scriptsdir[@]/)
43
require "$SCRIPTSDIR/general.pl$DOTIN";
44
require "$SCRIPTSDIR/platform.pl$DOTIN";
45
require "$SCRIPTSDIR/util.pl$DOTIN";
46
require "$SCRIPTSDIR/file.pl$DOTIN";
47
require "$SCRIPTSDIR/xml.pl$DOTIN";
48
require "$SCRIPTSDIR/parse.pl$DOTIN";
49
#require "$SCRIPTSDIR/mouse.pl$DOTIN";
53
# -- Tool information --- #
56
$version = "@VERSION@";
57
@platforms = ("redhat-5.2", "redhat-6.0", "redhat-6.1", "redhat-6.2",
58
"redhat-7.0", "redhat-7.1", "redhat-7.2", "turbolinux-7.0");
60
$description =<<"end_of_desc;";
61
Configures Pointing Tool Device
64
@conf_files = ("/etc/X11/XF86Config");
68
sub gst_mouse_conf_get
74
$config_file = &gst_file_open_read_from_names (@conf_files);
75
if (not $config_file) { return; }
76
*CONFIG_FILE = $config_file;
78
while (<CONFIG_FILE>) {
81
# We're only interested in the pointer section
83
next if (/^\#/ || /^$/);
87
while (<CONFIG_FILE>) {
91
next if (/^\#/ || /^$/);
92
last if (/EndSection/);
94
($a, $b) = split (" ", $_, 2);
96
if ($b) { $hash{"$a"} = $b; }
97
else { $hash{"$a"} = "on"; }
108
my @tags = ('Protocol', 'Device', 'BaudRate', 'SampleRate', 'Emulate3Buttons', 'Emulate3Timeout', 'ChordMiddle');
111
&gst_xml_print_begin ();
113
while ($i = shift @tags) {
114
if (exists $$h{$i} && $$h{$i} eq "on") { gst_xml_print_line ("<$i/>\n"); }
115
elsif (exists $$h{$i}) { gst_xml_print_line ("<$i>$$h{$i}</$i>\n"); }
118
&gst_xml_print_end ();
126
# --- Write new configuration to file --- #
130
print "Not implemented yet! \n";
137
# --- Get configuration from file --- #
143
$hash = &gst_mouse_conf_get ();
151
# --- Filter config: XML in, XML out --- #
155
print "Not implemented yet! \n";
162
# get, set and filter are special cases that don't need more parameters than a ref to their function.
163
# Read general.pl.in:gst_run_directive to know about the format of this hash.
166
"get" => [ \&get, [], "" ],
167
"set" => [ \&set, [], "" ],
168
"filter" => [ \&filter, [], "" ]
171
$tool = &gst_init ($name, $version, $description, $directives, @ARGV);
172
&gst_platform_ensure_supported ($tool, @platforms);