Beispiel #1
0
/*
================
rvClientEntity::SetAxis
================
*/
void rvClientEntity::SetAxis ( const idMat3& axis ) {
	if ( IsBound() && axisBind ) {
		bindAxis = axis;
	} else {
		worldAxis = axis;
	}
}
Beispiel #2
0
 void Buffer::Bind() const {
     if (!IsBound()) {
         GLSL_BUFFER targetBuffer = TargetBuffer();
         glBindBuffer(targetBuffer, m_bufferHandle);
         CheckError();
     }
 }
Beispiel #3
0
/*
================
rvClientEntity::SetOrigin
================
*/
void rvClientEntity::SetOrigin( const idVec3& origin ) {
	if ( IsBound() ) {
		bindOrigin = origin;
	} else {
		worldOrigin = origin;
	}
}
status_t
BAbstractSocket::Connect(const BNetworkAddress& peer, int type,
	bigtime_t timeout)
{
	Disconnect();

	fInitStatus = _OpenIfNeeded(peer.Family(), type);
	if (fInitStatus == B_OK)
		fInitStatus = SetTimeout(timeout);

	if (fInitStatus == B_OK && !IsBound()) {
		BNetworkAddress local;
		local.SetToWildcard(peer.Family());
		fInitStatus = Bind(local);
	}
	if (fInitStatus != B_OK)
		return fInitStatus;

	BNetworkAddress normalized = peer;
	if (connect(fSocket, normalized, normalized.Length()) != 0) {
		TRACE("%p: connecting to %s: %s\n", this,
			normalized.ToString().c_str(), strerror(errno));
		return fInitStatus = errno;
	}

	fIsConnected = true;
	fPeer = normalized;
	_UpdateLocalAddress();

	TRACE("%p: connected to %s (local %s)\n", this, peer.ToString().c_str(),
		fLocal.ToString().c_str());

	return fInitStatus = B_OK;
}
Beispiel #5
0
GPU2DMesh::~GPU2DMesh()
{
    if ( IsOpened() )
        Close();
    if ( IsBound() )
        UnBind();
}
Beispiel #6
0
// [T]
String TypeVar::ToString() const {
  if (IsBound()) {
    return String::Format("$T.%d=%s", id_number_, type_);
  }

  return String::Format("$T.%d(%s)", id_number_, types_);
}
status_t
UnixEndpoint::Listen(int backlog)
{
	TRACE("[%ld] %p->UnixEndpoint::Listen(%d)\n", find_thread(NULL), this,
		backlog);

	UnixEndpointLocker endpointLocker(this);

	if (!IsBound())
		RETURN_ERROR(EDESTADDRREQ);
	if (fState != UNIX_ENDPOINT_NOT_CONNECTED)
		RETURN_ERROR(EINVAL);

	gSocketModule->set_max_backlog(socket, backlog);

	fAcceptSemaphore = create_sem(0, "unix accept");
	if (fAcceptSemaphore < 0)
		RETURN_ERROR(ENOBUFS);

	_UnsetReceiveFifo();

	fCredentials.pid = getpid();
	fCredentials.uid = geteuid();
	fCredentials.gid = getegid();

	fState = UNIX_ENDPOINT_LISTENING;

	RETURN_ERROR(B_OK);
}
Beispiel #8
0
void Ports::BoundTo(std::string pName, Edge pE) {
	if (IsBound(pName) ) {
		if ( !(BoundTo(pName) == pE))
			CosiLog << "WARNING : port "<< pName << " already bound"<< endl;
	}
	mBound[pName] = pE;
}
Beispiel #9
0
TSharedPtr< class IPropertyHandle > FPropertyTableCell::GetPropertyHandle() const 
{ 
	if( IsBound() ) 
	{
		return PropertyEditor->GetPropertyHandle(); 
	}
	return NULL;
}
Beispiel #10
0
Void GPU2DBrush::UnBind()
{
    Assert( IsBound() );

    m_pContext2D->_UnRegisterBrush( this );

    m_pDevice2DBrush->Destroy();
}
void FInteractiveTutorials::OnDelegateTriggered(Param1Type Param1, Param2Type Param2, Param3Type Param3, Param4Type Param4)
{
	auto Delegate = GetTriggerDelegate<DelegateType>(DelegateEnumType);
	if (Delegate.IsBound())
	{
		ExecuteCompletion(Delegate.Execute(Param1, Param2, Param3, Param4));
	}
}
void FInteractiveTutorials::OnDelegateTriggered()
{
	auto Delegate = GetTriggerDelegate<DelegateType>(DelegateEnumType);
	if (Delegate.IsBound())
	{
		ExecuteCompletion(Delegate.Execute());
	}
}
Beispiel #13
0
Void GPU2DMesh::UnBind()
{
    Assert( IsBound() );

    m_pContext2D->_UnRegisterMesh( this );

    m_hDevice2DMesh.Destroy();
}
Beispiel #14
0
Void GPU2DMesh::Bind()
{
    Assert( !(IsBound()) );

    m_hDevice2DMesh.Create();

    m_pContext2D->_RegisterMesh( this );
}
Beispiel #15
0
Void GPU2DSolidColorBrush::Bind()
{
    Assert( !(IsBound()) );

    m_hDevice2DSolidColorBrush.Create();

    m_pContext2D->_RegisterBrush( this );
}
Beispiel #16
0
Void GPU2DLinearGradientBrush::Bind( const GPU2DGradientDesc * pGradientDesc )
{
    Assert( !(IsBound()) );

    m_hDevice2DLinearGradientBrush.Create( (const Device2DGradientDesc *)pGradientDesc );

    m_pContext2D->_RegisterBrush( this );
}
Beispiel #17
0
// Begin rendering to FBO
bool CFrameBufferObjectGL::BeginRender()
{
  if (IsValid() && IsBound())
  {
    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
    return true;
  }
  return false;
}
Beispiel #18
0
Void GPU2DBitmapBrush::Bind()
{
    Assert( !(IsBound()) );
    Assert( m_pBitmap != NULL && m_pBitmap->IsBound() );

    m_hDevice2DBitmapBrush.Create();

    m_pContext2D->_RegisterBrush( this );
}
Beispiel #19
0
std::vector<std::string> Ports::GetNotBoundInOut() {
	iterator It;
	std::vector<std::string> RetVal;
	for (It = Begin() ; It != End() ; It++) {
		if ( (!IsBound(Name(It))) && (If(It).GetDirection() == Interface::INOUT)) {
			RetVal.push_back(Name(It)) ;
		}
	}
	return RetVal ;
}
bool CFrameBufferObjectGL::BeginRender()
{
  if (IsValid() && IsBound())
  {
#if defined(HAS_GL) || defined(HAS_GL2)
    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
#else
    glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
#endif
    m_isRendering = true;
    return true;
  }
  return false;
}
status_t
UnixEndpoint::_Unbind()
{
	if (fState == UNIX_ENDPOINT_CONNECTED || fState == UNIX_ENDPOINT_LISTENING)
		RETURN_ERROR(B_BAD_VALUE);

	if (IsBound()) {
		UnixAddressManagerLocker addressLocker(gAddressManager);
		gAddressManager.Remove(this);
		if (struct vnode* vnode = fAddress.Vnode())
			vfs_put_vnode(vnode);

		fAddress.Unset();
	}

	RETURN_ERROR(B_OK);
}
	virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyClippingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const
	{
		if (Texture.IsBound() || TextureChannel.IsBound())
		{
			UTexture2D* NewTexture = Texture.Get();
			int32 NewTextureChannel = TextureChannel.Get();

			if (NewTexture != CachedTexture
				|| NewTextureChannel != CachedTextureChannel)
			{
				CachedTexture = NewTexture;
				CachedTextureChannel = NewTextureChannel;
				Viewport->Invalidate();
			}
		}

		return SCompoundWidget::OnPaint(Args, AllottedGeometry, MyClippingRect, OutDrawElements, LayerId, InWidgetStyle, bParentEnabled);
	}
