Exemplo n.º 1
0
	void GingaNclGfx::release() {
		AnimePlayer* p;
		vector<AnimePlayer*>::iterator i;

		if (animes != NULL) {
			i = animes->begin();
			while (i != animes->end()) {
				p = *i;
				p->stop();
				delete p;
				++i;
			}

			delete animes;
			animes = NULL;
		}

		if (bg != NULL) {
			bg->clearContent();
			bg->hide();
			delete bg;
			bg = NULL;
		}

		if (top != NULL) {
			top->clearContent();
			top->hide();
			delete top;
			top = NULL;
		}

		if (bottom != NULL) {
			bottom->clearContent();
			bottom->hide();
			delete bottom;
			bottom = NULL;
		}
	}
Exemplo n.º 2
0
	void GingaNclGfx::show(int l, int t, int w, int h) {
		int size, compRollerW, compRollerH, initX, initY;
		double rate;
		vector<int> x;
		vector<int> y;
		AnimePlayer* p;
		IWindow* win;
		ISurface* s;
		vector<string>* mrls, *mrlsAux;
		IComponentManager* cm = IComponentManager::getCMInstance();

		release();

		GingaNclGfx::w = w;
		GingaNclGfx::h = h;
		rate = 0.2;
		initX = (w/2) - ((550 * rate)/2);
		initY = (h/2) - ((530 * rate)/2);

		x.push_back(initX + (130 * rate));
		x.push_back(initX + (240 * rate));
		x.push_back(initX + (340 * rate));
		x.push_back(initX + (400 * rate));
		x.push_back(initX + (340 * rate));
		x.push_back(initX + (240 * rate));
		x.push_back(initX + (130 * rate));
		x.push_back(initX + (60 * rate));

		y.push_back(initY + (90 * rate));
		y.push_back(initY + (50 * rate));
		y.push_back(initY + (90 * rate));
		y.push_back(initY + (190 * rate));
		y.push_back(initY + (330 * rate));
		y.push_back(initY + (380 * rate));
		y.push_back(initY + (330 * rate));
		y.push_back(initY + (190 * rate));

		compRollerW = 115 * rate;
		compRollerH = 113 * rate;

		mrls = new vector<string>;
		mrls->push_back("/usr/local/lib/ginga/files/img/roller/b1.png");
		mrls->push_back("/usr/local/lib/ginga/files/img/roller/b2.png");
		mrls->push_back("/usr/local/lib/ginga/files/img/roller/b3.png");
		mrls->push_back("/usr/local/lib/ginga/files/img/roller/b4.png");
		mrls->push_back("/usr/local/lib/ginga/files/img/roller/b5.png");
		mrls->push_back("/usr/local/lib/ginga/files/img/roller/b6.png");
		mrls->push_back("/usr/local/lib/ginga/files/img/roller/b7.png");
		mrls->push_back("/usr/local/lib/ginga/files/img/roller/b8.png");

		animes = new vector<AnimePlayer*>;
		bg = ((WindowCreator*)(cm->getObject("Window")))(l, t, w, h);
		s = ((ImageRenderer*)(cm->getObject("ImageRenderer")))(
				(char*)("/usr/local/lib/ginga/files/img/roller/loading.png"));

		bg->setCaps(bg->getCap("ALPHACHANNEL"));
		bg->draw();
		bg->show();
		bg->raiseToTop();

		bg->renderFrom(s);

		delete s;
		s = NULL;

		bottom = ((WindowCreator*)(cm->getObject("Window")))(
				5, h - 30, w / 2, 30);

		bottom->setCaps(bottom->getCap("ALPHACHANNEL"));
		bottom->draw();
		bottom->setBackgroundColor(0, 0, 0, 0);
		bottom->show();
		bottom->raiseToTop();

		top = ((WindowCreator*)(cm->getObject("Window")))(5, 5, w / 2, 30);
		top->setCaps(top->getCap("ALPHACHANNEL"));
		top->draw();
		top->setBackgroundColor(0, 0, 0, 0);
		top->show();
		top->raiseToTop();

		size = mrls->size();
		for (unsigned int i = 0; i < size; i++) {
			mrlsAux = new vector<string>(*mrls);
			p = createAnimePlayer(mrlsAux);
			win = ((WindowCreator*)(cm->getObject("Window")))(
					x[i], y[i], compRollerW, compRollerH);

			win->setCaps(win->getCap("ALPHACHANNEL"));
			win->draw();
			win->show();
			win->raiseToTop();

			p->setVoutWindow(win);
			animes->push_back(p);
			roll(mrls);
		}

		delete mrls;
		mrls = NULL;

		for (unsigned int i = 0; i < size; i++) {
			((*animes)[i])->play();
		}
	}
