Exemple #1
0
/* This is called when the current task does not know which screen is shown, 
	so that switch_screen() can not be used.
	We simply exit the current screen and enter the new one.
	
	if a popup is active, do not switch screens,
		set deferred_screen instead
*/
void
show_screen(enum SCREEN newscreen){
	screen_exit(cur_screen);
	if (popup_active)
		deferred_screen = newscreen;
	else
		screen_enter(newscreen);	
};
Exemple #2
0
/**
 * 清理图形模块
 **/
static void graph_exit()
{
	/** 刷黑屏幕 **/
	engine_clear_black(global_wm.gd_handler);
	/** 清理屏幕 **/
	screen_exit();
	/** 清理窗口管理器图形设备 */
	engine_graphics_device_exit(global_wm.gd_handler);
}
Exemple #3
0
int main(int argc, char *argv[])
{
	uint32_t colorblock[60000];
	uint32_t i = 0;
	/* On veut remplir une mire avec 7 bandes de couleur de 100 pixels de
	 * large chacune, et de 600 pixels de haut
	 *  On initialise donc un écran de largeur 700, et de hauteur 600
	 */
	screen_init(700, 600, 25);

	/* On veut ensuite copier les bandes de couleur, à la bonne place dans
	 * l'image.
	 * Pour cela, on utilise la fonction screen_cpyrect. On initialise
	 * également le bloc à copier
	 */
	for (i = 0 ; i < 60000 ; i++) {
		colorblock[i] = WHITE;
	}
	screen_cpyrect(0,0,100,600, colorblock);
	for (i = 0 ; i < 60000 ; i++) {
		colorblock[i] = RED;
	}
	screen_cpyrect(100,0,100,600, colorblock);
	for (i = 0 ; i < 60000 ; i++) {
		colorblock[i] = RED | BLUE;
	}
	screen_cpyrect(200,0,100,600, colorblock);
	for (i = 0 ; i < 60000 ; i++) {
		colorblock[i] = BLUE;
	}
	screen_cpyrect (300,0,100,600, colorblock);
	for (i = 0 ; i < 60000 ; i++) {
		colorblock[i] = BLUE | GREEN;
	}
	screen_cpyrect (400,0,100,600, colorblock);
	for (i = 0 ; i < 60000 ; i++) {
		colorblock[i] = GREEN;
	}
	screen_cpyrect (500,0,100,600, colorblock);
	for (i = 0 ; i < 60000 ; i++) {
		colorblock[i] = BLACK;
	}
	screen_cpyrect (600,0,100,600, colorblock);
	// Les 7 bandes ont été copiés, on peut maintenant afficher l'image
	screen_refresh();
	/* Une fois rafraichit, on ferme l'écran. Cette fonction attend en fait
	 * que l'on ferme explicitement la fenetre
	 */
	screen_exit();
	return 0;
}
Exemple #4
0
static void
exit_and_cleanup(void)
{
	screen_exit();
#ifndef NCMPC_MINI
	set_xterm_title("");
#endif
	printf("\n");

	if (mpd) {
		mpdclient_disconnect(mpd);
		mpdclient_free(mpd);
	}
}
Exemple #5
0
void
screen_resize(struct mpdclient *c)
{
	if (COLS<SCREEN_MIN_COLS || LINES<SCREEN_MIN_ROWS) {
		screen_exit();
		fprintf(stderr, "%s\n", _("Error: Screen too small"));
		exit(EXIT_FAILURE);
	}
#ifdef PDCURSES
	resize_term(LINES, COLS);
#else 
	resizeterm(LINES, COLS);
#endif

	screen.cols = COLS;
	screen.rows = LINES;

	title_bar_resize(&screen.title_bar, screen.cols);

	/* main window */
	screen.main_window.cols = screen.cols;
	screen.main_window.rows = screen.rows-4;
	wresize(screen.main_window.w, screen.main_window.rows, screen.cols);
	wclear(screen.main_window.w);

	/* progress window */
	progress_bar_resize(&screen.progress_bar, screen.cols,
			    screen.rows - 2, 0);
	progress_bar_paint(&screen.progress_bar);

	/* status window */
	status_bar_resize(&screen.status_bar, screen.cols, screen.rows - 1, 0);
	status_bar_paint(&screen.status_bar, c->status, c->song);

	screen.buf_size = screen.cols;
	g_free(screen.buf);
	screen.buf = g_malloc(screen.cols);

	/* resize all screens */
	screen_list_resize(screen.main_window.cols, screen.main_window.rows);

	/* ? - without this the cursor becomes visible with aterm & Eterm */
	curs_set(1);
	curs_set(0);

	screen_paint(c);
}
Exemple #6
0
void cleanup() {
    task_quit_all();

    ui_exit();
    screen_exit();

    socExit();
    if(soc_buffer != NULL) {
        free(soc_buffer);
        soc_buffer = NULL;
    }

    amExit();
    httpcExit();
    ptmuExit();
    acExit();
    cfguExit();
    romfsExit();
    gfxExit();
}
Exemple #7
0
void cleanup() {
    clipboard_clear();

    task_exit();
    ui_exit();
    screen_exit();

    socExit();
    if(soc_buffer != NULL) {
        free(soc_buffer);
        soc_buffer = NULL;
    }

    amExit();
    httpcExit();
    ptmuExit();
    acExit();
    cfguExit();
    romfsExit();
    gfxExit();
}
Exemple #8
0
int main(int argc, char *argv[])			/* main program       */
{

    int   x, retval = 1;			/* counters, etc.     */
    off_t val, len;					/* len need to be off_t*/

    windows = (WINS *) calloc(1, sizeof(WINS));	/* malloc windows     */
    head = llalloc();							/* malloc list space  */
    fpINfilename = NULL;			/* allocate in and    */
    fpOUTfilename = NULL;			/* out file name ptrs */
    printHex = TRUE;							/* address format     */
    USE_EBCDIC = FALSE;							/*use ascii by default*/

							/* get cmd line args  */
    len = parseArgs(argc, argv);
    MIN_ADDR_LENGTH = getMinimumAddressLength(len);

    use_env(TRUE);					/* use env values     */
    slk_init(0);					/* init menu bar      */
    init_screen();					/* init visuals       */
    init_colors();

    if ((COLS < MIN_COLS) || (LINES < MIN_LINES))	/* screen's too small */
    {
	endwin();
	fprintf(stderr,"\n\nThe screen size too small.\nThe minimum allowable");
	fprintf(stderr," screen size is %dx%d\n\n", MIN_COLS, MIN_LINES + 1);
	exit(-1);
    }
    
    slk_set(6, (printHex) ? "Hex Addr":"Dec Addr", 1);
    init_fkeys();					/* define menu bar    */
    

    while (retval)
    {
	free_windows(windows);
        
	/* calculate screen   */
	BASE                = (resize > 0 && resize < COLS) ? resize:((COLS-6-MIN_ADDR_LENGTH)/4);
	MAXY                = (LINES) - 3;
	hex_win_width       = BASE * 3;
	ascii_win_width     = BASE;
	hex_outline_width   = (BASE * 3) + 3 + MIN_ADDR_LENGTH;
	ascii_outline_width = BASE + 2;
            
	init_menu(windows);				/* init windows       */
	head = freeList(head);				/* free & init head   */
							/* print origin loc   */
	mvwprintw(windows->hex_outline, 0, 1, "%0*d", MIN_ADDR_LENGTH, 0);
    
	if (fpIN != NULL)				/* if no infile...    */
	{
            len = maxLoc(fpIN);				/* get last file loc  */
	    val = maxLines(len); 			/* max file lines     */
            for (x = 0; x <= MAXY && x<=val; x++)       /* output lines       */
		outline(fpIN, x);
	}

	wmove(windows->hex, 0, 0);			/* cursor to origin   */
    
	refreshall(windows);				/* refresh all wins   */
	doupdate();					/* update screen      */
        
	mvwaddch(windows->scrollbar, 1, 0, ACS_CKBOARD);/* clear scroller     */
							/* get user input     */
	retval = wacceptch(windows, len); 
    }
    
    free(fpINfilename);
    free(fpOUTfilename);
    freeList(head);
    
    screen_exit(0);					/* end visualizations */
    return retval;					/* return             */
}
Exemple #9
0
Display::~Display()
{
   screen_exit();
}