Example #1
0
// =====================
//     PRIVATE SLOTS
// =====================
void LDesktop::InitDesktop(){
  //This is called *once* during the main initialization routines
  checkResolution(); //Adjust the desktop config file first (if necessary)
  if(DEBUG){ qDebug() << "Init Desktop:" << desktopnumber; }
    //connect(desktop, SIGNAL(resized(int)), this, SLOT(UpdateGeometry(int)));
  if(DEBUG){ qDebug() << "Desktop #"<<desktopnumber<<" -> "<< desktop->screenGeometry(desktopnumber) << LSession::handle()->screenGeom(desktopnumber); }
  deskMenu = new QMenu(0);
    connect(deskMenu, SIGNAL(triggered(QAction*)), this, SLOT(SystemApplication(QAction*)) );
  winMenu = new QMenu(0);
    winMenu->setTitle(tr("Window List"));
    winMenu->setIcon( LXDG::findIcon("preferences-system-windows","") );
  connect(winMenu, SIGNAL(triggered(QAction*)), this, SLOT(winClicked(QAction*)) );
  workspacelabel = new QLabel(0);
    workspacelabel->setAlignment(Qt::AlignCenter);
  wkspaceact = new QWidgetAction(0);
    wkspaceact->setDefaultWidget(workspacelabel);
  bgtimer = new QTimer(this);
    bgtimer->setSingleShot(true);
    connect(bgtimer, SIGNAL(timeout()), this, SLOT(UpdateBackground()) );

    connect(QApplication::instance(), SIGNAL(DesktopConfigChanged()), this, SLOT(SettingsChanged()) );
    connect(QApplication::instance(), SIGNAL(DesktopFilesChanged()), this, SLOT(UpdateDesktop()) );
    connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(LocaleChanged()) );

  if(DEBUG){ qDebug() << "Create bgWindow"; }
  bgWindow = new QWidget();
	bgWindow->setObjectName("bgWindow");
	bgWindow->setContextMenuPolicy(Qt::CustomContextMenu);
	bgWindow->setFocusPolicy(Qt::StrongFocus);
  	bgWindow->setWindowFlags(Qt::WindowStaysOnBottomHint | Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
	LSession::handle()->XCB->SetAsDesktop(bgWindow->winId());
	bgWindow->setGeometry(LSession::handle()->screenGeom(desktopnumber));
	connect(bgWindow, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowMenu()) );
  if(DEBUG){ qDebug() << "Create bgDesktop"; }
  bgDesktop = new LDesktopPluginSpace(bgWindow); //new QMdiArea(bgWindow);
      int grid = settings->value(DPREFIX+"GridSize",-1).toInt();
      if(grid<0 && bgWindow->height() > 2000){ grid = 200; }
      else if(grid<0){ grid = 100; }
      bgDesktop->SetIconSize( grid );
      connect(bgDesktop, SIGNAL(PluginRemovedByUser(QString)), this, SLOT(RemoveDeskPlugin(QString)) );
      connect(bgDesktop, SIGNAL(IncreaseIcons()), this, SLOT(IncreaseDesktopPluginIcons()) );
      connect(bgDesktop, SIGNAL(DecreaseIcons()), this, SLOT(DecreaseDesktopPluginIcons()) );
      connect(bgDesktop, SIGNAL(HideDesktopMenu()), deskMenu, SLOT(hide()));
  if(DEBUG){ qDebug() << " - Desktop Init Done:" << desktopnumber; }
  //Start the update processes
  QTimer::singleShot(10,this, SLOT(UpdateMenu()) );
  QTimer::singleShot(0,this, SLOT(UpdateBackground()) );
  QTimer::singleShot(1,this, SLOT(UpdateDesktop()) );
  QTimer::singleShot(2,this, SLOT(UpdatePanels()) );
}
Example #2
0
// =====================
//     PRIVATE SLOTS 
// =====================
void LDesktop::SettingsChanged(){
  settings->sync(); //make sure to catch external settings changes
  QTimer::singleShot(1,this, SLOT(UpdateMenu()) );
  QTimer::singleShot(1,this, SLOT(UpdateBackground()) );
  QTimer::singleShot(1,this, SLOT(UpdateDesktop()) );
  QTimer::singleShot(1,this, SLOT(UpdatePanels()) );
}
Example #3
0
void FrogApp::Update(uint32_t delta)
{
	Spritesheet *sss;
	Texture *ttt;
	Animation *aaa;

	if (keyboard[SDL_SCANCODE_ESCAPE])
		Stop();

    //printf("VIDA PLAYER: %d", player->GetHealth());
    if (player->GetHealth()==0) Stop();

	// update background and tilemap
	UpdateBackground(1);
	layer1wanim.Step();
	layer2wanim.Step();
	layer3wanim.Step();
	layer4wanim.Step();


	UpdateLevel();


	/*
	Entity*p=inicial;
	printf("ELIST: { ");
	for(;p;p=p->Next()) {
		printf("[ep:%d,x:%f,prev:%d,next:%d],",p,p->X(),p->Prev(),p->Next());
	}
	printf(" }\n");
	*/
}
void PanelView::ForceUpdateBackground()
{
  is_dirty_ = true;
  UpdateBackground();

  QueueDraw();
}
Example #5
0
void Scene_Battle::Update() {
	options_window->Update();
	status_window->Update();
	command_window->Update();
	help_window->Update();
	item_window->Update();
	skill_window->Update();
	target_window->Update();
	message_window->Update();

	if (!message_window->GetVisible()) {
		ProcessActions();
	}

	if (!Game_Message::message_waiting) {
		ProcessInput();
	}

	//DoAuto();

	UpdateBackground();
	//UpdateCursors();
	//UpdateSprites();
	//UpdateFloaters();
	//UpdateAnimations();

	Game_Battle::Update();

	Main_Data::game_screen->Update();
}
LDesktop::LDesktop(int deskNum) : QObject(){
	
  DPREFIX = "desktop-"+QString::number(deskNum)+"/";
  desktopnumber = deskNum;
  desktop = new QDesktopWidget();
  defaultdesktop = (deskNum== desktop->primaryScreen());
  xoffset = 0;
  for(int i=0; i<desktopnumber; i++){
    xoffset += desktop->screenGeometry(i).width();
  }
  deskMenu = new QMenu(0);
  appmenu = new AppMenu(0);
  //Setup the internal variables
  settings = new QSettings(QSettings::UserScope, "LuminaDE","desktopsettings", this);
  bgtimer = new QTimer(this);
    bgtimer->setSingleShot(true);
 
  bgWindow = new QWidget(0);
	bgWindow->setObjectName("bgWindow");
	bgWindow->setContextMenuPolicy(Qt::CustomContextMenu);
	LX11::SetAsDesktop(bgWindow->winId());
	bgWindow->setGeometry(xoffset,0,desktop->screenGeometry().width(), desktop->screenGeometry().height());
	connect(bgWindow, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowMenu()) );
  
  //Start the update processes
  QTimer::singleShot(1,this, SLOT(UpdateMenu()) );
  QTimer::singleShot(1,this, SLOT(UpdateBackground()) );
  QTimer::singleShot(1,this, SLOT(UpdateDesktop()) );
  QTimer::singleShot(1,this, SLOT(UpdatePanels()) );

}
Example #7
0
void CMuleToolbarCtrl::ChangeToolbarBitmap(const CString& path, bool bRefresh)
{
	bool bResult = false;
	CImageList ImageList;
	CEnBitmap Bitmap;
	if (!path.IsEmpty() && Bitmap.LoadImage(path))
	{
		BITMAP bm = {0};
		Bitmap.GetObject(sizeof(bm), &bm);
		if (bm.bmWidth == NUM_BUTTON_BITMAPS*m_sizBtnBmp.cx && bm.bmHeight == m_sizBtnBmp.cy)
		{
			bool bAlpha = bm.bmBitsPixel > 24;
			if (ImageList.Create(m_sizBtnBmp.cx, bm.bmHeight, bAlpha ? ILC_COLOR32 : (theApp.m_iDfltImageListColorFlags | ILC_MASK), 0, 1))
			{
				ImageList.Add(&Bitmap,  bAlpha ? 0xFF000000 : RGB(255, 0, 255));
				CImageList* pimlOld = SetImageList(&ImageList);
				ImageList.Detach();
				if (pimlOld)
					pimlOld->DeleteImageList();
				bResult = true;
			}
		}
		Bitmap.DeleteObject();
	}

	// if image file loading or image list creation failed, create default image list.
	if (!bResult)
	{
		// load from icon ressources
		ImageList.Create(m_sizBtnBmp.cx, m_sizBtnBmp.cy, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1);
		ImageList.Add(CTempIconLoader(_T("CONNECT"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("DISCONNECT"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("STOPCONNECTING"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("KADEMLIA"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("SERVER"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("TRANSFER"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("SEARCH"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("SharedFiles"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("MESSAGES"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("IRC"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("STATISTICS"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("PREFERENCES"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("TOOLS"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("HELP"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ASSERT( ImageList.GetImageCount() == NUM_BUTTON_BITMAPS );
		CImageList* pimlOld = SetImageList(&ImageList);
		ImageList.Detach();
		if (pimlOld)
			pimlOld->DeleteImageList();
	}

	if (bRefresh)
	{
		UpdateBackground();
		Invalidate();
		Refresh();
	}
}
Example #8
0
// =====================
//     PRIVATE SLOTS
// =====================
void LDesktop::InitDesktop(){
  //This is called *once* during the main initialization routines
  checkResolution(); //Adjust the desktop config file first (if necessary)
  if(DEBUG){ qDebug() << "Init Desktop:" << desktopnumber; }
    //connect(desktop, SIGNAL(resized(int)), this, SLOT(UpdateGeometry(int)));
  if(DEBUG){ qDebug() << "Desktop #"<<desktopnumber<<" -> "<< desktop->screenGeometry(desktopnumber) << LSession::handle()->screenGeom(desktopnumber); }
  deskMenu = new QMenu(0);
    connect(deskMenu, SIGNAL(triggered(QAction*)), this, SLOT(SystemApplication(QAction*)) );
  winMenu = new QMenu(0);
    winMenu->setTitle(tr("Window List"));
    winMenu->setIcon( LXDG::findIcon("preferences-system-windows","") );
  connect(winMenu, SIGNAL(triggered(QAction*)), this, SLOT(winClicked(QAction*)) );
  workspacelabel = new QLabel(0);
    workspacelabel->setAlignment(Qt::AlignCenter);
  wkspaceact = new QWidgetAction(0);
    wkspaceact->setDefaultWidget(workspacelabel);
  bgtimer = new QTimer(this);
    bgtimer->setSingleShot(true);
    connect(bgtimer, SIGNAL(timeout()), this, SLOT(UpdateBackground()) );

    connect(QApplication::instance(), SIGNAL(DesktopConfigChanged()), this, SLOT(SettingsChanged()) );
    connect(QApplication::instance(), SIGNAL(DesktopFilesChanged()), this, SLOT(UpdateDesktop()) );
    connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(LocaleChanged()) );

  if(DEBUG){ qDebug() << "Create bgWindow"; }
  bgWindow = new QWidget();
	bgWindow->setObjectName("bgWindow");
	bgWindow->setContextMenuPolicy(Qt::CustomContextMenu);
  	bgWindow->setWindowFlags(Qt::WindowStaysOnBottomHint | Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
	LSession::handle()->XCB->SetAsDesktop(bgWindow->winId());
	bgWindow->setGeometry(LSession::handle()->screenGeom(desktopnumber));
	connect(bgWindow, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowMenu(const QPoint&)) );
  if(DEBUG){ qDebug() << "Create bgDesktop"; }
  bgDesktop = new QMdiArea(bgWindow);
	//Make sure the desktop area is transparent to show the background
        bgDesktop->setBackground( QBrush(Qt::NoBrush) );
	bgDesktop->setStyleSheet( "QMdiArea{ border: none; background: transparent;}" );
  if(DEBUG){ qDebug() << " - Desktop Init Done:" << desktopnumber; }
  //Start the update processes
  QTimer::singleShot(10,this, SLOT(UpdateMenu()) );
  QTimer::singleShot(0,this, SLOT(UpdateBackground()) );
  QTimer::singleShot(1,this, SLOT(UpdateDesktop()) );
  QTimer::singleShot(2,this, SLOT(UpdatePanels()) );
}
Example #9
0
LDesktop::LDesktop(int deskNum) : QObject(){
	
  DPREFIX = "desktop-"+QString::number(deskNum)+"/";
  desktopnumber = deskNum;
  desktop = new QDesktopWidget();
  defaultdesktop = (deskNum== desktop->primaryScreen());
  xoffset = 0;
  for(int i=0; i<desktopnumber; i++){
    xoffset += desktop->screenGeometry(i).width();
  }
  deskMenu = new QMenu(0);
  appmenu = new AppMenu(0);
  workspacelabel = new QLabel(0);
    workspacelabel->setAlignment(Qt::AlignCenter);
  wkspaceact = new QWidgetAction(0);
    wkspaceact->setDefaultWidget(workspacelabel);
  //Setup the internal variables
  settings = new QSettings(QSettings::UserScope, "LuminaDE","desktopsettings", this);
  //qDebug() << " - Desktop Settings File:" << settings->fileName();
  if(!QFile::exists(settings->fileName())){ settings->setValue(DPREFIX+"background/filelist",QStringList()<<"default"); settings->sync(); }
  bgtimer = new QTimer(this);
    bgtimer->setSingleShot(true);
    connect(bgtimer, SIGNAL(timeout()), this, SLOT(UpdateBackground()) );
  watcher = new QFileSystemWatcher(this);
    connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(SettingsChanged()) );
    watcher->addPath(settings->fileName());
 
  bgWindow = new QWidget(0);
	bgWindow->setObjectName("bgWindow");
	bgWindow->setContextMenuPolicy(Qt::CustomContextMenu);
	LX11::SetAsDesktop(bgWindow->winId());
	bgWindow->setGeometry(xoffset,0,desktop->screenGeometry().width(), desktop->screenGeometry().height());
	connect(bgWindow, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowMenu()) );
  
  //Start the update processes
  QTimer::singleShot(1,this, SLOT(UpdateMenu()) );
  QTimer::singleShot(1,this, SLOT(UpdateBackground()) );
  QTimer::singleShot(1,this, SLOT(UpdateDesktop()) );
  QTimer::singleShot(1,this, SLOT(UpdatePanels()) );

}
Example #10
0
void LDesktop::SettingsChanged(){
  if(issyncing){ return; } //don't refresh for internal modifications to the 
  issyncing = true;
  qDebug() << "Found Settings Change:" << desktopnumber;
  settings->sync(); //make sure to sync with external settings changes
  UpdateBackground();
  UpdateDesktop();
  UpdatePanels();
  UpdateMenu();
  issyncing = false;
  QTimer::singleShot(100, this, SLOT(UnlockSettings()) ); //give it a few moments to settle before performing another sync
}
Example #11
0
void CAboutDlg::UpdateDialogSize()
{
	ChangeZoomType(m_ZoomType);
	if (m_IsHighContrast)
	{
		SetClientRect((DWORD)(SIZE_X * m_ZoomRatio), (DWORD)(SIZE_HC_Y * m_ZoomRatio), 0);
	}
	else
	{
		SetClientRect((DWORD)(SIZE_X * m_ZoomRatio), (DWORD)(SIZE_Y * m_ZoomRatio), 0);
	}

	UpdateBackground();

	m_CtrlCrystalDewWorld.InitControl( 24,  24, 128, 128, m_ZoomRatio, IP(L"logo"), 1, 0, CButtonCx::OwnerDrawImage);
	m_CtrlCrystalDewWorld.SetHandCursor();

#ifdef SUISHO_SHIZUKU_SUPPORT
	m_CtrlProjectShizukuKirinokasumu.InitControl(340, 324, 292, 20, m_ZoomRatio, NULL, 0, 0, CButtonCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlProjectShizukuLinuxhajapan.InitControl(340, 368, 292, 20, m_ZoomRatio, NULL, 0, 0, CButtonCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlProjectShizukuOpensourcechannel.InitControl(340, 392, 292, 20, m_ZoomRatio, NULL, 0, 0, CButtonCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlProjectShizukuBellche.InitControl(340, 416, 292, 20, m_ZoomRatio, NULL, 0, 0, CButtonCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlSecretVoice.InitControl(200, 412, 40, 40, m_ZoomRatio, NULL, 0, 0, CButtonCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlProjectShizukuKirinokasumu.SetHandCursor();
	m_CtrlProjectShizukuLinuxhajapan.SetHandCursor();
	m_CtrlProjectShizukuOpensourcechannel.SetHandCursor();
	m_CtrlProjectShizukuBellche.SetHandCursor();
	m_CtrlSecretVoice.SetHandCursor();
#endif

	m_CtrlVersion.SetFontEx(m_FontFace, 28, m_ZoomRatio, 255, RGB(0, 0, 0), FW_BOLD, m_FontType);
	m_CtrlEdition.SetFontEx(m_FontFace, 28, m_ZoomRatio, 255, RGB(0, 0, 0), FW_BOLD, m_FontType);
	m_CtrlRelease.SetFontEx(m_FontFace, 16, m_ZoomRatio, 255, RGB(0, 0, 0), FW_NORMAL, m_FontType);
	m_CtrlCopyright.SetFontEx(m_FontFace, 16, m_ZoomRatio, 255, RGB(0, 0, 0), FW_NORMAL, m_FontType);
	m_CtrlLicense.SetFontEx(m_FontFace, 16, m_ZoomRatio, 255, RGB(0, 0, 0), FW_NORMAL, m_FontType);

	m_CtrlVersion.InitControl(200, 12, 420, 36, m_ZoomRatio, NULL, 0, SS_CENTER, CStaticCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlEdition.InitControl(200, 48, 420, 36, m_ZoomRatio, NULL, 0, SS_CENTER, CStaticCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlRelease.InitControl(200, 88, 420, 24, m_ZoomRatio, NULL, 0, SS_CENTER, CStaticCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlCopyright.InitControl(200, 112, 420, 24, m_ZoomRatio, NULL, 0, SS_CENTER, CStaticCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlLicense.InitControl(200, 136, 420, 24, m_ZoomRatio, NULL, 0, SS_CENTER, CStaticCx::OwnerDrawTransparent | m_IsHighContrast);

	Invalidate();
}
Example #12
0
void Scene_Battle::Update() {
	options_window->Update();
	status_window->Update();
	command_window->Update();
	help_window->Update();
	item_window->Update();
	skill_window->Update();
	target_window->Update();
	message_window->Update();

	// Query Timer before and after update.
	// If it reached zero during update was a running battle timer.
	int timer1 = Main_Data::game_party->GetTimer(Game_Party::Timer1);
	int timer2 = Main_Data::game_party->GetTimer(Game_Party::Timer2);
	Main_Data::game_party->UpdateTimers();
	if ((Main_Data::game_party->GetTimer(Game_Party::Timer1) == 0 && timer1 > 0) ||
		(Main_Data::game_party->GetTimer(Game_Party::Timer2) == 0 && timer2 > 0)) {
		Scene::Pop();
	}

	bool events_finished = Game_Battle::UpdateEvents();

	if (Game_Message::visible && events_finished && !message_window->IsNextMessagePossible()) {
		// Handle message box closing when not caused by event e.g. victory message
		Game_Message::closing = true;
	}

	if (!Game_Message::visible && events_finished) {
		ProcessActions();
		ProcessInput();
	}

	UpdateBackground();

	Game_Battle::Update();

	Main_Data::game_screen->Update();

	if (Game_Battle::IsTerminating()) {
		Scene::Pop();
	}
}
Example #13
0
void Scene_Battle::Update() {
	options_window->Update();
	status_window->Update();
	command_window->Update();
	help_window->Update();
	item_window->Update();
	skill_window->Update();
	target_window->Update();
	message_window->Update();

	// Query Timer before and after update.
	// If it reached zero during update was a running battle timer.
	int timer1 = Main_Data::game_party->GetTimer(Game_Party::Timer1);
	int timer2 = Main_Data::game_party->GetTimer(Game_Party::Timer2);
	Main_Data::game_party->UpdateTimers();
	if ((Main_Data::game_party->GetTimer(Game_Party::Timer1) == 0 && timer1 > 0) ||
		(Main_Data::game_party->GetTimer(Game_Party::Timer2) == 0 && timer2 > 0)) {
		Scene::Pop();
	}

	if (Game_Battle::UpdateEvents()) {
		ProcessActions();
		ProcessInput();
	}

	//DoAuto();

	UpdateBackground();
	//UpdateCursors();
	//UpdateSprites();
	//UpdateFloaters();
	//UpdateAnimations();

	Game_Battle::Update();

	Main_Data::game_screen->Update();

	if (Game_Battle::IsTerminating()) {
		Scene::Pop();
	}
}
Example #14
0
void CPluginBackground::OnMainThreadActivated(int anEditorEvent /*= -1*/, int anViewerEvent /*= -1*/)
{
#ifdef _DEBUG
	DWORD nCurActions = mn_ReqActions;
#endif

	if (anEditorEvent != -1 || anViewerEvent != -1)
	{
		mn_ReqActions |= ra_CheckPanelFolders;
		// При закрытии QView нельзя перечитывать параметры панелей,
		// т.к. панель на месте QView еще НЕ видима, будет глюк отрисовки
		if (anViewerEvent == VE_CLOSE)
		{
			SetForceCheck();
			return;
		}
	}

	if ((mn_ReqActions & ra_CheckPanelFolders))
	{
		mn_ReqActions &= ~ra_CheckPanelFolders;
		CheckPanelFolders((anEditorEvent == EE_GOTFOCUS) ? pbp_Editor : (anViewerEvent == VE_GOTFOCUS) ? pbp_Viewer : 0);
	}
	else if ((anEditorEvent == EE_GOTFOCUS) || (anViewerEvent == VE_GOTFOCUS))
	{
		m_Default.Place = (anEditorEvent == EE_GOTFOCUS) ? pbp_Editor : pbp_Viewer;
		if (IsParmChanged(&m_Default, &m_Last))
		{
			mn_ReqActions |= ra_UpdateBackground;
		}
	}

	if ((mn_ReqActions & ra_UpdateBackground))
	{
		mn_ReqActions &= ~ra_UpdateBackground;
		UpdateBackground();
	}
}
void
PanelView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
{
  nux::Geometry const& geo = GetGeometry();
  UpdateBackground();

  bool overlay_mode = InOverlayMode();
  GfxContext.PushClippingRectangle(geo);

  if (IsTransparent())
  {
    nux::Geometry const& geo_absolute = GetAbsoluteGeometry();

    if (BackgroundEffectHelper::blur_type != BLUR_NONE)
    {
      bg_blur_texture_ = bg_effect_helper_.GetBlurRegion();
    }
    else
    {
      bg_blur_texture_ = bg_effect_helper_.GetRegion();
    }

    if (bg_blur_texture_.IsValid())
    {
      nux::TexCoordXForm texxform_blur_bg;
      texxform_blur_bg.flip_v_coord = true;
      texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
      texxform_blur_bg.uoffset = geo.x / static_cast<float>(geo_absolute.width);
      texxform_blur_bg.voffset = geo.y / static_cast<float>(geo_absolute.height);

      nux::ROPConfig rop;
      rop.Blend = false;
      rop.SrcBlend = GL_ONE;
      rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;

      GfxContext.PushClippingRectangle(geo);

#ifndef NUX_OPENGLES_20
      if (GfxContext.UsingGLSLCodePath())
        gPainter.PushDrawCompositionLayer(GfxContext, geo,
                                          bg_blur_texture_,
                                          texxform_blur_bg,
                                          nux::color::White,
                                          WindowManager::Default().average_color(),
                                          nux::LAYER_BLEND_MODE_OVERLAY,
                                          true, rop);
      else
        gPainter.PushDrawTextureLayer(GfxContext, geo,
                                      bg_blur_texture_,
                                      texxform_blur_bg,
                                      nux::color::White,
                                      true,
                                      rop);
#else
        gPainter.PushDrawCompositionLayer(GfxContext, geo,
                                          bg_blur_texture_,
                                          texxform_blur_bg,
                                          nux::color::White,
                                          WindowManager::Default().average_color(),
                                          nux::LAYER_BLEND_MODE_OVERLAY,
                                          true, rop);
#endif

      GfxContext.PopClippingRectangle();
    }

    if (overlay_mode && !Settings::Instance().GetLowGfxMode())
    {
      nux::GetPainter().RenderSinglePaintLayer(GfxContext, geo, bg_darken_layer_.get());

      GfxContext.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
      nux::TexCoordXForm refine_texxform;

      int refine_x_pos = geo.x + (stored_dash_width_ - refine_gradient_midpoint);

      refine_x_pos += unity::Settings::Instance().LauncherWidth(monitor_);
      GfxContext.QRP_1Tex(refine_x_pos, geo.y,
                          bg_refine_tex_->GetWidth(),
                          bg_refine_tex_->GetHeight(),
                          bg_refine_tex_->GetDeviceTexture(),
                          refine_texxform, nux::color::White);

      GfxContext.QRP_1Tex(refine_x_pos + bg_refine_tex_->GetWidth(),
                          geo.y, geo.width, geo.height,
                          bg_refine_single_column_tex_->GetDeviceTexture(),
                          refine_texxform, nux::color::White);
    }
  }

  if (!overlay_mode || !GfxContext.UsingGLSLCodePath())
    nux::GetPainter().RenderSinglePaintLayer(GfxContext, geo, bg_layer_.get());

  GfxContext.PopClippingRectangle();

  if (needs_geo_sync_)
  {
    SyncGeometries();
    needs_geo_sync_ = false;
  }
}
Example #16
0
void Game::Update()
{
	display->Clear(0.1f, 0.1f, 0.1f, 1.0f);

	if (controller.isClosing())
	{
		timer->Pause();
		state = MENU;
		menu->SetState(MenuState::PAUSE);
	}

	timer->Update();
	totalTime = timer->GetTotalTime();
	elapsedTime = timer->GetElapsedTime();

	controller.Update(elapsedTime);
	while (SDL_PollEvent(&e))
		controller.HandleInput(e);

	switch (state)
	{
	case(GameState::MENU) :
		menu->Update(elapsedTime, totalTime);
		switch (menu->GetState())
		{
		case(MenuState::START) :
			Restart();
			break;
		case(MenuState::RESUME) :
			timer->Resume();
			state = GameState::RUNNING;
			break;
		case(MenuState::QUIT) :
			End();
			break;
		case(MenuState::RETRY) :
			Restart();
			break;
		}
		break;

	case(GameState::RUNNING) :
		UpdateBackground(elapsedTime, totalTime);

		UseBomb();
		Shoot();
		UpdateBomb(elapsedTime, totalTime);
		UpdatePlayerBullets(elapsedTime, totalTime);
		UpdatePlayer(elapsedTime, totalTime);
		if (player->IsHit())
			PlayerHit();
		
		enemyHandler->Update(elapsedTime, totalTime, &playerbullets, bomb);
		if (!enemyHandler->EnemiesLeft())
			Won();
		if (player->GetState() == GameObject::DEAD)
			Lost();
		UpdateOverlay(elapsedTime, totalTime);

		break;
	}

	display->Update();
}
Example #17
0
void CSettingDlg::UpdateDialogSize()
{
	ChangeZoomType(m_ZoomType);
	SetClientRect((DWORD)(SIZE_X * m_ZoomRatio), (DWORD)(SIZE_Y * m_ZoomRatio), 0);

	UpdateBackground();

	m_CtrlLabelAam.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlLabelApm.SetFontEx(m_FontFace, 12, m_ZoomRatio);

	m_CtrlLabelAamLow.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlLabelAamHigh.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlLabelAamRecommend.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlLabelApmLow.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlLabelApmHigh.SetFontEx(m_FontFace, 12, m_ZoomRatio);

	m_CtrlAamStatus.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlCurrentAam.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlRecommendAam.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlApmStatus.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlCurrentApm.SetFontEx(m_FontFace, 12, m_ZoomRatio);

	m_CtrlEnableAam.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlDisableAam.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlEnableApm.SetFontEx(m_FontFace, 12, m_ZoomRatio);
	m_CtrlDisableApm.SetFontEx(m_FontFace, 12, m_ZoomRatio);

	m_CtrlLabelAam.InitControl(8, 44, 384, 24, m_ZoomRatio, NULL, 0, SS_LEFT, CStaticCx::OwnerDrawGlass | m_IsHighContrast);
	m_CtrlLabelApm.InitControl(8, 188, 384, 24, m_ZoomRatio, NULL, 0, SS_LEFT, CStaticCx::OwnerDrawGlass | m_IsHighContrast);

	m_CtrlLabelAamLow.InitControl(16, 72, 160, 20, m_ZoomRatio, NULL, 0, SS_LEFT, CStaticCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlLabelAamHigh.InitControl(176, 72, 160, 20, m_ZoomRatio, NULL, 0, SS_RIGHT, CStaticCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlLabelAamRecommend.InitControl(176, 120, 160, 20, m_ZoomRatio, NULL, 0, SS_RIGHT, CStaticCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlLabelApmLow.InitControl(16, 216, 160, 20, m_ZoomRatio, NULL, 0, SS_LEFT, CStaticCx::OwnerDrawTransparent | m_IsHighContrast);
	m_CtrlLabelApmHigh.InitControl(176, 216, 160, 20, m_ZoomRatio, NULL, 0, SS_RIGHT, CStaticCx::OwnerDrawTransparent | m_IsHighContrast);

	m_CtrlAamStatus.InitControl(344, 72, 40, 20, m_ZoomRatio, NULL, 0, SS_CENTER, CStaticCx::OwnerDrawGlass | m_IsHighContrast);
	m_CtrlCurrentAam.InitControl(344, 96, 40, 20, m_ZoomRatio, NULL, 0, SS_CENTER, CStaticCx::OwnerDrawGlass | m_IsHighContrast);
	m_CtrlRecommendAam.InitControl(344, 120, 40, 20, m_ZoomRatio, NULL, 0, SS_CENTER, CStaticCx::OwnerDrawGlass | m_IsHighContrast);
	m_CtrlApmStatus.InitControl(344, 216, 40, 20, m_ZoomRatio, NULL, 0, SS_CENTER, CStaticCx::OwnerDrawGlass | m_IsHighContrast);
	m_CtrlCurrentApm.InitControl(344, 240, 40, 20, m_ZoomRatio, NULL, 0, SS_CENTER, CStaticCx::OwnerDrawGlass | m_IsHighContrast);

	m_CtrlEnableAam.InitControl(220, 148, 160, 28, m_ZoomRatio, NULL, 0, SS_CENTER, CButtonCx::SystemDraw | m_IsHighContrast);
	m_CtrlDisableAam.InitControl(20, 148, 160, 28, m_ZoomRatio, NULL, 0, SS_CENTER, CButtonCx::SystemDraw | m_IsHighContrast);
	m_CtrlEnableApm.InitControl(220, 268, 160, 28, m_ZoomRatio, NULL, 0, SS_CENTER, CButtonCx::SystemDraw | m_IsHighContrast);
	m_CtrlDisableApm.InitControl(20, 268, 160, 28, m_ZoomRatio, NULL, 0, SS_CENTER, CButtonCx::SystemDraw | m_IsHighContrast);

	m_CtrlSelectDisk.SetFontEx(m_FontFace, 14, m_ZoomRatio);
	m_CtrlSelectDisk.MoveWindow((DWORD)(8 * m_ZoomRatio), (DWORD)(8 * m_ZoomRatio), (DWORD)(384 * m_ZoomRatio), (DWORD)(32 * m_ZoomRatio));
	m_AamScrollbar.MoveWindow((DWORD)(16 * m_ZoomRatio), (DWORD)(96 * m_ZoomRatio), (DWORD)(324 * m_ZoomRatio), (DWORD)(20 * m_ZoomRatio));
	m_ApmScrollbar.MoveWindow((DWORD)(16 * m_ZoomRatio), (DWORD)(240 * m_ZoomRatio), (DWORD)(324 * m_ZoomRatio), (DWORD)(20 * m_ZoomRatio));

	m_IsDrawFrame = IsDrawFrame();

	m_CtrlAamStatus.SetDrawFrame(m_IsDrawFrame);
	m_CtrlCurrentAam.SetDrawFrame(m_IsDrawFrame);
	m_CtrlRecommendAam.SetDrawFrame(m_IsDrawFrame);
	m_CtrlApmStatus.SetDrawFrame(m_IsDrawFrame);
	m_CtrlCurrentApm.SetDrawFrame(m_IsDrawFrame);

	Invalidate();
}
Example #18
0
void OpSpeedDialView::OnSpeedDialBackgroundChanged()
{
	UpdateBackground();
	NotifyContentChanged();
}
Example #19
0
OP_STATUS OpSpeedDialView::Init()
{
	SetSkinned(TRUE);

	SetName("Speed dial");

	RETURN_IF_ERROR(g_speeddial_manager->AddConfigurationListener(this));
	RETURN_IF_ERROR(g_speeddial_manager->AddListener(*this));

	m_content = OP_NEW(QuickScrollContainer,
				(QuickScrollContainer::VERTICAL, QuickScrollContainer::SCROLLBAR_AUTO));
	RETURN_OOM_IF_NULL(m_content);
	RETURN_IF_ERROR(m_content->Init());
	m_content->SetRespectScrollbarMargin(false);
	m_content->SetListener(this);
	m_content->SetContainer(this);

	QuickBackgroundWidget<OpImageBackground>* stack_background = OP_NEW(QuickBackgroundWidget<OpImageBackground>, ());
	if (!stack_background || OpStatus::IsError(stack_background->Init()))
	{
		OP_DELETE(stack_background);
		return OpStatus::ERR;
	}
	m_content->SetContent(stack_background);
	stack_background->SetPreferredHeight(WidgetSizes::Fill);

	m_background = stack_background->GetOpWidget();
	m_background->SetSkinned(TRUE);
	m_background->GetBorderSkin()->SetImage("Speed Dial Widget Skin");

	UpdateBackground();

	// Create the main stack layout
	QuickStackLayout* stack(OP_NEW(QuickStackLayout, (QuickStackLayout::VERTICAL)));
	RETURN_OOM_IF_NULL(stack);
	stack_background->SetContent(stack);

	// Create the layout for the search field and the config button
	m_top_line_layout = OP_NEW(TopLineLayout, (*m_content));
	RETURN_OOM_IF_NULL(m_top_line_layout);
	RETURN_IF_ERROR(stack->InsertWidget(m_top_line_layout));

	// DefaultSpeeddialSearchType of -1 means no search field
	OpAutoPtr<OpSpeedDialSearchWidget> search_widget(OP_NEW(OpSpeedDialSearchWidget, ()));
	RETURN_OOM_IF_NULL(search_widget.get());
	RETURN_IF_ERROR(search_widget->Init());
	search_widget->SetName("Speed Dial search field");

	m_search_field = QuickWrap(search_widget.release());
	RETURN_OOM_IF_NULL(m_search_field);
	RETURN_IF_ERROR(m_top_line_layout->SetSearchField(m_search_field));

	if (!g_searchEngineManager->GetDefaultSpeedDialSearch())
		m_search_field->Hide();

	// Create the global configuration button
	OpButton* global_config_button;
	RETURN_IF_ERROR(OpButton::Construct(&global_config_button, OpButton::TYPE_CUSTOM, OpButton::STYLE_TEXT));
	m_config_button = QuickWrap(global_config_button);
	RETURN_OOM_IF_NULL(m_config_button);
	RETURN_IF_ERROR(m_top_line_layout->SetGlobalConfigButton(m_config_button));

	if (IsReadOnly())
		m_config_button->Hide();
	global_config_button->SetButtonStyle(OpButton::STYLE_IMAGE_AND_TEXT_CENTER);
	global_config_button->SetName("Speed Dial Global Configuration");
	global_config_button->GetBorderSkin()->SetImage("Speed Dial Button Skin", "Link Button Skin");
	global_config_button->GetForegroundSkin()->SetImage("Speed Dial Configure Icon");

	OpString str;
	global_config_button->SetTabStop(TRUE);
	global_config_button->SetSystemFont(OP_SYSTEM_FONT_UI_DIALOG);

	OpInputAction * action = OP_NEW(OpInputAction, (OpInputAction::ACTION_SHOW_SPEEDDIAL_GLOBAL_CONFIG));
	RETURN_OOM_IF_NULL(action);
	RETURN_IF_ERROR(g_languageManager->GetString(Str::D_SPEEDDIAL_GLOBAL_CONFIGURATION, str));
	action->GetActionInfo().SetStatusText(str);
	global_config_button->SetAction(action);

	OpAutoPtr<QuickCentered> centered_thumbnails(OP_NEW(QuickCentered, ()));
	RETURN_OOM_IF_NULL(centered_thumbnails.get());

	// Create the thumbnail layout and put it in the UI
	m_thumbnail_flow = OP_NEW(QuickFlowLayout, ());
	RETURN_OOM_IF_NULL(m_thumbnail_flow);
	m_thumbnail_flow->SetName("speeddial_flow_layout");
	centered_thumbnails->SetContent(m_thumbnail_flow);
	RETURN_IF_ERROR(stack->InsertWidget(centered_thumbnails.release()));

	RETURN_IF_ERROR(CreateThumbnails());

	m_content->SetParentOpWidget(this);

	UpdateButtonVisibility();

	return OpStatus::OK;
}