Beispiel #23
0
/*
================
rvClientEntity::UpdateBind
================
*/
void rvClientEntity::UpdateBind( bool skipModelUpdate ) {
	if ( !IsBound() ) {
		return;
	}

	idMat3 tempWorldAxis;
	if ( bindJoint != INVALID_JOINT ) {
		if ( bindMaster.IsValid() ) {
			if ( skipModelUpdate ) {
				bindMaster->GetWorldOriginAxisNoUpdate( bindJoint, worldOrigin, tempWorldAxis );
			} else {
				bindMaster->GetAnimator()->GetJointTransform( bindJoint, gameLocal.time, worldOrigin, tempWorldAxis );
				worldOrigin = bindMaster->GetLastPushedOrigin() + ( worldOrigin * bindMaster->GetLastPushedAxis() );
				tempWorldAxis *= bindMaster->GetLastPushedAxis();
			}
		} else {
			rvClientEntity* clientEnt = bindMasterClient;

			clientEnt->GetAnimator()->GetJointTransform( bindJoint, gameLocal.time, worldOrigin, tempWorldAxis );

			renderEntity_t* renderEnt = clientEnt->GetRenderEntity();

			worldOrigin = renderEnt->origin + ( worldOrigin * renderEnt->axis );
			tempWorldAxis	*= renderEnt->axis;
		}
	} else {
		if ( bindMaster.IsValid() ) {
			worldOrigin	= bindMaster->GetLastPushedOrigin();
			tempWorldAxis	= bindMaster->GetLastPushedAxis();
		} else {
			renderEntity_t* renderEnt = bindMasterClient->GetRenderEntity();

			worldOrigin	= renderEnt->origin;
			tempWorldAxis = renderEnt->axis;
		}
	}

	worldOrigin += (bindOrigin * tempWorldAxis);
	if ( axisBind ) {
		worldAxis    = bindAxis * tempWorldAxis;
	}
}
Beispiel #24
0
Ports Ports::operator-( Ports pP) {
	//Return the intersection
	Ports RetVal;
	//Get the set of ports of the left hand side
	std::map<std::string,Interface> P = GetValue();
	std::map<std::string,Interface>::iterator It;
	for(It = P.begin(); It != P.end();It++) {
		//if the port is in also in the right hand side and
		//if the interface is the same
		//add the port to the return value
		if ( pP.HasPort(It->first) && It->second == pP[It->first]) {
			RetVal.AddPort(It->first,It->second);
			//if are both bound to the same edge then bound it
			//otherwise don't
			if ( IsBound(It->first) && pP.IsBound(It->first) && (BoundTo(It->first) == pP.BoundTo(It->first))) {
				RetVal.BoundTo(It->first,BoundTo(It->first) );
			}
		}
	}
	return RetVal;
}
Beispiel #25
0
	FText SummaryInformation_GetSummary() const
	{
		FText SummaryText = LOCTEXT("DataGraphSummary_Warning", "Not implemented yet");
		const bool bCanDisplayData = GraphDescription.CombinedGraphDataSource->CanBeDisplayedAsIndexBased() && ParentWidget->GetViewMode() == EDataGraphViewModes::Index;

		const uint32 FrameIndex = OnGetMouseFrameIndex.IsBound() ? (uint32)OnGetMouseFrameIndex.Execute() : 0;
		const FGraphDataSourceRefConst* GraphDataSource = GraphDescription.CombinedGraphDataSource->GetFirstSource();

		if( bCanDisplayData && GraphDataSource && FrameIndex < (*GraphDataSource)->GetNumFrames() )
		{
			const double SampleValue = (*GraphDataSource)->GetValueFromIndex( FrameIndex );
			const EProfilerSampleTypes::Type UnitType = (*GraphDataSource)->GetSampleType();
			const FProfilerAggregatedStat& Aggregated = *(*GraphDataSource)->GetAggregatedStat();

			static const FNumberFormattingOptions SampleValueFormattingOptions = FNumberFormattingOptions()
				.SetMinimumFractionalDigits(2)
				.SetMaximumFractionalDigits(2);

			SummaryText = FText::Format(LOCTEXT("DataGraphSummary_SummaryFmt", "{0} - {1}"), FText::AsNumber(SampleValue, &SampleValueFormattingOptions), FText::FromString(Aggregated.ToString()));
		}

		return SummaryText;
	}
