Beispiel #1
0
/*
 * External definitions defined here.
 */
GR_WINDOW_ID	cachewindowid;		/* cached window id */
GR_WINDOW_ID    cachepixmapid;         /* cached pixmap id */
GR_GC_ID	cachegcid;		/* cached graphics context id */
GR_WINDOW	*cachewp;		/* cached window pointer */
GR_GC		*cachegcp;		/* cached graphics context */
GR_PIXMAP       *cachepp;               /* cached pixmap */
GR_PIXMAP       *listpp;                /* List of all pixmaps */
GR_WINDOW	*listwp;		/* list of all windows */
GR_WINDOW	*rootwp;		/* root window pointer */
GR_GC		*listgcp;		/* list of all gc */
GR_REGION	*listregionp;		/* list of all regions */
GR_FONT		*listfontp;		/* list of all fonts */
GR_CURSOR	*listcursorp;		/* list of all cursors */
GR_CURSOR	*stdcursor;		/* root window cursor */
GR_GC		*curgcp;		/* currently enabled gc */
GR_WINDOW	*clipwp;		/* window clipping is set for */
GR_WINDOW	*focuswp;		/* focus window for keyboard */
GR_WINDOW	*mousewp;		/* window mouse is currently in */
GR_WINDOW	*grabbuttonwp;		/* window grabbed by button */
GR_CURSOR	*curcursor;		/* currently enabled cursor */
GR_COORD	cursorx;		/* current x position of cursor */
GR_COORD	cursory;		/* current y position of cursor */
GR_BUTTON	curbuttons;		/* current state of buttons */
GR_CLIENT	*curclient;		/* client currently executing for */
GR_EVENT_LIST	*eventfree;		/* list of free events */
GR_BOOL		focusfixed;		/* TRUE if focus is fixed on a window */
PMWFONT		stdfont;		/* default font*/
char		*progname;		/* Name of this program.. */

int		current_fd;		/* the fd of the client talking to */
int		connectcount = 0;	/* number of connections to server */
GR_CLIENT	*root_client;		/* root entry of the client table */
GR_CLIENT	*current_client;	/* the client we are currently talking*/
char		*current_shm_cmds;
int		current_shm_cmds_size;
static int	keyb_fd;		/* the keyboard file descriptor */
static int	mouse_fd;		/* the mouse file descriptor */
char		*curfunc;		/* the name of the current server func*/
GR_BOOL		screensaver_active;	/* time before screensaver activates */
GR_SELECTIONOWNER selection_owner;	/* the selection owner and typelist */
int		autoportrait = FALSE;	/* auto portrait mode switching*/
MWCOORD		nxres;			/* requested server x resolution*/
MWCOORD		nyres;			/* requested server y resolution*/
GR_GRABBED_KEY  *list_grabbed_keys = NULL;     /* list of all grabbed keys */

#if MW_FEATURE_TIMERS
GR_TIMEOUT	screensaver_delay;	/* time before screensaver activates */
GR_TIMER_ID     cache_timer_id;         /* cached timer ID */
GR_TIMER        *cache_timer;           /* cached timer */
GR_TIMER        *list_timer;            /* list of all timers */
#endif
#if MW_FEATURE_TWO_KEYBOARDS
static int	keyb2_fd;		/* the keyboard file descriptor */
#endif

static int	persistent_mode = FALSE;
static int	portraitmode = MWPORTRAIT_NONE;

SERVER_LOCK_DECLARE /* Mutex for all public functions (only if NONETWORK and THREADSAFE) */

#if (_MSC_VER == 1500) && NONETWORK
int WinMain(int hInstance, int hPrevInstance, char *lpCmdLine, int nShowCmd)
{
	char *av[1] = { "nanox.exe" };
	int main(int ac, char **av);
	return main(1, av);
}
#endif

#if !NONETWORK
static int	Argc;
static char **	Argv;
int		un_sock;		/* the server socket descriptor */

static void
usage(void)
{
	EPRINTF("Usage: %s [-p] [-A] [-NLRD] [-x #] [-y #]"
#if FONTMAPPER
		" [-c <fontconfig-file>"
#endif
		" ...]\n", progname);
	exit(1);
}

#if ALLEGRO
int real_main(int ac, char **av);	/* ALLEGRO renamed main entry point*/
int main(int ac, char **av)
{
#define MAIN(ac,av)	real_main(ac,av)
	/* required to force allegro to run OSX API calls on the main thread*/
	extern int al_run_main(int ac, char **av, int (*main_ptr)());
	return al_run_main(ac, av, real_main);
}
Beispiel #2
0
int main(int argc, char **argv) {
  return al_run_main(argc, argv, real_main);
}