void KPrinter::loadSettings() { d->m_options = d->m_impl->loadOptions(); // load the last printer used in the current process (if any) // and remove the corresponding entry in the option map, as it // is not needed anymore setSearchName(option("kde-searchname")); d->m_options.remove("kde-searchname"); KConfig *conf = KGlobal::config(), *pconf = KMFactory::self()->printConfig(); conf->setGroup("KPrinter Settings"); pconf->setGroup("General"); // load latest used printer from config file, if required in the options if (searchName().isEmpty() && pconf->readBoolEntry("UseLast", true)) setSearchName(conf->readEntry("Printer")); // latest used print command setOption("kde-printcommand",conf->readPathEntry("PrintCommand")); // latest used document directory setDocDirectory( conf->readPathEntry( "DocDirectory" ) ); setDocFileName( "print" ); }
// GetSessionView //--------------------------------------------------------------------------- GetSessionView::GetSessionView() : MenuTemplateView() { setSearchName("GetSessionView"); setTitle("Select Session"); setSubTitle(""); // Join. addSpecialButton( joinPos, "Join", bJoin); // Host. addSpecialButton( hostPos, "Host", bHost); // Next. addSpecialButton( nextPos, "Next", bNext); // Back. addSpecialButton( backPos, "Back", bBack); } // end GetSessionView::GetSessionView
// OrderingView //--------------------------------------------------------------------------- OrderingView::OrderingView() : MenuTemplateView() { setSearchName("OrderingView"); setTitle("Ordering Information"); setSubTitle(""); } // end OrderingView::OrderingView
// reset //--------------------------------------------------------------------------- // Purpose: Reset all the settings for this window. //--------------------------------------------------------------------------- void View::reset() { min.zero(); max.zero(); status = 0; searchName = 0; title = 0; subTitle = 0; statusText = 0; focusComponent = 0; setSearchName("donut"); setTitle("donut"); setSubTitle("donut"); removeComponents(); moveAreaHeight = DEFAULT_MOVE_AREA_HEIGHT; borderSize = DEFAULT_BORDER_SIZE; snapToTolerance = DEFAULT_SNAP_TOLERANCE; setAllowResize(true); setAllowMove(true); setBordered(true); setVisible(false); setDisplayStatusBar(false); setAlwaysOnBottom(false); //setScrollBar(false); } // end reset
EndRoundView::EndRoundView() : SpecialButtonView() { setSearchName("EndRoundView"); setTitle("Round stats"); setSubTitle(""); setAllowResize(false); setAllowMove(false); setVisible(false); setBordered(false); int x = (screen->getWidth() / 2) - 250; int y = (screen->getHeight() / 2) - 250; moveTo(iXY(x, y)); resize(iXY(500, 500)); checkArea(iXY(screen->getWidth(),screen->getHeight())); allyImage.loadBMP("pics/default/ally.bmp"); allyRequestImage.loadBMP("pics/default/allyRequest.bmp"); allyOtherImage.loadBMP("pics/default/allyOther.bmp"); noAllyImage.loadBMP("pics/default/noAlly.bmp"); colorImage.loadBMP("pics/default/playerColor.bmp"); selected_line = -1; RectWinner = getClientRect(); RectWinner.min.x = RectWinner.min.y = 0; RectStates = RectWinner; RectWinner.max.y = HEADER_HEIGHT-10; RectStates.min.y = HEADER_HEIGHT; } // end EndRoundView::EndRoundView
// AreYouSureResignView //--------------------------------------------------------------------------- AreYouSureResignView::AreYouSureResignView() : SpecialButtonView() { setSearchName("AreYouSureResignView"); setTitle(_("Resign")); setSubTitle(""); loaded = false; } // end AreYouSureResignView::AreYouSureResignView
// UnitSelectionView //--------------------------------------------------------------------------- UnitSelectionView::UnitSelectionView() : View() { setSearchName("UnitSelectionView"); setTitle("Selects Your Units"); setSubTitle(""); setAllowResize(false); setAllowMove(false); setDisplayStatusBar(true); setVisible(false); moveTo(bodyTextRect.min); resize(bodyTextRect.getSize()); //setScrollBar(true); maxYOffset = 0; // Define the scrollBar fot this view. scrollBar = new ScrollBar(HORIZONTAL, 0, 1, 0, 100); add(scrollBar); } // end UnitSelectionView::UnitSelectionView
// UnitColorView //--------------------------------------------------------------------------- UnitColorView::UnitColorView() : View() { setSearchName("UnitColorView"); setTitle("Selects Your Unit Color"); setSubTitle(""); setAllowResize(false); setAllowMove(false); setVisible(false); Surface unitSurface; moveTo(400, 200); packedBody.load("units/pics/pak/TitaHNSD.pak"); packedBody.setFPS(12); packedTurret.load("units/pics/pak/TitaTNSD.pak"); packedTurret.setFPS(8); grassSurface.loadBMP("pics/grass.bmp"); fuckingSurface.create(packedTurret.getWidth(), packedTurret.getHeight(), 1); fuckingSurface.fill(0); resizeClientArea(packedTurret.getWidth(), packedTurret.getHeight()); int size = packedTurret.getWidth() / 2; addButtonCenterText(iXY(0, 0), size, "Up", "", bIncreaseBrightness); addButtonCenterText(iXY(size, 0), size, "Down", "", bDecreaseBrightness); setGrayColorTable(); rebuildGrayColorTable(); } // end UnitColorView::UnitColorView
// HostJoinTemplateView //--------------------------------------------------------------------------- HostJoinTemplateView::HostJoinTemplateView() : MenuTemplateView() { setSearchName("HostJoinTemplateView"); setTitle(""); setSubTitle(""); add( new newButton( "PLAY", "Play", playPos, 1) ); } // end HostJoinTemplateView constructor
// AreYouSureExitView //--------------------------------------------------------------------------- AreYouSureExitView::AreYouSureExitView() : SpecialButtonView() { setSearchName("AreYouSureExitView"); setTitle("Exit netPanzer"); setSubTitle(""); } // end AreYouSureExitView::AreYouSureExitView
// RankView //--------------------------------------------------------------------------- RankView::RankView() : GameTemplateView() { setSearchName("RankView"); setTitle("Rankings"); setSubTitle(" - TAB"); setAllowResize(false); moveTo(GameConfig::interface_rankposition_x, GameConfig::interface_rankposition_y); resize(iXY(WINDOW_WIDTH, 200)); checkArea(iXY(screen->getWidth(),screen->getHeight())); // Define the scrollBar fot this view. scrollBar = new ScrollBar(ScrollBar::VERTICAL, 0, 1, 0, 100); if (scrollBar == 0) { throw Exception("ERROR: Unable to allocate the scrollBar."); } allyImage.loadBMP("pics/default/ally.bmp"); allyRequestImage.loadBMP("pics/default/allyRequest.bmp"); allyOtherImage.loadBMP("pics/default/allyOther.bmp"); noAllyImage.loadBMP("pics/default/noAlly.bmp"); colorImage.loadBMP("pics/default/playerColor.bmp"); selected_line = -1; } // end RankView::RankView
// GameTemplateView //--------------------------------------------------------------------------- GameTemplateView::GameTemplateView() : View() { setSearchName("GameTemplateView"); setTitle("Game Template"); setSubTitle(""); } // end GameTemplateView::GameTemplateView
// LibView //--------------------------------------------------------------------------- LibView::LibView() : GameTemplateView() { setSearchName("LibView"); setTitle("Lib Stats"); setSubTitle(" - F5"); setAllowResize(false); setAllowMove(true); setDisplayStatusBar(false); setVisible(false); moveTo(0, 0); resize(325, 375); addButtonCenterText(iXY((getClientRect().getSize().x / 3) * 0, 0), getClientRect().getSize().x / 3, "Surface", "", bSurfaceInfo); addButtonCenterText(iXY((getClientRect().getSize().x / 3) * 1, 0), getClientRect().getSize().x / 3, "Particles", "", bParticleInfo); addButtonCenterText(iXY((getClientRect().getSize().x / 3) * 2, 0), getClientRect().getSize().x / 3, "Environment", "", bEnvironmentInfo); checkBoxAllowParticleGeneration.setLabel("Allow Particle Generation"); checkBoxAllowParticleGeneration.setLocation(0, 15); checkBoxAllowParticleGeneration.setState(Particle2D::getCreateParticles()); add(&checkBoxAllowParticleGeneration); checkBoxAllowTimeSlice.setLabel("Allow Time Slice"); checkBoxAllowTimeSlice.setLocation(0, 30); checkBoxAllowTimeSlice.setState(gTimeSliceFlag); add(&checkBoxAllowTimeSlice); checkBoxAllowSpanBlitting.setLabel("Allow Blended Span Blitting"); checkBoxAllowSpanBlitting.setLocation(0, 45); checkBoxAllowSpanBlitting.setState(allowSpanBlitting); add(&checkBoxAllowSpanBlitting); checkBoxParticlesCanHaveSmoke.setLabel("Allow Explosion Particle Smoke"); checkBoxParticlesCanHaveSmoke.setLocation(0, 60); checkBoxParticlesCanHaveSmoke.setState(ParticleInterface::gParticlesCanHaveSmoke); add(&checkBoxParticlesCanHaveSmoke); checkBoxSolidColorExplosionParticles.setLabel("Solid Color Explosion Particles"); checkBoxSolidColorExplosionParticles.setLocation(0, 75); checkBoxSolidColorExplosionParticles.setState(ParticleInterface::gSolidColorExplosionParticles); add(&checkBoxSolidColorExplosionParticles); checkBoxParticleInterfaceSim.setLabel("Particle Interface Sim"); checkBoxParticleInterfaceSim.setLocation(0, 90); checkBoxParticleInterfaceSim.setState(ParticleInterface::gTestSim); add(&checkBoxParticleInterfaceSim); checkBoxSolidBackground.setLabel("Solid Background"); checkBoxSolidBackground.setLocation(0, 105); checkBoxSolidBackground.setState(GameView::gDrawSolidBackground); add(&checkBoxSolidBackground); checkBoxDrawExplosionParticleCount.setLabel("Draw Explosion Particle Count"); checkBoxDrawExplosionParticleCount.setLocation(0, 120); checkBoxDrawExplosionParticleCount.setState(ParticleInterface::gDrawExplosionParticleCount); add(&checkBoxDrawExplosionParticleCount); } // end LibView::LibView
// MainMenuView //--------------------------------------------------------------------------- MainMenuView::MainMenuView() : MenuTemplateView() { setSearchName("MainView"); setTitle("Main"); setSubTitle(""); setVisible(true); } // end MainMenuView::MainMenuView
// SoundView //--------------------------------------------------------------------------- SoundView::SoundView() : OptionsTemplateView() { setSearchName("SoundView"); setTitle("Sound Options"); initButtons(); } // end SoundView::SoundView
// OptionsTemplateView //--------------------------------------------------------------------------- OptionsTemplateView::OptionsTemplateView() : MenuTemplateView() { setSearchName("OptionsView"); setTitle("OptionsTemplate"); setSubTitle(""); initButtons(); } // end OptionsTemplateView::OptionsTemplateView
IRCLobbyView::IRCLobbyView() : View() { lobby_connection=0; change_name=0; skipChatLines=0; lobby_view_height=184; total_displayed_servers=0; setSearchName("IRCLobbyView"); setTitle("Lobby"); setSubTitle(""); setAllowResize(false); setAllowMove(false); setVisible(false); topViewableItem=0; moveTo(iXY(bodyTextRect.max.x-440, bodyTextRect.min.y + 170)); iXY area_size = iXY(440, lobby_view_height); resizeClientArea(area_size); int chat_y=lobby_view_height-(Surface::getFontHeight()*2); addButtonCenterText(iXY(getClientRect().getSizeX()-80, chat_y), 80, "Refresh", "", buttonRefresh); szChat.init(" ", 255,39); cInputField* input = addInputField(iXY(4, chat_y), &szChat, "", true); input->setReturnAction(chatReturnPressed); server_list_end_y=(Surface::getFontHeight()*6); chat_list_end_y=getClientRect().getSizeY()-(Surface::getFontHeight()*2); server_list_end_x=(getClientRect().getSizeX()-12); iXY size(12, 12); iXY pos(getClientRect().getSizeX() - size.x, 0); serverUpButton.setLabel("-"); serverUpButton.setBounds(iRect(pos, pos + size)); add(&serverUpButton); pos.y= server_list_end_y-size.y; serverDownButton.setLabel("+"); serverDownButton.setBounds(iRect(pos, pos + size)); add(&serverDownButton); pos.y+=size.y; chatUpButton.setLabel("-"); chatUpButton.setBounds(iRect(pos, pos + size)); add(&chatUpButton); pos.y = chat_list_end_y-size.y; chatDownButton.setLabel("+"); chatDownButton.setBounds(iRect(pos, pos + size)); add(&chatDownButton); // XXX ugly ugly ugly if(!lobby_view) lobby_view = this; }
// ControlsView //--------------------------------------------------------------------------- ControlsView::ControlsView() : OptionsTemplateView() { setSearchName("ControlsView"); setTitle("Control Options"); setSubTitle(""); initButtons(); } // end ControlsView::ControlsView
// InterfaceView //--------------------------------------------------------------------------- InterfaceView::InterfaceView() : OptionsTemplateView() { setSearchName("InterfaceView"); setTitle("Interface Options"); setSubTitle(""); initButtons(); } // end InterfaceView::InterfaceView
PrepareTeam::PrepareTeam() : GameTemplateView() { setSearchName("PrepareTeam"); // setTitle(_("Prepare Team")); setAllowMove(false); menuImage.loadPNG("pics/backgrounds/canon.png"); vsImage.loadPNG("pics/backgrounds/vs.png"); moveTo((screen->getWidth()/2) - (menuImage.getWidth()/2), (screen->getHeight()/2) - ( menuImage.getHeight()/1.5)); resize(menuImage.getWidth(), menuImage.getHeight()+300); menuImageXY.x = 0; menuImageXY.y = 0; // rect.position.x = menuImageXY.x+ ((menuImage.getWidth()-500)/2); // rect.position.y = menuImageXY.y+menuImage.getHeight(); // rect.setSize(500,300); // // firstrect.position.x = rect.position.x+7; // firstrect.position.y = rect.position.y+30; // firstrect.setSize(180,rect.size.y-7); // // secondrect.position.x = rect.min.x + rect.size.x - 185; // secondrect.position.y = firstrect.position.y; // secondrect.setSize(rect.size.x-20 ,firstrect.size.y); // // changebutton = Button::createNewSpecialButton( " >> ", // iXY(firstrect.max.x+29, (firstrect.position.y+50)), // (secondrect.position.x-firstrect.max.x)-39, // new ChangeTeamAction(this)); // add(changebutton); // // readybutton = Button::createNewSpecialButton( _("Ready"), // iXY(firstrect.max.x+29, (firstrect.position.y+85)), // (secondrect.position.x-firstrect.max.x)-39, // new PlayerReadyAction(this)); // add(readybutton); // // scTeam1 = new tVScrollBar(); // add(scTeam1); // StateTeam1 = new tPlayerStateBox(firstrect, 0); // StateTeam1->setVscrollBar(scTeam1); // StateTeam1->setShowTeam(0); // add(StateTeam1); // // scTeam2 = new tVScrollBar(); // add(scTeam2); // StateTeam2 = new tPlayerStateBox(secondrect, 0); // StateTeam2->setVscrollBar(scTeam2); // StateTeam2->setShowTeam(1); // add(StateTeam2); // loaded = false; }
// VisualsView //--------------------------------------------------------------------------- VisualsView::VisualsView() : OptionsTemplateView() { setSearchName("VisualsView"); setTitle("Visual Options"); setSubTitle(""); selectedColorStartY = 0; initButtons(); } // end VisualsView::VisualsView
//--------------------------------------------------------------------------- HostView::HostView() : HostJoinTemplateView() { setSearchName("HostView"); setTitle("Host Options"); setSubTitle(""); sprintf(HostView::gameTypeBuf, "Objective"); //addButtonCenterText(iXY(x, y), buttonXSize, "Objective", "", setGameTypeObjective); //x += buttonXSize; //addButtonCenterText(iXY(x, y), buttonXSize, "Frag Limit", "", setGameTypeFragLimit); //addButton(iXY(x + buttonXSize + 1, y), "+", "", increaseFragLimit); //addButton(iXY(x + buttonXSize + 15, y), "-", "", decreaseFragLimit); //x += buttonXSize; //addButtonCenterText(iXY(x, y), buttonXSize, "Time Limit", "", setGameTypeTimeLimit); //addButton(iXY(x + buttonXSize + 1, y), "+", "", increaseTimeLimit); //addButton(iXY(x + buttonXSize + 15, y), "-", "", decreaseTimeLimit); //iXY pos(200, 380); //int yOffset = 20; //choiceAllowAllies.add("Yes"); //choiceAllowAllies.add("No"); //choiceAllowAllies.setLocation(pos); //pos.y += yOffset; //add(&choiceAllowAllies); // //choiceSpawnPlacement.add("Round Robin"); //choiceSpawnPlacement.add("Random"); //choiceSpawnPlacement.setLocation(pos); //pos.y += yOffset; //add(&choiceSpawnPlacement); // //choiceCloudCoverage.add("Clear"); //choiceCloudCoverage.add("Broken"); //choiceCloudCoverage.add("Partly Cloudy"); //choiceCloudCoverage.add("Overcast"); //choiceCloudCoverage.add("Extremely Cloudy"); //choiceCloudCoverage.setLocation(pos); //pos.y += yOffset; //add(&choiceCloudCoverage); // //choiceWindSpeed.add("Calm"); //choiceWindSpeed.add("Breezy"); //choiceWindSpeed.add("Brisk Winds"); //choiceWindSpeed.add("Heavy Winds"); //choiceWindSpeed.add("Typhoon"); //choiceWindSpeed.setLocation(pos); //pos.y += yOffset; //add(&choiceWindSpeed); } // end HostView::HostView
GFlagSelectionView::GFlagSelectionView() : View() { setSearchName("GFlagSelectionView"); setTitle("GFlag Selection"); setSubTitle(""); setAllowResize(false); setAllowMove(false); setVisible(false); setBordered(false); loaded = false; }
// GameView //--------------------------------------------------------------------------- GameView::GameView() : View() { setSearchName("GameView"); setAlwaysOnBottom(true); resize(800,600); moveTo(iXY(0, 0)); add(new InfoBar(0,0)); // will add after input handling is done //add(new MiniMap(100,100)); } // end GameView::GameView
CodeStatsView::CodeStatsView() : GameTemplateView() { setSearchName("CodeStatsView"); setTitle("CodeStatsView"); setSubTitle(" - F4"); setAllowResize(false); setAllowMove(true); setDisplayStatusBar(true); setVisible(false); moveTo(iXY(0, 0)); iXY area_size = iXY(280, 280) ; long bXOffset; INFO_AREA_Y_OFFSET = 2; resizeClientArea(area_size); bXOffset = area_size.x / 3; addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), bXOffset, "Net", "", buttonNetwork); addButtonCenterText(iXY(bXOffset, INFO_AREA_Y_OFFSET), bXOffset, "Sprite", "", buttonSorter); addButtonCenterText(iXY(bXOffset*2, INFO_AREA_Y_OFFSET), bXOffset, "Unit", "", buttonUnit); INFO_AREA_Y_OFFSET += 18; addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), area_size.x, "Path", "", buttonPathing); INFO_AREA_Y_OFFSET += 18; bXOffset = area_size.x / 3; addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), bXOffset, "Debug", "", buttonDebug); addButtonCenterText(iXY(bXOffset, INFO_AREA_Y_OFFSET), bXOffset, "Sample", "", buttonSample); addButtonCenterText(iXY(bXOffset*2, INFO_AREA_Y_OFFSET), bXOffset, "NetLog", "", bNetLog ); INFO_AREA_Y_OFFSET += 18; /* addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), 20, "+", "", bPlusPacketSize ); addButtonCenterText(iXY(25, INFO_AREA_Y_OFFSET), 20, "-", "", bMinusPacketSize ); addButtonCenterText(iXY(50, INFO_AREA_Y_OFFSET), 20, "0", "", bMinusPacketSize ); addButtonCenterText(iXY(65, INFO_AREA_Y_OFFSET), 20, "1", "", bMinusPacketSize ); addButtonCenterText(iXY(45, INFO_AREA_Y_OFFSET), 40, "Send", "", bSend ); INFO_AREA_Y_OFFSET += 18; INFO_AREA_Y_OFFSET += 18; */ display_mode = _display_mode_network_stats; } // end CodeStatsView::CodeStatsView
// RankView //--------------------------------------------------------------------------- RankView::RankView() : GameTemplateView() { setSearchName("RankView"); setTitle("Rankings"); setSubTitle(" - F6"); setAllowResize(false); moveTo(iXY(0, 0)); resize(iXY(450, 200)); centerAbsolute(); const unsigned MAX_NAME_CHARS = 20; const unsigned MAX_FLAG_CHARS = 5; const unsigned MAX_KILLS_CHARS = 6; const unsigned MAX_LOSSES_CHARS = 7; const unsigned MAX_POINTS_CHARS = 7; const unsigned MAX_OBJECTIVE_CHARS = 10; //addLabel(iXY nPos, char *nLabel, BYTE color); unsigned xOffset = 0; unsigned yOffset = 16; addLabel(iXY(xOffset, yOffset), "Name", Color::red); xOffset += MAX_NAME_CHARS*CHAR_XPIX; addLabel(iXY(xOffset, yOffset), "Flag", Color::red); xOffset += MAX_FLAG_CHARS*CHAR_XPIX; addLabel(iXY(xOffset, yOffset), "Kills", Color::red); xOffset += MAX_KILLS_CHARS*CHAR_XPIX; addLabel(iXY(xOffset, yOffset), "Losses", Color::red); xOffset += MAX_LOSSES_CHARS*CHAR_XPIX; addLabel(iXY(xOffset, yOffset), "Points", Color::red); xOffset += MAX_POINTS_CHARS*CHAR_XPIX; addLabel(iXY(xOffset, yOffset), "Objective", Color::red); xOffset += MAX_POINTS_CHARS*CHAR_XPIX; // Define the scrollBar fot this view. scrollBar = new ScrollBar(VERTICAL, 0, 1, 0, 100); if (scrollBar == 0) { throw Exception("ERROR: Unable to allocate the scrollBar."); } //iRect clientRect(getClientRect()); //scrollBar->setViewableAmount(clientRect.getSizeY() / (TEXT_GAP_SPACE + CHAR_YPIX) - 1); //scrollBar->setBlockIncrement(1); //add(scrollBar); } // end RankView::RankView
// init //--------------------------------------------------------------------------- void GameView::init() { setSearchName("GameView"); setTitle("Game"); setSubTitle(""); setBordered(false); setAlwaysOnBottom(true); setAllowResize(false); setDisplayStatusBar(false); setVisible(false); moveTo(iXY(0, 0)); resize(iXY(SCREEN_XPIX, SCREEN_YPIX)); } // end GameView::init
// init //--------------------------------------------------------------------------- void GameView::init() { setSearchName("GameView"); setTitle("Game"); setSubTitle(""); setBordered(false); setAlwaysOnBottom(true); setAllowResize(false); setDisplayStatusBar(false); setVisible(false); moveTo(iXY(0, 0)); resize(iXY(screen->getPixX(), screen->getPixY())); } // end GameView::init
// HostOptionsView //--------------------------------------------------------------------------- HostOptionsView::HostOptionsView() : RMouseHackView() { setSearchName("HostOptionsView"); setTitle("Host Options"); setSubTitle(""); setAllowResize(false); setAllowMove(false); setVisible(false); moveTo(bodyTextRect.min.x, bodyTextRect.min.y + 205); resizeClientArea(bodyTextRect.getSizeX()-5, 168); addMeterButtons(iXY(BORDER_SPACE, BORDER_SPACE)); } // end HostOptionsView::HostOptionsView
// MiniMapView //--------------------------------------------------------------------------- MiniMapView::MiniMapView() : GameTemplateView() { assert(this != 0); setSearchName("MiniMapView"); setTitle("MiniMapView"); setSubTitle(""); setAllowResize(false); setDisplayStatusBar(false); setVisible(false); setAllowMove(true); setBordered(false); resize(160, 160); add(new MiniMap(1,1,158,158)); } // end MiniMapView::MiniMapView