Ejemplo n.º 1
0
InspectorNote::InspectorNote(QWidget* parent)
   : InspectorElementBase(parent)
      {
      iElement = new InspectorElementElement(this);
      iNote    = new InspectorNoteBase(this);
      iSegment = new InspectorSegment(this);

      layout->addWidget(iElement);
      layout->addWidget(iNote);
      layout->addWidget(iSegment);

      connect(iElement, SIGNAL(enableApply()), SLOT(checkDirty()));
      connect(iNote,    SIGNAL(enableApply()), SLOT(checkDirty()));
      connect(iSegment, SIGNAL(enableApply()), SLOT(checkDirty()));
      }
Ejemplo n.º 2
0
void ConfigStorage::restart()
{
	checkDirty();

	if (lseek(m_cfg_file, 0, SEEK_SET) < 0)
		checkFileError(m_sharedMemory->getHeader()->cfg_file_name, "lseek", isc_io_read_err);
}
Ejemplo n.º 3
0
void Program::setShaderStorageBlockBinding(const GLuint storageBlockIndex, const GLuint storageBlockBinding) const
{
	checkDirty();
    if (!m_linked)
        return;

    glShaderStorageBlockBinding(id(), storageBlockIndex, storageBlockBinding);
}
Ejemplo n.º 4
0
GLint Program::getAttributeLocation(const std::string & name) const
{
	checkDirty();
    if (!m_linked)
        return -1;

    return glGetAttribLocation(id(), name.c_str());
}
Ejemplo n.º 5
0
void Program::use() const
{
	checkDirty();

    if (!isLinked())
        return;

    glUseProgram(id());
}
Ejemplo n.º 6
0
void LLPanelClassified::apply()
{
	// Apply is used for automatically saving results, so only
	// do that if there is a difference, and this is a save not create.
	if (checkDirty() && mPaidFor)
	{
		sendClassifiedInfoUpdate();
	}
}
Ejemplo n.º 7
0
UniformBlock * Program::getUniformBlockByIdentity(const LocationIdentity & identity)
{
    checkDirty();

    if (m_uniformBlocks.find(identity) == m_uniformBlocks.end())
        m_uniformBlocks[identity] = UniformBlock(this, identity);

    return &m_uniformBlocks[identity];
}
Ejemplo n.º 8
0
BOOL LLPanelClassified::canClose()
{
	if (mForceClose || !checkDirty()) 
		return TRUE;

	LLSD args;
	args["NAME"] = mNameEditor->getText();
	LLNotificationsUtil::add("ClassifiedSave", args, LLSD(), boost::bind(&LLPanelClassified::saveCallback, this, _1, _2));
	return FALSE;
}
Ejemplo n.º 9
0
std::string Program::getActiveUniformName(GLuint uniformIndex) const
{
    checkDirty();

    GLint length = getActiveUniform(uniformIndex, GL_UNIFORM_NAME_LENGTH);
    std::vector<char> name(length);
    glGetActiveUniformName(id(), uniformIndex, length, nullptr, name.data());

    return std::string(name.data(), length);
}
Ejemplo n.º 10
0
gl::GLint Program::getInterface(gl::GLenum programInterface, gl::GLenum pname) const
{
    checkDirty();

    gl::GLint result;

    getInterface(programInterface, pname, &result);

    return result;
}
Ejemplo n.º 11
0
void ConfigStorage::release()
{
	fb_assert(m_recursive > 0);
	fb_assert(m_mutexTID == getThreadId());

	if (--m_recursive == 0)
	{
		checkDirty();
		m_mutexTID = 0;
		m_sharedMemory->mutexUnlock();
	}
}
Ejemplo n.º 12
0
void RenderAf::disableServices()
{
	m_services_disabled_nums.clear();
	m_services_disabled_nums.resize( m_services_num, 0);
	if( m_services_disabled.size())
	{
		for( int i = 0; i < m_services_disabled.size(); i++)
			for( int j = 0; j < m_services_num; j++)
				if( m_services_disabled[i] == m_host.getServiceName(j))
					m_services_disabled_nums[j] = 1;
	}
	checkDirty();
}
// Checked: 2011-11-08 (RLVa-1.5.0)
void RlvFloaterStrings::onClose(bool fQuitting)
{
	checkDirty(false);
	if (m_fDirty)
	{
		// Save the custom string overrides
		RlvStrings::saveToFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, RLV_STRINGS_FILE));

		if (!fQuitting) // Singu Note: We're done if fQuitting, don't notify
		// Remind the user their changes require a relog to take effect
		LLNotificationsUtil::add("RLVChangeStrings");
	}

	if (fQuitting) destroy();
	else setVisible(false); // Hide when closing.
}
Ejemplo n.º 14
0
std::string Program::getActiveUniformName(const GLuint uniformIndex) const
{
    checkDirty();

    GLint length = getActiveUniform(uniformIndex, GL_UNIFORM_NAME_LENGTH);
    assert(length > 1); // Has to include at least 1 char and '\0'
        
    std::vector<char> name(length);
    glGetActiveUniformName(id(), uniformIndex, length, nullptr, name.data());

	// glGetActiveUniformName() insists we query '\0' as well, but it 
	// shouldn't be passed to std::string(), otherwise std::string::size()
	// returns <actual size> + 1 (on clang)	
    auto numChars = length - 1; 
    return std::string(name.data(), numChars);
}
Ejemplo n.º 15
0
bool RenderAf::getFarmHost( af::Host * newHost)
{
	// Store old services usage:
	std::list<int> servicescounts_old;
	std::list<std::string> servicesnames_old;
	for( int i = 0; i < m_services_num; i++)
	{
		servicescounts_old.push_back( m_services_counts[i]);
		servicesnames_old.push_back( m_host.getServiceName(i));
	}
	int servicesnum_old = m_services_num;

	// Clear services and services usage:
	m_host.clearServices();
	m_services_counts.clear();
	m_services_num = 0;

	// When render becames online it refresh hardware information:
	if( newHost ) m_host.copy( *newHost);

	// Get farm services setttings:
	if( af::farm()->getHost( m_name, m_host, m_farm_host_name, m_farm_host_description ) == false)
	{
		m_farm_host_name = "no farm host";
		m_farm_host_description = "";
		return false;
	}

	// Check dirty - check if capacity was overriden and now is equal to the new value
	checkDirty();

	m_services_num = m_host.getServicesNum();
	m_services_counts.resize( m_services_num, 0);

	std::list<std::string>::const_iterator osnIt = servicesnames_old.begin();
	std::list<int>::const_iterator oscIt = servicescounts_old.begin();
	for( int o = 0; o < servicesnum_old; o++, osnIt++, oscIt++)
		for( int i = 0; i < m_services_num; i++)
			if( *osnIt == m_host.getServiceName(i))
				m_services_counts[i] = *oscIt;

	disableServices();

	return true;
}
Ejemplo n.º 16
0
void
UIManager::motionEvent( int x, int y )
{
    if ( is_mode_change_pending() ) {
		// Don't process events until mode change occurs 
		return;
    }

    // Reverse y coordinate
    y = getparam_y_resolution() - y;
	
	std::list<pp::Widget*>::iterator it;
	
	for(it=widgets.begin();it!=widgets.end();it++){
		(*it)->mouseMotion(x,y);
	}
	
    pp::Vec2d oldPos = cursorPos;
    cursorPos = pp::Vec2d(x,y);

    if ( oldPos.x != x || oldPos.y != y ) {
		// Update UI snow 
		if ( getparam_ui_snow() ) {
			if ( rightMouseButtonDown ) {
				make_ui_snow( cursorPos );
				reset_ui_snow_cursor_pos( cursorPos );
			} else if ( middleMouseButtonDown ) {
				make_ui_snow( cursorPos );
				push_ui_snow( cursorPos );
			} else {
				push_ui_snow( cursorPos );
			}
		}

		// Need to redraw cursor
		setDirty();
		checkDirty();
    }
}
Ejemplo n.º 17
0
void 
UIManager::mouseEvent( int button, int state, int x, int y )
{
    if ( is_mode_change_pending() ) {
		// Don't process events until mode change occurs 
		return;
    }

    // Reverse y coordinate 
    y = getparam_y_resolution() - y;
	
	
	std::list<pp::Widget*>::iterator it;
	
	if ( state == SDL_PRESSED ) {
		for(it=widgets.begin();it!=widgets.end();it++){
			(*it)->mouseDown(button,x,y);
		}
	} else {
		for(it=widgets.begin();it!=widgets.end();it++){
			(*it)->mouseUp(button,x,y);
		}
	}

    if ( button == SDL_BUTTON_LEFT ) {
		leftMouseButtonDown = (bool) ( state == SDL_PRESSED );
    }
    if ( button == SDL_BUTTON_MIDDLE ) {
		middleMouseButtonDown = (bool) ( state == SDL_PRESSED );
    }
    if ( button == SDL_BUTTON_RIGHT ) {
		rightMouseButtonDown = (bool) ( state == SDL_PRESSED );
    }

    checkDirty();
}
Ejemplo n.º 18
0
void LLPanelClassified::refresh()
{
	if (!mDataRequested)
	{
		sendClassifiedInfoRequest();
	}

    // Check for god mode
    BOOL godlike = gAgent.isGodlike();
	BOOL is_self = (gAgent.getID() == mCreatorID);

    // Set button visibility/enablement appropriately
	if (mInFinder)
	{

		// End user doesn't ned to see price twice, or date posted.

		mSnapshotCtrl->setEnabled(godlike);
		if(godlike)
		{
			//make it smaller, so text is more legible
			mSnapshotCtrl->setOrigin(20, 175);
			mSnapshotCtrl->reshape(300, 200);
		}
		else
		{
			mSnapshotCtrl->setOrigin(mSnapshotSize.mLeft, mSnapshotSize.mBottom);
			mSnapshotCtrl->reshape(mSnapshotSize.getWidth(), mSnapshotSize.getHeight());
			//normal
		}
		mNameEditor->setEnabled(godlike);
		mDescEditor->setEnabled(godlike);
		mCategoryCombo->setEnabled(godlike);
		mCategoryCombo->setVisible(godlike);

		mMatureCombo->setEnabled(godlike);
		mMatureCombo->setVisible(godlike);

		// Jesse (who is the only one who uses this, as far as we can tell
		// Says that he does not want a set location button - he has used it
		// accidently in the past.
		mSetBtn->setVisible(FALSE);
		mSetBtn->setEnabled(FALSE);

		mUpdateBtn->setEnabled(godlike);
		mUpdateBtn->setVisible(godlike);
	}
	else
	{
		mSnapshotCtrl->setEnabled(is_self);
		mNameEditor->setEnabled(is_self);
		mDescEditor->setEnabled(is_self);
		//mPriceEditor->setEnabled(is_self);
		mCategoryCombo->setEnabled(is_self);
		mMatureCombo->setEnabled(is_self);

		if( is_self )
		{							
			if( mMatureCombo->getCurrentIndex() == 0 )
			{
				// It's a new panel.
				// PG regions should have PG classifieds. AO should have mature.
								
				setDefaultAccessCombo();
			}
		}
		
		if (mAutoRenewCheck)
		{
			mAutoRenewCheck->setEnabled(is_self);
			mAutoRenewCheck->setVisible(is_self);
		}
		
		mClickThroughText->setEnabled(is_self);
		mClickThroughText->setVisible(is_self);

		mSetBtn->setVisible(is_self);
		//mSetBtn->setEnabled(is_self);
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
		mSetBtn->setEnabled(is_self && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) );
// [/RLVa:KB]

		mUpdateBtn->setEnabled(is_self && checkDirty());
		mUpdateBtn->setVisible(is_self);
	}
}
Ejemplo n.º 19
0
void Program::getInterface(gl::GLenum programInterface, gl::GLenum pname, gl::GLint * params) const
{
    checkDirty();

    glGetProgramInterfaceiv(id(), programInterface, pname, params);
}
Ejemplo n.º 20
0
void Program::getResourceName(gl::GLenum programInterface, gl::GLuint index, gl::GLsizei bufSize, gl::GLsizei * length, char * name) const
{
    checkDirty();

    glGetProgramResourceName(id(), programInterface, index, bufSize, length, name);
}
Ejemplo n.º 21
0
void Program::getResource(gl::GLenum programInterface, gl::GLuint index, gl::GLsizei propCount, const gl::GLenum * props, gl::GLsizei bufSize, gl::GLsizei * length, gl::GLint * params) const
{
    checkDirty();

    glGetProgramResourceiv(id(), programInterface, index, propCount, props, bufSize, length, params);
}
Ejemplo n.º 22
0
gl::GLint Program::getResourceLocationIndex(gl::GLenum programInterface, const std::string & name) const
{
    checkDirty();

    return glGetProgramResourceLocationIndex(id(), programInterface, name.c_str());
}
Ejemplo n.º 23
0
void Program::getActiveAttrib(gl::GLuint index, gl::GLsizei bufSize, gl::GLsizei * length, gl::GLint * size, gl::GLenum * type, gl::GLchar * name) const
{
    checkDirty();

    glGetActiveAttrib(id(), index, bufSize, length, size, type, name);
}
Ejemplo n.º 24
0
void Program::getActiveUniforms(const GLsizei uniformCount, const GLuint * uniformIndices, const GLenum pname, GLint * params) const
{
    checkDirty();

    glGetActiveUniformsiv(id(), uniformCount, uniformIndices, pname, params);
}
Ejemplo n.º 25
0
GLuint Program::getUniformBlockIndex(const std::string & name) const
{
    checkDirty();

    return glGetUniformBlockIndex(id(), name.c_str());
}