Esempio n. 1
0
int test_mouse_key()
{
	unsigned long mask=0;
	int count=0;

display_puts("key open\n");
	if ((keyb_fd = GdOpenKeyboard()) < 0) {
		PRINT_ERROR("Cannot initialise keyboard");
		return -1;
	}

	psd = GdOpenScreen();
	if(psd==NULL) {
		syscall_puts("GdOpenScreen error\n");
		GdCloseKeyboard();
		return -1;
	}

display_puts("mouse open\n");
	if ((mouse_fd = GdOpenMouse()) < 0) {
		PRINT_ERROR("Cannot initialise mouse");
		GdCloseScreen(psd);
		GdCloseKeyboard();
		return -1;
	}

	GdSetForegroundPixelVal(psd, 7);
	GdSetBackgroundPixelVal(psd, 0);
	GdSetDash(&mask, &count);

	for(;;) {
		GsSelect();
	}
	return 0;
}
Esempio n. 2
0
/*
 * This is the main server loop which initialises the server, services
 * the clients, and shuts the server down when there are no more clients.
 */
int
main(int argc, char *argv[])
{
	/* Attempt to initialise the server*/
	if(GsInitialize())
		exit(1);

	while(1)
		GsSelect();
	return 0;
}
Esempio n. 3
0
int
main(int ac,char **av)
{
	if ((keyb_fd = GdOpenKeyboard()) < 0) {
		PRINT_ERROR("Cannot initialise keyboard");
		return -1;
	}

	if ((mouse_fd = GdOpenMouse()) < 0) {
		PRINT_ERROR("Cannot initialise mouse");
		GdCloseKeyboard();
		return -1;
	}

	for(;;)
		GsSelect();

	return 0;
}
Esempio n. 4
0
/*
 * This is the main server loop which initialises the server, services
 * the clients, and shuts the server down when there are no more clients.
 */
int
main(int argc, char *argv[])
{
	int t;

	progname = argv[0];

	t = 1;
	while ( t < argc ) {
		if ( !strcmp("-e",argv[t])) {
			escape_quits = FALSE;
			++t;
			continue;
		}
		if ( !strcmp("-p",argv[t]) ) {
			persistent_mode = TRUE;
			++t;
			continue;
		}
		if ( !strcmp("-A",argv[t]) ) {
			autoportrait = TRUE;
			++t;
			continue;
		}
		if ( !strcmp("-N",argv[t]) ) {
			portraitmode = MWPORTRAIT_NONE;
			++t;
			continue;
		}
		if ( !strcmp("-L",argv[t]) ) {
			portraitmode = MWPORTRAIT_LEFT;
			++t;
			continue;
		}
		if ( !strcmp("-R",argv[t]) ) {
			portraitmode = MWPORTRAIT_RIGHT;
			++t;
			continue;
		}
		if ( !strcmp("-D",argv[t]) ) {
			portraitmode = MWPORTRAIT_DOWN;
			++t;
			continue;
		}
		if ( !strcmp("-x",argv[t]) ) {
			if (++t >= argc)
				usage();
			nxres = atoi(argv[t]);
			++t;
			continue;
		}
		if ( !strcmp("-y",argv[t]) ) {
			if (++t >= argc)
				usage();
			nyres = atoi(argv[t]);
			++t;
			continue;
		}
#if FONTMAPPER
		if ( !strcmp("-c",argv[t]) ) {
			int read_configfile(char *file);

			if (++t >= argc)
				usage();
			read_configfile(argv[t]);
			++t;
			continue;
		}
#endif
		usage();
	}

	/* Attempt to initialise the server*/
	if(GsInitialize() < 0)
		exit(1);

	while(1)
		GsSelect(0L);
	return 0;
}
Esempio n. 5
0
int
MAIN(int argc, char **argv)			/* ALLEGRO=real_main(), main() otherwise*/
{
	int t;

	progname = argv[0];

	t = 1;
	while ( t < argc ) {
		if ( !strcmp("-p",argv[t]) ) {
			persistent_mode = TRUE;
			++t;
			continue;
		}
		if ( !strcmp("-A",argv[t]) ) {
			autoportrait = TRUE;
			++t;
			continue;
		}
		if ( !strcmp("-N",argv[t]) ) {
			portraitmode = MWPORTRAIT_NONE;
			++t;
			continue;
		}
		if ( !strcmp("-L",argv[t]) ) {
			portraitmode = MWPORTRAIT_LEFT;
			++t;
			continue;
		}
		if ( !strcmp("-R",argv[t]) ) {
			portraitmode = MWPORTRAIT_RIGHT;
			++t;
			continue;
		}
		if ( !strcmp("-D",argv[t]) ) {
			portraitmode = MWPORTRAIT_DOWN;
			++t;
			continue;
		}
		if ( !strcmp("-x",argv[t]) ) {
			if (++t >= argc)
				usage();
			nxres = atoi(argv[t]);
			++t;
			continue;
		}
		if ( !strcmp("-y",argv[t]) ) {
			if (++t >= argc)
				usage();
			nyres = atoi(argv[t]);
			++t;
			continue;
		}
#if FONTMAPPER
		if ( !strcmp("-c",argv[t]) ) {
			int read_configfile(char *file);

			if (++t >= argc)
				usage();
			read_configfile(argv[t]);
			++t;
			continue;
		}
#endif
		usage();
	}

    Argc = argc;
    Argv = argv;
	/*
	 * This is the main server loop which initialises the server, services
	 * the clients, and shuts the server down when there are no more clients.
	 */
	if(GsInitialize() < 0)
		exit(1);

	while(1)
		GsSelect(0L);
	return 0;
}