static void Init() { static PixmapT recycled[2]; chunky[0] = &recycled[0]; chunky[1] = &recycled[1]; InitSharedPixmap(chunky[0], WIDTH, HEIGHT, PM_GRAY4, screen[0]->planes[1]); InitSharedPixmap(chunky[1], WIDTH, HEIGHT, PM_GRAY4, screen[1]->planes[1]); UVMapRender = MemAlloc(UVMapRenderSize, MEMF_PUBLIC); textureHi = NewPixmap(texture->width, texture->height * 2, PM_CMAP, MEMF_PUBLIC); textureLo = NewPixmap(texture->width, texture->height * 2, PM_CMAP, MEMF_PUBLIC); MakeUVMapRenderCode(); PixmapScramble(texture, textureHi, textureLo); custom->dmacon = DMAF_SETCLR | DMAF_BLITTER; ITER(i, 0, 4, BlitterClearSync(screen[0], i)); ITER(i, 0, 4, BlitterClearSync(screen[1], i)); memset(screen[0]->planes[4], 0x55, WIDTH * HEIGHT * 4 / 8); memset(screen[1]->planes[4], 0x55, WIDTH * HEIGHT * 4 / 8); cp = NewCopList(1024); MakeCopperList(cp); CopListActivate(cp); custom->dmacon = DMAF_SETCLR | DMAF_RASTER; custom->intena = INTF_SETCLR | INTF_BLIT; }
void GTKMusicBrowser::CreateToolbar(GtkWidget *vbox) { toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH); gtk_toolbar_set_button_relief(GTK_TOOLBAR(toolbar), GTK_RELIEF_NONE); gtk_toolbar_set_space_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_SPACE_LINE); gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "New Playlist", "Start Editing a new Playlist", "Toolbar/New", NewPixmap(new_pic), GTK_SIGNAL_FUNC(new_plist_tool), this); gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Save Playlist", "Save the Current Playlist to Disk", "Toolbar/Save", NewPixmap(save_pic), GTK_SIGNAL_FUNC(save_list_tool), this); gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Import Items", "Import a Playlist or Track into My Music", "Toolbar/Import", NewPixmap(import_pic), GTK_SIGNAL_FUNC(import_tool), this); toolRemove = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Remove Track", "Remove a Track from the Playlist", "Toolbar/Remove", NewPixmap(trash_pic), GTK_SIGNAL_FUNC(remove_tool), this); gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Edit", "Edit a Track or Playlist", "Toolbar/Edit", NewPixmap(edit_pic), GTK_SIGNAL_FUNC(edit_tool), this); gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); addTrack = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Add Items", "Add Music from My Music to the Playlist", "Toolbar/AddItem", NewPixmap(add_track_pic), GTK_SIGNAL_FUNC(add_track_tool), this); addFile = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Add File", "Add a File to the Playlist", "Toolbar/Add", NewPixmap(add_file), GTK_SIGNAL_FUNC(add_tool), this); toolUp = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Move Up", "Move The Currently Selected Track in the Playlist Up", "Toolbar/Up", NewPixmap(up_pic), GTK_SIGNAL_FUNC(move_up_tool), this); toolDown = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Move Down", "Move the Currently Selected Track in the Playlist Down", "Toolbar/Down", NewPixmap(down_pic), GTK_SIGNAL_FUNC(move_down_tool), this); gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, TRUE, 0); SetToolbarType(); gtk_widget_show(toolbar); }
/* -------------------------------------------------------------------- */ void ResizeDiffWindow(Widget w, XtPointer client, XtPointer call) { int n, depth; Arg args[5]; n = 0; XtSetArg(args[n], XmNwidth, &diffPlot.x.windowWidth); ++n; XtSetArg(args[n], XmNheight, &diffPlot.x.windowHeight); ++n; XtSetArg(args[n], XmNdepth, &depth); ++n; XtGetValues(diffPlot.canvas, args, n); NewPixmap(&diffPlot, diffPlot.x.windowWidth, diffPlot.x.windowHeight, depth); diffPlot.x.HD = (int)(diffPlot.x.windowWidth * 0.83); diffPlot.x.VD = (int)(diffPlot.x.windowHeight * 0.691); diffPlot.x.LV = (int)(diffPlot.x.windowWidth * 0.104); diffPlot.x.TH = (int)(diffPlot.x.windowHeight * 0.09); diffPlot.x.RV = diffPlot.x.LV + diffPlot.x.HD; diffPlot.x.BH = diffPlot.x.TH + diffPlot.x.VD; diffPlot.x.ticLength = diffPlot.x.HD > 400 ? 10 : 5; diffPlot.x.yLabelOffset = 10; diffPlot.x.yTicLabelOffset = 5; diffPlot.x.xTicLabelOffset = 20; diffPlot.x.xLegendText = 55; fontOffset = (diffPlot.x.windowWidth < 400) ? 1 : 0; } /* END RESIZEDIFFWINDOW */
void CreateErrorDialog(ErrorDialog * errorDialog, GtkWidget * window) { GtkWidget *button, *hbox, *pixmap; errorDialog->dialog = gtk_dialog_new(); gtk_window_set_title(GTK_WINDOW(errorDialog->dialog), _("Error")); gtk_window_set_modal(GTK_WINDOW(errorDialog->dialog), TRUE); gtk_window_position(GTK_WINDOW(errorDialog->dialog), GTK_WIN_POS_MOUSE); gtk_container_set_border_width(GTK_CONTAINER(errorDialog->dialog), 5); gtk_signal_connect(GTK_OBJECT(errorDialog->dialog), "delete_event", GTK_SIGNAL_FUNC(DeleteEvent), NULL); button = gtk_button_new_with_label(_("Cancel")); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(errorDialog->dialog)->action_area), button, FALSE, FALSE, 0); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(CancelDialog), (gpointer) errorDialog->dialog); GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); gtk_widget_grab_default(button); gtk_widget_show(button); hbox = gtk_hbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(errorDialog->dialog)->vbox), hbox); gtk_widget_show(hbox); if (window) { pixmap = NewPixmap(stop_xpm, window->window, &window->style->bg[GTK_STATE_NORMAL]); gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, FALSE, 10); gtk_widget_show(pixmap); } errorDialog->text = gtk_label_new(""); gtk_box_pack_start(GTK_BOX(hbox), errorDialog->text, FALSE, FALSE, 10); gtk_widget_show(errorDialog->text); }
void CreateInfoDialog(InfoDialog * infoDialog, GtkWidget * window) { GtkWidget *hbox, *pixmap; infoDialog->dialog = gtk_dialog_new(); gtk_window_set_title(GTK_WINDOW(infoDialog->dialog), _("Info")); gtk_window_set_modal(GTK_WINDOW(infoDialog->dialog), TRUE); gtk_window_position(GTK_WINDOW(infoDialog->dialog), GTK_WIN_POS_MOUSE); gtk_container_set_border_width(GTK_CONTAINER(infoDialog->dialog), 5); gtk_signal_connect(GTK_OBJECT(infoDialog->dialog), "delete_event", GTK_SIGNAL_FUNC(DeleteEvent), NULL); hbox = gtk_hbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(infoDialog->dialog)->vbox), hbox); gtk_widget_show_now(hbox); if (window) { pixmap = NewPixmap(info_xpm, window->window, &window->style->bg[GTK_STATE_NORMAL]); gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, FALSE, 10); gtk_widget_show_now(pixmap); } infoDialog->text = gtk_label_new(""); gtk_box_pack_start(GTK_BOX(hbox), infoDialog->text, FALSE, FALSE, 10); gtk_widget_show_now(infoDialog->text); }
void GUI_CreateSpeedDialWindow(void) { int nmenu_items = sizeof(menu_items) / sizeof(menu_items[0]); GtkItemFactory *item_factory; GtkAccelGroup *accel_group; SortColumn *sColumn; GtkWidget *menubar; GtkWidget *main_vbox; GtkWidget *toolbar; GtkWidget *clistScrolledWindow; register gint i; gchar *titles[3] = { _("Key"), _("Name"), _("Number") }; InitMainMenu(); GUI_SpeedDialWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_wmclass(GTK_WINDOW(GUI_SpeedDialWindow), "SpeedDialWindow", "Xgnokii"); gtk_window_set_title(GTK_WINDOW(GUI_SpeedDialWindow), _("Speed Dial")); gtk_widget_set_usize(GTK_WIDGET(GUI_SpeedDialWindow), 350, 220); //gtk_container_set_border_width (GTK_CONTAINER (GUI_SpeedDialWindow), 10); gtk_signal_connect(GTK_OBJECT(GUI_SpeedDialWindow), "delete_event", GTK_SIGNAL_FUNC(DeleteEvent), NULL); gtk_widget_realize(GUI_SpeedDialWindow); accel_group = gtk_accel_group_new(); item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", accel_group); gtk_item_factory_create_items(item_factory, nmenu_items, menu_items, NULL); gtk_window_add_accel_group(GTK_WINDOW(GUI_SpeedDialWindow), accel_group); /* Finally, return the actual menu bar created by the item factory. */ menubar = gtk_item_factory_get_widget(item_factory, "<main>"); main_vbox = gtk_vbox_new(FALSE, 1); gtk_container_border_width(GTK_CONTAINER(main_vbox), 1); gtk_container_add(GTK_CONTAINER(GUI_SpeedDialWindow), main_vbox); gtk_widget_show(main_vbox); gtk_box_pack_start(GTK_BOX(main_vbox), menubar, FALSE, FALSE, 0); gtk_widget_show(menubar); /* Create the toolbar */ toolbar = gtk_toolbar_new(); gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS); gtk_toolbar_set_orientation(GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL); gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), NULL, _("Read from phone"), NULL, NewPixmap(Read_xpm, GUI_SpeedDialWindow->window, &GUI_SpeedDialWindow->style->bg[GTK_STATE_NORMAL]), (GtkSignalFunc) ReadSpeedDial, NULL); gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), NULL, _("Save to phone"), NULL, NewPixmap(Send_xpm, GUI_SpeedDialWindow->window, &GUI_SpeedDialWindow->style->bg[GTK_STATE_NORMAL]), (GtkSignalFunc) SaveSpeedDial, NULL); gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), NULL, _("Import from file"), NULL, NewPixmap(Open_xpm, GUI_SpeedDialWindow->window, &GUI_SpeedDialWindow->style->bg[GTK_STATE_NORMAL]), (GtkSignalFunc) ImportSpeedDial, NULL); gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), NULL, _("Export to file"), NULL, NewPixmap(Save_xpm, GUI_SpeedDialWindow->window, &GUI_SpeedDialWindow->style->bg[GTK_STATE_NORMAL]), (GtkSignalFunc) ExportSpeedDial, NULL); gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), NULL, _("Edit entry"), NULL, NewPixmap(Edit_xpm, GUI_SpeedDialWindow->window, &GUI_SpeedDialWindow->style->bg[GTK_STATE_NORMAL]), (GtkSignalFunc) EditKey, NULL); gtk_box_pack_start(GTK_BOX(main_vbox), toolbar, FALSE, FALSE, 0); gtk_widget_show(toolbar); clist = gtk_clist_new_with_titles(3, titles); gtk_clist_set_shadow_type(GTK_CLIST(clist), GTK_SHADOW_OUT); // gtk_clist_set_compare_func (GTK_CLIST (clist), CListCompareFunc); gtk_clist_set_sort_column(GTK_CLIST(clist), 0); gtk_clist_set_sort_type(GTK_CLIST(clist), GTK_SORT_ASCENDING); gtk_clist_set_auto_sort(GTK_CLIST(clist), FALSE); //gtk_clist_set_selection_mode (GTK_CLIST (clist), GTK_SELECTION_EXTENDED); gtk_clist_set_column_width(GTK_CLIST(clist), 1, 150); gtk_clist_set_column_width(GTK_CLIST(clist), 2, 115); gtk_clist_set_column_justification(GTK_CLIST(clist), 0, GTK_JUSTIFY_CENTER); // gtk_clist_set_column_visibility (GTK_CLIST (clist), 3, xgnokiiConfig.callerGroupsSupported); for (i = 0; i < 3; i++) { if ((sColumn = g_malloc(sizeof(SortColumn))) == NULL) { g_print(_("Error: %s: line %d: Can't allocate memory!\n"), __FILE__, __LINE__); gtk_main_quit(); } sColumn->clist = clist; sColumn->column = i; gtk_signal_connect(GTK_OBJECT(GTK_CLIST(clist)->column[i].button), "clicked", GTK_SIGNAL_FUNC(SetSortColumn), (gpointer) sColumn); } gtk_signal_connect(GTK_OBJECT(clist), "select_row", GTK_SIGNAL_FUNC(ClickEntry), NULL); clistScrolledWindow = gtk_scrolled_window_new(NULL, NULL); gtk_container_add(GTK_CONTAINER(clistScrolledWindow), clist); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(clistScrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start(GTK_BOX(main_vbox), clistScrolledWindow, TRUE, TRUE, 0); gtk_widget_show(clist); gtk_widget_show(clistScrolledWindow); questMark.pixmap = gdk_pixmap_create_from_xpm_d(GUI_SpeedDialWindow->window, &questMark.mask, &GUI_SpeedDialWindow->style-> bg[GTK_STATE_NORMAL], quest_xpm); CreateErrorDialog(&errorDialog, GUI_SpeedDialWindow); CreateInfoDialog(&infoDialog, GUI_SpeedDialWindow); speedDialInitialized = FALSE; }