void 		start_game(t_all *all)
{
  int 		ch;
  int 		frozen;

  frozen = -1;
  init_win();
  refresh();
  init_windowss(all);
  ch = wgetch(stdscr);
  all->time_tmp = time(NULL);
  init_coloo();
  game_play(all);
  while ((int)ch != all->param.quit[0])
    {
      ch = wgetch(stdscr);
      if ((int)ch == all->param.pause[0])
	frozen *= -1;
      get_key_ch(all, ch);
      if (frozen < 0 && all->time_tmp - time(NULL) <= -1)
	{
	  all->time_tmp = time(NULL);
	  fall_token(all);
	}
    }
  end_window();

}
Beispiel #2
0
int main(void)
{
	pthread_t thread;

	init_win();

	if (init_gamebasis() == -1)
	{
		printw("Error during the allocation memory process.\n");
		refresh();
		endwin();

		return 0;
	}

	if (pthread_create(&thread, NULL, &judge, NULL) != 0)
		printw("Error during the creation thread process.\n");
	else
		pthread_join(thread, NULL);

	free_mats();
	endwin();

	return 0;
}
Beispiel #3
0
int main(int argc, char** argv)
{
  geom_t geom;

  geom.x=10;
  geom.y=10;
  geom.width=100;
  geom.height=100;

  init_win(&argc, argv, geom);
  while(1);
}
Beispiel #4
0
bool Initialize::doInitialization()
{
#ifdef TARGET_OS_MAC
    #error "TODO initialize for osx"
#elif defined __linux__
    return init_linux();
#elif defined _WIN32 || defined _WIN64
    return init_win();
#else
    #error "unknown platform"
#endif
}
Beispiel #5
0
/*!
 * \brief DialogSettings::DialogSettings
 * \param parent
 *
 * DialogSettings
 */
