KomposeDesktopWidget::KomposeDesktopWidget(int desktop, QWidget *parent, KomposeLayout *l, const char *name)
    : KomposeTaskContainerWidget( desktop, parent, l, name ),
    highlight(false)
{
  // Retrieve geometry
  //   QDesktopWidget *deskwidget = new QDesktopWidget();
  //   deskRect = deskwidget->screenGeometry();
  //   delete deskwidget;
  initFonts();

  // Set Desktop background as our background
  setBackgroundMode( Qt::NoBackground );

  KWinModule kwinmodule( this, 1 );
  deskName = kwinmodule.desktopName(desktop+1);

  QToolTip::add( this, i18n("Desktop %1 - %2").arg(desktop).arg(deskName) );

  rootpix = new KRootPixmap (this);
  rootpix->start();
  setAcceptDrops(TRUE);

  createTaskWidgets();

  connect( KomposeTaskManager::self(), SIGNAL( newTask( KomposeTask* ) ), this, SLOT( createTaskWidget( KomposeTask* ) ) );

  setFocusPolicy(QWidget::ClickFocus);

}
示例#2
0
文件: buffwindow.cpp 项目: kerlw/Dawn
BuffWindow::BuffWindow( Player *player ) : FramesBase ( 0, 0, 0, 0, 0, 0 )
{
  initFonts();
  loadTextures();
  toggle();
  this->player = player;
  tooltip = NULL;
  posY = Configuration::screenHeight - 50;
  posX = Configuration::screenWidth - 204;
}
示例#3
0
Common::Error Parallaction_br::init() {

	_screenWidth = 640;
	_screenHeight = 400;

	if (getPlatform() == Common::kPlatformPC) {
		if (getFeatures() & GF_DEMO) {
			_disk = new DosDemoDisk_br(this);
		} else {
			_disk = new DosDisk_br(this);
		}
		_disk->setLanguage(2);					// NOTE: language is now hardcoded to English. Original used command-line parameters.
		MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM);
		MidiDriver *driver = MidiDriver::createMidi(dev);
		_soundManI = new DosSoundMan_br(this, driver);
	} else {
		_disk = new AmigaDisk_br(this);
		_disk->setLanguage(2);					// NOTE: language is now hardcoded to English. Original used command-line parameters.
		_soundManI = new AmigaSoundMan_br(this);
	}

	_disk->init();
	_soundMan = new SoundMan(_soundManI);

	initResources();
	initFonts();
	_locationParser = new LocationParser_br(this);
	_locationParser->init();
	_programParser = new ProgramParser_br(this);
	_programParser->init();

	_cmdExec = new CommandExec_br(this);
	_programExec = new ProgramExec_br(this);

	_walker = new PathWalker_BR;

	_part = -1;
	_nextPart = -1;

	_subtitle[0] = 0;
	_subtitle[1] = 0;

	memset(_zoneFlags, 0, sizeof(_zoneFlags));

	_countersNames = 0;

	_saveLoad = new SaveLoad_br(this, _saveFileMan);

	initInventory();
	setupBalloonManager();

	Parallaction::init();

	return Common::kNoError;
}
示例#4
0
void setupDisplay(gDisplay *d) {
  printf("trying to create window\n");
  d->win_id = initWindow();
  printf("window created\n");
  /* printf("win_id is %d\n", d->win_id); */
  printf("loading fonts...\n");
  initFonts();
  printf("loading textures...\n");
  initTexture(game->screen);

  SystemReshapeFunc(reshape);
}
示例#5
0
void OptionsMenu::init()
{
	if(!inited)
	{
		addObject(mainMenu.getCamera());
		addObject(mainMenu.getSkybox());
		addObject(mainMenu.getBridge());
		addObject(mainMenu.getFloor());
		addObject(mainMenu.getFadeConstant());
		addObject(mainMenu.getLogo());
		initFonts();
		initCursor();
	}
	inited = true;
}
示例#6
0
void loadArt() {
    char buf[120];
    char *path;

    game->screen->artpack.path = artpack_list[artpack_index];

    getArtPath("artpack.ini", buf);
    path = getFullPath(buf);
    if(path != NULL) {
        loadIniFile(path);
        free(path);
    }

    initTexture(game->screen);
    initFonts();
}
示例#7
0
    void Configuration::initialize()
    {
        initTextures();
        initFonts();
        initSounds();
        initMusics();

        initPlayerInputs();
        initGuiInputs();

        rand_init();

        musics.get(Musics::Theme).setLoop(true);
        musics.get(Musics::Theme).play();

    }
