console: allow VCs to be overridden by UI
We want to expose VCs using a VteTerminal widget. We need access to provide our own CharDriverState in order to do this. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1361367806-4599-3-git-send-email-aliguori@us.ibm.com
This commit is contained in:
		
							parent
							
								
									22bc9a46bd
								
							
						
					
					
						commit
						d82831dbc5
					
				| 
						 | 
					@ -443,7 +443,6 @@ void vga_hw_text_update(console_ch_t *chardata);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int is_graphic_console(void);
 | 
					int is_graphic_console(void);
 | 
				
			||||||
int is_fixedsize_console(void);
 | 
					int is_fixedsize_console(void);
 | 
				
			||||||
CharDriverState *text_console_init(QemuOpts *opts);
 | 
					 | 
				
			||||||
void text_consoles_set_display(DisplayState *ds);
 | 
					void text_consoles_set_display(DisplayState *ds);
 | 
				
			||||||
void console_select(unsigned int index);
 | 
					void console_select(unsigned int index);
 | 
				
			||||||
void console_color_init(DisplayState *ds);
 | 
					void console_color_init(DisplayState *ds);
 | 
				
			||||||
| 
						 | 
					@ -451,6 +450,11 @@ void qemu_console_resize(DisplayState *ds, int width, int height);
 | 
				
			||||||
void qemu_console_copy(DisplayState *ds, int src_x, int src_y,
 | 
					void qemu_console_copy(DisplayState *ds, int src_x, int src_y,
 | 
				
			||||||
                       int dst_x, int dst_y, int w, int h);
 | 
					                       int dst_x, int dst_y, int w, int h);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef CharDriverState *(VcHandler)(QemuOpts *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CharDriverState *vc_init(QemuOpts *opts);
 | 
				
			||||||
 | 
					void register_vc_handler(VcHandler *handler);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* sdl.c */
 | 
					/* sdl.c */
 | 
				
			||||||
void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
 | 
					void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2980,7 +2980,7 @@ static const struct {
 | 
				
			||||||
    { .name = "socket",    .open = qemu_chr_open_socket },
 | 
					    { .name = "socket",    .open = qemu_chr_open_socket },
 | 
				
			||||||
    { .name = "udp",       .open = qemu_chr_open_udp },
 | 
					    { .name = "udp",       .open = qemu_chr_open_udp },
 | 
				
			||||||
    { .name = "msmouse",   .open = qemu_chr_open_msmouse },
 | 
					    { .name = "msmouse",   .open = qemu_chr_open_msmouse },
 | 
				
			||||||
    { .name = "vc",        .open = text_console_init },
 | 
					    { .name = "vc",        .open = vc_init },
 | 
				
			||||||
    { .name = "memory",    .open = qemu_chr_open_ringbuf },
 | 
					    { .name = "memory",    .open = qemu_chr_open_ringbuf },
 | 
				
			||||||
#ifdef _WIN32
 | 
					#ifdef _WIN32
 | 
				
			||||||
    { .name = "file",      .open = qemu_chr_open_win_file_out },
 | 
					    { .name = "file",      .open = qemu_chr_open_win_file_out },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										14
									
								
								ui/console.c
								
								
								
								
							
							
						
						
									
										14
									
								
								ui/console.c
								
								
								
								
							| 
						 | 
					@ -1537,7 +1537,7 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
 | 
				
			||||||
        chr->init(chr);
 | 
					        chr->init(chr);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CharDriverState *text_console_init(QemuOpts *opts)
 | 
					static CharDriverState *text_console_init(QemuOpts *opts)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    CharDriverState *chr;
 | 
					    CharDriverState *chr;
 | 
				
			||||||
    QemuConsole *s;
 | 
					    QemuConsole *s;
 | 
				
			||||||
| 
						 | 
					@ -1573,6 +1573,18 @@ CharDriverState *text_console_init(QemuOpts *opts)
 | 
				
			||||||
    return chr;
 | 
					    return chr;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static VcHandler *vc_handler = text_console_init;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CharDriverState *vc_init(QemuOpts *opts)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return vc_handler(opts);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void register_vc_handler(VcHandler *handler)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    vc_handler = handler;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void text_consoles_set_display(DisplayState *ds)
 | 
					void text_consoles_set_display(DisplayState *ds)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue