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);
}
Exemplo n.º 2
0
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);
}