Esempio n. 1
0
bool Presentation::start(AV_View * view)
{
  EV_EditMethodContainer * pEMC = m_pApp->getEditMethodContainer();
  g_return_val_if_fail (pEMC != 0, FALSE);
  m_pView = static_cast<FV_View *>(view);
  m_sPrevBindings = m_pApp->getInputMode();
  _loadPresentationBindings(view);
  UT_sint32 i = m_pApp->setInputMode("Presentation");
  if(i < 0 )
    return false;
  // get a handle to the actual EditMethod
  EV_EditMethod * pFullScreen = pEMC->findEditMethodByName ("viewFullScreen");
  g_return_val_if_fail (pFullScreen != 0, false);
  const char * sz ="";
  EV_EditMethodCallData calldata(sz,0);
  calldata.m_xPos = 0;
  calldata.m_yPos = 0;
  m_iPage = 0;
  XAP_Frame * pFrame = static_cast<XAP_Frame*>(m_pView->getParentData());
  m_OldZoomType = pFrame->getZoomType();
  m_iOldZoom = pFrame->getZoomPercentage();

  pFrame->hideMenuScroll(true);
  bool b = false;
  b = (pFullScreen->Fn(view,&calldata) ? TRUE : FALSE);
  GR_Graphics * pG = m_pView->getGraphics();

  //
  // Let all the configure events propagate to their full extent
  //
  for(i= 0; i<20;i++)
    pFrame->nullUpdate();
  pFrame->setZoomType(XAP_Frame::z_PAGEWIDTH);
  i = m_pView-> calculateZoomPercentForPageWidth();
  pFrame->quickZoom(i);
  for(i= 0; i<20;i++)
    pFrame->nullUpdate();

  b= showNextPage();
  if(pG)
    pG->allCarets()->disable();
   return b;
}
Esempio n. 2
0
static bool
Presentation_context (AV_View * v, EV_EditMethodCallData * d)
{
        FV_View * pView = static_cast<FV_View *>(v);
	XAP_Frame * pFrame = static_cast<XAP_Frame *> (pView->getParentData());
	UT_sint32 xPos = d->m_xPos;
	UT_sint32 yPos = d->m_yPos;
	const char * szContextMenuName =  XAP_App::getApp()->getMenuFactory()->FindContextMenu(PresentationContextID);
	UT_DEBUGMSG(("Context Menu Name is........ %s \n",szContextMenuName));
	if (!szContextMenuName)
		return false;
	bool res = pFrame->runModalContextMenu(pView,szContextMenuName,
									   xPos,yPos);
	pFrame->nullUpdate();
	GR_Graphics * pG  = pView->getGraphics();
	if(pG)
	  pG->allCarets()->disable();
	return res;
}
Esempio n. 3
0
bool Presentation::drawNthPage(UT_sint32 iPage)
{
  GR_Graphics * pG = m_pView->getGraphics();
  GR_Painter p(pG);
#if USE_PIXMAP
  GR_Image * pImage = renderPageToImage(iPage,pG->getZoomPercentage());
  UT_DEBUGMSG(("Image Display Width %d Image Display Height %d Zoom %d \n",pImage->getDisplayWidth(),pImage->getDisplayHeight(),pG->getZoomPercentage()));
  p.drawImage(pImage,0,0);
  delete pImage;
#else
  dg_DrawArgs da;
  da.pG = pG;
  da.xoff = 0;
  da.yoff = 0;
  m_pView->draw(iPage, &da);
  fp_Page * pPage = m_pView->getLayout()->getNthPage(iPage);
  UT_sint32 iTotalHeight = (pPage->getHeight() + m_pView->getPageViewSep())*iPage;
  m_pView->setYScrollOffset(iTotalHeight);
  if(pG)
    pG->allCarets()->disable();
#endif
  return true;
}