void Plugin::handleBatteryInfo (BatteryInfo info) { if (!Battery2Action_.contains (info.ID_)) { QAction *act = new QAction (tr ("Battery status"), this); act->setProperty ("WatchActionIconChange", true); act->setProperty ("Liznoo/BatteryID", info.ID_); act->setProperty ("Action/Class", GetUniqueID () + "/BatteryAction"); act->setProperty ("Action/ID", GetUniqueID () + "/" + info.ID_); emit gotActions (QList<QAction*> () << act, AEPLCTray); Battery2Action_ [info.ID_] = act; connect (act, SIGNAL (triggered ()), this, SLOT (handleHistoryTriggered ())); } UpdateAction (info); CheckNotifications (info); Battery2LastInfo_ [info.ID_] = info; }
void Plugin::handleBatteryInfo (BatteryInfo info) { #if QT_VERSION < 0x050000 const auto& iconName = GetBattIconName (info); if (!Battery2Action_.contains (info.ID_)) { QAction *act = new QAction (tr ("Battery status"), this); act->setProperty ("WatchActionIconChange", true); act->setProperty ("Liznoo/BatteryID", info.ID_); act->setProperty ("Action/Class", GetUniqueID () + "/BatteryAction"); act->setProperty ("Action/ID", GetUniqueID () + "/" + info.ID_); act->setProperty ("ActionIcon", iconName); emit gotActions ({ act }, ActionsEmbedPlace::LCTray); Battery2Action_ [info.ID_] = act; connect (act, SIGNAL (triggered ()), this, SLOT (handleHistoryTriggered ())); } else Battery2Action_ [info.ID_]->setProperty ("ActionIcon", iconName); #endif CheckNotifications (info); Battery2LastInfo_ [info.ID_] = info; }
void CStringID::SetContentWithExpectedCRC(const char* content, bool noCase, bool resolve, IDType crc) { SetContent(content, noCase, resolve); IDType computedCrc = GetUniqueID(); if (crc != computedCrc) { BEHAVIAC_ASSERT(false, "C%sStringID(0x%08X, \"%s\") has wrong CRC (should be 0x%08X!) RETAIL BUILDS WILL USE THE WRONG VALUE, THIS MUST BE FIXED P0!", noCase ? "NoCase" : "", crc, content, GetUniqueID()); } }
/****************************************************************************** Function Name : CBaseEntityTA Input(s) : CBaseEntityTA& RefObj Output : - Functionality : Copy Constructor Member of : CBaseEntityTA Friend of : - Author(s) : Venkatanarayana Makam Date Created : 06/04/2011 Modifications : ******************************************************************************/ CBaseEntityTA::CBaseEntityTA(const CBaseEntityTA& RefObj) { m_dwNextID = RefObj.m_dwNextID; m_dwID = GetUniqueID(); m_eType = RefObj.m_eType; m_lDefaultChannelUsed = RefObj.m_lDefaultChannelUsed; }
void dLineNodeInfo::DrawWireFrame(dSceneRender* const render, dScene* const scene, dScene::dTreeNode* const myNode) const { dAssert (myNode == scene->Find(GetUniqueID())); dAssert (scene->GetInfoFromNode(myNode) == this); // int displayList = render->GetCachedFlatShadedDisplayList(m_mesh); // dAssert (displayList > 0); if (m_curve.GetControlPointArray()) { dVector savedColor (render->GetColor()); render->PushMatrix(&m_matrix[0][0]); //render->DrawDisplayList(displayList); render->BeginLine(); render->SetColor(dVector (1.0f, 1.0f, 1.0f)); dFloat scale = 1.0f / m_renderSegments; dBigVector p0 (m_curve.CurvePoint(0.0f)); for (int i = 1; i <= m_renderSegments; i ++) { dFloat u = i * scale; dBigVector p1 (m_curve.CurvePoint(u)); render->DrawLine (dVector(dFloat(p0.m_x), dFloat(p0.m_y), dFloat(p0.m_z), dFloat(p0.m_w)), dVector(dFloat(p1.m_x), dFloat(p1.m_y), dFloat(p1.m_z), dFloat(p1.m_w))); p0 = p1; } render->End(); render->PopMatrix(); render->SetColor(savedColor); } }
OP_STATUS SpeedDialData::GenerateIDIfNeeded(BOOL force, BOOL use_hash, INT32 position) { // generate a unique id if(force || GetUniqueID().IsEmpty()) { if(use_hash && position > 0) { // Generate a hash based on the position and url, only call on upgrade from < 11.10 // See https://ssl.opera.com:8008/developerwiki/Opera_Link/Speeddial_2.0#General_notes OpString8 str8, url, md5; RETURN_IF_ERROR(url.SetUTF8FromUTF16(GetURL())); RETURN_IF_ERROR(str8.AppendFormat("%d%s", position, url.CStr())); RETURN_IF_ERROR(OpMisc::CalculateMD5Checksum(str8.CStr(), str8.Length(), md5)); md5.MakeUpper(); RETURN_IF_ERROR(m_unique_id.Set(md5.CStr())); } else { // generate a default unique ID RETURN_IF_ERROR(StringUtils::GenerateClientID(m_unique_id)); } } return OpStatus::OK; }
AAX_Result IPlugAAX::SetChunk(AAX_CTypeID chunkID, const AAX_SPlugInChunk * iChunk ) { TRACE; if (chunkID == GetUniqueID()) { ByteChunk IPlugChunk; IPlugChunk.PutBytes(iChunk->fData, iChunk->fSize); int pos = 0; //GetIPlugVerFromChunk(&IPlugChunk, &pos); pos = UnserializeState(&IPlugChunk, pos); for (int i = 0; i< NParams(); i++) { SetParameterNormalizedValue(mParamIDs.Get(i)->Get(), GetParam(i)->GetNormalized() ); } RedrawParamControls(); //TODO: what about icontrols not linked to params how do they get redrawn - setdirty via UnserializeState()? mNumPlugInChanges++; // necessary in order to cause CompareActiveChunk() to get called again and turn off the compare light return AAX_SUCCESS; } return AAX_ERROR_INVALID_CHUNK_ID; }
FAsyncPathFindingQuery::FAsyncPathFindingQuery(const UObject* InOwner, const ANavigationData& InNavData, const FVector& Start, const FVector& End, const FNavPathQueryDelegate& Delegate, TSharedPtr<const FNavigationQueryFilter> SourceQueryFilter) : FPathFindingQuery(InOwner, InNavData, Start, End, SourceQueryFilter) , QueryID(GetUniqueID()) , OnDoneDelegate(Delegate) { }
void Plugin::NotifyBirthday (ICLEntry *entry, int days) { const auto& hrId = entry->GetEntryName (); const QString& notify = days ? tr ("%1 has birthday in %n day(s)!", 0, days).arg (hrId) : tr ("%1 has birthday today!").arg (hrId); auto e = Util::MakeNotification (tr ("Birthday reminder"), notify, PInfo_); e.Additional_ ["org.LC.AdvNotifications.SenderID"] = GetUniqueID (); e.Additional_ ["org.LC.AdvNotifications.EventCategory"] = AN::CatOrganizer; e.Additional_ ["org.LC.AdvNotifications.EventID"] = "org.LC.Plugins.Azoth.BirthdayNotifier.Birthday/" + entry->GetEntryID (); e.Additional_ ["org.LC.AdvNotifications.VisualPath"] = QStringList (hrId); e.Additional_ ["org.LC.AdvNotifications.EventType"] = AN::TypeOrganizerEventDue; e.Additional_ ["org.LC.AdvNotifications.FullText"] = notify; e.Additional_ ["org.LC.AdvNotifications.ExtendedText"] = notify; e.Additional_ ["org.LC.AdvNotifications.Count"] = 1; const auto& px = QPixmap::fromImage (entry->GetAvatar ()); if (!px.isNull ()) e.Additional_ ["NotificationPixmap"] = px; emit gotEntity (e); }
void cArrowEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) { if (!a_EntityHit.IsMob() && !a_EntityHit.IsMinecart() && !a_EntityHit.IsPlayer() && !a_EntityHit.IsBoat()) { // Not an entity that interacts with an arrow return; } int Damage = (int)(GetSpeed().Length() / 20 * m_DamageCoeff + 0.5); if (m_IsCritical) { Damage += m_World->GetTickRandomNumber(Damage / 2 + 2); } a_EntityHit.TakeDamage(dtRangedAttack, this, Damage, 1); // Broadcast successful hit sound m_World->BroadcastSoundEffect( "random.successful_hit", (int)std::floor(GetPosX() * 8.0), (int)std::floor(GetPosY() * 8.0), (int)std::floor(GetPosZ() * 8.0), 0.5f, 0.75f + ((float)((GetUniqueID() * 23) % 32)) / 64.0f ); Destroy(); }
FAsyncPathFindingQuery::FAsyncPathFindingQuery(const FPathFindingQuery& Query, const FNavPathQueryDelegate& Delegate, const EPathFindingMode::Type QueryMode) : FPathFindingQuery(Query) , QueryID(GetUniqueID()) , OnDoneDelegate(Delegate) , Mode(QueryMode) { }
bool VUINodeRotator::Build(TiXmlElement *pNode, const char *szPath, bool bWrite) { if ( bWrite == false ) { return VPushButton::Build( pNode,szPath,bWrite); } if ( GetUniqueID() != 0 ) { VString szID = VGUIManager::GetIDName( (int)GetUniqueID() ); XMLHelper::Exchange_String(pNode,"ID",szID,bWrite); } XMLHelper::Exchange_Floats(pNode,"pos",m_vPosition.data,2,bWrite); XMLHelper::Exchange_Floats(pNode,"size",m_vSize.data,2,bWrite); VUINodeExportHelperXML::GlobalManager().BuildImageState( &m_ButtonCfg , this , XMLHelper::SubNode(pNode,"image",bWrite) , szPath,bWrite ); VUINodeExportHelperXML::GlobalManager().BuildTextState( &m_TextCfg , this , XMLHelper::SubNode(pNode,"text",bWrite) , szPath,bWrite ); // m_ButtonCfg.SetStretchMode(VImageState::TEXTURE_SIZE); // get the size of the control if (m_vSize.x<=0.f) { m_vSize = m_ButtonCfg.m_States[VDlgControlBase::NORMAL].GetSize(); float fBoxWidth = m_vSize.x; hkvVec2 vTextSize = m_TextCfg.m_States[VDlgControlBase::NORMAL].GetSize(); m_vSize.x += vTextSize.x + fBoxWidth; m_vSize.y = hkvMath::Max(m_vSize.y,vTextSize.y); // offset the text by the size of the checkbox for (int i=0;i<VWindowBase::STATE_COUNT;i++) { hkvVec2 vNewOfs = m_TextCfg.m_States[i].GetTextOfs(); vNewOfs.x += fBoxWidth; m_TextCfg.m_States[i].SetTextOfs(vNewOfs); } } // initial checked status (actually same as selected) bool bChecked = false; XMLHelper::Exchange_Bool(pNode,"checked",bChecked,bWrite); return true; }
FAsyncPathFindingQuery::FAsyncPathFindingQuery(const UObject* InOwner, const ANavigationData* InNavData, const FVector& Start, const FVector& End, const FNavPathQueryDelegate& Delegate, TSharedPtr<const FNavigationQueryFilter> SourceQueryFilter) : FPathFindingQuery(InOwner, *InNavData, Start, End, SourceQueryFilter) , QueryID(GetUniqueID()) , OnDoneDelegate(Delegate) { if (InNavData == nullptr) { UE_LOG(LogNavigation, Error, TEXT("Trying to instantiate FAsyncPathFindingQuery while InNavData == null")); } }
QList<EffectInfo> Plugin::GetEffects () const { return { { GetUniqueID () + ".Filter", tr ("Visual effects"), {}, false, [this] (const QByteArray&, IPath*) -> IFilterElement* { return new VisualFilter { GetUniqueID () + ".Filter", LmpProxy_ }; } } }; }
void CVideoInfoTag::SetUniqueIDs(std::map<std::string, std::string> uniqueIDs) { for (const auto& uniqueid : uniqueIDs) { if (uniqueid.first.empty()) uniqueIDs.erase(uniqueid.first); } if (uniqueIDs.find(m_strDefaultUniqueID) == uniqueIDs.end()) uniqueIDs[m_strDefaultUniqueID] = GetUniqueID(); m_uniqueIDs = std::move(uniqueIDs); }
QList<EffectInfo> Plugin::GetEffects () const { return { { GetUniqueID () + ".Filter", tr ("HTTP streaming"), {}, false, [this] (const QByteArray& instance, IPath *path) -> IFilterElement* { return new HttpStreamFilter { GetUniqueID () + ".Filter", instance, path }; } } }; }
Actor::Actor () { //_drawable=new Drawable(); //_physics= new BasicPhysics(PhysicsArgu::basicArgu); _drawable=NULL; _physics=NULL; _collider=NULL; _ID=GetUniqueID(); _position = Vector2D::ZERO; // _isCollidable = true; }
void dMeshNodeInfo::DrawFlatShaded(dSceneRender* const render, dScene* const scene, dScene::dTreeNode* const myNode) const { dAssert (myNode == scene->Find(GetUniqueID())); dAssert (scene->GetInfoFromNode(myNode) == this); int displayList = render->GetCachedFlatShadedDisplayList(m_mesh); dAssert (displayList > 0); render->PushMatrix(&m_matrix[0][0]); //render->SetColor(dVector(0, 0, 0, 0)); render->DrawDisplayList(displayList); render->PopMatrix(); }
bool VUINodeImage::Build(TiXmlElement *pNode, const char *szPath, bool bWrite) { if ( bWrite == false ) { return VImageControl::Build( pNode,szPath,bWrite); } if ( GetUniqueID() != 0 ) { VString szID = VGUIManager::GetIDName( (int)GetUniqueID() ); XMLHelper::Exchange_String(pNode,"ID",szID,bWrite); } XMLHelper::Exchange_Floats(pNode,"pos",m_vPosition.data,2,bWrite); XMLHelper::Exchange_Floats(pNode,"size",m_vSize.data,2,bWrite); // if (!VDlgControlBase::Build(pNode,szPath,bWrite)) // return false; VUINodeExportHelperXML::GlobalManager().BuildImageState( &m_Image , this , XMLHelper::SubNode(pNode,"image",bWrite) , szPath,bWrite ); return true; }
void Plugin::Init (ICoreProxy_ptr proxy) { Proxy_ = proxy; Util::InstallTranslator ("tabslist"); ShowList_ = new QAction (tr ("List of tabs"), this); ShowList_->setProperty ("ActionIcon", "view-list-details"); ShowList_->setShortcut (QString ("Ctrl+Shift+L")); ShowList_->setProperty ("Action/ID", GetUniqueID () + "_showlist"); connect (ShowList_, SIGNAL (triggered ()), this, SLOT (handleShowList ())); }
cPlayer::~cPlayer(void) { LOGD("Deleting cPlayer \"%s\" at %p, ID %d", m_PlayerName.c_str(), this, GetUniqueID()); // Notify the server that the player is being destroyed cRoot::Get()->GetServer()->PlayerDestroying(this); SaveToDisk(); m_World->RemovePlayer( this ); m_ClientHandle = NULL; delete m_InventoryWindow; LOGD("Player %p deleted", this); }
void UDestructibleComponent::SetCollisionResponseForActor(PxRigidDynamic* Actor, int32 ChunkIdx, const FCollisionResponseContainer* ResponseOverride /*= NULL*/) { #if WITH_APEX if (ApexDestructibleActor == NULL) { return; } // Get collision channel and response PxFilterData PQueryFilterData, PSimFilterData; uint8 MoveChannel = GetCollisionObjectType(); if(IsCollisionEnabled()) { UDestructibleMesh* TheDestructibleMesh = GetDestructibleMesh(); AActor* Owner = GetOwner(); bool bLargeChunk = IsChunkLarge(ChunkIdx); const FCollisionResponseContainer& UseResponse = ResponseOverride == NULL ? (bLargeChunk ? LargeChunkCollisionResponse.GetResponseContainer() : SmallChunkCollisionResponse.GetResponseContainer()) : *ResponseOverride; physx::PxU32 SupportDepth = TheDestructibleMesh->ApexDestructibleAsset->getChunkDepth(ChunkIdx); const bool bEnableImpactDamage = IsImpactDamageEnabled(TheDestructibleMesh, SupportDepth); CreateShapeFilterData(MoveChannel, GetUniqueID(), UseResponse, 0, ChunkIdxToBoneIdx(ChunkIdx), PQueryFilterData, PSimFilterData, BodyInstance.bUseCCD, bEnableImpactDamage, false); PQueryFilterData.word3 |= EPDF_SimpleCollision | EPDF_ComplexCollision; SCOPED_SCENE_WRITE_LOCK(Actor->getScene()); TArray<PxShape*> Shapes; Shapes.AddUninitialized(Actor->getNbShapes()); int ShapeCount = Actor->getShapes(Shapes.GetData(), Shapes.Num()); for (int32 i=0; i < ShapeCount; ++i) { PxShape* Shape = Shapes[i]; Shape->setQueryFilterData(PQueryFilterData); Shape->setSimulationFilterData(PSimFilterData); Shape->setFlag(PxShapeFlag::eSCENE_QUERY_SHAPE, true); Shape->setFlag(PxShapeFlag::eSIMULATION_SHAPE, true); Shape->setFlag(PxShapeFlag::eVISUALIZATION, true); } } #endif }
void AAudioVolume::RemoveProxy() const { // World will be NULL during exit purge. UWorld* World = GetWorld(); if (World) { if (FAudioDevice* AudioDevice = World->GetAudioDevice()) { DECLARE_CYCLE_STAT(TEXT("FAudioThreadTask.RemoveAudioVolumeProxy"), STAT_AudioRemoveAudioVolumeProxy, STATGROUP_TaskGraphTasks); const uint32 AudioVolumeID = GetUniqueID(); FAudioThread::RunCommandOnAudioThread([AudioDevice, AudioVolumeID]() { AudioDevice->RemoveAudioVolumeProxy(AudioVolumeID); }, GET_STATID(STAT_AudioRemoveAudioVolumeProxy)); } } }
/*********************************************************************************** ** SearchTemplate Constructor ** ** ***********************************************************************************/ SearchTemplate::SearchTemplate(BOOL filtered) : OpFilteredVectorItem<SearchTemplate>(filtered), m_type(SEARCH_TYPE_GOOGLE), m_format_id(Str::NOT_A_STRING), m_seperator_after(FALSE), m_is_post(FALSE), m_use_tld(FALSE), m_pbar_pos(-1), m_ui_id(GetUniqueID() + SEARCH_TYPE_MAX), // Note: this should be unique globally really, not like now m_name(Str::NOT_A_STRING), m_no_id(FALSE), m_search_used(FALSE), m_store(CUSTOM) #ifdef SEARCH_PROVIDER_QUERY_SUPPORT ,m_spii(this) #endif { }
CBaseFX* CClientFXMgr::CreateFX(const char *sName, FX_BASEDATA *pBaseData, CBaseFXProps* pProps, HOBJECT hInstParent) { CBaseFX *pNewFX = NULL; // Locate the named FX FX_REF *pFxRef = CClientFXDB::GetSingleton().FindFX(sName); if( pFxRef ) { pNewFX = pFxRef->m_pfnCreate(); } // If we have a new fx, go ahead and add it onto the active list if( pNewFX ) { // Assign a unique ID for this FX pBaseData->m_dwID = GetUniqueID(); if( !pNewFX->Init(m_pClientDE, pBaseData, pProps) ) { // See if the FX->Init() filled out data to create a new instance... if( pBaseData->m_sNode[0] ) { CLIENTFX_CREATESTRUCT fxCS( pBaseData->m_sNode, pBaseData->m_dwFlags, pBaseData->m_vPos, pBaseData->m_rRot ); fxCS.m_vTargetNorm = pBaseData->m_vTargetNorm; fxCS.m_hParent = hInstParent; CreateClientFX( fxCS, LTTRUE ); } pNewFX->Term(); CClientFXDB::GetSingleton().DeleteEffect(pNewFX); pNewFX = NULL; } } // All done.... return pNewFX; }
QString OPFResource::AddNCXItem(const QString &ncx_path) { QWriteLocker locker(&GetLock()); QString source = CleanSource::ProcessXML(GetText(),"application/oebps-package+xml"); OPFParser p; p.parse(source); QString path_to_oebps_folder = QFileInfo(GetFullPath()).absolutePath() + "/"; QString ncx_oebps_path = QString(ncx_path).remove(path_to_oebps_folder); int n = p.m_manifest.count(); ManifestEntry me; me.m_id = GetUniqueID("ncx", p); me.m_href = ncx_oebps_path; me.m_mtype = "application/x-dtbncx+xml"; p.m_manifest.append(me); p.m_idpos[me.m_id] = n; p.m_hrefpos[me.m_href] = n; UpdateText(p); return me.m_id; }
CPathID::CPathID(const char* path, bool doNotFromat) { BEHAVIAC_ASSERT(path); if (doNotFromat) { behaviac::string strPath(path); strPath = make_lower(strPath); SetContentPrivate(strPath.c_str()); #ifdef BEHAVIAC_ENABLE_ASSERTS CPathID pathId(path); BEHAVIAC_ASSERT(GetUniqueID() == pathId.GetUniqueID()); #endif // #ifdef BEHAVIAC_ENABLE_ASSERTS } else { SetContent(path); } }
FText UK2Node_LiveEditObject::GetNodeTitle(ENodeTitleType::Type TitleType) const { UEdGraphPin* BaseClassPin = GetBaseClassPin(); if ((BaseClassPin == nullptr) || (BaseClassPin->DefaultObject == nullptr)) { return NSLOCTEXT("K2Node", "LiveEditObject_NullTitle", "LiveEditObject NONE"); } else if (CachedNodeTitle.IsOutOfDate()) { FNumberFormattingOptions NumberOptions; NumberOptions.UseGrouping = false; FFormatNamedArguments Args; Args.Add(TEXT("SpawnString"), FText::FromName(BaseClassPin->DefaultObject->GetFName())); Args.Add(TEXT("ID"), FText::AsNumber(GetUniqueID(), &NumberOptions)); CachedNodeTitle = FText::Format(NSLOCTEXT("K2Node", "LiveEditObject", "LiveEditObject {SpawnString}_{ID}"), Args); } return CachedNodeTitle; }
void Plugin::Init (ICoreProxy_ptr proxy) { Util::InstallTranslator ("glance"); Proxy_ = proxy; Core::Instance ().SetProxy (proxy); ActionGlance_ = new QAction (GetName (), this); ActionGlance_->setToolTip ("Show the quick overview of tabs"); ActionGlance_->setShortcut (QKeySequence ("Ctrl+Shift+G")); ActionGlance_->setShortcutContext (Qt::ApplicationShortcut); ActionGlance_->setProperty ("ActionIcon", "view-list-icons"); ActionGlance_->setProperty ("Action/ID", GetUniqueID () + "_glance"); connect (ActionGlance_, SIGNAL (triggered ()), this, SLOT (on_ActionGlance__triggered ())); }
void CBFileListTable::UpdateFileInfo ( const JIndex index ) { FileInfo info = itsFileInfo->GetElement(index); info.id = GetUniqueID(); const JString& fileName = *(GetFullNameList().NthElement(index)); const JError err = JGetModificationTime(fileName, &(info.modTime)); assert_ok( err ); itsFileInfo->SetElement(index, info); if (itsFileUsage != NULL) { itsFileUsage->SetElement(index, kJTrue); } }