DialogSettings::DialogSettings(QWidget *parent) :
    QDialog(parent)
{
    if (DEBUG) cout << Q_FUNC_INFO << endl;

    init_var();
    init_win();
    init_sig();
    init_css();

    init_settings();
}
Beispiel #6
0
Datei: init.c Projekt: m-ab/fdf
t_env		init_env(int **tab, int xmax, int ymax)
{
	t_env e;

	e.x_offset = 500;
	e.y_offset = 250;
	e.zoom = 1.5;
	e.alt = 1.5;
	e.tab = tab;
	e.xmax = xmax;
	e.ymax = ymax;
	init_win(&e);
	return (e);
}
Beispiel #7
0
//------------ Begin of function Sys::init ----------//
int Sys::init( HANDLE hInstance ) {
    err_when( init_flag );

    //------- initialize basic vars --------//
    app_hinstance = (HINSTANCE)hInstance;

#ifdef BETA
    debug_session       = m.is_file_exist("DEBUG.SYS");
    testing_session     = m.is_file_exist("TESTING.SYS");
#endif

#ifdef DEBUG
    // Ben has put debug.sys in download version, so change to use DEBUGCC.SYS
    debug_session       = m.is_file_exist("DEBUGCC.SYS");
    testing_session     = m.is_file_exist("TESTING.SYS");
#endif

    // add in (GAME_VERSION>=200)
    use_true_front      = debug_session;

    // Ben what Win2K winXP has no lock buffer problem, so force to 1 to turn on triple buffer (1 primary + 2 system memory surfaces)
    use_true_front = 1;

    if( m.is_file_exist("WINMODE.SYS") )
	use_true_front = 2;                           // window mode

    set_game_dir();                                 // set game directories names and game version

    //------- initialize more stuff ---------//
    if( !init_win() )
	return FALSE;

    if( !init_directx() )
	return FALSE;

    if( !init_objects() )                           // initialize system objects which do not change from games to games.
	return FALSE;

    init_flag = 1;

    return TRUE;
}
DialogFlowConstructorEPI::DialogFlowConstructorEPI(Coord **coords_arterial, Coord **coords_venous, Coord **coords_csf,
                                             QStringList *list_arterial, QStringList *list_venous, QStringList *list_csf,
                                             Coord *coord_arterial_cervical, Coord *coord_venous_cervical, Coord *coord_csf_cervical,
                                             QStringList *list_arterial_cervical, QStringList *list_venous_cervical, QStringList *list_csf_cervical,
                                             Coord *coord_arterial_cerebral, Coord *coord_venous_cerebral, Coord *coord_csf_cerebral,
                                             QStringList *list_arterial_cerebral, QStringList *list_venous_cerebral, QStringList *list_csf_cerebral,
                                             QWidget *parent) :
    QDialog(parent)
{
    if (DEBUG) cout << Q_FUNC_INFO << endl;

    //Address copy
    this->coords_arterial = coords_arterial;
    this->coords_venous = coords_venous;
    this->coords_csf = coords_csf;

    this->coord_arterial_cervical = coord_arterial_cervical;
    this->coord_venous_cervical = coord_venous_cervical;
    this->coord_csf_cervical = coord_csf_cervical;
    this->coord_arterial_cerebral = coord_arterial_cerebral;
    this->coord_venous_cerebral = coord_venous_cerebral;
    this->coord_csf_cerebral = coord_csf_cerebral;

    this->list_arterial = list_arterial;
    this->list_venous = list_venous;
    this->list_csf = list_csf;

    this->list_arterial_cervical = list_arterial_cervical;
    this->list_venous_cervical = list_venous_cervical;
    this->list_csf_cervical = list_csf_cervical;

    this->list_arterial_cerebral = list_arterial_cerebral;
    this->list_venous_cerebral = list_venous_cerebral;
    this->list_csf_cerebral = list_csf_cerebral;

    init_var();
    init_win();
    init_sig();
    init_css();
}
Beispiel #9
0
int
main(int argc, char *argv[])
{
	KeySym key;
	XEvent event;
	int hidden = 1;
	int fullscreen = 0;
	int i, tmp;
	int old_height = 0;
	Window tmpwin, last_focused, current_focused;
	XWindowAttributes wa;

	/* strip the path from argv[0] if there is one */
	progname = strrchr(argv[0], '/');
	if (!progname)
		progname = argv[0];
	else
		progname++;

	for (i = 1; i < argc; i++) {
		if (!strcmp(argv[i], "-h")) {
			printf("%s:\n"
				   "-e: program to execute\n"
				   "you can configure me via xresources:\n"
				   "%s*foo:value\n"
				   "foo can be any standard xterm/urxvt/st xresource or:\n"
				   "resource               default value\n\n"
				   "term:                  xterm\n"
				   "restart:               0\n"
				   "xOffset:               0\n"
				   "yOffset:               0\n"
				   "xrandrSupport:         0\n"
				   "screenWidth:           Display width\n"
				   "consoleHeight:         10\n"
				   "aniDelay:              40\n"
				   "stepSize;              1\n"
				   "toggleKey:             ControlAlt+y\n"
				   "keySmaller:            Control+KP_Subtract\n"
				   "keyBigger:             Control+KP_Add\n" "keyFull:               Alt+F11\n", progname, progname);
			exit(0);
		}
	}

	if (!(dpy = XOpenDisplay(NULL))) {
		fprintf(stderr, " can not open dpy %s", XDisplayName(NULL));
	}
	screen = DefaultScreen(dpy);
	root = RootWindow(dpy, screen);
	XSetErrorHandler(handle_xerror);
	cursor = XCreateFontCursor(dpy, XC_double_arrow);
	get_defaults();
	init_win();
	init_command(argc, argv);
	init_xterm(1);
	while (1) {
		XNextEvent(dpy, &event);
		switch (event.type) {
		case FocusOut:
			/* Always keep input focus when visible */
			if (!hidden)
				XSetInputFocus(dpy, termwin, RevertToPointerRoot, CurrentTime);
			break;
		case EnterNotify:
			XSetInputFocus(dpy, termwin, RevertToPointerRoot, CurrentTime);
			XSync(dpy, False);
			break;
		case LeaveNotify:
			if (last_focused && event.xcrossing.detail != NotifyInferior) {
				XSetInputFocus(dpy, last_focused, RevertToPointerRoot, CurrentTime);
				XSync(dpy, False);
			}
			break;
		case KeyPress:
			key = XKeycodeToKeysym(dpy, event.xkey.keycode, 0);
			if (key == opt_key) {
				if (!hidden) {
					XGetInputFocus(dpy, &current_focused, &revert_to);
					if (last_focused && current_focused == termwin)
						XSetInputFocus(dpy, last_focused, RevertToPointerRoot, CurrentTime);
					/* else
					   XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); */
					if (opt_step && !fullscreen)
						roll(UP);
					XUnmapWindow(dpy, win);
					hidden = 1;
					XSync(dpy, False);
				}
				else {
					XGetInputFocus(dpy, &last_focused, &revert_to);
					last_focused = get_toplevel_parent(last_focused);

					if (opt_step && !fullscreen) {
						XGrabServer(dpy);
						roll(DOWN);
						XUngrabServer(dpy);
					}
					else if (opt_xrandr)
						update_geom(last_focused);
					XMoveWindow(dpy, win, opt_x, opt_y);
					XMapWindow(dpy, win);
					XRaiseWindow(dpy, win);
					XSetInputFocus(dpy, termwin, RevertToPointerRoot, CurrentTime);
					hidden = 0;
					XSync(dpy, False);
					XSetInputFocus(dpy, termwin, RevertToPointerRoot, CurrentTime);
					XSync(dpy, False);
				}
				break;
			}
			if (!hidden) {
				if (key == opt_key_full) {
					if (!fullscreen) {
						old_height = height;
						height = get_optimal_height(get_display_height());
						fullscreen = 1;
					}
					else {
						height = old_height;
						fullscreen = 0;
					}
				}

				/* update height inc just in case something changed for the
				 * terminal, i.e. font size */
				resize_inc = get_height_inc();
				if (key == opt_key_bigger)
					height += resize_inc;
				if (key == opt_key_smaller)
					height -= resize_inc;
				if (height < resize_inc)
					height = resize_inc;
				height = get_optimal_height(height);
				resize_term(opt_width, height);
				XSetInputFocus(dpy, termwin, RevertToPointerRoot, CurrentTime);
				XSync(dpy, False);
			}
			break;
		case ButtonPress:
			resize();
			XSync(dpy, False);
			break;
		case UnmapNotify:
			if (event.xunmap.window == termwin) {
				if (opt_restart) {
					if (opt_restart_hidden) {
						roll(UP);
						hidden = 1;
					}
					init_xterm(0);
					XSync(dpy, False);
					if (opt_restart_hidden && last_focused)
						XSetInputFocus(dpy, last_focused, RevertToPointerRoot, CurrentTime);
					else
						XSetInputFocus(dpy, termwin, RevertToPointerRoot, CurrentTime);
				}
				else {
					if (last_focused)
						XSetInputFocus(dpy, last_focused, RevertToPointerRoot, CurrentTime);
					XSync(dpy, False);
					exit(0);
				}
			}
			break;
		}
	}
	return 0;
}
Beispiel #10
0
int main(int argc, char **args)
{
    init_win();
    int i = 0,flag = 0, x = 0;
    bug_msg_t *p = (bug_msg_t *)malloc(sizeof(bug_msg_t));
    if(p == NULL) {
        return -1;
    } 
    user_msg_t *p_1 = (user_msg_t *)malloc(sizeof(user_msg_t));
    if(p_1 == NULL) {
        return -1;
    } 
    head.next = &head;
    head.prev = &head;
    head_user.next = &head_user;
    head_user.prev = &head_user;
    overload_bugList();
joggle: 
	overload_userList();
    i = boot_screen();
    switch(i){
        case 0:
            create_frame();
            create_msg_zone();
            create_title_window("User Login");
			x = user_login();
            if(x == 1) {
                 show_message("No user\nPlease register");
                 sleep(2);
                 goto joggle;
            }            
            if(x == 0) {
            core:
                flag = core_func();
                switch(flag){
                    case 0:
                       p = &head;
                        if( Add_Bug() == 0) {
                            File_bugList(p);
                            goto core;
                        }else {
                             return 0;
                        }
                    case 1:
                        if(Selection_Show_Bug() == -1){
                           goto core;
                        }else {
                             p = &head;
                             File_bugList(p);
                        }
                        break;
                    default:
                         exit_win();
                         return 0;
                }
            }
            break;
        case 1:
            create_frame();
            create_msg_zone();
            create_title_window("User Register");
       	    if(User_register() == 0) {
                 p_1 = &head_user;
                 File_userList(p_1);
                 goto joggle;
                 break;
            }
            break;
        default:
            exit_win();
            return 0;
    }
     exit_win();
     return 0;
}