Exemplo n.º 1
0
// Insert pObject into the OMObjectVector at position index. 
// Existing objects at index> and higher are shifted up one index position.
AAFRESULT STDMETHODCALLTYPE ImplAAFRefArrayValue::InsertObjectAt(
  ImplAAFStorable* pObject,
  aafUInt32 index)
{
  AAFRESULT result = AAFRESULT_SUCCESS;
  if (NULL == pObject)
    return AAFRESULT_NULL_PARAM;

  // Cannot change size of a fixed array.
  ASSERTU(!fixedSize());
  if (fixedSize())
    return AAFRESULT_INVALID_OBJ;    
  
  // Validate the index...  
  OMObjectVector * pReferenceVector = referenceVector();
  ASSERTU (NULL != pReferenceVector);
  aafUInt32 elementCount = pReferenceVector->count();
  if (index > elementCount) // it is valid to insert after the last element
    return AAFRESULT_BADINDEX;

  pReferenceVector->insertObjectAt(pObject, index);
  
  if (usesReferenceCounting())
  {
    pObject->AcquireReference();
  }

  
  return result;
}  
Exemplo n.º 2
0
// Remove the object from the OMObjectVector at position index.
// Existing objects in the OMObjectVector at index + 1 and higher 
// are shifted down one index position.
AAFRESULT STDMETHODCALLTYPE ImplAAFRefArrayValue::RemoveObjectAt(
  aafUInt32 index)
{
  AAFRESULT result = AAFRESULT_SUCCESS;

  // Cannot change size of a fixed array.
  ASSERTU(!fixedSize());
  if (fixedSize())
    return AAFRESULT_INVALID_OBJ;    
  
  // Validate the index...  
  OMObjectVector * pReferenceVector = referenceVector();
  ASSERTU (NULL != pReferenceVector);
  aafUInt32 elementCount = pReferenceVector->count();
  if (index >= elementCount)
    return AAFRESULT_BADINDEX;
    
    
  OMObject *oldStorable = pReferenceVector->removeObjectAt(index);
  if (usesReferenceCounting())
  {
    if (oldStorable)
      ReleaseOldObject(oldStorable);
  }
  
  return result;
}  
Exemplo n.º 3
0
// Prepend the given pObject> to the OMObjectVector.
AAFRESULT STDMETHODCALLTYPE ImplAAFRefArrayValue::PrependObject(
  ImplAAFStorable* pObject)
{
  AAFRESULT result = AAFRESULT_SUCCESS;
  if (NULL == pObject)
    return AAFRESULT_NULL_PARAM;

  // Cannot change size of a fixed array.
  ASSERTU(!fixedSize());
  if (fixedSize())
    return AAFRESULT_INVALID_OBJ;    

  ImplAAFStorable *storable = ImplAAFRefValue::ConvertRootToOMStorable(pObject);
  if (NULL == storable)
    result = AAFRESULT_INVALID_OBJ; 
    
  OMObjectVector * pReferenceVector = referenceVector();
  ASSERTU (NULL != pReferenceVector);
  pReferenceVector->prependObject(storable);

  if (usesReferenceCounting())
  {
    pObject->AcquireReference();
  }
  
  return result;
}  
Exemplo n.º 4
0
// Remove the given object from the container property.
AAFRESULT STDMETHODCALLTYPE ImplAAFRefArrayValue::RemoveObject(
  ImplAAFStorable* pObject)
{
  // Cannot change size of a fixed array.
  ASSERTU(!fixedSize());
  if (fixedSize())
    return AAFRESULT_INVALID_OBJ;    
  return ImplAAFRefContainerValue::RemoveObject(pObject);
}
Exemplo n.º 5
0
PassRefPtr<Image> CSSCrossfadeValue::image(const LayoutObject& layoutObject,
                                           const IntSize& size) {
  if (size.isEmpty())
    return nullptr;

  Image* fromImage =
      renderableImageForCSSValue(m_fromValue.get(), layoutObject);
  Image* toImage = renderableImageForCSSValue(m_toValue.get(), layoutObject);

  if (!fromImage || !toImage)
    return Image::nullImage();

  RefPtr<Image> fromImageRef(fromImage);
  RefPtr<Image> toImageRef(toImage);

  if (fromImage->isSVGImage())
    fromImageRef = SVGImageForContainer::create(
        toSVGImage(fromImage), size, 1, urlForCSSValue(m_fromValue.get()));

  if (toImage->isSVGImage())
    toImageRef = SVGImageForContainer::create(toSVGImage(toImage), size, 1,
                                              urlForCSSValue(m_toValue.get()));

  return CrossfadeGeneratedImage::create(
      fromImageRef, toImageRef, m_percentageValue->getFloatValue(),
      fixedSize(layoutObject, FloatSize(size)), size);
}
Exemplo n.º 6
0
int main() {
	// array init the left most can be empty, but the rest can't
	int a[][ROW] = {{1, 2}, {3, 4}, {5, 6}};
	
	// pass a 2 day array to function
	fixedSize(a);
	fixedSizePointer(a);
	dynamicSize(ROW, a);
}
Exemplo n.º 7
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);






    //evitamos que cambie el formulario
    QSize fixedSize(380,155 );
    setMinimumSize(fixedSize);
    setMaximumSize(fixedSize);
    setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);




    Timer = new QTimer();
    Timer2 = new QTimer();
    mEngine = new YahooEngine();

      connect(Timer, SIGNAL(timeout()), this, SLOT(Refrescar())); // temporizaor horario
      connect(Timer2, SIGNAL(timeout()), this, SLOT(slot_Actualizar())); // temporizaor horario

       connect(mEngine, SIGNAL(Finish()), this, SLOT(Exportar())); // temporizaor horario
      QSettings MeteoIni("Meteo.ini", QSettings::IniFormat);

      Timer->start(1000);






       ui->lineCiudad->setText(MeteoIni.value("Ciudad").toString());



 mEngine->update(ui->lineCiudad->text());


