Ejemplo n.º 1
0
void QMetaObjectPublisher::signalEmitted(const QObject *object, const int signalIndex, const QVariantList &arguments)
{
    if (!webChannel || webChannel->d_func()->transports.isEmpty()) {
        if (signalIndex == s_destroyedSignalIndex)
            objectDestroyed(object);
        return;
    }
    if (!signalToPropertyMap.value(object).contains(signalIndex)) {
        QJsonObject message;
        const QString &objectName = registeredObjectIds.value(object);
        Q_ASSERT(!objectName.isEmpty());
        message[KEY_OBJECT] = objectName;
        message[KEY_SIGNAL] = signalIndex;
        if (!arguments.isEmpty()) {
            message[KEY_ARGS] = wrapList(arguments);
        }
        message[KEY_TYPE] = TypeSignal;
        broadcastMessage(message);

        if (signalIndex == s_destroyedSignalIndex) {
            objectDestroyed(object);
        }
    } else {
        pendingPropertyUpdates[object][signalIndex] = arguments;
        if (clientIsIdle && !blockUpdates && !timer.isActive()) {
            timer.start(PROPERTY_UPDATE_INTERVAL, this);
        }
    }
}
Ejemplo n.º 2
0
void QGuardedPtrPrivate::reconnect( QObject *o )
{
    if ( obj == o )
	return;
    if ( obj )
	disconnect( obj, SIGNAL( destroyed() ),
		    this, SLOT( objectDestroyed() ) );
    obj = o;
    if ( obj )
	connect( obj, SIGNAL( destroyed() ),
		 this, SLOT( objectDestroyed() ) );
}
Ejemplo n.º 3
0
void AutomationPattern::addObject( AutomatableModel * _obj, bool _search_dup )
{
	if( _search_dup )
	{
		for( objectVector::iterator it = m_objects.begin();
					it != m_objects.end(); ++it )
		{
			if( *it == _obj )
			{
				// Already exists
				// TODO: Maybe let the user know in some non-annoying way
				return;
			}
		}
	}

	// the automation track is unconnected and there is nothing in the track
	if( m_objects.isEmpty() && hasAutomation() == false )
	{
		// then initialize first value
		putValue( MidiTime(0), _obj->value<float>(), false );
	}

	m_objects += _obj;

	connect( _obj, SIGNAL( destroyed( jo_id_t ) ),
			this, SLOT( objectDestroyed( jo_id_t ) ),
						Qt::DirectConnection );

	emit dataChanged();

}
Ejemplo n.º 4
0
/*!
  \internal
*/
void QSScript::setContext( QObject *context )
{
    Q_ASSERT( !d->context );
    connect( context, SIGNAL( destroyed() ),
	     this, SLOT( objectDestroyed() ) );
    d->context = context;
}
Ejemplo n.º 5
0
void AutomationPattern::addObject( AutomatableModel * _obj, bool _search_dup )
{
	if( _search_dup )
	{
		for( objectVector::iterator it = m_objects.begin();
					it != m_objects.end(); ++it )
		{
			if( *it == _obj )
			{
				TextFloat::displayMessage( _obj->displayName(), tr( "Model is already connected "
												"to this pattern." ), embed::getIconPixmap( "automation" ), 2000 );
				return;
			}
		}
	}

	// the automation track is unconnected and there is nothing in the track
	if( m_objects.isEmpty() && hasAutomation() == false )
	{
		// then initialize first value
		putValue( MidiTime(0), _obj->inverseScaledValue( _obj->value<float>() ), false );
	}

	m_objects += _obj;

	connect( _obj, SIGNAL( destroyed( jo_id_t ) ),
			this, SLOT( objectDestroyed( jo_id_t ) ),
						Qt::DirectConnection );

	emit dataChanged();

}
Ejemplo n.º 6
0
bool AutomationPattern::addObject( AutomatableModel * _obj, bool _search_dup )
{
	if( _search_dup )
	{
		for( objectVector::iterator it = m_objects.begin();
					it != m_objects.end(); ++it )
		{
			if( *it == _obj )
			{				
				return false;
			}
		}
	}

	// the automation track is unconnected and there is nothing in the track
	if( m_objects.isEmpty() && hasAutomation() == false )
	{
		// then initialize first value
		putValue( MidiTime(0), _obj->inverseScaledValue( _obj->value<float>() ), false );
	}

	m_objects += _obj;

	connect( _obj, SIGNAL( destroyed( jo_id_t ) ),
			this, SLOT( objectDestroyed( jo_id_t ) ),
						Qt::DirectConnection );

	emit dataChanged();

	return true;
}
void ImageQualityController::removeLayer(RenderObject* object, LayerSizeMap* innerMap, const void* layer)
{
    if (innerMap) {
        innerMap->remove(layer);
        if (innerMap->isEmpty())
            objectDestroyed(object);
    }
}
Ejemplo n.º 8
0
QObjectProxy::QObjectProxy( QObject *qObject_, PyrObject *scObject_ )
: qObject( qObject_ ), scObject( scObject_ )
{
  qObject->installEventFilter( this );
  connect( qObject, SIGNAL( destroyed() ), this, SLOT( objectDestroyed() ) );
  // TODO
  // install finalizer
}
Ejemplo n.º 9
0
bool QActionGroup::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: childToggled((bool)static_QUType_bool.get(_o+1)); break;
    case 1: childDestroyed(); break;
    case 2: internalComboBoxActivated((int)static_QUType_int.get(_o+1)); break;
    case 3: internalComboBoxHighlighted((int)static_QUType_int.get(_o+1)); break;
    case 4: internalToggle((QAction*)static_QUType_ptr.get(_o+1)); break;
    case 5: objectDestroyed(); break;
    default:
	return QAction::qt_invoke( _id, _o );
    }
    return TRUE;
}
int Q3ActionGroup::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = Q3Action::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: selected((*reinterpret_cast< Q3Action*(*)>(_a[1]))); break;
        case 1: activated((*reinterpret_cast< Q3Action*(*)>(_a[1]))); break;
        case 2: childToggled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 3: childActivated(); break;
        case 4: childDestroyed(); break;
        case 5: internalComboBoxActivated((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 6: internalComboBoxHighlighted((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 7: internalToggle((*reinterpret_cast< Q3Action*(*)>(_a[1]))); break;
        case 8: objectDestroyed(); break;
        }
        _id -= 9;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = isExclusive(); break;
        case 1: *reinterpret_cast< bool*>(_v) = usesDropDown(); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setExclusive(*reinterpret_cast< bool*>(_v)); break;
        case 1: setUsesDropDown(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 2;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
PlayerImage::~PlayerImage() {
    if(mLegsSurface != NULL)
        SDL_FreeSurface(mLegsSurface);
    
    if(mTorsoSurface != NULL)
        SDL_FreeSurface(mTorsoSurface);
        
    if(mLegsData != NULL)
        free(mLegsData);
        
    if(mTorsoData != NULL)
        free(mTorsoData);
        
    objectDestroyed();
}
Ejemplo n.º 12
0
/*!
  \internal

  Creates a new script in \a project with the name \a name,
  context \a context and code \a code.
*/
QSScript::QSScript( QSProject *project,
		    const QString &name,
		    const QString &code,
		    QObject *context )
    :
    QObject( project, name.local8Bit() )
{
    d = new QSScriptPrivate;
    d->code = code;
    d->name = name;
    d->project = project;

    if( context ) {
	d->context = context;
	connect( context, SIGNAL( destroyed() ),
		 this, SLOT( objectDestroyed() ) );
    }
}
Ejemplo n.º 13
0
bool QAction::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: activate(); break;
    case 1: toggle(); break;
    case 2: setOn((bool)static_QUType_bool.get(_o+1)); break;
    case 3: setEnabled((bool)static_QUType_bool.get(_o+1)); break;
    case 4: setDisabled((bool)static_QUType_bool.get(_o+1)); break;
    case 5: setVisible((bool)static_QUType_bool.get(_o+1)); break;
    case 6: internalActivation(); break;
    case 7: toolButtonToggled((bool)static_QUType_bool.get(_o+1)); break;
    case 8: objectDestroyed(); break;
    case 9: menuStatusText((int)static_QUType_int.get(_o+1)); break;
    case 10: showStatusText((const QString&)static_QUType_QString.get(_o+1)); break;
    case 11: clearStatusText(); break;
    default:
	return QObject::qt_invoke( _id, _o );
    }
    return TRUE;
}
Ejemplo n.º 14
0
/*!
  \internal

  Creates a new script in \a project with the name \a name,
  context \a context and code \a code.
*/
QSScript::QSScript(QSProject *project,
                   const QString &name,
                   const QString &code,
                   QObject *context)
  :
  QObject(project, name.local8Bit())
{
  d = new QSScriptPrivate;
#ifndef AQ_ENABLE_SCRIPTCACHE
  d->code = code;
#else
  d->code = aqSha1(code);
  aqDiskCacheInsert(d->code, code);
#endif

  d->name = name;
  d->project = project;

  if (context) {
    d->context = context;
    connect(context, SIGNAL(destroyed()),
            this, SLOT(objectDestroyed()));
  }
}
int Q3Action::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: activated(); break;
        case 1: toggled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: activate(); break;
        case 3: toggle(); break;
        case 4: setOn((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 5: setEnabled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 6: setDisabled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 7: setVisible((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 8: internalActivation(); break;
        case 9: toolButtonToggled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 10: objectDestroyed(); break;
        case 11: menuStatusText((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 12: showStatusText((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 13: clearStatusText(); break;
        }
        _id -= 14;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = isToggleAction(); break;
        case 1: *reinterpret_cast< bool*>(_v) = isOn(); break;
        case 2: *reinterpret_cast< bool*>(_v) = isEnabled(); break;
        case 3: *reinterpret_cast< QIcon*>(_v) = iconSet(); break;
        case 4: *reinterpret_cast< QString*>(_v) = text(); break;
        case 5: *reinterpret_cast< QString*>(_v) = menuText(); break;
        case 6: *reinterpret_cast< QString*>(_v) = toolTip(); break;
        case 7: *reinterpret_cast< QString*>(_v) = statusTip(); break;
        case 8: *reinterpret_cast< QString*>(_v) = whatsThis(); break;
        case 9: *reinterpret_cast< QKeySequence*>(_v) = accel(); break;
        case 10: *reinterpret_cast< bool*>(_v) = isVisible(); break;
        }
        _id -= 11;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setToggleAction(*reinterpret_cast< bool*>(_v)); break;
        case 1: setOn(*reinterpret_cast< bool*>(_v)); break;
        case 2: setEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 3: setIconSet(*reinterpret_cast< QIcon*>(_v)); break;
        case 4: setText(*reinterpret_cast< QString*>(_v)); break;
        case 5: setMenuText(*reinterpret_cast< QString*>(_v)); break;
        case 6: setToolTip(*reinterpret_cast< QString*>(_v)); break;
        case 7: setStatusTip(*reinterpret_cast< QString*>(_v)); break;
        case 8: setWhatsThis(*reinterpret_cast< QString*>(_v)); break;
        case 9: setAccel(*reinterpret_cast< QKeySequence*>(_v)); break;
        case 10: setVisible(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 11;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 11;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Ejemplo n.º 16
0
QGuardedPtrPrivate::QGuardedPtrPrivate( QObject* o)
    : QObject(0, "_ptrpriv" ), obj( o )
{
    if ( obj )
	connect( obj, SIGNAL( destroyed() ), this, SLOT( objectDestroyed() ) );
}