nsAccessible*
nsOuterDocAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
                                      EWhichChildAtPoint aWhichChild)
{
  PRInt32 docX = 0, docY = 0, docWidth = 0, docHeight = 0;
  nsresult rv = GetBounds(&docX, &docY, &docWidth, &docHeight);
  NS_ENSURE_SUCCESS(rv, nsnull);

  if (aX < docX || aX >= docX + docWidth || aY < docY || aY >= docY + docHeight)
    return nsnull;

  // Always return the inner doc as direct child accessible unless bounds
  // outside of it.
  nsAccessible* child = GetChildAt(0);
  NS_ENSURE_TRUE(child, nsnull);

  if (aWhichChild = eDeepestChild)
    return child->GetChildAtPoint(aX, aY, eDeepestChild);
  return child;
}
Ejemplo n.º 2
0
bool MythUIButtonTree::gestureEvent(MythGestureEvent *event)
{
    bool handled = false;

    if (event->gesture() == MythGestureEvent::Click)
    {
        // We want the relative position of the click
        QPoint position = event->GetPosition() -
                          m_Parent->GetArea().topLeft();

        MythUIType *type = GetChildAt(position, false, false);

        if (!type)
            return false;

        MythUIButtonList *list = dynamic_cast<MythUIButtonList *>(type);

        if (list)
            handled = list->gestureEvent(event);
    }

    return handled;
}
Ejemplo n.º 3
0
void IconMerger::CheckOverflow(
    /* [in] */ Int32 width)
{
    if (mMoreView == NULL) return;

        Int32 N = GetChildCount();
        Int32 visibleChildren = 0, visibility;
        for (Int32 i = 0; i < N; i++) {
            AutoPtr<IView> childView = GetChildAt(i);
            childView->GetVisibility(&visibility);
            if (visibility != IView::GONE) visibleChildren++;
        }

        mMoreView->GetVisibility(&visibility);
        Boolean overflowShown = (visibility == IView::VISIBLE);
        // let's assume we have one more slot if the more icon is already showing
        if (overflowShown) visibleChildren--;
        Boolean moreRequired = visibleChildren * mIconSize > width;
        if (moreRequired != overflowShown) {
            AutoPtr<IRunnable> runnable = new SetVisibilityRunnable(moreRequired, this);
            Post(runnable);
        }
}
Ejemplo n.º 4
0
bool CParameter::HitTest(int x, int y)
{
	return NULL != GetChildAt(x, y);
}
nsAccessible*
nsHTMLImageMapAccessible::GetAnchor(PRUint32 aAnchorIndex)
{
  return GetChildAt(aAnchorIndex);
}
void ActionBarContainer::OnLayout(
    /* [in] */ Boolean changed,
    /* [in] */ Int32 l,
    /* [in] */ Int32 t,
    /* [in] */ Int32 r,
    /* [in] */ Int32 b)
{
    FrameLayout::OnLayout(changed, l, t, r, b);

    Int32 visible;

    Boolean hasTabs = mTabContainer != NULL && (mTabContainer->GetVisibility(&visible), visible) != IView::GONE;

    if (hasTabs) {
        Int32 containerHeight = GetMeasuredHeight();
        Int32 tabHeight;
        mTabContainer->GetMeasuredHeight(&tabHeight);

        Int32 options;
        mActionBarView->GetDisplayOptions(&options);

        if ((options & IActionBar::DISPLAY_SHOW_HOME) == 0) {
            // Not showing home, put tabs on top.
            Int32 count = GetChildCount();
            for (Int32 i = 0; i < count; i++) {
                AutoPtr<IView> child = GetChildAt(i);

                if (child == mTabContainer) continue;

                Boolean collapsed;
                mActionBarView->IsCollapsed(&collapsed);
                if (!collapsed) {
                    child->OffsetTopAndBottom(tabHeight);
                }
            }
            mTabContainer->Layout(l, 0, r, tabHeight);
        } else {
            mTabContainer->Layout(l, containerHeight - tabHeight, r, containerHeight);
        }
    }

    Boolean needsInvalidate = FALSE;
    if (mIsSplit) {
        if (mSplitBackground != NULL) {
            mSplitBackground->SetBounds(0, 0, GetMeasuredWidth(), GetMeasuredHeight());
            needsInvalidate = TRUE;
        }
    } else {
        if (mBackground != NULL) {
            Int32 l, t, r, b;
            mActionBarView->GetLeft(&l);
            mActionBarView->GetTop(&t);
            mActionBarView->GetRight(&r);
            mActionBarView->GetBottom(&b);

            mBackground->SetBounds(l, t, r, b);
            needsInvalidate = TRUE;
        }
        if ((mIsStacked = hasTabs && mStackedBackground != NULL)) {

            Int32 l, t, r, b;
            mTabContainer->GetLeft(&l);
            mTabContainer->GetTop(&t);
            mTabContainer->GetRight(&r);
            mTabContainer->GetBottom(&b);

            mStackedBackground->SetBounds(l, t, r, b);
            needsInvalidate = TRUE;
        }
    }

    if (needsInvalidate) {
        Invalidate();
    }
}
NS_IMETHODIMP nsMsgGroupThread::GetChildHdrAt(PRInt32 aIndex, nsIMsgDBHdr **aResult)
{
  return GetChildAt(aIndex, aResult);
}
NS_IMETHODIMP nsMsgGroupThread::GetChild(nsMsgKey msgKey, nsIMsgDBHdr **aResult)
{
  PRUint32 childIndex = m_keys.IndexOf(msgKey);
  return (childIndex != kNotFound) ? GetChildAt(childIndex, aResult) : NS_MSG_MESSAGE_NOT_FOUND;
}