Timer2->start(900000);
//Timer2->start(3000);


}
LayoutSize StyleGeneratedImage::imageSize(const LayoutObject* layoutObject, float multiplier) const
{
    if (m_fixedSize) {
        LayoutSize fixedSize(m_imageGeneratorValue->fixedSize(layoutObject));
        if (multiplier == 1.0f)
            return fixedSize;

        LayoutUnit width(fixedSize.width() * multiplier);
        LayoutUnit height(fixedSize.height() * multiplier);

        // Don't let images that have a width/height >= 1 shrink below 1 when zoomed.
        if (fixedSize.width() > LayoutUnit())
            width = max(LayoutUnit(1), width);

        if (fixedSize.height() > LayoutUnit())
            height = max(LayoutUnit(1), height);

        return LayoutSize(width, height);
    }

    return LayoutSize();
}
Exemplo n.º 9
0
PlayerSetting::PlayerSetting(QString Modulo,QDialog *parent )
    :QDialog(parent)
{
    setupUi(this);
    setModal(true);

    //define size of form
    QSize fixedSize(660,485);
    setMinimumSize(fixedSize);
    setMaximumSize(fixedSize);
    setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
    listWidget->setCurrentRow(0);
    stackedWidget->setCurrentIndex(0);

    this->setWindowTitle(this->windowTitle() + " [ " + Modulo.toLatin1() + " ]");

    connect(BtnSalir,SIGNAL(clicked()),this, SLOT(ClickSalir()));
    w_Modulo=Modulo;

    AddDispositivo();

    Establecer();
}
Exemplo n.º 10
0
    QSizeF PreviewContentWidget::evaluatePreviewScaledSize(const int boundWidth) const
    {
        const auto &previewSize = (
            PreviewGenuineSize_.isEmpty() ?
                getPlaceholderSize() :
                PreviewGenuineSize_
        );

        QSizeF fixedSize(boundWidth, 0);

        // prevent small images from being stretched up
        fixedSize.setWidth(
            std::min(fixedSize.width(), previewSize.width())
        );

        const auto verticalAspectRatio = ((double)previewSize.height() / (double)previewSize.width());
        fixedSize.setHeight(fixedSize.width() * verticalAspectRatio);

        const auto shouldScaleDown =
            (fixedSize.width() > getMaxPreviewSize().width()) ||
            (fixedSize.height() > getMaxPreviewSize().height());
        if (shouldScaleDown)
        {
            fixedSize = fixedSize.scaled(getMaxPreviewSize(), Qt::KeepAspectRatio);
        }

        const auto shouldScaleUp =
            (fixedSize.width() < getMinPreviewSize().width()) &&
            (fixedSize.height() < getMinPreviewSize().height());
        if (shouldScaleUp)
        {
            fixedSize = fixedSize.scaled(getMinPreviewSize(), Qt::KeepAspectRatio);
        }

        return fixedSize;
    }
