2N/A/*
2N/A * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
2N/A *
2N/A * Permission is hereby granted, free of charge, to any person obtaining a
2N/A * copy of this software and associated documentation files (the "Software"),
2N/A * to deal in the Software without restriction, including without limitation
2N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
2N/A * and/or sell copies of the Software, and to permit persons to whom the
2N/A * Software is furnished to do so, subject to the following conditions:
2N/A *
2N/A * The above copyright notice and this permission notice shall be included in
2N/A * all copies or substantial portions of the Software.
2N/A *
2N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
2N/A * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2N/A * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
2N/A * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2N/A * SOFTWARE.
2N/A *
2N/A * Except as contained in this notice, the name of Conectiva Linux shall
2N/A * not be used in advertising or otherwise to promote the sale, use or other
2N/A * dealings in this Software without prior written authorization from
2N/A * Conectiva Linux.
2N/A *
2N/A * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
2N/A *
2N/A */
2N/A
2N/A#ifdef HAVE_CONFIG_H
2N/A# include "xorg-config.h"
2N/A#endif
2N/A
2N/A#include <X11/IntrinsicP.h>
2N/A#include <X11/StringDefs.h>
2N/A#include <X11/Xmu/SysUtil.h>
2N/A#include <X11/Xos.h>
2N/A#include <stdio.h>
2N/A#include <stdlib.h>
2N/A#include <dirent.h>
2N/A#include <string.h>
2N/A#ifdef sun
2N/A#undef index
2N/A#undef rindex
2N/A#include <strings.h>
2N/A#endif
2N/A#include <unistd.h>
2N/A
2N/A#include <stdarg.h>
2N/A
2N/A/* Get PATH_MAX */
2N/A#ifndef PATH_MAX
2N/A# if defined(_POSIX_SOURCE)
2N/A# include <limits.h>
2N/A# else
2N/A# define _POSIX_SOURCE
2N/A# include <limits.h>
2N/A# undef _POSIX_SOURCE
2N/A# endif
2N/A# ifndef PATH_MAX
2N/A# ifdef MAXPATHLEN
2N/A# define PATH_MAX MAXPATHLEN
2N/A# else
2N/A# define PATH_MAX 1024
2N/A# endif
2N/A# endif
2N/A#endif
2N/A
2N/A#include <xf86Parser.h>
2N/A#include <X11/XKBlib.h>
2N/A#include <X11/extensions/XKBgeom.h>
2N/A#include <X11/extensions/XKM.h>
2N/A#include <X11/extensions/XKBfile.h>
2N/A#include <X11/extensions/XKBui.h>
2N/A#include <X11/extensions/XKBrules.h>
2N/A
2N/A#ifndef _xf86cfg_config_h
2N/A#define _xf86cfg_config_h
2N/A
2N/A/* Must match the offset in the xf86info structure at config.c,
2N/A * and is used also by interface.c
2N/A */
2N/A#define MOUSE 0
2N/A#define KEYBOARD 1
2N/A#define CARD 2
2N/A#define MONITOR 3
2N/A#define SCREEN 4
2N/A#define SERVER 5
2N/A
2N/A#define UNUSED 0
2N/A#define USED 1
2N/A
2N/A#define CONFIG_LAYOUT 0
2N/A#define CONFIG_SCREEN 1
2N/A#define CONFIG_MODELINE 2
2N/A#define CONFIG_ACCESSX 3
2N/Aextern int config_mode;
2N/A
2N/A#define CONFPATH "%A," "%R," \
2N/A "/etc/X11/%R," "%P/etc/X11/%R," \
2N/A "%E," "%F," \
2N/A "/etc/X11/%F," "%P/etc/X11/%F," \
2N/A "%D/%X," \
2N/A "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
2N/A "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
2N/A "%P/etc/X11/%X," \
2N/A "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
2N/A "%P/lib/X11/%X"
2N/A#define USER_CONFPATH "/etc/X11/%S," "%P/etc/X11/%S," \
2N/A "/etc/X11/%G," "%P/etc/X11/%G," \
2N/A "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
2N/A "%P/etc/X11/%X," \
2N/A "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
2N/A "%P/lib/X11/%X"
2N/A
2N/A/*
2N/A * Types
2N/A */
2N/Atypedef struct _XF86SetupInfo XF86SetupInfo;
2N/Atypedef void (*XF86SetupFunction)(XF86SetupInfo*);
2N/A
2N/Atypedef struct _XF86SetupFunctionList {
2N/A XF86SetupFunction *functions;
2N/A int num_functions;
2N/A int cur_function;
2N/A} XF86SetupFunctionList;
2N/A
2N/Astruct _XF86SetupInfo {
2N/A int num_lists;
2N/A int cur_list;
2N/A XF86SetupFunctionList *lists;
2N/A};
2N/A
2N/Atypedef Bool (*ConfigCheckFunction)(void);
2N/A
2N/Atypedef struct _xf86cfgDevice xf86cfgDevice;
2N/A
2N/Astruct _xf86cfgDevice {
2N/A XtPointer config;
2N/A Widget widget;
2N/A int type, state, refcount;
2N/A};
2N/A
2N/Atypedef struct {
2N/A XF86ConfScreenPtr screen;
2N/A Widget widget;
2N/A int type, state, refcount;
2N/A xf86cfgDevice *card;
2N/A xf86cfgDevice *monitor;
2N/A short row, column;
2N/A XRectangle rect;
2N/A short rotate;
2N/A} xf86cfgScreen;
2N/A
2N/A/* this structure is used just to restore
2N/A properly the monitors layout in the
2N/A screen window configuration.
2N/A */
2N/Atypedef struct {
2N/A XF86ConfLayoutPtr layout;
2N/A xf86cfgScreen **screen;
2N/A XPoint *position;
2N/A int num_layouts;
2N/A} xf86cfgLayout;
2N/A
2N/A/* The vidmode extension usage is controlled by this structure.
2N/A * The information is read at startup, and added monitors cannot
2N/A * be configured, since they are not attached to a particular screen.
2N/A */
2N/Atypedef struct _xf86cfgVidMode xf86cfgVidmode;
2N/A
2N/Atypedef struct {
2N/A XF86ConfLayoutPtr layout; /* current layout */
2N/A Widget cpu;
2N/A xf86cfgLayout **layouts;
2N/A Cardinal num_layouts;
2N/A xf86cfgScreen **screens;
2N/A Cardinal num_screens;
2N/A xf86cfgDevice **devices;
2N/A Cardinal num_devices;
2N/A xf86cfgVidmode **vidmodes;
2N/A Cardinal num_vidmodes;
2N/A} xf86cfgComputer;
2N/A
2N/A/*
2N/A * Prototypes
2N/A */
2N/Avoid StartConfig(void);
2N/ABool ConfigLoop(ConfigCheckFunction);
2N/Avoid ConfigError(void);
2N/Avoid ChangeScreen(XF86ConfMonitorPtr, XF86ConfMonitorPtr,
2N/A XF86ConfDevicePtr, XF86ConfDevicePtr);
2N/Avoid SetTip(xf86cfgDevice*);
2N/ABool startx(void);
2N/Avoid endx(void);
2N/Avoid startaccessx(void);
2N/Avoid ConfigCancelAction(Widget, XEvent*, String*, Cardinal*);
2N/Avoid ExpertConfigureStart(void);
2N/Avoid ExpertConfigureEnd(void);
2N/Avoid ExpertCloseAction(Widget, XEvent*, String*, Cardinal*);
2N/Avoid ExpertCallback(Widget, XtPointer, XtPointer);
2N/A
2N/A/*
2N/A * Initialization
2N/A */
2N/Aextern Widget toplevel, configp, current, back, next;
2N/Aextern XtAppContext appcon;
2N/Aextern XF86SetupInfo xf86info;
2N/Aextern Widget ident_widget;
2N/Aextern char *ident_string;
2N/Aextern XF86ConfigPtr XF86Config;
2N/Aextern char *XF86Config_path;
2N/Aextern char *XF86Module_path;
2N/Aextern char *XFree86_path;
2N/Aextern char *XF86Font_path;
2N/Aextern char *XF86RGB_path;
2N/Aextern char *XFree86Dir;
2N/Aextern xf86cfgComputer computer;
2N/Aextern Atom wm_delete_window;
2N/Aextern Display *DPY;
2N/Aextern Pixmap menuPixmap;
2N/A#ifdef USE_MODULES
2N/Aextern int nomodules;
2N/A#endif
2N/A
2N/A#endif /* _xf86cfg_config_h */
2N/A