Esempio n. 1
0
WAbstractMedia::Source::Source(WAbstractMedia *parent,
			       const WLink& link, const std::string &type,
			       const std::string &media)
  :  parent(parent),
     type(type),
     media(media),
     link(link)
{
  if (link.type() == WLink::Resource)
    connection = link.resource()->dataChanged().connect
      (this, &Source::resourceChanged);
}
Esempio n. 2
0
WAbstractMedia::Source::Source(WAbstractMedia *parent,
			       const WLink& link, const std::string &type,
			       const std::string &media)
  :  parent(parent),
     type(type),
     media(media),
     link(link)
{
  if (link.type() == LinkType::Resource) {
    /*
    connection = link.resource()->dataChanged().connect
      ([=]() { this->resourceChanged(); });
    */
#ifdef WT_TARGET_JAVA
    connection = link.resource()->dataChanged().connect
      (this, std::bind(&Source::resourceChanged, this));
#else // !WT_TARGET_JAVA
    connection = link.resource()->dataChanged().connect
      (std::bind(&Source::resourceChanged, this));
#endif // WT_TARGET_JAVA
  }
}
Esempio n. 3
0
void WPushButton::setLink(const WLink& link)
{
  if (link == link_)
    return;

  link_ = link;
  flags_.set(BIT_LINK_CHANGED);

  if (link.type() == WLink::Resource)
    link.resource()->dataChanged().connect(this, &WPushButton::resourceChanged);

  repaint(RepaintPropertyIEMobile);
}
Esempio n. 4
0
void WImage::setImageLink(const WLink& link)
{
  if (link.type() != WLink::Resource && canOptimizeUpdates()
      && (link == imageLink_))
    return;

  imageLink_ = link;

  if (link.type() == WLink::Resource)
    link.resource()->dataChanged().connect(this, &WImage::resourceChanged);

  flags_.set(BIT_IMAGE_LINK_CHANGED);

  repaint(RepaintPropertyIEMobile);
}
Esempio n. 5
0
void WCssDecorationStyle::setBackgroundImage(const WLink& image,
					     Repeat repeat,
					     WFlags<Side> sides)
{
  if (image.type() == WLink::Resource)
    image.resource()->dataChanged().
      connect(this, &WCssDecorationStyle::backgroundImageResourceChanged);

  if (!WWebWidget::canOptimizeUpdates()
      || backgroundImage_ != image
      || backgroundImageRepeat_ != repeat
      || backgroundImageLocation_ != sides) {
    backgroundImage_ = image;
    backgroundImageRepeat_ = repeat;
    backgroundImageLocation_ = sides;
    backgroundImageChanged_ = true;

    changed();
  }
}