示例#8
0
Graphics::Graphics()
{
	mBufferFactory = new BufferFactory();

	initBuffers();
	initEffect();
	initFonts();

	mWhiteTexture = loadTexture("data/imgs/white.bmp");

	// TESTING.. 
	D3DVERTEXELEMENT9 elems[MAX_FVF_DECL_SIZE];
	UINT numElems = 0;
	VertexPNT::Decl->GetDeclaration(elems, &numElems);
	D3DXCreateMesh(2, 4, D3DXMESH_MANAGED, elems, gd3dDevice, &mRayMesh);
	
	onResetDevice();
}
U2Panel::U2Panel(QWidget *parent,QString text):QWidget(parent){
	skin=NULL;
	initSkin();
    initGlobalVars();
    initWindowAttrs();
    initPixmapBuffer();
    initFonts();
    initPinYinDB();
    initCursorTimer();
    startCursorTimer();
	themeDialogShows=FALSE;
	text_buf=text;
	if(text_buf.length()>0){
	cout<<"text buf length "<<text_buf.length()<<endl;
	cout<<text_buf<<endl;
	
		text_ptr=text_buf.length();
		text_order();
		text_genePos();
	}
	initClipBoard();
}
示例#10
0
void modelEngine::initialize(void)
{
	numModels = 0;
	numShaders = 0;
	modelEngine_init_ogl(&state);
	init_model_proj(&state);
	glEnable(GL_TEXTURE_2D);

	glEnable(GL_CULL_FACE);

	glCullFace(GL_BACK);

	glFrontFace(GL_CCW);

	glEnable(GL_BLEND);
	glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA);
	glBlendEquation(GL_FUNC_ADD);

	glDepthRangef(0.0,1.0);

	glEnable(GL_DEPTH_TEST);

	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
	//glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE);

	// Enable lighting
	

	mat_specular[0] = 1.0;
	mat_specular[1] = 1.0;
	mat_specular[2] = 1.0;
	mat_specular[3] = 1.0;

	mat_shininess[0] = 50.0;

	light_position[0] = 0.0;
	light_position[1] = 5.0;
	light_position[2] = 36.0;
	light_position[3] = 0.0;

	//glClearColor (0.0, 0.0, 0.0, 0.0);
	GLfloat mat_ambient[] = { 1.0, 0.5, 0.5, 1.0 };
	glShadeModel (GL_SMOOTH);
	glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient);
	checkGLError();
	glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
	checkGLError();
	glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
	checkGLError();

	GLfloat light_ambient[] = { 0.5, 0.5, 0.5, 1.0 };
	GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
	GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 };
	glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
	checkGLError();
	glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
	checkGLError();
	glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
	checkGLError();
	glLightfv(GL_LIGHT0, GL_POSITION, light_position);
	checkGLError();


	//glLightfv(GL_LIGHT0, GL_POSITION, light_position);
	//glLightfv(GL_LIGHT0, GL_AMBIENT, light_position);
	checkGLError();
	glEnable(GL_LIGHTING);
	checkGLError();
	glEnable(GL_LIGHT0);
	checkGLError();

	// Initialize fonts
	initFonts();
}
示例#11
0
Common::Error Parallaction_ns::init() {

	_screenWidth = 320;
	_screenHeight = 200;

	if (getPlatform() == Common::kPlatformPC) {
		_disk = new DosDisk_ns(this);
	} else {
		if (getFeatures() & GF_DEMO) {
			strcpy(_location._name, "fognedemo");
		}
		_disk = new AmigaDisk_ns(this);
	}

	_disk->init();

	if (getPlatform() == Common::kPlatformPC) {
		_soundManI = new DosSoundMan_ns(this);
		_soundManI->setMusicVolume(ConfMan.getInt("music_volume"));
	} else {
		_soundManI = new AmigaSoundMan_ns(this);
	}

	_soundMan = new SoundMan(_soundManI);

	initResources();
	initFonts();
	_locationParser = new LocationParser_ns(this);
	_locationParser->init();
	_programParser = new ProgramParser_ns(this);
	_programParser->init();

	_cmdExec = new CommandExec_ns(this);
	_programExec = new ProgramExec_ns(this);

	_walker = new PathWalker_NS(this);

	_sarcophagusDeltaX = 0;
	_movingSarcophagus = false;
	_freeSarcophagusSlotX = INITIAL_FREE_SARCOPHAGUS_SLOT_X;

	num_foglie = 0;

	_intro = false;
	_inTestResult = false;

	_location._animations.push_front(_char._ani);

	_saveLoad = new SaveLoad_ns(this, _saveFileMan);

	initInventory();
	setupBalloonManager();

	_score = 1;

	_testResultLabels[0] = 0;
	_testResultLabels[1] = 0;

	Parallaction::init();

	return Common::kNoError;
}
示例#12
0
void StyleManager::pushFont(propertyId_t type,AbstractFont * f){
	if(type>=fontRegistry.size())
		initFonts(type+1);
	fontRegistry[type].push_back(f);
}
示例#13
0
void StyleManager::setDefaultFont(propertyId_t type,AbstractFont * f){
	if(type>=fontRegistry.size())
		initFonts(type+1);
	fontRegistry[type][0]=f;
}
示例#14
0
文件: main.cpp 项目: Nebual/terracer
int main(int argc, char *argv[]) {
    static SDL_Window *window;
    if(initWindow(&window, &renderer, argc, argv)) return 1;
    initVariables(WIDTH, HEIGHT);
    initTextures();
    initFonts();
    initInput();
    //initHUD();

    generateLevel(FIRSTLEVEL);

    hud = new Hud();

    /*==============*/
    /*  Test Stuff  */
    /*==============*/

    /*PhysicsEntity *goomba = new PhysicsEntity(getTexture("goomba"), 500, 50);
    goomba->patrolling = 1;

    Interactable *healthUp = new Interactable(getTexture("concrete"), 800, 500);
    healthUp->target = ply;
    healthUp->action = HEALTH_UP;

    Interactable *scrapUp = new Interactable(getTexture("sand"), 850, 500);
    scrapUp->target = ply;
    scrapUp->action = SCRAP_UP;*/

    /*=================*/
    /*End of Test Stuff*/
    /*=================*/

    int lastFrame = curtime_u() - 1;
    double dt;
    while(!quit) {
        if(DEBUG) fpsCounter();

        // Calculate dt
        int curFrame = curtime_u();
        if(lastFrame > curFrame) {
            dt = ((1000000 - lastFrame) + curFrame) / 1000000.0;
        }
        else {
            dt = (curFrame - lastFrame) / 1000000.0;
        }
        if(dt > 0.05) {
            dt = 0.05;   // Clamp dt so objects don't have collision issues
        }
        lastFrame = curFrame;

        // ===================
        // Update
        if(nextlevel != "") {
            printf("Switching to level %s\n", nextlevel.c_str());
            generateLevel(nextlevel);
            nextlevel = "";
        }
        TimerRun();
        for(int enti=0; enti<entsC; enti++) {
            if(ents[enti] == NULL) continue;
            ents[enti]->Update(dt);
            if(ents[enti]->isKilled) delete ents[enti];
        }

        // ====================
        // Drawing
        for(int rli=0; rli<RL_MAX; rli++) {
            if(rli == RL_BACKGROUND) {
                drawBackground(renderer, dt);
                continue; // Done in drawBackground
            }
            Drawable** layer = renderLayers[rli];
            for(int enti=0; enti<renderLayersC[rli]; enti++) {
                if(layer[enti] == NULL) continue;
                layer[enti]->Draw(dt);
            }
        }

        // Flip render buffer
        SDL_RenderPresent(renderer);

        // Frame limiting, not needed if we're using vsync
        //SDL_Delay((1000 / 66) - (curtime_u() - lastFrame)/1000);
    }
    printf("\nShutting down...\n");

    cleanLevel();
    // Destroy old textures
    for(std::map<std::string, TextureData>::iterator it = blockTDs.begin(); it != blockTDs.end(); ++it) {
        SDL_DestroyTexture(it->second.texture);
    }
    blockTDs.clear();

    SDL_DestroyRenderer(renderer);
    SDL_DestroyWindow(window);

    Mix_CloseAudio();
    Mix_Quit();

    IMG_Quit();
    SDL_Quit();
    return 0;
}