Ejemplo n.º 1
0
void OSMutexRW::LockWrite()
{
    OSMutexLocker locker(&fInternalLock);
    AddWriteWaiter();       //  1 writer queued            
#if DEBUGMUTEXRW

    if (Active()) 
    {   qtss_printf("LockWrite(conflict) state = %d active readers = %d, waiting writers = %d, waiting readers=%d\n", fState, fActiveReaders, fWriteWaiters, fReadWaiters);
        CountConflict(1);  
    }

    qtss_printf("LockWrite 'waiting' fState = %d locked active readers = %d, waiting writers = %d, waiting readers=%d\n",fState, fActiveReaders, fReadWaiters, fWriteWaiters);
#endif

    //while   (ActiveReaders())  // active readers
	while (Active())//modify by tex
	{       
        fWritersCond.Wait(&fInternalLock,OSMutexRW::eMaxWait);
    }

    RemoveWriteWaiter(); // remove from waiting writers
    SetState(OSMutexRW::eActiveWriterState);    // this is the active writer    
    fActiveReaders = fState; 
#if DEBUGMUTEXRW
//  qtss_printf("LockWrite 'locked' fState = %d locked active readers = %d, waiting writers = %d, waiting readers=%d\n",fState, fActiveReaders, fReadWaiters, fWriteWaiters);
#endif

}
Ejemplo n.º 2
0
void MenuItem::Mouse(HWND hwnd, UINT uMsg, DWORD wParam, DWORD lParam)
{
    int i = 0;
    switch(uMsg)
    {
        case WM_MBUTTONUP:
            i = INVOKE_MID;
            break;

        case WM_RBUTTONUP:
            i = INVOKE_RIGHT;
            break;

        case WM_LBUTTONUP:
            i = INVOKE_LEFT;
            if (m_pMenu->m_dblClicked)
                i |= INVOKE_DBL;

            if (0x8000 & GetAsyncKeyState(VK_MENU))
            {
                if (i & INVOKE_DBL)
                    i = INVOKE_PROP;
                else
                    i = 0;
            }
            break;

        case WM_LBUTTONDBLCLK:
        case WM_LBUTTONDOWN:
        case WM_MBUTTONDOWN:
        case WM_RBUTTONDOWN:
            m_pMenu->set_capture(MENU_CAPT_ITEM);
            Active(1);
            break;

        case WM_MOUSEMOVE:
            if (m_pMenu->m_captureflg && hwnd != window_under_mouse())
            {
                // start drag operation on mouseleave
                m_pMenu->set_capture(0);
                i = INVOKE_DRAG;
                break;
            }
            Active(1);
            break;

        case WM_MOUSEWHEEL:
            m_pMenu->HideChild();
            Active(2);
            break;
    }

    if (i && m_bActive && false == m_bNOP)
        Invoke(i);
}
Ejemplo n.º 3
0
    void MasterEntity::PreFrame( bool paused )
    {
        if( m_Ready && !Active() )
            CommitActive();

        if( !paused )
            GameCall<void>( "GamePreFrame" );

        if( m_Controller.Exists() && Active() )
            m_Controller->PreFrame();
    }
