Ejemplo n.º 1
0
void SwitchToWindowedModeDx9(HWND hwnd)
{
    video_canvas_t *c;

    fullscreen_transition = 1;

    c = video_canvas_for_hwnd(hwnd);

    video_device_release_dx9(c);

    /* Create statusbar here to get correct dimensions for client window */
    statusbar_create(hwnd);
    ui_set_render_window(c, 0);

    LockWindowUpdate(hwnd);
    SetWindowLong(hwnd, GWL_STYLE, old_style);
    /* Restore  Menu */
    SetMenu(hwnd,old_menu);
    ui_show_menu();
    SetWindowPos(hwnd, HWND_NOTOPMOST, old_rect.left, old_rect.top, old_rect.right - old_rect.left, old_rect.bottom - old_rect.top, SWP_NOCOPYBITS);
    ShowCursor(TRUE);
    LockWindowUpdate(NULL);

    video_device_create_dx9(c, 0);
    video_canvas_refresh_all(c);

    fullscreen_transition = 0;
    c->refreshrate = old_refreshrate;
}
Ejemplo n.º 2
0
static int show_pcba_test_menu(void)
{
	int chosen_item = -1;
	int i = 0;
	char* items[P_MENU_PHONE_TEST_CNT+1];
	int menu_cnt = P_MENU_PHONE_TEST_CNT;
	int result = 0,time_consume = 0;
	time_t start_time,end_time;
	unsigned char txt_flag=1;
	menu_info* pmenu = menu_pcba_test;
	int ret;
	pcba_phone=1;

	for(i = 0; i < menu_cnt; i++) {
		items[i] = pmenu[i].title;
	}
	items[menu_cnt] = NULL;

	while(1) {
		chosen_item = ui_show_menu(MENU_TITLE_PHONETEST, items, 0, chosen_item,P_MENU_PHONE_TEST_CNT);
		LOGD("mmitest chosen_item = %d", chosen_item);
		if(chosen_item >= 0 && chosen_item < menu_cnt) {
			LOGD("mmitest select menu = <%s>", pmenu[chosen_item].title);
			if(chosen_item >= P_MENU_PHONE_TEST_CNT) {
				return 0;
			}
			if(pmenu[chosen_item].func != NULL) {
				start_time = time(NULL);
				result = pmenu[chosen_item].func();
				LOGD("mmitest result=%d", result);
				end_time = time(NULL);
				time_consume = end_time -start_time;
				LOGD("mmitest select menu = <%s> consume time = %d", pmenu[chosen_item].title,time_consume);

			}
			write_bin(PCBATXTPATH);
		}
		else if (chosen_item < 0){
			return 0;
		}
    }
	return 0;
}
Ejemplo n.º 3
0
static int show_suggestion_test_menu(void)
{
	int chosen_item = -1;
	int i = 0;
	char* items[K_MENU_NOT_AUTO_TEST_CNT+1];
	int menu_cnt = K_MENU_NOT_AUTO_TEST_CNT;
	int result = 0,time_consume = 0;
	time_t start_time,end_time;
	menu_info* pmenu = menu_not_auto_test;
	pcba_phone=2;

	for(i = 0; i < menu_cnt; i++) {
		items[i] = pmenu[i].title;
	}
	items[menu_cnt] = NULL;

	while(1) {
		LOGD("mmitest back to main");
		chosen_item = ui_show_menu(MENU_NOT_AUTO_TEST, items, 0, chosen_item,K_MENU_NOT_AUTO_TEST_CNT);
		LOGD("mmitest chosen_item = %d",chosen_item);
		if(chosen_item >= 0 && chosen_item < menu_cnt) {
			LOGD("mmitest select menu = <%s>",  pmenu[chosen_item].title);
			if(chosen_item >= K_MENU_NOT_AUTO_TEST_CNT) {
				return 0;
			}
			if(pmenu[chosen_item].func != NULL) {
				start_time = time(NULL);
				result = pmenu[chosen_item].func();
				LOGD("mmitest result=%d", result);
				end_time = time(NULL);
				time_consume = end_time -start_time;
				LOGD("mmitest select menu = <%s> consume time = %d", pmenu[chosen_item].title,time_consume);
			}
			write_bin(PHONETXTPATH);
			write_bin(PCBATXTPATH);
		}else if (chosen_item < 0){
			return 0;
		}
	}
	return 0;
}
Ejemplo n.º 4
0
static int show_root_menu(void)
{
	int chosen_item = -1;
	int i = 0,time_consume = 0,total_time = 0;
	const char* items[K_MENU_ROOT_CNT+2];
	int menu_cnt = K_MENU_ROOT_CNT+1;
	menu_info* pmenu = menu_root;
	time_t start_time,end_time;

	temp_set_visible(1);

	for(i = 0; i < menu_cnt; i++) {
		items[i] = pmenu[i].title;
	}
	items[menu_cnt] = NULL;

	while(1) {
		chosen_item = ui_show_menu(MENU_TITLE_ROOT, items, 1, chosen_item,K_MENU_ROOT_CNT+1);
		LOGD("mmitest chosen_item = %d",  chosen_item);
		if(chosen_item >= 0 && chosen_item < menu_cnt) {
			if(pmenu[chosen_item].func != NULL) {
				LOGD("mmitest select menu = <%s>", pmenu[chosen_item].title);
				start_time = time(NULL);
				pmenu[chosen_item].func();
				end_time = time(NULL);
				time_consume = end_time -start_time;
				total_time += time_consume;
				LOGD("mmitest select menu = <%s> consume time = %d",  pmenu[chosen_item].title,time_consume);
				LOGD("mmitest select menu = <%s> total time consum = %d", MENU_TITLE_ROOT,total_time);
			}
		}
		LOGD("mmitest chosen_item = %d,text_tp_rows=%d", chosen_item,text_tp_rows);
		if(chosen_item < text_tp_rows)
			menu_change=0;
		else menu_change=2;
	}
	return 0;
}
Ejemplo n.º 5
0
static int show_phone_info_menu(void)
{
        int chosen_item = -1;
        int i = 0;
        char* items[K_MENU_INFO_CNT+1];
        int menu_cnt = K_MENU_INFO_CNT;
        int result = 0,time_consume = 0;
        time_t start_time,end_time;

        menu_info* pmenu = menu_phone_info_testmenu;
        for(i = 0; i < menu_cnt; i++) {
            items[i] = pmenu[i].title;
        }
        LOGD("mmitest menu_cnt=%d",menu_cnt);
        items[menu_cnt] = NULL;
        while(1) {
            chosen_item = ui_show_menu(MENU_PHONE_INFO, items, 0, chosen_item,K_MENU_INFO_CNT);
            LOGD("mmitest chosen_item = %d", chosen_item);
            if(chosen_item >= 0 && chosen_item < menu_cnt) {
                LOGD("mmitest select menu = <%s>", pmenu[chosen_item].title);
                if(chosen_item >= K_MENU_INFO_CNT) {
                    return 0;
                }
                if(pmenu[chosen_item].func != NULL) {
                        start_time = time(NULL);
                        result = pmenu[chosen_item].func();
                        end_time = time(NULL);
                        time_consume = end_time -start_time;
                        LOGD("mmitest select menu = <%s> consume time = %d", pmenu[chosen_item].title,time_consume);
                }
            }else if (chosen_item < 0){
                    return 0;
            }
        }
        return 0;
}
Ejemplo n.º 6
0
static int show_suggestion_test_result(void)
{
	int i = 0;
	int id,num;
	char tmp[64][64];
	mmi_result*ptr;
	int chosen_item = -1;
	char* items[3];
	int result = 0,time_consume = 0;
	time_t start_time,end_time;

	pcba_phone=2;
	num = sizeof(mmi_data_table)/sizeof(mmi_data_table[0]);
	while(1) {
		for(i = 0; i < 2; i++){
                    id = mmi_data_table[num-2+i].id;
                    ptr = get_result_ptr(id);
                    memset(tmp[i], 0, sizeof(tmp[i]));
                    switch(ptr->pass_faild) {
				case RL_NA:
					sprintf(tmp[i],"%s:%s",(mmi_data_table[num-2+i].name+2),TEXT_NA);
					break;
				case RL_FAIL:
					sprintf(tmp[i],"%s:%s",(mmi_data_table[num-2+i].name+2),TEXT_FAIL);
					break;
				case RL_PASS:
					sprintf(tmp[i],"%s:%s",(mmi_data_table[num-2+i].name+2),TEXT_PASS);
					break;
				case RL_NS:
					sprintf(tmp[i],"%s:%s",(mmi_data_table[num-2+i].name+2),TEXT_NS);
					break;
				default:
					sprintf(tmp[i],"%s:%s",(mmi_data_table[num-2+i].name+2),TEXT_NA);
					break;
                    }
                    menu_not_suggestion_result_menu[i].title=tmp[i];
                    menu_not_suggestion_result_menu[i].func= mmi_data_table[num-2+i].func;
                    items[i] = menu_not_suggestion_result_menu[i].title;
                    LOGD("mmitest <%d>-%s", i, menu_not_suggestion_result_menu[i].title);
		}
		menu_result_info* pmenu = menu_not_suggestion_result_menu;
		items[i] = NULL;
		chosen_item = ui_show_menu(MENU_NOT_AUTO_REPORT, items, 0, chosen_item,2);
		LOGD("mmitest chosen_item = %d", chosen_item);
		if(chosen_item >= 0 && chosen_item < num) {
                    LOGD("mmitest select menu = <%s>", pmenu[chosen_item].title);
                    if(chosen_item >= num) {
                        return 0;
                    }
                    if(pmenu[chosen_item].func != NULL) {
                        start_time = time(NULL);
                        result = pmenu[chosen_item].func();
                        end_time = time(NULL);
                        time_consume = end_time -start_time;
                        LOGD("mmitest select menu = <%s> consume time = %d", pmenu[chosen_item].title,time_consume);
                    }
                    write_bin(PHONETXTPATH);
                    write_bin(PCBATXTPATH);
		}else if (chosen_item < 0){
                    return 0;
		}
      }

      return 0;
}