Example #1
0
void CXFA_FFDocView::AddInvalidateRect(CXFA_FFPageView* pPageView,
                                       const CFX_RectF& rtInvalidate) {
  if (m_mapPageInvalidate[pPageView]) {
    m_mapPageInvalidate[pPageView]->Union(rtInvalidate);
    return;
  }
  CFX_RectF* pRect = new CFX_RectF;
  pRect->Set(rtInvalidate.left, rtInvalidate.top, rtInvalidate.width,
             rtInvalidate.height);
  m_mapPageInvalidate[pPageView].reset(pRect);
}
FX_BOOL CXFA_FFField::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
  if (!m_pNormalWidget) {
    return FALSE;
  }
  CFX_RectF rtWidget;
  m_pNormalWidget->GetWidgetRect(rtWidget);
  if (rtWidget.Contains(fx, fy)) {
    return TRUE;
  }
  return FALSE;
}
Example #3
0
FX_BOOL CXFA_FFComboBox::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
  if (!m_pNormalWidget) {
    return FALSE;
  }
  CFX_RectF rtWidget;
  ((CFWL_ComboBox*)m_pNormalWidget)->GetBBox(rtWidget);
  if (rtWidget.Contains(fx, fy)) {
    return TRUE;
  }
  return FALSE;
}
bool CXFA_FFComboBox::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
  if (!m_pNormalWidget) {
    return false;
  }
  CFX_RectF rtWidget;
  ((CFWL_ComboBox*)m_pNormalWidget)->GetBBox(rtWidget);
  if (rtWidget.Contains(fx, fy)) {
    return true;
  }
  return false;
}
Example #5
0
bool CXFA_FFDateTimeEdit::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
  if (!m_pNormalWidget) {
    return false;
  }
  CFX_RectF rtWidget;
  ((CFWL_DateTimePicker*)m_pNormalWidget)->GetBBox(rtWidget);
  if (rtWidget.Contains(fx, fy)) {
    return true;
  }
  return false;
}
Example #6
0
void CFWL_FormTP::DrawMinimizeBox(CFX_Graphics* pGraphics,
                                  const CFX_RectF* pRect,
                                  FWLTHEME_STATE eState,
                                  CFX_Matrix* pMatrix,
                                  int32_t iActive) {
  DrawMinMaxBoxCommon(pGraphics, pRect, eState, pMatrix);
  CFX_RectF rtMin;
  rtMin.Set(pRect->left + 5, pRect->top + 13, pRect->width - 14,
            pRect->height - 18);
  FillSoildRect(pGraphics, 0xFFFFFFFF, &rtMin, pMatrix);
}
Example #7
0
void CXFA_FFDocView::AddInvalidateRect(IXFA_PageView* pPageView,
                                       const CFX_RectF& rtInvalidate) {
  CFX_RectF* pRect = (CFX_RectF*)m_mapPageInvalidate.GetValueAt(pPageView);
  if (!pRect) {
    pRect = new CFX_RectF;
    pRect->Set(rtInvalidate.left, rtInvalidate.top, rtInvalidate.width,
               rtInvalidate.height);
    m_mapPageInvalidate.SetAt(pPageView, pRect);
  } else {
    pRect->Union(rtInvalidate);
  }
}
Example #8
0
int32_t CFWL_CaretImp::CFWL_CaretTimer::Run(FWL_HTIMER hTimer) {
    if (m_pCaret->GetStates() & FWL_STATE_CAT_HightLight) {
        m_pCaret->SetStates(FWL_STATE_CAT_HightLight, FALSE);
    } else {
        m_pCaret->SetStates(FWL_STATE_CAT_HightLight);
    }
    CFX_RectF rt;
    m_pCaret->GetWidgetRect(rt);
    rt.Set(0, 0, rt.width + 1, rt.height);
    m_pCaret->Repaint(&rt);
    return 1;
}
void IFWL_DateTimePicker::DisForm_GetBBox(CFX_RectF& rect) const {
  rect = m_pProperties->m_rtWidget;
  if (DisForm_IsNeedShowButton())
    rect.width += m_fBtn;
  if (!IsMonthCalendarVisible())
    return;

  CFX_RectF rtMonth;
  m_pMonthCal->GetWidgetRect(rtMonth);
  rtMonth.Offset(m_pProperties->m_rtWidget.left, m_pProperties->m_rtWidget.top);
  rect.Union(rtMonth);
}
Example #10
0
void CFWL_WidgetMgrDelegate::DrawChild(IFWL_Widget* parent,
                                       const CFX_RectF& rtClip,
                                       CFX_Graphics* pGraphics,
                                       const CFX_Matrix* pMatrix) {
  if (!parent)
    return;

  FX_BOOL bFormDisable = m_pWidgetMgr->IsFormDisabled();
  IFWL_Widget* pNextChild = m_pWidgetMgr->GetFirstChildWidget(parent);
  while (pNextChild) {
    IFWL_Widget* child = pNextChild;
    pNextChild = m_pWidgetMgr->GetNextSiblingWidget(child);
    if (child->GetStates() & FWL_WGTSTATE_Invisible)
      continue;

    CFX_RectF rtWidget;
    child->GetWidgetRect(rtWidget);
    if (rtWidget.IsEmpty())
      continue;

    CFX_Matrix widgetMatrix;
    CFX_RectF clipBounds(rtWidget);
    if (!bFormDisable)
      child->GetMatrix(widgetMatrix, TRUE);
    if (pMatrix)
      widgetMatrix.Concat(*pMatrix);

    if (!bFormDisable) {
      widgetMatrix.TransformPoint(clipBounds.left, clipBounds.top);
      clipBounds.Intersect(rtClip);
      if (clipBounds.IsEmpty())
        continue;

      pGraphics->SaveGraphState();
      pGraphics->SetClipRect(clipBounds);
    }
    widgetMatrix.Translate(rtWidget.left, rtWidget.top, TRUE);
    IFWL_WidgetDelegate* pDelegate = child->SetDelegate(nullptr);
    if (pDelegate) {
      if (m_pWidgetMgr->IsFormDisabled() ||
          IsNeedRepaint(child, &widgetMatrix, rtClip)) {
        pDelegate->OnDrawWidget(pGraphics, &widgetMatrix);
      }
    }
    if (!bFormDisable)
      pGraphics->RestoreGraphState();

    DrawChild(child, clipBounds, pGraphics,
              bFormDisable ? &widgetMatrix : pMatrix);
    child = m_pWidgetMgr->GetNextSiblingWidget(child);
  }
}
void CFWL_DateTimeCalendarImpDelegate::OnLButtonUpEx(CFWL_MsgMouse* pMsg) {
  if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) {
    return DisForm_OnLButtonUpEx(pMsg);
  }
  if (m_pOwner->m_rtLBtn.Contains(pMsg->m_fx, pMsg->m_fy)) {
    m_pOwner->m_iLBtnPartStates = 0;
    m_pOwner->Repaint(&m_pOwner->m_rtLBtn);
    return;
  }
  if (m_pOwner->m_rtRBtn.Contains(pMsg->m_fx, pMsg->m_fy)) {
    m_pOwner->m_iRBtnPartStates = 0;
    m_pOwner->Repaint(&m_pOwner->m_rtRBtn);
    return;
  }
  if (m_pOwner->m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) {
    return;
  }
  int32_t iOldSel = 0;
  if (m_pOwner->m_arrSelDays.GetSize() > 0) {
    iOldSel = m_pOwner->m_arrSelDays[0];
  }
  int32_t iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
  CFX_RectF rt;
  IFWL_DateTimePicker* pIPicker =
      static_cast<IFWL_DateTimePicker*>(m_pOwner->m_pOuter);
  CFWL_DateTimePickerImp* pPicker =
      static_cast<CFWL_DateTimePickerImp*>(pIPicker->GetImpl());
  pPicker->m_pForm->GetWidgetRect(rt);
  rt.Set(0, 0, rt.width, rt.height);
  if (iCurSel > 0) {
    LPDATEINFO lpDatesInfo =
        (LPDATEINFO)m_pOwner->m_arrDates.GetAt(iCurSel - 1);
    CFX_RectF rtInvalidate(lpDatesInfo->rect);
    if (iOldSel > 0 && iOldSel <= m_pOwner->m_arrDates.GetSize()) {
      lpDatesInfo = (LPDATEINFO)m_pOwner->m_arrDates.GetAt(iOldSel - 1);
      rtInvalidate.Union(lpDatesInfo->rect);
    }
    m_pOwner->AddSelDay(iCurSel);
    if (!m_pOwner->m_pOuter)
      return;
    pPicker->ProcessSelChanged(m_pOwner->m_iCurYear, m_pOwner->m_iCurMonth,
                               iCurSel);
    pPicker->ShowMonthCalendar(FALSE);
  } else if (m_bFlag && (!rt.Contains(pMsg->m_fx, pMsg->m_fy))) {
    IFWL_DateTimePicker* pIPicker =
        static_cast<IFWL_DateTimePicker*>(m_pOwner->m_pOuter);
    CFWL_DateTimePickerImp* pPicker =
        static_cast<CFWL_DateTimePickerImp*>(pIPicker->GetImpl());
    pPicker->ShowMonthCalendar(FALSE);
  }
  m_bFlag = 0;
}
FWL_WidgetHit IFWL_DateTimePicker::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
  if (m_pWidgetMgr->IsFormDisabled())
    return DisForm_HitTest(fx, fy);
  if (m_rtClient.Contains(fx, fy))
    return FWL_WidgetHit::Client;
  if (IsMonthCalendarVisible()) {
    CFX_RectF rect;
    m_pMonthCal->GetWidgetRect(rect);
    if (rect.Contains(fx, fy))
      return FWL_WidgetHit::Client;
  }
  return FWL_WidgetHit::Unknown;
}
Example #13
0
void CFWL_FormTP::DrawFormBorder(CFX_Graphics* pGraphics,
                                 const CFX_RectF* pRect,
                                 FWLTHEME_STATE eState,
                                 CFX_Matrix* pMatrix,
                                 int32_t iActive) {
  CFX_RectF rt;
  rt.Set(pRect->left, pRect->top, 1, pRect->height);
  FX_FLOAT fBottom, fRight;
  fBottom = pRect->bottom();
  fRight = pRect->right();
  CFX_Path path;
  path.Create();
  CFX_Color clrLine;
  path.Clear();
  path.MoveTo(pRect->left, pRect->top);
  path.LineTo(pRect->left, fBottom - 1);
  path.LineTo(fRight - 1, fBottom - 1);
  path.LineTo(fRight - 1, pRect->top);
  clrLine = m_pThemeData->clrFormBorder[iActive][2];
  pGraphics->SetStrokeColor(&clrLine);
  pGraphics->StrokePath(&path, pMatrix);
  path.Clear();
  path.MoveTo(pRect->left + 1, pRect->top);
  path.LineTo(pRect->left + 1, fBottom - 2);
  path.LineTo(fRight - 2, fBottom - 2);
  path.LineTo(fRight - 2, pRect->top);
  clrLine = m_pThemeData->clrFormBorder[iActive][1];
  pGraphics->SetStrokeColor(&clrLine);
  pGraphics->StrokePath(&path, pMatrix);
  path.Clear();
  path.MoveTo(pRect->left + 2, pRect->top);
  path.LineTo(pRect->left + 2, fBottom - 3);
  path.LineTo(fRight - 3, fBottom - 3);
  path.LineTo(fRight - 3, pRect->top);
  clrLine = m_pThemeData->clrFormBorder[iActive][0];
  pGraphics->SetStrokeColor(&clrLine);
  pGraphics->StrokePath(&path, pMatrix);
  path.Clear();
  path.MoveTo(pRect->left + 3, pRect->top);
  path.LineTo(pRect->left + 3, fBottom - 4);
  path.LineTo(fRight - 4, fBottom - 4);
  path.LineTo(fRight - 4, pRect->top);
  clrLine = m_pThemeData->clrFormBorder[iActive][4];
  pGraphics->SetStrokeColor(&clrLine);
  pGraphics->StrokePath(&path, pMatrix);
  m_rtDisLBorder.Set(pRect->left, pRect->top + 29, 4, pRect->height - 29);
  m_rtDisRBorder.Set(pRect->right() - 4, pRect->top + 29, 4,
                     pRect->height - 29);
  m_rtDisBBorder.Set(pRect->left, pRect->bottom() - 4, pRect->width, 4);
  m_rtDisCaption.Set(pRect->left, pRect->top, pRect->width, 29);
}
FWL_ERR CFWL_DateTimePickerImp::DisForm_GetBBox(CFX_RectF& rect) {
  rect = m_pProperties->m_rtWidget;
  if (DisForm_IsNeedShowButton()) {
    rect.width += m_fBtn;
  }
  if (IsMonthCalendarShowed()) {
    CFX_RectF rtMonth;
    m_pMonthCal->GetWidgetRect(rtMonth);
    rtMonth.Offset(m_pProperties->m_rtWidget.left,
                   m_pProperties->m_rtWidget.top);
    rect.Union(rtMonth);
  }
  return FWL_ERR_Succeeded;
}
Example #15
0
void CFWL_FormTP::CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect) {
  FX_DWORD dwStyles = pWidget->GetStyles();
  CFX_RectF rtWidget;
  pWidget->GetWidgetRect(rtWidget);
  rtWidget.Offset(-rtWidget.left, -rtWidget.top);
  if (dwStyles & FWL_WGTSTYLE_CloseBox) {
    rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Span,
             rtWidget.top + FWLTHEME_FORMBTN_Margin, FWLTHEME_FORMBTN_Size,
             FWLTHEME_FORMBTN_Size);
  } else {
    rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Span,
             rtWidget.top + FWLTHEME_FORMBTN_Margin, 0, 0);
  }
}
FWL_ERR CFWL_DateTimePickerImp::GetBBox(CFX_RectF& rect) {
  if (m_pWidgetMgr->IsFormDisabled()) {
    return DisForm_GetBBox(rect);
  }
  rect = m_pProperties->m_rtWidget;
  if (IsMonthCalendarShowed()) {
    CFX_RectF rtMonth;
    m_pMonthCal->GetWidgetRect(rtMonth);
    rtMonth.Offset(m_pProperties->m_rtWidget.left,
                   m_pProperties->m_rtWidget.top);
    rect.Union(rtMonth);
  }
  return FWL_ERR_Succeeded;
}
Example #17
0
void IFWL_Widget::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
  if (!bAutoSize) {
    rect = m_pProperties->m_rtWidget;
    return;
  }

  if (HasEdge()) {
    FX_FLOAT fEdge = GetEdgeWidth();
    rect.Inflate(fEdge, fEdge);
  }
  if (HasBorder()) {
    FX_FLOAT fBorder = GetBorderSize();
    rect.Inflate(fBorder, fBorder);
  }
}
void IFWL_DateTimePicker::GetBBox(CFX_RectF& rect) const {
  if (m_pWidgetMgr->IsFormDisabled()) {
    DisForm_GetBBox(rect);
    return;
  }

  rect = m_pProperties->m_rtWidget;
  if (IsMonthCalendarVisible()) {
    CFX_RectF rtMonth;
    m_pMonthCal->GetWidgetRect(rtMonth);
    rtMonth.Offset(m_pProperties->m_rtWidget.left,
                   m_pProperties->m_rtWidget.top);
    rect.Union(rtMonth);
  }
}
Example #19
0
FWL_WidgetHit CXFA_FFSignature::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) {
  if (m_pNormalWidget) {
    FX_FLOAT ffx = fx, ffy = fy;
    FWLToClient(ffx, ffy);
    if (m_pNormalWidget->HitTest(ffx, ffy) != FWL_WidgetHit::Unknown)
      return FWL_WidgetHit::Client;
  }
  CFX_RectF rtBox;
  GetRectWithoutRotate(rtBox);
  if (!rtBox.Contains(fx, fy))
    return FWL_WidgetHit::Unknown;
  if (m_rtCaption.Contains(fx, fy))
    return FWL_WidgetHit::Titlebar;
  return FWL_WidgetHit::Client;
}
FX_DWORD CFWL_DateTimePickerImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
  if (m_pWidgetMgr->IsFormDisabled()) {
    return DisForm_HitTest(fx, fy);
  }
  if (m_rtClient.Contains(fx, fy)) {
    return FWL_WGTHITTEST_Client;
  }
  if (IsMonthCalendarShowed()) {
    CFX_RectF rect;
    m_pMonthCal->GetWidgetRect(rect);
    if (rect.Contains(fx, fy)) {
      return FWL_WGTHITTEST_Client;
    }
  }
  return FWL_WGTHITTEST_Unknown;
}
Example #21
0
void IFWL_Widget::GetClientRect(CFX_RectF& rect) {
  GetEdgeRect(rect);
  if (HasEdge()) {
    FX_FLOAT fEdge = GetEdgeWidth();
    rect.Deflate(fEdge, fEdge);
  }
}
int32_t CFDE_TxtEdtPage::GetDisplayPos(const CFX_RectF& rtClip,
                                       FXTEXT_CHARPOS*& pCharPos,
                                       CFX_RectF* pBBox) const {
    pCharPos = FX_Alloc(FXTEXT_CHARPOS, m_nCharCount);
    int32_t nCharPosCount = 0;
    FDE_TEXTEDITPIECE* pPiece = nullptr;
    int32_t nVisualObjCount = m_PieceMassArr.GetSize();
    FXTEXT_CHARPOS* pos = pCharPos;
    CFX_RectF rtObj;
    for (int32_t i = 0; i < nVisualObjCount; i++) {
        pPiece = m_PieceMassArr.GetPtrAt(i);
        m_pTextSet->GetRect(pPiece, rtObj);
        if (!rtClip.IntersectWith(rtObj)) {
            continue;
        }
        int32_t nCount = m_pTextSet->GetDisplayPos(pPiece, pos, FALSE);
        nCharPosCount += nCount;
        pos += nCount;
    }
    if ((nCharPosCount * 5) < (m_nCharCount << 2)) {
        FXTEXT_CHARPOS* pTemp = FX_Alloc(FXTEXT_CHARPOS, nCharPosCount);
        FXSYS_memcpy(pTemp, pCharPos, sizeof(FXTEXT_CHARPOS) * nCharPosCount);
        FX_Free(pCharPos);
        pCharPos = pTemp;
    }
    return nCharPosCount;
}
Example #23
0
FX_BOOL CFDE_RenderContext::ApplyClip(IFDE_VisualSet* pVisualSet,
                                      FDE_HVISUALOBJ hObj,
                                      FDE_HDEVICESTATE& hState) {
  CFX_RectF rtClip;
  if (!pVisualSet->GetClip(hObj, rtClip)) {
    return FALSE;
  }
  CFX_RectF rtObj;
  pVisualSet->GetRect(hObj, rtObj);
  rtClip.Offset(rtObj.left, rtObj.top);
  m_Transform.TransformRect(rtClip);
  const CFX_RectF& rtDevClip = m_pRenderDevice->GetClipRect();
  rtClip.Intersect(rtDevClip);
  hState = m_pRenderDevice->SaveState();
  return m_pRenderDevice->SetClipRect(rtClip);
}
Example #24
0
void CFWL_ScrollBarImp::CalcMaxTrackRect(CFX_RectF& rect) {
  if (m_bMinSize) {
    rect.Empty();
    return;
  }
  FX_FLOAT ix = (m_rtThumb.left + m_rtThumb.right()) / 2;
  FX_FLOAT iy = (m_rtThumb.top + m_rtThumb.bottom()) / 2;
  FX_BOOL bVertical = IsVertical();
  rect.left = bVertical ? m_rtClient.left : ix;
  rect.top = bVertical ? iy : m_rtClient.top;
  rect.width = bVertical ? m_rtClient.width : m_rtClient.right() - ix;
  rect.height = bVertical ? m_rtClient.bottom() - iy : m_rtClient.height;
  if (m_bCustomLayout) {
    if (bVertical) {
      if (m_rtMinBtn.top > m_rtThumb.top && m_rtMinBtn.height > 0 &&
          m_rtMaxBtn.height > 0) {
        rect.height -= (m_rtClient.bottom() - m_rtMinBtn.top);
      } else if (m_rtMinBtn.height > 0 && m_rtMaxBtn.height > 0) {
        rect.height -= (m_rtClient.bottom() - m_rtMaxBtn.top);
      }
    } else {
      if (m_rtMinBtn.left > m_rtThumb.left && m_rtMinBtn.width > 0 &&
          m_rtMaxBtn.width > 0) {
        rect.width -= (m_rtClient.right() - m_rtMinBtn.left);
      } else if (m_rtMinBtn.width > 0 && m_rtMaxBtn.width > 0) {
        rect.width -= (m_rtClient.right() - m_rtMaxBtn.left);
      }
    }
  }
}
Example #25
0
void CFWL_ScrollBarImp::CalcMinTrackRect(CFX_RectF& rect) {
  if (m_bMinSize) {
    rect.Empty();
    return;
  }
  FX_FLOAT fBottom = m_rtThumb.bottom();
  FX_FLOAT fRight = m_rtThumb.right();
  FX_FLOAT ix = (m_rtThumb.left + fRight) / 2;
  FX_FLOAT iy = (m_rtThumb.top + fBottom) / 2;
  rect.left = m_rtClient.left;
  rect.top = m_rtClient.top;
  FX_BOOL bVertical = IsVertical();
  rect.width = bVertical ? m_rtClient.width : ix;
  rect.height = bVertical ? iy : m_rtClient.height;
  if (m_bCustomLayout) {
    if (bVertical) {
      if (0 == m_rtMinBtn.height && 0 == m_rtMaxBtn.height) {
        rect.top = m_rtClient.top;
      } else if (m_rtMinBtn.top < m_rtThumb.top) {
        rect.top = m_rtMinBtn.bottom();
        rect.height -= (m_rtMinBtn.bottom() - m_rtClient.top);
      }
    } else {
      if (0 == m_rtMinBtn.width && 0 == m_rtMaxBtn.width) {
        rect.left = m_rtClient.left;
      } else if (m_rtMinBtn.left < m_rtThumb.left) {
        rect.left = m_rtMinBtn.right();
        rect.width -= (m_rtMinBtn.right() - m_rtClient.left);
      }
    }
  }
}
Example #26
0
void IFWL_ComboList::OnProcessMessage(CFWL_Message* pMessage) {
  if (!pMessage)
    return;

  CFWL_MessageType dwHashCode = pMessage->GetClassID();
  bool backDefault = true;
  if (dwHashCode == CFWL_MessageType::SetFocus ||
      dwHashCode == CFWL_MessageType::KillFocus) {
    OnDropListFocusChanged(pMessage, dwHashCode == CFWL_MessageType::SetFocus);
  } else if (dwHashCode == CFWL_MessageType::Mouse) {
    CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
    IFWL_ScrollBar* vertSB = GetVertScrollBar();
    if (IsShowScrollBar(true) && vertSB) {
      CFX_RectF rect;
      vertSB->GetWidgetRect(rect);
      if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) {
        pMsg->m_fx -= rect.left;
        pMsg->m_fy -= rect.top;
        vertSB->GetDelegate()->OnProcessMessage(pMsg);
        return;
      }
    }
    switch (pMsg->m_dwCmd) {
      case FWL_MouseCommand::Move: {
        backDefault = false;
        OnDropListMouseMove(pMsg);
        break;
      }
      case FWL_MouseCommand::LeftButtonDown: {
        backDefault = false;
        OnDropListLButtonDown(pMsg);
        break;
      }
      case FWL_MouseCommand::LeftButtonUp: {
        backDefault = false;
        OnDropListLButtonUp(pMsg);
        break;
      }
      default:
        break;
    }
  } else if (dwHashCode == CFWL_MessageType::Key) {
    backDefault = !OnDropListKey(static_cast<CFWL_MsgKey*>(pMessage));
  }
  if (backDefault)
    IFWL_ListBox::OnProcessMessage(pMessage);
}
Example #27
0
void CFWL_WidgetMgrDelegate::OnDrawWidget(IFWL_Widget* pWidget,
                                          CFX_Graphics* pGraphics,
                                          const CFX_Matrix* pMatrix) {
  if (!pWidget || !pGraphics)
    return;

  CFX_Graphics* pTemp = DrawWidgetBefore(pWidget, pGraphics, pMatrix);
  CFX_RectF clipCopy;
  pWidget->GetWidgetRect(clipCopy);
  clipCopy.left = clipCopy.top = 0;
  if (bUseOffscreenDirect(pWidget)) {
    DrawWidgetAfter(pWidget, pGraphics, clipCopy, pMatrix);
    return;
  }
  CFX_RectF clipBounds;

#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ || \
    _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_
  IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(nullptr);
  pDelegate->OnDrawWidget(pTemp, pMatrix);
  pGraphics->GetClipRect(clipBounds);
  clipCopy = clipBounds;
#elif _FX_OS_ == _FX_MACOSX_
  if (m_pWidgetMgr->IsFormDisabled()) {
    IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(nullptr);
    pDelegate->OnDrawWidget(pTemp, pMatrix);
    pGraphics->GetClipRect(clipBounds);
    clipCopy = clipBounds;
  } else {
    clipBounds.Set(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d);
    const_cast<CFX_Matrix*>(pMatrix)->SetIdentity();  // FIXME: const cast.
    IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(nullptr);
    pDelegate->OnDrawWidget(pTemp, pMatrix);
  }
#endif  // _FX_OS_ == _FX_MACOSX_

  if (!m_pWidgetMgr->IsFormDisabled()) {
    CFX_RectF rtClient;
    pWidget->GetClientRect(rtClient);
    clipBounds.Intersect(rtClient);
  }
  if (!clipBounds.IsEmpty())
    DrawChild(pWidget, clipBounds, pTemp, pMatrix);

  DrawWidgetAfter(pWidget, pGraphics, clipCopy, pMatrix);
  m_pWidgetMgr->ResetRedrawCounts(pWidget);
}
Example #28
0
void CFDE_TextOut::SetLineWidth(CFX_RectF& rect) {
  if ((m_dwStyles & FDE_TTOSTYLE_SingleLine) == 0) {
    FX_FLOAT fLineWidth = 0.0f;
    if (m_dwStyles & FDE_TTOSTYLE_VerticalLayout) {
      if (rect.Height() < 1.0f) {
        rect.height = m_fFontSize * 1000.0f;
      }
      fLineWidth = rect.Height();
    } else {
      if (rect.Width() < 1.0f) {
        rect.width = m_fFontSize * 1000.0f;
      }
      fLineWidth = rect.Width();
    }
    m_pTxtBreak->SetLineWidth(fLineWidth);
  }
}
Example #29
0
int32_t CXFA_RenderContext::DoRender(IFX_Pause* pPause) {
  int32_t iCount = 0;
  while (m_pWidget) {
    CXFA_FFWidget* pWidget = m_pWidget;
    CFX_RectF rtWidgetBox;
    pWidget->GetBBox(rtWidgetBox, XFA_WidgetStatus_Visible);
    rtWidgetBox.width += 1;
    rtWidgetBox.height += 1;
    if (rtWidgetBox.IntersectWith(m_rtClipRect))
      pWidget->RenderWidget(m_pGS, &m_matrix, m_dwStatus);
    m_pWidget = m_pWidgetIterator->MoveToNext();
    iCount++;
    if (iCount > kMaxCount && pPause && pPause->NeedToPauseNow())
      return XFA_RENDERSTATUS_ToBeContinued;
  }
  return XFA_RENDERSTATUS_Done;
}
void CFDE_TxtEdtPage::NormalizePt2Rect(CFX_PointF& ptF,
                                       const CFX_RectF& rtF,
                                       FX_FLOAT fTolerance) const {
    if (rtF.Contains(ptF.x, ptF.y)) {
        return;
    }
    if (ptF.x < rtF.left) {
        ptF.x = rtF.left;
    } else if (ptF.x >= rtF.right()) {
        ptF.x = rtF.right() - fTolerance;
    }
    if (ptF.y < rtF.top) {
        ptF.y = rtF.top;
    } else if (ptF.y >= rtF.bottom()) {
        ptF.y = rtF.bottom() - fTolerance;
    }
}