Ejemplo n.º 1
0
Archivo: ft.c Proyecto: Oxyoptia/x3270
/* Pop up a message, end the transfer. */
void
ft_complete(const char *errmsg)
{
    /* Close the local file. */
    if (fts.local_file != NULL && fclose(fts.local_file) < 0) {
	popup_an_errno(errno, "close(%s)", ftc->local_filename);
    }
    fts.local_file = NULL;

    /* Clean up the state. */
    ft_state = FT_NONE;
    if (ft_start_id != NULL_IOID) {
	RemoveTimeOut(ft_start_id);
	ft_start_id = NULL_IOID;
    }

    /* Get the idle timeout going again. */
    idle_ft_complete();

    /* Pop down the in-progress shell. */
    ft_gui_progress_popdown();

    /* Pop up the text. */
    if (errmsg != NULL) {
	char *msg_copy = NewString(errmsg);

	/* Make sure the error message will fit on the pop-up. */
	ft_gui_errmsg_prepare(msg_copy);

	/* Clear out the progress display. */
	ft_gui_clear_progress();

	/* Pop up the error. */
	popup_an_error("%s", msg_copy);
	Free(msg_copy);
    } else {
	struct timeval t1;
	double bytes_sec;
	char *buf;

	(void) gettimeofday(&t1, NULL);
	bytes_sec = (double)fts.length /
		((double)(t1.tv_sec - t0.tv_sec) + 
		 (double)(t1.tv_usec - t0.tv_usec) / 1.0e6);
	buf = xs_buffer(get_message("ftComplete"), fts.length,
		display_scale(bytes_sec),
		fts.is_cut ? "CUT" : "DFT");
	ft_gui_clear_progress();
	ft_gui_complete_popup(buf);
	Free(buf);
    }

    /* I hope I can do this unconditionally. */
    sms_continue();
}
Ejemplo n.º 2
0
void RenderModel::
        display_scale(Heightmap::FreqAxis x)
{
    if (x != display_scale ())
        if (update_queue_)
            update_queue_->clear();

    tfr_map_.write ()->display_scale( x );

    deprecateCache();
}
Ejemplo n.º 3
0
int previewpicture(fb_info fb_inf)
{
	struct  dirent *mydr;
	DIR *fpdir;
	char buf[PICTURE_MAX][PICTURE_MAX];
	int picture_number = 0;
	int i = 0;
 /* struct sigaction sig_set;

    sigemptyset(&sig_set.sa_mask);
    sig_set.sa_handler = sig_usr;
    sig_set.sa_flags = 0;

    sigprocmask(SIG_BLOCK, &sig_set.sa_mask, NULL);


    sigaction(SIGABRT, &sig_set, NULL);
    sigaction(SIGCONT, &sig_set, NULL);
*/
	fpdir = opendir("../image");
	while(((mydr = readdir(fpdir) ))!= NULL )
	{
		if((strcmp(mydr->d_name, "..")==0) || (strcmp(mydr->d_name, ".")==0))
			continue;
		strcpy(buf[picture_number],mydr->d_name);
		picture_number++;
	}
	closedir(fpdir);

	while(i <= picture_number )
	{
		display_jpeg("1.jpg",fb_inf);
		if(sig_number < 0)
			sig_number = 0;
		if(sig_number > picture_number)
			sig_number = picture_number;
		i = sig_number;
		
		if(i < picture_number )
			display_scale(buf[i++],fb_inf.w/4,fb_inf.h/4,fb_inf.w/16,fb_inf.h/16,fb_inf);
		else break;
		if(i < picture_number )
			display_scale(buf[i++],fb_inf.w/4,fb_inf.h/4,3*fb_inf.w/8,fb_inf.h/16,fb_inf);
		else break;
		if(i < picture_number )
			display_scale(buf[i++],fb_inf.w/4,fb_inf.h/4,11*fb_inf.w/16,fb_inf.h/16,fb_inf);
		else break;
		if(i < picture_number )
			display_scale(buf[i++],fb_inf.w/4,fb_inf.h/4,fb_inf.w/16,3*fb_inf.h/8,fb_inf);
		else break;
		if(i < picture_number )
			display_scale(buf[i++],fb_inf.w/4,fb_inf.h/4,3*fb_inf.w/8,3*fb_inf.h/8,fb_inf);
		else break;
		if(i < picture_number )
			display_scale(buf[i++],fb_inf.w/4,fb_inf.h/4,11*fb_inf.w/16,3*fb_inf.h/8,fb_inf);
		else break;
		if(i < picture_number )
			display_scale(buf[i++],fb_inf.w/4,fb_inf.h/4,1*fb_inf.w/16,11*fb_inf.h/16,fb_inf);
		else break;
		if(i < picture_number )
			display_scale(buf[i++],fb_inf.w/4,fb_inf.h/4,3*fb_inf.w/8,11*fb_inf.h/16,fb_inf);
		else break;
		if(i < picture_number )
			display_scale(buf[i++],fb_inf.w/4,fb_inf.h/4,11*fb_inf.w/16,11*fb_inf.h/16,fb_inf);
		else break;
		sig_number = i;

		if(init_ft("mao.ttf",0) != 0)
		{
			fprintf(stderr, "Error inital font\n");
			return 1;
		}
		display_string("上一页",fb_inf.w/2,98*fb_inf.h/100,fb_inf, 0x00ff0000);
		display_string("下一页",3*fb_inf.w/4,98*fb_inf.h/100,fb_inf, 0x00ff0000);

        if (restar_flag == 1)
        {
        printf("ddddddddddd\n");
            init_restar();
            return 1;
        }
        pause();
	}
	display_string("已到最后一页",fb_inf.w,98*fb_inf.h/100,fb_inf, 0x00ff0000);

	return 0;
}