Exemplo n.º 3
0
	void GingaNclGfx::show(int l, int t, int w, int h) {
		int compRollerW, compRollerH, initX, initY;
		unsigned int i, size;
		double rate;
		vector<int> x;
		vector<int> y;
		AnimePlayer* p;
		IWindow* win;
		ISurface* s;
		vector<string>* mrls, *mrlsAux;

		release();

		GingaNclGfx::w = w;
		GingaNclGfx::h = h;
		rate = 0.2;
		initX = (w/2) - ((550 * rate)/2);
		initY = (h/2) - ((530 * rate)/2);

		x.push_back(initX + (130 * rate));
		x.push_back(initX + (240 * rate));
		x.push_back(initX + (340 * rate));
		x.push_back(initX + (400 * rate));
		x.push_back(initX + (340 * rate));
		x.push_back(initX + (240 * rate));
		x.push_back(initX + (130 * rate));
		x.push_back(initX + (60 * rate));

		y.push_back(initY + (90 * rate));
		y.push_back(initY + (50 * rate));
		y.push_back(initY + (90 * rate));
		y.push_back(initY + (190 * rate));
		y.push_back(initY + (330 * rate));
		y.push_back(initY + (380 * rate));
		y.push_back(initY + (330 * rate));
		y.push_back(initY + (190 * rate));

		compRollerW = 115 * rate;
		compRollerH = 113 * rate;

		mrls = new vector<string>;
		mrls->push_back(DATA_PREFIX_PATH "/share/ginga/img/roller/b1.png");
		mrls->push_back(DATA_PREFIX_PATH "/share/ginga/img/roller/b2.png");
		mrls->push_back(DATA_PREFIX_PATH "/share/ginga/img/roller/b3.png");
		mrls->push_back(DATA_PREFIX_PATH "/share/ginga/img/roller/b4.png");
		mrls->push_back(DATA_PREFIX_PATH "/share/ginga/img/roller/b5.png");
		mrls->push_back(DATA_PREFIX_PATH "/share/ginga/img/roller/b6.png");
		mrls->push_back(DATA_PREFIX_PATH "/share/ginga/img/roller/b7.png");
		mrls->push_back(DATA_PREFIX_PATH "/share/ginga/img/roller/b8.png");

		animes = new vector<AnimePlayer*>;

#if HAVE_COMPSUPPORT
		bg = ((WindowCreator*)(cm->getObject("Window")))(l, t, w, h);
		s = ((ImageRenderer*)(cm->getObject("ImageRenderer")))(
				(char*)(DATA_PREFIX_PATH "/share/ginga/img/roller/loading.png"));
#else
		bg = new DFBWindow(l, t, w, h);
		s = ImagePlayer::renderImage(
				DATA_PREFIX_PATH "/share/ginga/img/roller/loading.png");
#endif

		bg->setCaps(bg->getCap("ALPHACHANNEL"));
		bg->draw();
		bg->show();
		bg->raiseToTop();

		bg->renderFrom(s);

		delete s;
		s = NULL;

#if HAVE_COMPSUPPORT
		bottom = ((WindowCreator*)(cm->getObject("Window")))(
				5, h - 30, w / 2, 30);
#else
		bottom = new DFBWindow(
				5, h - 30, w / 2, 30);
#endif

		bottom->setCaps(bottom->getCap("ALPHACHANNEL"));
		bottom->draw();
		bottom->setBackgroundColor(0, 0, 0, 0);
		bottom->show();
		bottom->raiseToTop();

#if HAVE_COMPSUPPORT
		top = ((WindowCreator*)(cm->getObject("Window")))(5, 5, w / 2, 30);
#else
		top = new DFBWindow(5, 5, w / 2, 30);
#endif

		top->setCaps(top->getCap("ALPHACHANNEL"));
		top->draw();
		top->setBackgroundColor(0, 0, 0, 0);
		top->show();
		top->raiseToTop();

		size = mrls->size();
		for (i = 0; i < size; i++) {
			mrlsAux = new vector<string>(*mrls);
			p = createAnimePlayer(mrlsAux);

#if HAVE_COMPSUPPORT
			win = ((WindowCreator*)(cm->getObject("Window")))(
					x[i], y[i], compRollerW, compRollerH);
#else
			win = new DFBWindow(
					x[i], y[i], compRollerW, compRollerH);
#endif

			win->setCaps(win->getCap("ALPHACHANNEL"));
			win->draw();
			win->show();
			win->raiseToTop();

			p->setVoutWindow(win);
			animes->push_back(p);
			roll(mrls);
		}

		delete mrls;
		mrls = NULL;

		for (unsigned int i = 0; i < size; i++) {
			((*animes)[i])->play();
		}
	}