コード例 #1
0
ファイル: Screen.c プロジェクト: balagopalraj/clearlinux
int
xf86validateScreen(XF86ConfigPtr p)
{
    XF86ConfScreenPtr screen = p->conf_screen_lst;
    XF86ConfMonitorPtr monitor;
    XF86ConfAdaptorLinkPtr adaptor;

    while (screen) {
        if (screen->scrn_obso_driver && !screen->scrn_identifier)
            screen->scrn_identifier = screen->scrn_obso_driver;

        monitor =
            xf86findMonitor(screen->scrn_monitor_str, p->conf_monitor_lst);
        if (screen->scrn_monitor_str) {
            if (monitor) {
                screen->scrn_monitor = monitor;
                if (!xf86validateMonitor(p, screen))
                    return FALSE;
            }
        }

        screen->scrn_device =
            xf86findDevice(screen->scrn_device_str, p->conf_device_lst);

        adaptor = screen->scrn_adaptor_lst;
        while (adaptor) {
            adaptor->al_adaptor =
                xf86findVideoAdaptor(adaptor->al_adaptor_str,
                                     p->conf_videoadaptor_lst);
            if (!adaptor->al_adaptor) {
                xf86validationError(UNDEFINED_ADAPTOR_MSG,
                                    adaptor->al_adaptor_str,
                                    screen->scrn_identifier);
                return FALSE;
            }
            else if (adaptor->al_adaptor->va_fwdref) {
                xf86validationError(ADAPTOR_REF_TWICE_MSG,
                                    adaptor->al_adaptor_str,
                                    adaptor->al_adaptor->va_fwdref);
                return FALSE;
            }

            adaptor->al_adaptor->va_fwdref = strdup(screen->scrn_identifier);
            adaptor = adaptor->list.next;
        }

        screen = screen->list.next;
    }

    return TRUE;
}
コード例 #2
0
int
xf86validateLayout (XF86ConfigPtr p)
{
	XF86ConfLayoutPtr layout = p->conf_layout_lst;
	XF86ConfAdjacencyPtr adj;
	XF86ConfInactivePtr iptr;
	XF86ConfScreenPtr screen;
	XF86ConfDevicePtr device;

	while (layout)
	{
		adj = layout->lay_adjacency_lst;
		while (adj)
		{
			/* the first one can't be "" but all others can */
			screen = xf86findScreen (adj->adj_screen_str, p->conf_screen_lst);
			if (!screen)
			{
				xf86validationError (UNDEFINED_SCREEN_MSG,
							   adj->adj_screen_str, layout->lay_identifier);
				return (FALSE);
			}
			else
				adj->adj_screen = screen;

			adj = adj->list.next;
		}
		iptr = layout->lay_inactive_lst;
		while (iptr)
		{
			device = xf86findDevice (iptr->inactive_device_str,
									p->conf_device_lst);
			if (!device)
			{
				xf86validationError (UNDEFINED_DEVICE_LAY_MSG,
						iptr->inactive_device_str, layout->lay_identifier);
				return (FALSE);
			}
			else
				iptr->inactive_device = device;
			iptr = iptr->list.next;
		}

		if (xf86layoutAddInputDevices(p, layout) == -1)
		    return FALSE;

		layout = layout->list.next;
	}
	return (TRUE);
}
コード例 #3
0
int
xf86validateMonitor (XF86ConfigPtr p, XF86ConfScreenPtr screen)
{
	XF86ConfMonitorListPtr monitorlist;
	XF86ConfModesLinkPtr modeslnk;
	XF86ConfModesPtr modes;

	monitorlist = screen->scrn_monitor_lst;
	while (monitorlist)
	{
	    if (monitorlist->monitor) {
			modeslnk = monitorlist->monitor->mon_modes_sect_lst;
			while(modeslnk)
			{
				modes = xf86findModes (modeslnk->ml_modes_str, p->conf_modes_lst);
				if (!modes)
				{
					xf86validationError (UNDEFINED_MODES_MSG, 
					     		modeslnk->ml_modes_str, 
					     		screen->scrn_identifier);
					return (FALSE);
				}
				modeslnk->ml_modes = modes;
				modeslnk = modeslnk->list.next;
			}
		}
		monitorlist = monitorlist->list.next;
	}
	return (TRUE);
}
コード例 #4
0
ファイル: Device.c プロジェクト: aosm/X11
int
xf86validateDevice (XF86ConfigPtr p)
{
	XF86ConfDevicePtr device = p->conf_device_lst;

	if (!device) {
		xf86validationError ("At least one Device section is required.");
		return (FALSE);
	}

	while (device) {
		if (!device->dev_driver) {
			xf86validationError (UNDEFINED_DRIVER_MSG, device->dev_identifier);
			return (FALSE);
		}
	device = device->list.next;
	}
	return (TRUE);
}
コード例 #5
0
ファイル: Input.c プロジェクト: Magister/x11rdp_xorg71
int
xf86validateInput (XF86ConfigPtr p)
{
	XF86ConfInputPtr input = p->conf_input_lst;

#if 0 /* Enable this later */
	if (!input) {
		xf86validationError ("At least one InputDevice section is required.");
		return (FALSE);
	}
#endif

	while (input) {
		if (!input->inp_driver) {
			xf86validationError (UNDEFINED_INPUTDRIVER_MSG, input->inp_identifier);
			return (FALSE);
		}
		input = input->list.next;
	}
	return (TRUE);
}
コード例 #6
0
int
xf86layoutAddInputDevices(XF86ConfigPtr config, XF86ConfLayoutPtr layout)
{
    int count = 0;
    XF86ConfInputPtr input = config->conf_input_lst;
    XF86ConfInputrefPtr inptr;

    /* add all AutoServerLayout devices to the server layout */
    while (input)
    {
	if (xf86CheckBoolOption(input->inp_option_lst, "AutoServerLayout", FALSE))
	{
	    XF86ConfInputrefPtr iref = layout->lay_input_lst;

	    /* avoid duplicates if referenced but lists AutoServerLayout too */
	    while (iref)
	    {
		if (strcmp(iref->iref_inputdev_str, input->inp_identifier) == 0)
		    break;
		iref = iref->list.next;
	    }

	    if (!iref)
	    {
		XF86ConfInputrefPtr iptr;
		iptr = calloc(1, sizeof(XF86ConfInputrefRec));
		iptr->iref_inputdev_str = input->inp_identifier;
		layout->lay_input_lst = (XF86ConfInputrefPtr)
		    xf86addListItem((glp)layout->lay_input_lst, (glp)iptr);
		count++;
	    }
	}
	input = input->list.next;
    }

    inptr = layout->lay_input_lst;
    while (inptr)
    {
	input = xf86findInput (inptr->iref_inputdev_str,
		config->conf_input_lst);
	if (!input)
	{
	    xf86validationError (UNDEFINED_INPUT_MSG,
		    inptr->iref_inputdev_str, layout->lay_identifier);
	    return -1;
	}
	else
	    inptr->iref_inputdev = input;
	inptr = inptr->list.next;
    }

    return count;
}
コード例 #7
0
ファイル: Input.c プロジェクト: timon37/xwayland
int
xf86validateInput (XF86ConfigPtr p)
{
	XF86ConfInputPtr input = p->conf_input_lst;

	while (input) {
		if (!input->inp_driver) {
			xf86validationError (UNDEFINED_INPUTDRIVER_MSG, input->inp_identifier);
			return FALSE;
		}
		input = input->list.next;
	}
	return TRUE;
}
コード例 #8
0
ファイル: Layout.c プロジェクト: L3oV1nc3/VMGL
int
xf86validateLayout (XF86ConfigPtr p)
{
	XF86ConfLayoutPtr layout = p->conf_layout_lst;
	XF86ConfAdjacencyPtr adj;
	XF86ConfInactivePtr iptr;
	XF86ConfInputrefPtr inptr;
	XF86ConfScreenPtr screen;
	XF86ConfDevicePtr device;
	XF86ConfInputPtr input;

	while (layout)
	{
		adj = layout->lay_adjacency_lst;
		while (adj)
		{
			/* the first one can't be "" but all others can */
			screen = xf86findScreen (adj->adj_screen_str, p->conf_screen_lst);
			if (!screen)
			{
				xf86validationError (UNDEFINED_SCREEN_MSG,
							   adj->adj_screen_str, layout->lay_identifier);
				return (FALSE);
			}
			else
				adj->adj_screen = screen;

#if 0
			CheckScreen (adj->adj_top_str, adj->adj_top);
			CheckScreen (adj->adj_bottom_str, adj->adj_bottom);
			CheckScreen (adj->adj_left_str, adj->adj_left);
			CheckScreen (adj->adj_right_str, adj->adj_right);
#endif

			adj = adj->list.next;
		}
		iptr = layout->lay_inactive_lst;
		while (iptr)
		{
			device = xf86findDevice (iptr->inactive_device_str,
									p->conf_device_lst);
			if (!device)
			{
				xf86validationError (UNDEFINED_DEVICE_LAY_MSG,
						iptr->inactive_device_str, layout->lay_identifier);
				return (FALSE);
			}
			else
				iptr->inactive_device = device;
			iptr = iptr->list.next;
		}
		inptr = layout->lay_input_lst;
		while (inptr)
		{
			input = xf86findInput (inptr->iref_inputdev_str,
									p->conf_input_lst);
			if (!input)
			{
				xf86validationError (UNDEFINED_INPUT_MSG,
						inptr->iref_inputdev_str, layout->lay_identifier);
				return (FALSE);
			}
			else
				inptr->iref_inputdev = input;
			inptr = inptr->list.next;
		}
		layout = layout->list.next;
	}
	return (TRUE);
}