diff options
author | Mike Fulbright <msf@redhat.com> | 2002-11-12 16:41:02 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2002-11-12 16:41:02 +0000 |
commit | 82993d94b17f06f8d1513a4f51acaf0479c28c3a (patch) | |
tree | 62ab961301bfc9f014dc2e5f8945dfe32e6e70b1 /xsetup.py | |
parent | 0dec0a8eec3d0b363854524e66c082f9bf847179 (diff) | |
download | anaconda-82993d94b17f06f8d1513a4f51acaf0479c28c3a.tar.gz anaconda-82993d94b17f06f8d1513a4f51acaf0479c28c3a.tar.xz anaconda-82993d94b17f06f8d1513a4f51acaf0479c28c3a.zip |
new files needed for misc X11 related functionsBefore.rhpl.X.backend.port
Diffstat (limited to 'xsetup.py')
-rw-r--r-- | xsetup.py | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/xsetup.py b/xsetup.py new file mode 100644 index 000000000..66901cd7d --- /dev/null +++ b/xsetup.py @@ -0,0 +1,90 @@ +# +# xsetup.py - handles anaconda specific XFree86 needs +# +# Michael Fulbright <msf@redhat.com> +# +# Copyright 2002 Red Hat, Inc. +# +# This software may be freely redistributed under the terms of the GNU +# library public license. +# +# You should have received a copy of the GNU Library Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# + +# +# should probably go in rhpl +# +import xserver + +class XSetup: + + def __init__(self, hwstate): + self.skipx = 0 + self.xhwstate = hwstate + + # + # mouse and keyboard maybe should be part of this object + # + # really all of this should be in rhpl probably + # + def write(self, fn, mouse, keyboard): + outfile = fn + "/XF86Config" + xserver.writeXConfig(outfile, self.xhwstate, mouse, keyboard, + standalone = 0) + + def writeKS(self, f, desktop=None): + return + + # + # this needs lots of work + # + if self.skipx: + f.write("skipx\n") + return + +# +# old pre-rhpl backend code +# +# xmodes = self.getManualModes() +# +# if len(xmodes) == 0: +# f.write("skipx\n") +# return +# +# args = self.getArgList(xmodes) + + args = self.getArgList(self.xhwstate.get_resolution(), + self.xhwstate.get_colordepth()) + if desktop: + rl = desktop.getDefaultRunLevel() + if rl and str(rl) == '5': + args = args + ['--startxonboot', ''] + gui = desktop.getDefaultDesktop() + if gui: + args = args + ['--defaultdesktop', string.lower(gui)] + + f.write("xconfig") + for arg in args: + f.write(" " + arg) + f.write("\n") + + def getArgList(self, res, depth): + args = [] + vc = self.videocard + + args = args + [ "--card", '"' + vc.shortDescription() + '"' ] + args = args + [ "--videoram", vc.getVideoRam() ] + args = args + [ "--hsync", self.monitor.getMonitorHorizSync() ] + args = args + [ "--vsync", self.monitor.getMonitorVertSync() ] + + # XXX this isn't really quite right, but it works for the way + # things are now + args = args + [ "--resolution", res ] + args = args + [ "--depth", depth ] + + return args + + + |