void text_wrapper::ChunkText(void)
{
    int c_st = -1, c_en = -1;
    for (int i = 0; i < glyph_length; i++) {
        int g_st = glyph_text[i].uni_st, g_en = glyph_text[i].uni_en;
        glyph_text[i].char_start = false;
        glyph_text[i].word_start = false;
        glyph_text[i].para_start = false;
        // boundaries depend on the directionality
        // letter boundaries correspond to the glyphs starting one letter when you read them left to right (always)
        // because that's the order they are stored into in the glyph_text array
        if ( glyph_text[i].uni_dir == 0 ) {
            if ( IsBound(bnd_char, g_st, c_st) ) { // check if there is a charcater (=letter in pango speak) at this position
                // can be a 'start' boundary or a 'end' boundary, doesn't matter, as long
                // as you get from one letter to the next at this position
                if ( g_st == bounds[c_st].uni_pos ) glyph_text[i].char_start = true;
            }
            if ( IsBound(bnd_word, g_st, c_st) ) {
                if ( g_st == bounds[c_st].uni_pos ) glyph_text[i].word_start = true;
            }
            if ( IsBound(bnd_para, g_st, c_st) ) {
                if ( g_st == bounds[c_st].uni_pos ) glyph_text[i].para_start = true;
            }
        } else {
            if ( IsBound(bnd_char, g_en, c_en) ) {
                if ( g_en == bounds[c_en].uni_pos ) glyph_text[i].char_start = true;
            }
            if ( IsBound(bnd_word, g_en, c_en) ) {
                if ( g_en == bounds[c_en].uni_pos ) glyph_text[i].word_start = true;
            }
            if ( IsBound(bnd_para, g_en, c_en) ) {
                if ( g_en == bounds[c_en].uni_pos ) glyph_text[i].para_start = true;
            }
        }
    }

    if ( glyph_length > 0 ) {
        glyph_text[glyph_length].char_start = true;
        glyph_text[glyph_length].word_start = true;
        glyph_text[glyph_length].para_start = true;
    }
    {
        // doing little boxes
        int g_st = -1, g_en = -1;
        while ( NextWord(g_st, g_en) ) {
            // check uniformity of fonts
            if ( g_st < g_en ) {
                int n_st = g_st;
                int n_en = g_st;
                bool first = true;
                do {
                    n_st = n_en;
                    PangoFont *curPF = glyph_text[n_st].font;
                    do {
                        n_en++;
                    } while ( n_en < g_en && glyph_text[n_en].font == curPF );
                    if ( nbBox >= maxBox ) {
                        maxBox = 2 * nbBox + 1;
                        one_box *newdata = static_cast<one_box*>(realloc(boxes, maxBox * sizeof(one_box)));
                        if (newdata != NULL)
                        {
                            boxes = newdata;
                        }
                        else
                        {
                            g_warning("Failed to reallocate boxes");
                        }
                    }
                    boxes[nbBox].g_st = n_st;
                    boxes[nbBox].g_en = n_en;
                    boxes[nbBox].word_start = first;
                    boxes[nbBox].word_end = (n_en >= g_en);
                    nbBox++;
                    first = false;
                } while ( n_en < g_en );
            }
        }
    }
    {
        // doing little paras
        int g_st = -1, g_en = -1;
        while ( NextPara(g_st, g_en) ) {
            int b_st = 0;
            while ( b_st < nbBox && boxes[b_st].g_st < g_st ) b_st++;
            if ( b_st < nbBox && boxes[b_st].g_st == g_st ) {
                int b_en = b_st;
                while ( b_en < nbBox && boxes[b_en].g_en < g_en ) b_en++;
                if ( b_en < nbBox && boxes[b_en].g_en == g_en ) {
                    if ( nbPara >= maxPara ) {
                        maxPara = 2 * nbPara + 1;
                        one_para *newdata = static_cast<one_para*>(realloc(paras, maxPara * sizeof(one_para)));
                        if (newdata != NULL)
                        {
                            paras = newdata;
                        }
                        else
                        {
                            g_warning("Failed to reallocate paras");
                        }
                    }
                    paras[nbPara].b_st = b_st;
                    paras[nbPara].b_en = b_en;
                    nbPara++;
                }
            }
        }
    }
}
	void Construct( const FArguments& InArgs )
	{
		OnCancelClickedDelegate = InArgs._OnCancelClickedDelegate;

		TSharedRef<SVerticalBox> VerticalBox = SNew(SVerticalBox)
			+SVerticalBox::Slot()
			.AutoHeight()
			.Padding( 14.0f, 4.0f, 14.0f, 10.0f )
			[
				SNew( STextBlock )
					.Text( this, &SSlowTaskWidget::OnGetProgressText )
					.ShadowOffset( FVector2D( 1.0f, 1.0f ) )
			];

		if ( OnCancelClickedDelegate.IsBound() )
		{
			VerticalBox->AddSlot()
				.AutoHeight()
				.Padding(10.0f, 7.0f)
				[
					SNew(SHorizontalBox)
					+SHorizontalBox::Slot()
					.Padding(5,0,0,0)
					.FillWidth(0.8f)
					[
						SNew(SProgressBar)
						.Percent( this, &SSlowTaskWidget::GetProgressFraction )
					]
					+SHorizontalBox::Slot()
					.Padding(5,0,0,0)
					.FillWidth(0.2f)
					[
						SNew(SButton)
						.Text( NSLOCTEXT("FeedbackContextProgress", "Cancel", "Cancel") )
						.HAlign(EHorizontalAlignment::HAlign_Center)
						.OnClicked(this, &SSlowTaskWidget::OnCancel)
					]
				];
		}
		else
		{
			VerticalBox->AddSlot()
				.AutoHeight()
				.Padding(10.0f, 7.0f)
				[
					SNew(SHorizontalBox)
					+SHorizontalBox::Slot()
					.Padding(5,0,0,0)
					.FillWidth(1.0f)
					[
						SNew(SProgressBar)
						.Percent( this, &SSlowTaskWidget::GetProgressFraction )
					]
				];
		}

		SBorder::Construct( SBorder::FArguments()
			.BorderImage(FEditorStyle::GetBrush("Menu.Background"))
			.VAlign(VAlign_Center)
			[
				VerticalBox
			]
		);
	}
Beispiel #28
0
GPU2DLinearGradientBrush::~GPU2DLinearGradientBrush()
{
    if ( IsBound() )
        UnBind();
}
Beispiel #29
0
GPU2DSolidColorBrush::~GPU2DSolidColorBrush()
{
    if ( IsBound() )
        UnBind();
}
Beispiel #30
0
GPU2DBitmapBrush::~GPU2DBitmapBrush()
{
    if ( IsBound() )
        UnBind();
}