예제 #1
0
JFRect JViewSet::calculateExtent() {
  JFRect rect;
  void* arg[] = { &rect, &(eventMask=0)};
  forEachChild(DoCalculateExtent, arg);
  reshape(rect);
  return rect;
}
예제 #2
0
void JViewSet::ungroup(JViewSet& np, JFocusSet& set) {
  if (!parent->parent) {
    void* arg[] = {&np, &set};
    forEachChild(DoUngroup, arg);
    remove();
  } else JViewObj::ungroup(np, set);  
}
예제 #3
0
boolean JViewSet::handleJEvent(JEvent& e) {
  switch (e.id) {
    case JEvent::GLOBAL_KEY_PRESS:
    case JEvent::GLOBAL_KEY_ACTION:
    case JEvent::GLOBAL_KEY_RELEASE:
      if (!needEvent(GLOBAL_KEYBOARD_MASK)) return false;
      break;
    case JEvent::GLOBAL_MOUSE_MOVE:
    case JEvent::GLOBAL_MOUSE_DOWN:
    case JEvent::GLOBAL_MOUSE_ACTION:
    case JEvent::GLOBAL_MOUSE_UP:
      if (!needEvent(GLOBAL_MOUSE_MASK)) return false;
      break;
    case JEvent::KEY_PRESS:
    case JEvent::KEY_ACTION:
    case JEvent::KEY_RELEASE:
      if (!needEvent(KEYBOARD_MASK)) return false;
      break;
    case JEvent::GOT_FOCUS:
    case JEvent::LOST_FOCUS:
      if (!needEvent(FOCUS_MASK)) return false;
      break;
    case JEvent::MIXER_LINE_NOTIFY:
    case JEvent::MIXER_CONTROL_NOTIFY:
      if (!needEvent(MIXER_MASK)) return false;
      break;
  }
  forEachChild(DoHandleJEvent, (void**)&e);
  return true;
}
예제 #4
0
JArray JViewSet::getProperties() {
  JArray properties;
  JDictionary dict(101);
  void* arg[] = { &properties, &dict};
  forEachChild(DoGetProperties, arg);
  return properties;
}
// Increases count if key is glo_from by the number of its edges
// equal to glo_to
void countEdges(void *key, void *value) {
	uint64 from = *(uint64 *)key;
	if(from == glo_from) {
		uint64 *edges = (uint64 *)value;
		forEachChild(from, edges, increaseCountByMatchingEdges);
	}
}
예제 #6
0
void
KdmItem::updateVisible()
{
    updateThisVisible();
    forEachChild (itm)
        itm->updateVisible();
}
void printNodeAndChildren(void *k, void *v) {
	uint64 parent = *(uint64 *)k;
	uint64 *edges = (uint64 *)v;
	printf("%lli -> [", parent);
	forEachChild(parent, edges, printEdge);
	printf("]\n");
}
예제 #8
0
JViewObj* JViewSet::duplicate(JViewSet* _parent, JDictionary* dict) {
  JViewSet *set = (JViewSet*)JViewObj::duplicate(_parent);
  void* arg[] = { set, dict};
  set->delAll();
  forEachChild(DoDuplicate, arg);
  return set;
}
예제 #9
0
JFocusSet JViewSet::select(JFRect& r) {
  JFocusSet set;
  if (r && *this) {
    void* arg[] = {&r, &set};
    forEachChild(DoLocate, arg);
  }
  return set;
}
예제 #10
0
void
KdmItem::plugActions(bool plug)
{
    if (myWidget)
        plug = false;
    doPlugActions(plug);
    forEachChild (itm)
        itm->plugActions(plug);
}
예제 #11
0
JViewObj* JFocusSet::duplicateFocus(JViewSet& linkSet, JViewSet* _parent) {
  JFocusSet newSet;
  JDictionary dict(101);
  void* arg[] = { _parent, &dict, &newSet};
  forEachChild(DoFocusDuplicate, arg);
  linkSet.forEachChild(DoLinkRebuild, (void**)&dict);
  newSet.reshape(*this);
  *this = newSet;
  return null;
}
예제 #12
0
void
KdmItem::showWidget(bool show)
{
    if (!isVisible())
        show = false;
    if (myWidget) {
        if (show) {
            QSize sz(area.size().expandedTo(myWidget->minimumSize())
                                .boundedTo(myWidget->maximumSize()));
            QSize off((area.size() - sz) / 2);
            myWidget->setGeometry(
                area.x() + off.width(), area.y() + off.height(),
                sz.width(), sz.height());
        }
        myWidget->setVisible(show);
    }
    forEachChild (itm)
        itm->showWidget(show);
}
예제 #13
0
void
KdmItem::paint(QPainter *p, const QRect &rect, bool background, bool primaryScreen)
{
    if (!isVisible())
        return;
    if (background &&
        (p->device()->width() < m_minScrWidth ||
         p->device()->height() < m_minScrHeight))
        return;

    if (myWidget)
        return;

    QRect contentsRect = area.intersected(rect);
    if (!contentsRect.isEmpty() &&
        (!background || isBackground) &&
        (paintOnScreen == ScrAll ||
         ((paintOnScreen == ScrGreeter) == primaryScreen)))
    {
        drawContents(p, contentsRect);
        if (debugLevel & DEBUG_THEMING) {
            // Draw bounding rect for this item
            QPen pen(Qt::white);
            pen.setCapStyle(Qt::FlatCap);
            pen.setDashPattern(QVector<qreal>() << 5 << 6);
            p->setPen(pen);
            p->setBackgroundMode(Qt::OpaqueMode);
            p->setBackground(Qt::black);
            p->drawRect(area.x(), area.y(), area.width() - 1, area.height() - 1);
            p->setBackgroundMode(Qt::TransparentMode);
        }
    }

    // Dispatch paint events to children
    forEachChild (itm)
        itm->paint(p, rect, background, primaryScreen);
}
예제 #14
0
bool NCObject::isOnTopOf(NCObject* a, NCObject* b)
{
	// Determine which is on top, winKeys or the chat windows
	int aPos = 0;
	int bPos = 0;
	int counter = 0;
	forEachChild([&](ncpp::ncobject::NCObject* obj)
	{
		++counter;
		if(obj == a)
		{
			aPos = counter;
		}
		else if(obj == b)
		{
			bPos = counter;
		}
		if(0 != aPos && 0 != bPos)
			return false;
		return true;
	});

	return aPos > bPos;
}
예제 #15
0
void JFocusSet::toFront() 
{ forEachChild(DoToFront);}
예제 #16
0
void JViewSet::reparent(JViewSet& np)
{ forEachChild(DoReparent, (void**)&np);}
예제 #17
0
void
KdmItem::update()
{
    forEachChild (itm)
        itm->update();
}
예제 #18
0
void JViewSet::close() {
  forEachChild(DoClose);
  JViewObj::close();
}
예제 #19
0
void JViewSet::startup() {
  JViewObj::startup();
  forEachChild(DoStartup);
}
예제 #20
0
void JViewSet::remove() {
  forEachChild(DoRemove);
  JViewObj::remove();
}
예제 #21
0
void JViewSet::rescale(JFRect& info, double wscale, double hscale) {
  void* arg[] = { &info, &wscale, &hscale};
  forEachChild(DoRescale, arg);
  JViewObj::rescale(info, wscale, hscale);
}
예제 #22
0
void JViewSet::nearest(double _x, double _y, double& d, JViewObj*& dest) {
  void* arg[] = {&_x, &_y, &d, &dest};
  forEachChild(DoNearest, arg);
}
예제 #23
0
void JViewSet::touch(JFRect& r, JFocusSet& set) {
  if (r && *this) {
    void* arg[] = {&r, &set};
    forEachChild(DoTouch, arg);
  }
}
예제 #24
0
void JViewSet::toHash(JHashTable& hash) 
{ forEachChild(DoToHash, (void**)&hash);}
예제 #25
0
void JViewSet::fixPointer(JDictionary& dict) 
{ forEachChild(DoFixPointer, (void**)&dict);}
예제 #26
0
void JViewSet::fixParent(JViewSet* _parent) {
  parent = _parent;
  forEachChild(DoFixParent, (void**)this);
}
예제 #27
0
JFRect JViewSet::calculateUpdate() {
  JFRect rect;
  forEachChild(DoCalculateUpdate, (void**)&rect);
  return rect;
}
예제 #28
0
void JFocusSet::ungroup(JViewSet& np, JFocusSet& set) {
  void* arg[] = {&np, &set};
  forEachChild(DoUngroup, arg);
}
예제 #29
0
boolean JViewSet::updateProperty(JProperty& prop) { 
  forEachChild(DoUpdateProperty, (void**)&prop);
  return false;
}
예제 #30
0
JFPoint& JViewSet::translate(double dx, double dy) {
  JViewObj::translate(dx, dy);
  void* arg[] = { &dx, &dy};
  forEachChild(DoTranslate, arg);
  return *this;
}