Ejemplo n.º 4
0
// Mouse command MOUSEMOVE, LB_PRESSED, ...
void MenuItem::Mouse(HWND hwnd, UINT uMsg, DWORD wParam, DWORD lParam)
{
	int i = 0;
	switch (uMsg)
	{
	case WM_MBUTTONUP:
		i = INVOKE_MID;
		break;

	case WM_RBUTTONUP:
		i = INVOKE_RIGHT;
		break;

	case WM_LBUTTONUP:
		i = INVOKE_LEFT;
		if (m_pMenu->m_dblClicked) i |= INVOKE_DBL;
		break;

	case WM_LBUTTONDBLCLK:
	case WM_LBUTTONDOWN:
	case WM_MBUTTONDOWN:
	case WM_RBUTTONDOWN:
		SetCapture(hwnd);

	case WM_MOUSEMOVE:
		Active(1);
		break;
	}

	if (i && m_bActive)// && 0 == m_isNOP)
	{
		Menu::g_DiscardMouseMoves = 5;
		Invoke(i);
	}
}
Ejemplo n.º 5
0
void DriverLog::WriteLine(LPCTSTR message, ...)
{
	if (!Active() || message == 0)
		return;

    m_cs.Enter();
    
    static TCHAR lineStart[512];
    int lineStartSize = _stprintf_s(lineStart, 512, _T("[%4d][%6d]"), ::GetCurrentThreadId(), ::GetTickCount() - startTick);
    WriteFileLog(lineStart, lineStartSize);

    va_list args;
    va_start( args, message );

    int characters = _vsctprintf(message, args);
    if (characters != -1) {
		DynamicArray<TCHAR> buffer(characters + 5);
        if(-1 != _vstprintf_s(buffer, characters + 5, message, args)) {
			WritePipeLog(buffer, characters);
            buffer[characters] = _T('\r');
            buffer[characters + 1] = _T('\n');
            WriteFileLog(buffer, characters + 2);
        }
    }
    
    m_cs.Leave();
}
Ejemplo n.º 6
0
void ZModule_HealOverTime::BeginHeal(MMatchDamageType type, int nHealAmount, int numHeal, MMatchItemEffectId effectId, int nItemId)
{
	if (type != MMDT_HEAL && type != MMDT_REPAIR) { _ASSERT(0); return; }

	m_type.Set_CheckCrc(type);
	m_nEffectId = effectId;

	float fCurrTime = ZGetGame()->GetTime();

	m_fBeginTime.Set_CheckCrc(fCurrTime);

	m_fHeal.Set_CheckCrc((float)nHealAmount);
	m_numHealDesire.Set_CheckCrc(numHeal);
	m_numHealDone.Set_CheckCrc(0);

	if (!m_bOnHeal.Ref())
	{
		m_fNextHealTime.Set_CheckCrc(fCurrTime);
	}

	m_bOnHeal.Set_CheckCrc(true);
	m_nItemId = nItemId;

	Active();
}
Ejemplo n.º 7
0
    void PhysicsBodyObject::SetActive( bool active )
    {
        if( active == Active() )
            return;

        rsk::ActiveObject::SetActive( active );
    //
    //  Encapsulate RSKMAP_ITERATE; duplicate them so only what's needed is run
        PhysicsWorld* world = gGame->GetWorld();
        if( active )
        {
            RSKMAP_ITERATE_VALUE_NAMED( m_Detectors, slot )
            {
                if( slot->active )
                {
                    world->AddBody( slot->area.Self() );
                    CommitDetectorActive( *slot, active );
                }
            }
            return;
        }

        if( world )
        {
            RSKMAP_ITERATE_VALUE_NAMED( m_Detectors, slot )
            {
                CommitDetectorActive( *slot, active );
                world->RemoveBody( slot->area->GetID() );
            }
            return;
        }
Ejemplo n.º 8
0
/*
==================
FullscreenFX_DoubleVision::HighQuality
==================
*/
void FullscreenFX_DoubleVision::HighQuality() {
	int offset = fxman->GetPlayerView()->dvFinishTime - gameLocal.fast.time;
	float scale = offset * g_dvAmplitude.GetFloat();

	// for testing purposes
	if ( !Active() ) {
		static int test = 0;
		if ( test > 312 ) {
			test = 0;
		}

		offset = test++;
		scale = offset * g_dvAmplitude.GetFloat();
	}

	idPlayer * player = fxman->GetPlayer();

	if( player == NULL ) {
		return;
	}

	offset *= 2;		// crutch up for higher res

	// set the scale and shift
	if ( scale > 0.5f ) {
		scale = 0.5f;
	}
	float shift = scale * sin( sqrtf( (float)offset ) * g_dvFrequency.GetFloat() );
	shift = fabs( shift );

	// carry red tint if in berserk mode
	idVec4 color( 1.0f, 1.0f, 1.0f, 1.0f );
	if ( gameLocal.fast.time < player->inventory.powerupEndTime[ BERSERK ] ) {
		color.y = 0.0f;
		color.z = 0.0f;
	}

	if ( !common->IsMultiplayer() && gameLocal.fast.time < player->inventory.powerupEndTime[ HELLTIME ] || gameLocal.fast.time < player->inventory.powerupEndTime[ INVULNERABILITY ]) {
		color.y = 0.0f;
		color.z = 0.0f;
	}

	// uv coordinates
	float s0 = shift;
	float t0 = 1.0f;
	float s1 = 1.0f;
	float t1 = 0.0f;


	renderSystem->SetColor4( color.x, color.y, color.z, 1.0f );
	renderSystem->DrawStretchPic( 0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT, s0, t0, s1, t1, material );

	renderSystem->SetColor4( color.x, color.y, color.z, 0.5f );
	s0 = 0.0f;
	t0 = 1.0f;
	s1 = ( 1.0-shift );
	t1 = 0.0f;

	renderSystem->DrawStretchPic( 0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT, s0, t0, s1, t1, material );
}
Ejemplo n.º 9
0
void cVnsiOsd::SetActive(bool On)
{
  if (On != Active())
  {
    cOsd::SetActive(On);
    if (On)
    {
      // must clear all windows here to avoid flashing effects - doesn't work if done
      // in Flush() only for the windows that are actually used...
      for (int i = 0; i < MAXNUMWINDOWS; i++)
      {
        Cmd(VNSI_OSD_CLEAR, i);
      }
      if (GetBitmap(0)) // only flush here if there are already bitmaps
        Flush();
    }
    else if (shown)
    {
      for (int i = 0; GetBitmap(i); i++)
      {
        Cmd(VNSI_OSD_CLOSE, i);
      }
      shown = false;
    }
  }
}
Ejemplo n.º 10
0
void
IrcAbstractChannel::Incoming (const QString & message,
                         const QString & rawMessage)
{
  QString cooked = HtmlMangle::Anchorize (message, 
                         HtmlMangle::HttpExp(),
                         HtmlMangle::HtmlAnchor);
qDebug () << " cooked message " << cooked;
  QDateTime now = QDateTime::currentDateTime ();
  QString smalldate ("<span style=\"font-size:small\">"
                     "%1</span> %2");
  QString cookedLine;
  cookedLine.append ("<br>\n");
  cookedLine.append (smalldate
                          .arg (now.toString ("hh:mm:ss"))
                          .arg (cooked));
  cookedLog.append (cookedLine);
  UpdateCooked ();
  if (logging) {
    logFile.write (cookedLine.toUtf8());
    logFile.flush ();
  }
  CheckWatch (rawMessage.length() > 0 ? rawMessage : message);
  emit Active (this);
}
Ejemplo n.º 11
0
RefResult Composite::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, 
   PartID& partID, RefMessage message ) {
	switch (message) {
		case REFMSG_CHANGE:			
			if (paramDlg) 
				paramDlg->Invalidate();
			if (pblock->LastNotifyParamID() == comptex_tex && pblock->Count(comptex_tex) != subTex.Count())
				SetNumMaps(pblock->Count(comptex_tex));
			else if (pblock->LastNotifyParamID() == comptex_ons && pblock->Count(comptex_ons) != subTex.Count())
				SetNumMaps(pblock->Count(comptex_ons));
			DiscardTexHandles(); // DS 5/4/00
			ivalid.SetEmpty();
			if (paramDlg&&Active())
				paramDlg->ip->MtlChanged();
			break;
		
		case REFMSG_GET_PARAM_DIM:
			return REF_STOP; 
		
		case REFMSG_GET_PARAM_NAME: {
			GetParamName *gpn = (GetParamName*)partID;
			gpn->name= GetSubTexmapSlotName(gpn->index);			
			return REF_STOP; 
			}
		}
	return(REF_SUCCEED);
	}
