コード例 #1
0
 */
static GnomeUIInfo htmlbar_common_items[] =
{
	GNOMEUIINFO_ITEM_XPM_FILE_DATA (N_("P"), N_("Insert paragraph tag."),
					htmlbar_common_insert_p_tag_cb, NULL,
					"peacock-html-toolbars-control/paragraph.xpm"),
	GNOMEUIINFO_ITEM_XPM_FILE_DATA (N_("<BR>"), N_("Insert line break tag."),
					htmlbar_common_insert_br_tag_cb, NULL,
					"peacock-html-toolbars-control/br.xpm"),
	GNOMEUIINFO_ITEM_XPM_FILE_DATA (N_("&nbsp;"), N_("Insert space tag."),
					htmlbar_common_insert_nbsp_tag_cb, NULL,
					"peacock-html-toolbars-control/nbsp.xpm"),
	GNOMEUIINFO_SEPARATOR,

	GNOMEUIINFO_ITEM_STOCK (N_("Bold"), N_("Bold"),
				htmlbar_common_insert_b_tag_cb,
				GNOME_STOCK_PIXMAP_TEXT_BOLD),
	GNOMEUIINFO_ITEM_STOCK (N_("Italic"), N_("Italic"),
				htmlbar_common_insert_i_tag_cb,
				GNOME_STOCK_PIXMAP_TEXT_ITALIC),
	GNOMEUIINFO_ITEM_STOCK (N_("Underline"), N_("Underline"),
				htmlbar_common_insert_u_tag_cb,
				GNOME_STOCK_PIXMAP_TEXT_UNDERLINE),
	GNOMEUIINFO_ITEM_STOCK (N_("Strikeout"), N_("Strikeout"),
				htmlbar_common_insert_s_tag_cb,
				GNOME_STOCK_PIXMAP_TEXT_STRIKEOUT),
	GNOMEUIINFO_SEPARATOR,

	GNOMEUIINFO_ITEM_XPM_FILE_DATA (N_("Anchor"),
					N_("Insert an anchor tag."),
					htmlbar_common_insert_anchor_tag_cb,
コード例 #2
0
ファイル: set.cpp プロジェクト: chadaustin/isugamedev
int  main(int argc, char *argv[])
{
	gnome_init(VERSION, VERSION, argc, argv);

	/* Set up to draw from card class */
	GtkWidget *vbox, *vbox1, *vbox2, *vbox3;
	GtkWidget *tbar;
	GtkWidget *setbutton, *nosetbutton;
	GdkColor white, black, blue;
	/* Done setting up */

	window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_set_title(GTK_WINDOW(window), "Set Game");
	gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE);
	gtk_container_border_width(GTK_CONTAINER(window), 0);

	vbox= gtk_vbox_new(FALSE, 0);
	vbox1 = gtk_vbox_new(FALSE, 0);
	vbox2 = gtk_vbox_new(FALSE, 0);
	vbox3 = gtk_vbox_new(FALSE, 0);

	drawing_area = gtk_drawing_area_new();
  gtk_widget_set_events(drawing_area,
    GDK_EXPOSURE_MASK|GDK_BUTTON_PRESS_MASK);
  gtk_widget_set_events(window, GDK_KEY_PRESS_MASK);
  gtk_signal_connect(GTK_OBJECT(drawing_area), "expose_event",
    GTK_SIGNAL_FUNC(expose_event), 0);
  gtk_signal_connect(GTK_OBJECT(drawing_area), "button_press_event",
    GTK_SIGNAL_FUNC(button_event), 0);
	GnomeUIInfo toolbar[ ] = {
GNOMEUIINFO_ITEM_STOCK ("New Game", "Start new Game", newgame, GNOME_STOCK_PIXMAP_NEW),
GNOMEUIINFO_ITEM_STOCK ("High Scores", "Shows High scores", gtk_main_quit, GNOME_STOCK_PIXMAP_SCORES),
GNOMEUIINFO_ITEM_STOCK ("End Game", "Ends Current Game", gtk_main_quit, GNOME_STOCK_PIXMAP_STOP),
GNOMEUIINFO_ITEM_STOCK ("Exit", "Exit the application", gtk_main_quit, GNOME_STOCK_PIXMAP_EXIT),
GNOMEUIINFO_END
};
	tbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
	gnome_app_fill_toolbar(GTK_TOOLBAR(tbar), toolbar, gtk_accel_group_new());
	gtk_box_pack_start(GTK_BOX(vbox1), tbar, TRUE, TRUE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), vbox1, TRUE, TRUE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), vbox2, TRUE, TRUE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), vbox3, TRUE, TRUE, 0);
	gtk_box_pack_start(GTK_BOX(vbox2), drawing_area, TRUE, TRUE, 5);
	gtk_drawing_area_size(GTK_DRAWING_AREA(drawing_area), SPACE_INTER+CARD_WS*4, SPACE_INTER+CARD_HS*3);
	gtk_box_pack_start(GTK_BOX(vbox3), gtk_label_new("Player"), TRUE, TRUE, 1);
	playerscore = gtk_label_new("0");
	gtk_box_pack_start(GTK_BOX(vbox3), playerscore, TRUE, TRUE, 1);
	gtk_box_pack_start(GTK_BOX(vbox3), gtk_label_new("Computer"), TRUE, TRUE, 1);
	computerscore = gtk_label_new("0");
	gtk_box_pack_start(GTK_BOX(vbox3), computerscore, TRUE, TRUE, 1);
	gtk_box_pack_start(GTK_BOX(vbox3), gtk_label_new("Cards Remaining"), TRUE, TRUE, 1);
	cards_remain = gtk_label_new("81");
	gtk_box_pack_start(GTK_BOX(vbox3), cards_remain, TRUE, TRUE, 1);
	gtk_container_add(GTK_CONTAINER(window), vbox);
	gtk_widget_show_all(window);

	gtk_idle_add( myidle, NULL);


