Пример #1
0
menu_t *menu_create_main_menu(game_t *game){
	menu_t *menu = menu_create(game);
	
	menu_add_option(menu, "Play Game", &menu_new_game);
	menu_add_option(menu, "Load Game", &menu_load_game);
	menu_add_option(menu, "Options", &menu_options);
	menu_add_option(menu, "Exit", &menu_exit);
	
	return menu;
}
Пример #2
0
void mem_menu_create(struct menu *menu)
{
  /* initialize data */
  vector_init(&domains, sizeof(struct mem_domain));
  add_domain(0x80000000, 0x00C00000, "k0 rdram");
  add_domain(0xA0000000, 0x00C00000, "k1 rdram");
  add_domain(0xA3F00000, 0x00100000, "rdram regs");
  add_domain(0xA4000000, 0x00100000, "sp regs");
  add_domain(0xA4100000, 0x00100000, "dp com");
  add_domain(0xA4200000, 0x00100000, "dp span");
  add_domain(0xA4300000, 0x00100000, "mi regs");
  add_domain(0xA4400000, 0x00100000, "vi regs");
  add_domain(0xA4500000, 0x00100000, "ai regs");
  add_domain(0xA4600000, 0x00100000, "pi regs");
  add_domain(0xA4800000, 0x00100000, "si regs");
  add_domain(0xA8000000, 0x08000000, "cart dom2");
  add_domain(0xB0000000, 0x0FC00000, "cart dom1");
  add_domain(0xBFC00000, 0x000007C0, "pif rom");
  add_domain(0xBFC007C0, 0x00000040, "pif ram");
  /* initialize menus */
  menu_init(menu, MENU_NOVALUE, MENU_NOVALUE, MENU_NOVALUE);
  menu->selector = menu_add_submenu(menu, 0, 0, NULL, "return");
  {
    view_address = menu_add_intinput(menu, 0, 1, 16, 8, address_proc, NULL);
    struct menu_item *data_size = menu_add_option(menu, 9, 1,
                                                  "byte\0""halfword\0""word\0",
                                                  data_size_proc, NULL);
    menu_option_set(data_size, 2);
    view_data_size = 4;
    menu_add_button(menu, 18, 1, "<", prev_domain_proc, NULL);
    menu_add_button(menu, 20, 1, ">", next_domain_proc, NULL);
    view_domain_name = menu_add_static(menu, 22, 1, NULL, 0xC0C0C0);
    view_domain_name->text = malloc(32);
    struct gfx_texture *t_arrow = resource_get(RES_ICON_ARROW);
    view_pageup = menu_add_button_icon(menu, 0, 2, t_arrow, 0, 0xFFFFFF,
                                       page_up_proc, NULL);
    view_pagedown = menu_add_button_icon(menu, 2, 2, t_arrow, 1, 0xFFFFFF,
                                         page_down_proc, NULL);
    menu_add_static(menu, 9, 2, "0 1 2 3 4 5 6 7", 0xC0C0C0);
    for (int y = 0; y < MEM_VIEW_ROWS; ++y) {
      view_rows[y] = menu_add_static(menu, 0, 3 + y, NULL, 0xC0C0C0);
      view_rows[y]->text = malloc(9);
    }
    make_cells(menu);
    goto_domain(0);
  }
}
Пример #3
0
void
liferea_htmlview_prepare_context_menu (LifereaHtmlView *htmlview, GtkMenu *menu, const gchar *linkUri, const gchar *imageUri)
{
	GList *item, *items;
	gboolean link = (linkUri != NULL);
	gboolean image = (imageUri != NULL);

	/* first drop all menu items that are provided by the browser widget (necessary for WebKit) */
	item = items = gtk_container_get_children (GTK_CONTAINER (menu));
	while (item) {
		gtk_widget_destroy (GTK_WIDGET (item->data));
		item = g_list_next (item);
	}
	g_list_free (items);

	/* do not expose internal links */
	if (linkUri && liferea_htmlview_is_special_url (linkUri) && !g_str_has_prefix (linkUri, "javascript:") && !g_str_has_prefix (linkUri, "data:"))
		link = FALSE;

	/* and now add all we want to see */
	if (link) {
		gchar *path;
		menu_add_option (menu, _("Open Link In _Tab"), NULL, G_CALLBACK (on_popup_open_link_in_tab_activate), (gpointer)linkUri);
		menu_add_option (menu, _("_Open Link In Browser"), NULL, G_CALLBACK (on_popup_launch_link_activate), (gpointer)linkUri);
		menu_add_option (menu, _("_Open Link In External Browser"), NULL, G_CALLBACK (on_popup_launch_link_external_activate), (gpointer)linkUri);
		menu_add_separator (menu);
		
		path = g_strdup_printf (_("_Bookmark Link at %s"), social_get_bookmark_site ());
		menu_add_option (menu, path, NULL, on_popup_social_bm_link_activate, (gpointer)linkUri);
		g_free (path);

		menu_add_option (menu, _("_Copy Link Location"), "gtk-copy", G_CALLBACK (on_popup_copy_url_activate), (gpointer)linkUri);
	}
	if (image)
		menu_add_option (menu, _("_Copy Image Location"), "gtk-copy", G_CALLBACK (on_popup_copy_url_activate), (gpointer)imageUri);
	if (link)
		menu_add_option (menu, _("S_ave Link As"), "gtk-save", G_CALLBACK (on_popup_save_url_activate), (gpointer)linkUri);
	if (image)
		menu_add_option (menu, _("S_ave Image As"), "gtk-save", G_CALLBACK (on_popup_save_url_activate), (gpointer)imageUri);
	if (link) {	
		menu_add_separator (menu);
		menu_add_option (menu, _("_Subscribe..."), "gtk-add", G_CALLBACK (on_popup_subscribe_url_activate), (gpointer)linkUri);
	}
	
	if(!link && !image) {
		GtkWidget *item;
		item = menu_add_option (menu, NULL, GTK_STOCK_COPY, G_CALLBACK (on_popup_copy_activate), htmlview);
		if (!(RENDERER (htmlview)->hasSelection) (htmlview->priv->renderWidget)) 
			gtk_widget_set_sensitive (item, FALSE);

		menu_add_separator (menu);
		menu_add_option (menu, _("_Increase Text Size"), "gtk-zoom-in", G_CALLBACK (on_popup_zoomin_activate), htmlview);
		menu_add_option (menu, _("_Decrease Text Size"), "gtk-zoom-out", G_CALLBACK (on_popup_zoomout_activate), htmlview);
	}
}