Ejemplo n.º 12
0
void
TMagnify::StartSave()
{
	fImageFrozenOnSave = Active();
	if (fImageFrozenOnSave)
		MakeActive(false);
}
Ejemplo n.º 13
0
void CScoreboard::OnRender()
{
	if(!Active())
		return;

	// if the score board is active, then we should clear the motd message aswell
	if(m_pClient->m_pMotd->IsActive())
		m_pClient->m_pMotd->Clear();


	float Width = 400*3.0f*Graphics()->ScreenAspect();
	float Height = 400*3.0f;

	Graphics()->MapScreen(0, 0, Width, Height);

	float w = 700.0f;

	if(m_pClient->m_Snap.m_pGameInfoObj)
	{
		if(!(m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_TEAMS))
			RenderScoreboard(Width/2-w/2, 150.0f, w, 0, 0);
		else
		{
			const char *pRedClanName = GetClanName(TEAM_RED);
			const char *pBlueClanName = GetClanName(TEAM_BLUE);

			if(m_pClient->m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER && m_pClient->m_Snap.m_pGameDataObj)
			{
				char aText[256];
				str_copy(aText, Localize("Draw!"), sizeof(aText));

				if(m_pClient->m_Snap.m_pGameDataObj->m_TeamscoreRed > m_pClient->m_Snap.m_pGameDataObj->m_TeamscoreBlue)
				{
					if(pRedClanName)
						str_format(aText, sizeof(aText), Localize("%s wins!"), pRedClanName);
					else
						str_copy(aText, Localize("Red team wins!"), sizeof(aText));
				}
				else if(m_pClient->m_Snap.m_pGameDataObj->m_TeamscoreBlue > m_pClient->m_Snap.m_pGameDataObj->m_TeamscoreRed)
				{
					if(pBlueClanName)
						str_format(aText, sizeof(aText), Localize("%s wins!"), pBlueClanName);
					else
						str_copy(aText, Localize("Blue team wins!"), sizeof(aText));
				}

				float w = TextRender()->TextWidth(0, 86.0f, aText, -1);
				TextRender()->Text(0, Width/2-w/2, 39, 86.0f, aText, -1);
			}

			RenderScoreboard(Width/2-w-5.0f, 150.0f, w, TEAM_RED, pRedClanName ? pRedClanName : Localize("Red team"));
			RenderScoreboard(Width/2+5.0f, 150.0f, w, TEAM_BLUE, pBlueClanName ? pBlueClanName : Localize("Blue team"));
		}
	}

	RenderGoals(Width/2-w/2, 150+760+10, w);
	RenderSpectators(Width/2-w/2, 150+760+10+50+10, w);
	RenderRecordingNotification((Width/7)*4);
}
Ejemplo n.º 14
0
void cStreamdevStreamer::Activate(bool On) 
{
	if (On && !Active()) {
		Dprintf("activate streamer\n");
		m_Writer->Start();
		cThread::Start();
	}
}
Ejemplo n.º 15
0
int CScriptDebugger::PrepareLua(lua_State* l)
{
	// call this function immediatly before calling lua_pcall. 
	//returns index in stack for errorFunc
	if(!Active())return -1;

	m_nMode = DMOD_NONE;
	return m_lua->PrepareLua(l);
}
Ejemplo n.º 16
0
void CommandItem::next_item (WPARAM wParam)
{
    Menu *pm = m_pMenu->m_pParent;
    if (pm) {
        pm->set_focus();
        Active(0);
        PostMessage(pm->m_hwnd, WM_KEYDOWN, wParam, 0);
    }
}
Ejemplo n.º 17
0
LRESULT CScriptDebugger::_SendMessage(u32 message, WPARAM wParam, LPARAM lParam)
{
//	if ( (m_pDebugger)&&(m_pDebugger->Active())&&(message >= _DMSG_FIRST_MSG && message <= _DMSG_LAST_MSG) )
//		return m_pDebugger->DebugMessage(message, wParam, lParam);
	if ( (Active())&&(message >= _DMSG_FIRST_MSG && message <= _DMSG_LAST_MSG) )
		return DebugMessage(message, wParam, lParam);

	return 0;
}
Ejemplo n.º 18
0
BOOL CScriptDebugger::PrepareLuaBind()
{
	if(!Active())return FALSE;

	m_lua->PrepareLuaBind();
	m_nMode = DMOD_NONE;

	return TRUE;
}
Ejemplo n.º 19
0
void ShaderManager::Select( Shader *shader )
{
	bool active = Active();
	
	Selected = shader;
	
	if( active )
		glUseProgram( Selected->ProgramHandle );
}
Ejemplo n.º 20
0
void CCreditsState::Enter( void )
{
	Active(true);

	m_nBackgroundImgID = CSGD_TextureManager::GetInstance()->LoadTexture(
		_T("resource/graphics/menus/credits.png"));

	CAudioManager::GetInstance()->Play(BGM::CREDITS);
}
/**
  Function 		: MoveAsyncImap4CommandL
  Description 	: This function retrieves the download limits set
  @param 		: aCommand			The Imap command to be executed.
			 	  aImapServiceId	The Imap service Id
				  aMailSelection	The selection object
				  aDownloadLimits	The download limts set.		
  @return 		: none
*/
void CT_MsgImapMoveAsyncFunction::MoveAsyncImap4CommandL( TImap4Cmds aCommand,
										    CMsvEntrySelection& aMailSelection, TMsvId aImapServiceId , TBool aDownloadLimits, TMsvId afolderId)
	{
	
	// Loads the Imap account settings and saves the download limits
	CEmailAccounts* emailAccounts = CEmailAccounts::NewLC();	
	CImImap4Settings* imapSettings =  new(ELeave) CImImap4Settings();
	CleanupStack::PushL(imapSettings);

	TImapAccount imapAccount;
	emailAccounts->GetImapAccountL(aImapServiceId, imapAccount);
	emailAccounts->LoadImapSettingsL(imapAccount, *imapSettings);


	// If full download limts are set load it onto the the account
	CT_MsgActive&	active=Active();
	if(aDownloadLimits)
		{
		TImImap4GetMailInfo imapFullinfo;
		imapFullinfo.iDestinationFolder = afolderId;
		imapFullinfo.iGetMailBodyParts = imapSettings->GetMailOptions();
		imapFullinfo.iMaxEmailSize = imapSettings->MaxEmailSize();
	
		// Package of the download limits
		TPckgBuf<TImImap4GetMailInfo> fullPack(imapFullinfo);

		iSharedDataIMAP.iMtm->SwitchCurrentEntryL(aImapServiceId);
		// Moves asynchronous IMAP4-specific operation 
		iOperation = iSharedDataIMAP.iMtm->InvokeAsyncFunctionL(aCommand,aMailSelection, fullPack, active.iStatus);	
		}
	// If partial download limts are set load it onto the the account 
	else 
		{
		TImImap4GetPartialMailInfo imapPartialinfo;
		imapPartialinfo.iAttachmentSizeLimit = imapSettings->AttachmentSizeLimit();
		imapPartialinfo.iBodyTextSizeLimit = imapSettings->BodyTextSizeLimit();
		imapPartialinfo.iDestinationFolder = afolderId;
		imapPartialinfo.iPartialMailOptions = imapSettings->PartialMailOptions();
		imapPartialinfo.iTotalSizeLimit = imapSettings->MaxEmailSize();
	
		// Package of the download limits 
		TPckgBuf<TImImap4GetPartialMailInfo> partialPack(imapPartialinfo);
		
		// Switches the cuurent context on to the IMAP service ID 
		iSharedDataIMAP.iMtm->SwitchCurrentEntryL(aImapServiceId);
		
		// Moves asynchronous IMAP4-specific operation
		iOperation = iSharedDataIMAP.iMtm->InvokeAsyncFunctionL(aCommand,aMailSelection, partialPack, active.iStatus);
		}

	active.Activate();
	CActiveScheduler::Start();
	User::LeaveIfError(active.Result());

	CleanupStack::PopAndDestroy(2,emailAccounts); // imapSettings,emailAccounts
	}