/************************ Start Deck Setup *************************/
unsigned char *pixmap_data[] = {
    bean_e_bits,
    bean_s_bits,
    bean_f_bits,
    blob_e_bits,
    blob_s_bits,
    blob_f_bits,
    diamond_e_bits,
    diamond_s_bits,
    diamond_f_bits
  };
  int i, j;
  GdkWindow *wn = window->window;
  GdkColor col[4];
  GdkColormap *cmap = gdk_window_get_colormap(wn);
  GdkGC *gc;
  GtkStyle *style = gtk_widget_get_style(window);
  col[0].red = 54000; col[0].green = col[0].blue = 0;
  col[1].green = 40000; col[1].red = col[1].blue = 0;
  col[2].red = col[2].blue = 32000; col[2].green = 0;
  gdk_color_white(cmap, &white);
  gdk_color_black(cmap, &black);
  blue.red = blue.green = 0; blue.blue = 48000;
  gdk_color_alloc(cmap, &blue);
  for (i=0; i<3; i++)
    gdk_color_alloc(cmap, &col[i]);
  for (i=0; i<9; i++)
    for (j=0; j<3; j++)
      card_pixmap[i*3+j] = gdk_pixmap_create_from_data(wn, (gchar*) pixmap_data[i],
        SHAPE_W, SHAPE_H, -1, &col[j], &white);
  /* free colors? !! */

  gc = gdk_gc_new(wn);

  /*** cards in normal state ***/
  card_bkg = gdk_pixmap_new(wn, CARD_WIDTH, CARD_HEIGHT, -1);
  /* clear the card */
  gdk_gc_set_foreground(gc, &style->bg[GTK_STATE_NORMAL]);
  gdk_draw_rectangle(card_bkg, gc, 1, 0, 0, CARD_WIDTH, CARD_HEIGHT);
  /* draw corner arcs */
  gdk_gc_set_foreground(gc, &white);
  gdk_draw_arc(card_bkg, gc, 1, 0,                 0,
    2*ARC_SIZE, 2*ARC_SIZE, 90*64,  90*64);
  gdk_draw_arc(card_bkg, gc, 1, CARD_WIDTH-2*ARC_SIZE, 0,
    2*ARC_SIZE, 2*ARC_SIZE, 0,      90*64);
  gdk_draw_arc(card_bkg, gc, 1, 0,                 CARD_HEIGHT-2*ARC_SIZE,
    2*ARC_SIZE, 2*ARC_SIZE, 180*64, 90*64);
  gdk_draw_arc(card_bkg, gc, 1, CARD_WIDTH-2*ARC_SIZE,
    CARD_HEIGHT-2*ARC_SIZE, 2*ARC_SIZE, 2*ARC_SIZE, 270*64, 90*64);
  /* draw the rest */
  gdk_draw_rectangle(card_bkg, gc, 1, ARC_SIZE, 0, CARD_WIDTH-2*ARC_SIZE, CARD_HEIGHT);
  gdk_draw_rectangle(card_bkg, gc, 1, 0, ARC_SIZE, CARD_WIDTH, CARD_HEIGHT-2*ARC_SIZE);
	  gdk_gc_destroy(gc);

