qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/7] ui: add basic GTK gui (v2)


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH 2/7] ui: add basic GTK gui (v2)
Date: Wed, 05 Sep 2012 22:54:56 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2012-09-05 21:18, Anthony Liguori wrote:
> This is minimalistic and just contains the basic widget infrastructure.  The 
> GUI
> consists of a menu and a GtkNotebook.  To start with, the notebook has its 
> tabs
> hidden which provides a UI that looks very similar to SDL with the exception 
> of
> the menu bar.
> 
> The menu bar allows a user to toggle the visibility of the tabs.  Cairo is 
> used
> for rendering.
> 
> I used gtk-vnc as a reference.  gtk-vnc solves the same basic problems as QEMU
> since it was originally written as a remote display for QEMU.  So for the most
> part, the approach to rendering and keyboard handling should be pretty solid 
> for
> GTK.
> 
> Signed-off-by: Anthony Liguori <address@hidden>
> ---
> v1 -> v2
>  - add gtk-vnc license
>  - fix key propagation

...

> +static void gd_create_menus(GtkDisplayState *s)
> +{
> +    GtkStockItem item;
> +    GtkAccelGroup *accel_group;
> +    GSList *group = NULL;
> +    GtkWidget *separator;
> +
> +    accel_group = gtk_accel_group_new();
> +    s->file_menu = gtk_menu_new();
> +    gtk_menu_set_accel_group(GTK_MENU(s->file_menu), accel_group);
> +    s->file_menu_item = gtk_menu_item_new_with_mnemonic("_File");
> +
> +    s->quit_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL);
> +    gtk_stock_lookup(GTK_STOCK_QUIT, &item);
> +    gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->quit_item),
> +                                 "<QEMU>/File/Quit");
> +    gtk_accel_map_add_entry("<QEMU>/File/Quit", item.keyval, item.modifier);
> +
> +    s->view_menu = gtk_menu_new();
> +    gtk_menu_set_accel_group(GTK_MENU(s->view_menu), accel_group);
> +    s->view_menu_item = gtk_menu_item_new_with_mnemonic("_View");
> +
> +    separator = gtk_separator_menu_item_new();
> +    gtk_menu_append(GTK_MENU(s->view_menu), separator);
> +
> +    s->vga_item = gtk_radio_menu_item_new_with_mnemonic(group, "_VGA");

Minor nit, but "VGA" is the wrong name for QEMU in general. Maybe "Display"?

Jan


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]