Ejemplo n.º 22
0
/*attacked() returns 1 if square 'target' is attacked by color 'color'
  and 0 otherwise*/
int attacked(const int target, const int color) {
	int c;
	unsigned __int64 all;
	all = Bitboard(BLACK) | Bitboard(WHITE);

	for (c = 0;c < 16;c++) {
			if (Active(color, c)) {
				assert(Name(color,0)==king);
				if (c>0) assert(Name(color,c)!=king);					
					
					if (Kind(color, c)&table_attack[target - Position(color, c) + 128]) {
							if (IsNoSlide(color, c))
								return 1;

							if ((all&(bit_ray[Position(color, c)][target])) == 0)
								return 1;
							}

					}

			}

	switch (color) {
			case BLACK:

				if (File(target) != FilaA && IsBPawn(target + UP_L))
					return 1;

				if (File(target) != FilaH && IsBPawn(target + UP_R))
					return 1;

				break;

			case WHITE:
				if (File(target) != FilaA && IsWPawn(target + DOWN_L))
					return 1;

				if (File(target) != FilaH && IsWPawn(target + DOWN_R))
					return 1;

				break;

			case EMPTY:
				printf("Bad color board detect in attacked(): %d",color);
				assert(0);
				break;

			default:
				printf("Bad color board detect in attacked(): %d",color);
				assert(0);

				break;
			}

	return 0;
	}