Exemplo n.º 11
0
Image* CSSCrossfadeValue::image(RenderElement& renderer, const FloatSize& size)
{
    if (size.isEmpty())
        return nullptr;

    // FIXME: Skip Content Security Policy check when cross fade is applied to an element in a user agent shadow tree.
    // See <https://bugs.webkit.org/show_bug.cgi?id=146663>.
    auto options = CachedResourceLoader::defaultCachedResourceOptions();

    auto& cachedResourceLoader = renderer.document().cachedResourceLoader();
    auto* cachedFromImage = cachedImageForCSSValue(m_fromValue, cachedResourceLoader, options);
    auto* cachedToImage = cachedImageForCSSValue(m_toValue, cachedResourceLoader, options);

    if (!cachedFromImage || !cachedToImage)
        return Image::nullImage();

    auto* fromImage = cachedFromImage->imageForRenderer(&renderer);
    auto* toImage = cachedToImage->imageForRenderer(&renderer);

    if (!fromImage || !toImage)
        return Image::nullImage();

    m_generatedImage = CrossfadeGeneratedImage::create(*fromImage, *toImage, m_percentageValue->floatValue(), fixedSize(renderer), size);
    return m_generatedImage.get();
}
Exemplo n.º 12
0
PassRefPtr<Image> CSSCrossfadeValue::image(RenderObject* renderer, const IntSize& size)
{
    if (size.isEmpty())
        return 0;

    CachedResourceLoader* cachedResourceLoader = renderer->document()->cachedResourceLoader();
    CachedImage* cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), cachedResourceLoader);
    CachedImage* cachedToImage = cachedImageForCSSValue(m_toValue.get(), cachedResourceLoader);

    if (!cachedFromImage || !cachedToImage)
        return Image::nullImage();

    Image* fromImage = cachedFromImage->imageForRenderer(renderer);
    Image* toImage = cachedToImage->imageForRenderer(renderer);

    if (!fromImage || !toImage)
        return Image::nullImage();

    m_generatedImage = CrossfadeGeneratedImage::create(fromImage, toImage, m_percentageValue->getFloatValue(), fixedSize(renderer), size);

    return m_generatedImage.release();
}
Exemplo n.º 13
0
bool Format::parse( const String &fmt )
{

   String tmp;
   uint32 pos = 0;
   uint32 len = fmt.length();

   typedef enum {
      e_sInitial,
      e_sSize,
      e_sDecimals,
      e_sPadding,
      e_sDecSep,
      e_sGroupSep,
      e_sGroupSep2,
      e_sErrorEffect,
      e_sErrorEffect2,
      e_sNilMode,
      e_sNegFmt,
      e_sNegFmt2
   }
   t_state;
   t_state state = e_sInitial;


   while( pos < len )
   {
      uint32 chr = fmt.getCharAt( pos );

      switch( state )
      {

         //=============================
         // Basic state.
         //
         case e_sInitial:
            if( chr >= '0' && chr <= '9' )
            {
               // size already given
               if ( m_size != 0 )
                  return false;

               state = e_sSize;
               tmp.size(0);
               tmp += chr;
               break;
            }

            // else:
            switch( chr )
            {
               case 'N':
                  // it should be an octal.
                  m_convType = e_tNum;
                  numFormat( e_decimal );
               break;

               case '.':
                  // it should be an octal.
                  m_convType = e_tNum;
                  state = e_sDecimals;
                  tmp.size(0);
               break;

               case 'b':
                  // it should be an octal.
                  m_convType = e_tNum;
                  numFormat( e_binary );
               break;

               case 'B':
                  // it should be an octal.
                  m_convType = e_tNum;
                  numFormat( e_binaryB );
               break;

               case 'd':
                  m_convType = e_tNum;
                  state = e_sDecSep;
               break;

               case 'p':
                  state = e_sPadding;
               break;

               case 'g':
                  m_convType = e_tNum;
                  state = e_sGroupSep;
               break;

               case 'G':
                  m_convType = e_tNum;
                  state = e_sGroupSep2;
               break;

               case '0':
                  // it should be an octal.
                  m_convType = e_tNum;
                  numFormat( e_octalZero );
               break;

               case 'o':
                  // it should be an octal.
                  m_convType = e_tNum;
                  numFormat( e_octal );
               break;

               case 'x':
                  // it should be an octal.
                  m_convType = e_tNum;
                  numFormat( e_hexLower );
               break;

               case 'X':
                  // it should be an octal.
                  m_convType = e_tNum;
                  numFormat( e_hexUpper );
               break;

               case 'c':
                  // it should be an octal.
                  m_convType = e_tNum;
                  numFormat( e_cHexLower );
               break;

               case 'C':
                  // it should be an octal.
                  m_convType = e_tNum;
                  numFormat( e_cHexUpper );
               break;

               case 'e':
                  // it should be in scientific format
                  m_convType = e_tNum;
                  numFormat( e_scientific );
               break;

               case '/':
                  // it should be an octal.
                  state = e_sErrorEffect;
               break;

               case 'n':
                  state = e_sNilMode;
               break;

               case '|':
                  m_posOfObjectFmt = pos;
                  m_convType = e_tStr;
                  // complete parsing
                  pos = len;
               break;

               case '+':
                  m_negFormat = e_plusMinusFront;
                  state = e_sNegFmt;
               break;

               case '-':
                  m_negFormat = e_minusFront;
                  state = e_sNegFmt2;
               break;

               case '[':
                  m_negFormat = e_parenthesis;
               break;

               case ']':
                  m_negFormat = e_parpad;
               break;

               case 'r':
                  m_rightAlign = true;
               break;

               default:
                  // unrecognized character
                  m_convType = e_tError;
                  return false;
            }
         break;

         //=============================
         // Parse padding
         //
         case e_sDecSep:
            m_decimalSep = chr;
            state = e_sInitial;
         break;

         case e_sPadding:
            m_paddingChr = chr;
            state = e_sInitial;
         break;

         case e_sGroupSep:
            if( chr >= '0' && chr <='9' )
            {
               m_grouping = chr - '0';
               state = e_sGroupSep2;
            }
            else {
               m_thousandSep = chr;
               state = e_sInitial;
            }
         break;

         case e_sGroupSep2:
            m_thousandSep = chr;
            state = e_sInitial;
         break;

         //=============================
         // Size parsing state
         //
         case e_sSize:
            if( chr >= '0' && chr <= '9' )
            {
               tmp += chr;

               // size too wide
               if ( tmp.length() > 4 ) {
                  m_convType = e_tError;
                  return false;
               }
            }
            else
            {
               int64 tgt;
               tmp.parseInt( tgt );
               fieldSize( (uint16) tgt );

               if( chr == '*' )
               {
                  fixedSize( true );
               }
               else {
                  // reparse current char
                  --pos;
               }

               state = e_sInitial;
            }
         break;

         //=============================
         // Decimals parsing state
         //
         case e_sDecimals:
            if( chr >= '0' && chr <= '9' )
            {
               tmp += chr;

               // size too wide
               if ( tmp.length() > 2 ) {
                  m_convType = e_tError;
                  return false;
               }
            }
            else
            {
               int64 tgt;
               tmp.parseInt( tgt );
               decimals( (uint8) tgt );
               // reparse current char
               --pos;
               state = e_sInitial;
            }
         break;

         //===============================================
         // Parsing what should be done in case of error.
         //
         case e_sErrorEffect:
            if ( chr == 'c' )
            {
               state = e_sErrorEffect2;
               break;
            }

            // else
            switch( chr )
            {
               case 'n': mismatchAction( e_actNil ); break;
               case '0': mismatchAction( e_actZero ); break;
               case 'r': mismatchAction( e_actRaise ); break;

               default:
                  // invalid choiche
                  m_convType = e_tError;
                  return false;
            }

            state = e_sInitial;
         break;

         case e_sErrorEffect2:
            switch( chr )
            {
               case 'n': mismatchAction( e_actConvertNil ); break;
               case '0': mismatchAction( e_actConvertZero ); break;
               case 'r': mismatchAction( e_actConvertRaise ); break;

               default:
                  // invalid choiche
                  m_convType = e_tError;
                  return false;
            }
            state = e_sInitial;
         break;

         //=================================
         // parsing what do to with a Nil
         //
         case e_sNilMode:
            switch( chr )
            {
               case 'n': m_nilFormat = e_nilEmpty; break;
               case 'N': m_nilFormat = e_nilN; break;
               case 'l': m_nilFormat = e_nilnil; break;
               case 'L': m_nilFormat = e_nilNil; break;
               case 'u': m_nilFormat = e_nilNull; break;
               case 'U': m_nilFormat = e_nilNULL; break;
               case 'o': m_nilFormat = e_nilNone; break;
               case 'A': m_nilFormat = e_nilNA; break;

               default:
                  m_convType = e_tError;
                  return false;
            }
            state = e_sInitial;
         break;

         //=================================
         // Parsing neg format
         case e_sNegFmt:
            switch( chr ) {
               case '+': m_negFormat = e_plusMinusBack; break;
               case '^': m_negFormat = e_plusMinusEnd; break;
               default:
                  pos--;
            }
            state = e_sInitial;
         break;

         //=================================
         // Parsing neg format 2
         case e_sNegFmt2:
            switch( chr ) {
               case '-': m_negFormat = e_minusBack; break;
               case '^': m_negFormat = e_minusEnd; break;
               default:
                  pos--;
            }
            state = e_sInitial;
         break;

      }

      ++pos;
   } // end main loop


   // verify output status
   switch( state )
   {
      case e_sInitial: // ok
      case e_sNegFmt:
      break;

      case e_sSize:
      {
         int64 tgt;
         tmp.parseInt( tgt );
         fieldSize( (uint8) tgt );
      }
      break;

      case e_sDecimals:
      {
         int64 tgt;
         tmp.parseInt( tgt );
         decimals( (uint8) tgt );
      }
      break;

      // any other state means we're left in the middle of something
      default:
         m_convType = e_tError;
         return false;
   }

   // if everything goes fine...
   m_originalFormat = fmt;
   return true;
}
Exemplo n.º 14
0
AddEventos::AddEventos(QSqlDatabase w_db, QWidget*parent )
    :QDialog(parent)
{
    setupUi(this);
    db=w_db;//request data base
    setModal(true);


    //set size of form
    QSize fixedSize(this->width(),this->height());
    setMinimumSize(fixedSize);
    setMaximumSize(fixedSize);
    setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);

    //Aceptar/Cancelar
    connect(BtnAceptar,SIGNAL(clicked()),this, SLOT(ClickAceptar())); //ok
    connect(BtnCancelar,SIGNAL(clicked()),this, SLOT(close())); //cancel

    connect(ComboEvento,SIGNAL(activated(int)),this, SLOT(ClickTipo(int))); //type event
    connect(ChecEspera, SIGNAL(clicked(bool)), SpinEspera, SLOT(setEnabled(bool)));//Espera máxima

    connect(ChecExpiracion, SIGNAL(clicked(bool)), TimeExpiracion, SLOT(setEnabled(bool)));//expiracion
    connect(ChecExpiracion, SIGNAL(clicked(bool)), DateExpiracion, SLOT(setEnabled(bool)));

    connect(RadioOtrasHoras, SIGNAL(clicked()), this, SLOT(OtrasHoras()));
    connect(RadioUnaVez, SIGNAL(clicked()), this, SLOT(OtrasHoras()));
    connect(RadioCadaHora, SIGNAL(clicked()), this, SLOT(OtrasHoras()));


    connect(BtnTodos, SIGNAL(clicked(bool)), BtnLunes, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnMartes, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnMiercoles, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnJueves, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnViernes, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnSabado, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnDomingo, SLOT(click())); //¿todos?

    connect(TimeHoraInicio, SIGNAL(editingFinished()), this, SLOT( HoratoCheckBox()));


    connect(BtnUrl,SIGNAL(clicked()),this, SLOT(ClickUrl()));//url of add radio
    connect(BtnAddRadio,SIGNAL(clicked()),this, SLOT(AddRadio())); //button add radio


    //QString Path=QCoreApplication::applicationDirPath().toLatin1();
    //QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
    //db.setDatabaseName(Path + "/Eventos/evento.evt");
    //db.open();

    QSqlQuery query(db);

    w_AddHora = new AddHora(this);

    QDateTime w_DateTime;

    this->TimeHoraInicio->setTime(QDateTime::currentDateTime().time());  //ponemos hora y fecha de inico al dia de hoy
    this->DateFechaInicio->setDate(QDateTime::currentDateTime().date());

    TimeExpiracion->setTime(QDateTime::currentDateTime().time());  //ponemos hora y fecha expiracion  al dia de hoy
    DateExpiracion->setDate(QDateTime::currentDateTime().date());

    HoratoCheckBox();

    ModoEdit=false;
    this->FrameTipoRadio->setVisible(false); //parametros radio on-line false por defecto
}
Exemplo n.º 15
0
PassRefPtr<Image> CSSCrossfadeValue::image(LayoutObject* renderer, const IntSize& size)
{
    if (size.isEmpty())
        return nullptr;

    Document* document = &renderer->document();
    ImageResource* cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), document);
    ImageResource* cachedToImage = cachedImageForCSSValue(m_toValue.get(), document);

    if (!cachedFromImage || !cachedToImage)
        return Image::nullImage();

    Image* fromImage = cachedFromImage->imageForLayoutObject(renderer);
    Image* toImage = cachedToImage->imageForLayoutObject(renderer);

    if (!fromImage || !toImage)
        return Image::nullImage();

    m_generatedImage = CrossfadeGeneratedImage::create(fromImage, toImage, m_percentageValue->getFloatValue(), fixedSize(renderer), size);

    return m_generatedImage.release();
}