/************************ End Deck Setup *************************/



  /* done setting up for once 
	  to draw
	  wn = drawing_area->window;
	  gc-gdk_gc_new(wn);
	  card1.draw();
	  .............draw();
	  gdk_gc_destroy();
	  
	  
	  Card(int colr, int shp, int num, int shdng);
  */
 

		mytable.Draw();
	gtk_main();
	return 0;
}	
コード例 #3
0
ファイル: menus.c プロジェクト: jeansch/yank-component
        GNOME_APP_UI_ITEM, N_("TextNote"), N_("Add a TextNote"), cb_new_text,
        NULL, NULL, GNOME_APP_PIXMAP_DATA, 0,
        (gchar)NULL, GDK_CONTROL_MASK
    },
    {
        GNOME_APP_UI_ITEM, N_("CheckNote"), N_("Add a CheckNote"),
        cb_new_check, NULL, NULL, GNOME_APP_PIXMAP_DATA, 0,
        (gchar)NULL, GDK_CONTROL_MASK
    },
    {
        GNOME_APP_UI_ITEM, N_("TodoNote"), N_("Add a TodoNote"), cb_new_todo,
        NULL, NULL, GNOME_APP_PIXMAP_DATA, 0,
        (gchar)NULL, GDK_CONTROL_MASK
    },
    GNOMEUIINFO_SEPARATOR,
    GNOMEUIINFO_ITEM_STOCK(N_("Delete"), N_("Delete note(s)"),
                           cb_delete_dialog, GNOME_STOCK_PIXMAP_TRASH),
    GNOMEUIINFO_ITEM_STOCK(N_("Find"), N_("Find in notes"), cb_search_dialog,
                           GNOME_STOCK_PIXMAP_SEARCH),
#ifdef USE_GNOME_PRINT
    GNOMEUIINFO_ITEM_STOCK(N_("Print"), N_("Print selected note(s)"),
                           cb_print_notes, GNOME_STOCK_PIXMAP_PRINT),
#endif  /* USE_GNOME_PRINT */
    GNOMEUIINFO_SEPARATOR,
/*     GNOMEUIINFO_ITEM_STOCK(N_("Quit"), N_("Quit yank"), cb_exit, */
/*                            GNOME_STOCK_PIXMAP_QUIT), */
    GNOMEUIINFO_END
};

static GnomeUIInfo tree_item_edit_popup [] =
{
    GNOMEUIINFO_MENU_CUT_ITEM(cb_edit_cut_tree, NULL),
コード例 #4
0
static void
gnome_toggle_hex (GtkWidget *widget, WView *view)
{
	toggle_hex_mode (view);
}

static void
gnome_monitor (GtkWidget *widget, WView *view)
{
	set_monitor (view, 1);
}

GnomeUIInfo gview_file_menu [] = {
	GNOMEUIINFO_ITEM_STOCK (N_("Goto line"),
				N_("Jump to a specified line number"),
				&gnome_goto_line, GNOME_STOCK_PIXMAP_JUMP_TO),
	GNOMEUIINFO_ITEM (N_("Monitor file"), N_("Monitor file growing"),            &gnome_monitor, NULL),
	GNOMEUIINFO_ITEM_STOCK (N_("Close"),
				N_("Close the viewer"),
				&gview_quit, GNOME_STOCK_PIXMAP_QUIT),
	{ GNOME_APP_UI_ENDOFINFO, 0, 0 }
};

GnomeUIInfo gview_search_menu [] = {
	GNOMEUIINFO_ITEM_STOCK (N_("Search"),
				N_("String search"),
				gnome_normal_search_cmd, GNOME_STOCK_MENU_SEARCH),
	GNOMEUIINFO_ITEM_STOCK (N_("Regexp search"),
				N_("Regular expression search"),
				gnome_regexp_search_cmd, GNOME_STOCK_MENU_SEARCH),
コード例 #5
0
ファイル: interface.c プロジェクト: JeroenDeDauw/teg
	GNOMEUIINFO_END
};

GnomeUIInfo toolbar_main[] =
{
	{GNOME_APP_UI_ITEM, N_("Connect"), N_("Connect to server"),
	on_connect_activate, NULL, NULL,
	GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_NEW, 0, 0, NULL},

	{GNOME_APP_UI_ITEM, N_("Start"), N_("Start the game"),
	on_start_activate, NULL, NULL,
	GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_TIMER, 0, 0, NULL},

	GNOMEUIINFO_SEPARATOR,

	GNOMEUIINFO_ITEM_STOCK (N_("Send armies"), N_("Send your armies"), on_enviarfichas_activate, STOCK_SENDARMIES),

	{GNOME_APP_UI_ITEM, N_("1. Regroup"), N_("Regroup your armies, moving from one country to another"),
	on_reagrupe_activate, NULL, NULL,
	GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_REFRESH, 0, 0, NULL},

	GNOMEUIINFO_ITEM_STOCK (N_("2. Get card"), N_("Get a country card"), on_pedirtarjeta_activate, STOCK_GETCARD),

	GNOMEUIINFO_ITEM_STOCK (N_("3. End turn"), N_("Pass the turn to another player"), on_endturn_activate, STOCK_ENDTURN),

	GNOMEUIINFO_SEPARATOR,

	GNOMEUIINFO_ITEM_STOCK (N_("View players"), N_("View players status"), on_status_activate, STOCK_VIEWPLAYERS),
#if 0
	GNOMEUIINFO_ITEM_STOCK (N_("In"), NULL, canvas_map_zoom_in, STOCK_ZOOM_IN),
	GNOMEUIINFO_ITEM_STOCK (N_("Out"), NULL,canvas_map_zoom_out, STOCK_ZOOM_OUT),