Ejemplo n.º 23
0
//-----------------------------------------
// Функция логирует вставку из буфера обмена
//-----------------------------------------
void TKeyLogger::LogClipboard(const char* Text)
{
	//------  блокируем код --------
	TLock L = GetLock();
	//------------------------------
	if (STRA::IsEmpty(Text) || !Active()) return;

	HWND Wnd = (HWND)pGetFocus();
    FGrabber->LogClipboard(Wnd, Text);
}
Ejemplo n.º 24
0
void DriverLog::Deinitialize()
{
    if (!Active()) 
		return;

    CloseHandle(log_fp);

    log_fp = INVALID_HANDLE_VALUE;
	m_pipe = 0;
}
Ejemplo n.º 25
0
static PyObject *
PySfRenderWindow_SetActive(PySfRenderWindow *self, PyObject *args)
{
	PyObject*  Active( 0 );

	PyArg_ParseTuple( args, "|O", &Active );
	self->obj->SetActive( Active == 0 ? true : PyBool_AsBool( Active ) );

	Py_RETURN_NONE;
}
/**
 Function : doTestStepL
 Description : Get the count of message entries satisfying serach-sort criteria.
 @return : TVerdict - Test step result
 */
TVerdict CT_MsgSearchSortResultByQueryId::doTestStepL()
	{
	INFO_PRINTF1(_L("Test Step : SearchSortResultByQueryId"));
	TInt queryId = 0;
	if(!GetIntFromConfig(ConfigSection(), KRepeatedQueryID, queryId))
		{
		ERR_PRINTF1(_L("Can not find any Query ID for Execution"));
		SetTestStepResult(EFail);
		}
	else
		{
		// Set the preferred result type flag, default value is TMsvId 
		TBool resInTMsvEntry = EFalse;
		GetBoolFromConfig(ConfigSection(), KResultAsTMsvEntry, resInTMsvEntry);	
		TMsvSearchSortResultType resultType = EMsvResultAsTMsvId;
		if(resInTMsvEntry)
			{
			resultType = EMsvResultAsTMsvEntry;
			}
		
		// Set the iteration limit for getting the results
		TInt iteratorLimit = 0;
		GetIntFromConfig(ConfigSection(), KIteratorLimit, iteratorLimit);

		// Execute the search/sort request
		iSharedDataCommon.iSearchSortOperation = CMsvSearchSortOperation::NewL(*iSharedDataCommon.iSession);
		CT_MsgActive& active=Active();
		TRAPD(err, iSharedDataCommon.iSearchSortOperation->RequestL(queryId, active.iStatus, iteratorLimit));

		if(err == KErrNone)
			{
			active.Activate();
			CActiveScheduler::Start();
			
			//Check Search/Sort operation for errors
			TInt error = active.Result();
			if (error != KErrNone)
				{
				ERR_PRINTF2(_L("Search/Sort request failed with %d error"), error);
				SetTestStepError(error);
				}
			else
				{
				RetriveSearchSortResultL(iteratorLimit, resultType);
				}
			}
		else
			{
			SetTestStepError(err);	
			}
		}
		
	return TestStepResult();
	}
Ejemplo n.º 27
0
void TitleItem::Mouse(HWND hwnd, UINT uMsg, DWORD wParam, DWORD lParam)
{
    Menu *p = m_pMenu;

    switch(uMsg) {
    case WM_RBUTTONUP:
        if (m_bActive)
        {
#ifdef MENU_ROLLUP
            if (0x8000 & GetAsyncKeyState(VK_MENU))
            {
                p->m_bOnTop = false == p->m_bOnTop;
                p->SetZPos();
            }
            else
#endif
            if (wParam & MK_SHIFT)
                ShowContextMenu(NULL, m_pidl);
            else
                p->HideThis();
        }
        break;

    case WM_LBUTTONDBLCLK:
#ifdef MENU_ROLLUP
        p->m_bIconized = false == p->m_bIconized;
        p->redraw();
#else
        p->m_bOnTop = false == p->m_bOnTop;
        p->SetZPos();
#endif
        break;

    case WM_LBUTTONDOWN:
        UpdateWindow(hwnd);
        p->SetPinned(true);
        SetCursor(MenuInfo.move_cursor);
        SendMessage(hwnd, WM_SYSCOMMAND, 0xf012, 0);
        SetCursor(MenuInfo.arrow_cursor);
        p->SetZPos();
        if (false == p->m_bOnTop)
        {
            HWND hwnd = window_under_mouse();
            if (hwnd && (WS_EX_TOPMOST & GetWindowLong(hwnd, GWL_EXSTYLE)))
                p->m_bOnTop = true, p->SetZPos();
        }
        break;

    case WM_MOUSEMOVE:
    case WM_RBUTTONDOWN:
        Active(1);
        break;
    }
}
FilterGenreButton::FilterGenreButton(std::string const& label, NUX_FILE_LINE_DECL)
  : FilterBasicButton(label, NUX_FILE_LINE_PARAM)
{
  InitTheme();

  state_change.connect([this](nux::Button* button)
  {
    if (filter_)
      filter_->active = Active();
  });
}
/**
 Function : doTestStepL
 Description : Get the count of message entries satisfying serach-sort criteria and get the entries.
 @return : TVerdict - Test step result
 */
TVerdict CT_MsgSearchSortByQueryObject::doTestStepL()
	{
	INFO_PRINTF1(_L("Test Step : SearchSortByQueryObject"));
	
	// Read query marking option
	TBool markQuery = EFalse;
	GetBoolFromConfig(ConfigSection(), KMarkQuery, markQuery);
	markQuery ? INFO_PRINTF1(_L("Query is marked")) : INFO_PRINTF1(_L("Query is to not marked"));

	// Read the iteration limit for getting the results
	TInt iteratorLimit = 0;
	GetIntFromConfig(ConfigSection(), KIteratorLimit, iteratorLimit);

	// Execute the search/sort request
	iSharedDataCommon.iSearchSortOperation = CMsvSearchSortOperation::NewL(*iSharedDataCommon.iSession);
	CT_MsgActive& active=Active();
	TRAPD(err, iSharedDataCommon.iSearchSortOperation->RequestL(iSharedDataCommon.iSearchSortQuery, markQuery, active.iStatus, iteratorLimit));
	if(err == KErrNone)
		{
		active.Activate();
		CActiveScheduler::Start();
		
		//Check Search/Sort operation for errors
		TInt error = active.Result();
		if (error != KErrNone)
			{
			ERR_PRINTF2(_L("Search/Sort request failed with %d error"), error);
			SetTestStepError(error);
			}
		else
			{
			// Get the query ID for the above search/sort request
			TInt quryId = iSharedDataCommon.iSearchSortOperation->GetQueryIdL();
			TBool isRepetitionRequired = EFalse;
			GetBoolFromConfig(ConfigSection(), KIsRepetitionRequired, isRepetitionRequired);
			// Save the query ID to INI file
			isRepetitionRequired ? WriteIntToConfig(ConfigSection(), KRepeatedQueryID, quryId):WriteIntToConfig(ConfigSection(), KLastQueryID, quryId);

			TBool resInTMsvEntry = EFalse;
			GetBoolFromConfig(ConfigSection(), KResultAsTMsvEntry, resInTMsvEntry);	
			TMsvSearchSortResultType resultType = EMsvResultAsTMsvId;
			if(resInTMsvEntry)
				{
				resultType = EMsvResultAsTMsvEntry;
				}
			RetriveSearchSortResultL(iteratorLimit, resultType);
			}
		}
	else
		{
		SetTestStepError(err);	
		}
	return TestStepResult();
	}
Ejemplo n.º 30
0
CScriptDebugger::~CScriptDebugger()
{
	if (Active())
		_SendMessage	(DMSG_CLOSE_CONNECTION,0,0);

	CloseHandle			(m_mailSlot);

	xr_delete			(m_threads);
	xr_delete			(m_callStack);
	xr_delete			(m_lua);
}