Esempio n. 1
0
void VMacResourceIterator::SetPos(sLONG inPos)
{
	if (fPos == -1)
		_Load();
	if (testAssert(inPos >= 1 && inPos <= fIDs.GetCount()))
		fPos = inPos;
}
Esempio n. 2
0
 bool CFileOperate::Init()
 {
     if (!CCurlFtpMgr::Instance().Init()) {
         return false;
     }
     return _Load();   
 }
void VPictureData_MacPicture::DrawInCGContext(CGContextRef inDC, const VRect& r, VPictureDrawSettings* inSet) const
{
	_Load();
	if (fMetaFile)
	{
#if VERSIONWIN
		xDraw(fMetaFile, inDC, r, inSet);
#else
		if (inSet && inSet->GetDrawingMode() == 1)
		{
			if (!fTrans)
			{
				_CreateTransparent(inSet);
			}
			if (fTrans)
				xDraw(fTrans, inDC, r, inSet);
			else
				xDraw(fMetaFile, inDC, r, inSet);

		}
		else
			xDraw(fMetaFile, inDC, r, inSet);
#endif
	}
	else if (GetPicHandle())
		xDraw(GetPicHandle(), inDC, r, inSet);
}
Esempio n. 4
0
//---------------------------------------------------------
bool CSG_MetaData::Load(const CSG_String &File, const SG_Char *Extension)
{
	Destroy();

	//-----------------------------------------------------
	if( File.Find("http://") == 0 )
	{
		CSG_String	s(File.Right(File.Length() - CSG_String("http://").Length()));

		return( Load_HTTP(s.BeforeFirst('/'), s.AfterFirst('/')) );
	}

	//-----------------------------------------------------
	wxXmlDocument	XML;

	if( SG_File_Exists(SG_File_Make_Path(NULL, File, Extension)) && XML.Load(SG_File_Make_Path(NULL, File, Extension).c_str()) )
	{
		_Load(XML.GetRoot());

		return( true );
	}

	//-----------------------------------------------------
	return( false );
}
void VPictureData_GDIPlus::DrawInPortRef(PortRef inPortRef,const VRect& r,VPictureDrawSettings* inSet)const
{
	_Load();
	if(fBitmap)
	{
		xDraw(fBitmap,inPortRef,r,inSet);
	}
}
Esempio n. 6
0
DesktopSettingsPrivate::DesktopSettingsPrivate(server_read_only_memory* shared)
    :
    fShared(*shared)
{
    // if the on-disk settings are not complete, the defaults will be kept
    _SetDefaults();
    _Load();
}
Esempio n. 7
0
VHandle VMacResourceIterator::Last ()
{
	if (fPos == -1)
		_Load();
	
	fPos = fIDs.GetCount();
	return (fPos > 0) ? _GetResource(fPos) : NULL;
}
void VPictureData_MacPicture::DrawInPortRef(PortRef inPortRef, const VRect& inBounds, VPictureDrawSettings* inSet) const
{
	VPictureDrawSettings drset(inSet);

	_Load();
	bool istrans = false;
	if (inSet && (inSet->GetDrawingMode() == 1 || (inSet->GetDrawingMode() == 2 && inSet->GetAlpha() != 100)))
		istrans = true;

	// pp on utilsie pas l'emf pour l'impression (bug hair line)
	// sauf !!! si l'appel viens du write ou view
	// Dans ce cas, l'impression ne passe plus du tout par altura, donc impossible d'utiliser drawpicture
	if (fMetaFile && (!drset.IsDevicePrinter() || drset.CanUseEMFForMacPicture()))
	{
		drset.SetInterpolationMode(0);
		if (istrans)
		{
			if (!fTrans)
			{
				_CreateTransparent(&drset);
			}
			if (fTrans)
			{
				xDraw(fTrans, inPortRef, inBounds, &drset);
			}
			else
				xDraw(fMetaFile, inPortRef, inBounds, &drset);
		}
		else
		{
			xDraw(fMetaFile, inPortRef, inBounds, &drset);
		}
		return;
	}
	else if (GetPicHandle() && sQDBridge)
	{
		VRect dstRect, srcRect;
		_CalcDestRect(inBounds, dstRect, srcRect, drset);

		xMacRect r;
		r.left = dstRect.GetX();
		r.top = dstRect.GetY();
		r.right = dstRect.GetX() + dstRect.GetWidth();
		r.bottom = dstRect.GetY() + dstRect.GetHeight();


		if (drset.GetScaleMode() == PM_TOPLEFT)
		{
			sLONG ox, oy;
			drset.GetOrigin(ox, oy);
			r.left -= ox;
			r.top -= oy;
			r.right = r.left + GetWidth();
			r.bottom = r.top + GetHeight();
		}
		sQDBridge->DrawInMacPort(inPortRef, *this, (xMacRect*) &r, drset.GetDrawingMode() == 1, drset.GetScaleMode() == PM_TILE);
	}
}
Esempio n. 9
0
status_t
ThreadModelLoader::Load()
{
	try {
		return _Load();
	} catch(...) {
		return B_ERROR;
	}
}
Esempio n. 10
0
VideoFileTexture::VideoFileTexture(const char* fileName)
	:
	Texture(),
	fMediaFile(NULL),
	fVideoTrack(NULL),
	fVideoBitmap(NULL)
{
	_Load(fileName);
}
Esempio n. 11
0
Model* LoadMesh3DS(char *p_filename,bool bUseRef)
{
	i32 i;
	char cNameBuff[128];
	char *p_buffPtr=cNameBuff;
	char *p_cname=p_filename;
	Model *pModel;

	while(1)
	{
		*p_buffPtr=*p_cname;
		if(*p_cname=='\\' || *p_cname=='/')
		{
			p_buffPtr=cNameBuff;
		}
		else if(*p_cname=='.')
		{
			*p_buffPtr='\0';
			break;
		}
		else
			p_buffPtr++;
		
		p_cname++;
	}

	for(i=0;i<iNumBuckets;i++)
	{
		if(strcmp(ModelBuckets[i].pModel->cModelName,cNameBuff)==0)
		{
			ASSERT(iNumBuckets<MAX_MODELS,"too many models");
			ModelBuckets[iNumBuckets].pModel = Mesh_ModelCopy(ModelBuckets[i].pModel);
			ModelBuckets[iNumBuckets].iNumRef=1;
			iNumBuckets++; 

			return ModelBuckets[iNumBuckets-1].pModel;
		}
	}

	pModel=_Load(cNameBuff);

	ASSERT(pModel,"no model");

	ASSERT(iNumBuckets<MAX_MODELS,"too many models");
	ModelBuckets[iNumBuckets].pModel=pModel;
	ModelBuckets[iNumBuckets].iNumRef=1;
	iNumBuckets++; 

	pModel->bReference=bUseRef;
	pModel->uRenderFrame=0;

	pAllModels[iNumModels]=pModel;
	ASSERT(iNumModels<MAX_MODELS,"too many models");
	iNumModels++;

	return pModel;
}
xMacPictureHandle VPictureData_MacPicture::GetPicHandle()const
{
	_Load();
	if (fPicHandle)
	{
		assert(GetMacAllocator()->CheckBlock(fPicHandle));
	}
	return (xMacPictureHandle) fPicHandle;
}
sLONG VPictureData_GDIPlus::GetFrameCount()
{
	_Load();
	if(fBitmap)
	{
		return fBitmap->GetFrameCount(&Gdiplus::FrameDimensionTime);
	}
	else
		return 1;
}
Esempio n. 14
0
BOOL CModule::Create(LPCTSTR szModuleName)
{
	if(m_hModule != NULL &&
	   m_lpfnLoad != NULL && m_lpfnUnload != NULL && m_lpfnRun != NULL)
	{
		return TRUE;
	}

	if(m_hModule != NULL)
		Destroy();

	STLOG_WRITE(L"CModule::Create(LPCTSTR): Criando módulo [%s] para execução", szModuleName);

	m_hModule = LoadLibrary(szModuleName);

	if(m_hModule == NULL)
	{
		STLOG_WRITE(L"CModule::Create(LPCTSTR): Erro ao carregar DLL [%s]. Erro: [%d]", szModuleName, GetLastError());
		return FALSE;
	}

#ifdef _WIN32_WCE
	m_lpfnLoad    = (LPFNDLLLOAD)GetProcAddress(m_hModule, _T("_Load"));
	m_lpfnUnload  = (LPFNDLLUNLOAD)GetProcAddress(m_hModule, _T("_Unload"));
	m_lpfnRun     = (LPFNDLLRUN)GetProcAddress(m_hModule, _T("_Run"));
	m_lpfnRun1    = (LPFNDLLRUN1)GetProcAddress(m_hModule, _T("_Run1"));


	// Opcional...
	m_lpfnGetIcon	  = (LPFNDLLGETICON)GetProcAddress(m_hModule, _T("_GetIcon"));
	m_lpfnShowWindows = (LPFNDLLSHOWWINDOWS)GetProcAddress(m_hModule, _T("_ShowWindows"));
	m_lpfnSetDbPtr	  = (LPFNDLLSETDBPTR)GetProcAddress(m_hModule, _T("_SetDbPtr"));
	m_lpfnResetPrn    = (LPFNDLLRESETPRN)GetProcAddress(m_hModule, _T("_ResetPrinter"));
#else
	m_lpfnLoad    = (LPFNDLLLOAD)GetProcAddress(m_hModule, "_Load");
	m_lpfnUnload  = (LPFNDLLUNLOAD)GetProcAddress(m_hModule, "_Unload");
	m_lpfnRun     = (LPFNDLLRUN)GetProcAddress(m_hModule, "_Run");
	m_lpfnRun1    = (LPFNDLLRUN1)GetProcAddress(m_hModule, "_Run1");


	// Opcional...
	m_lpfnGetIcon	  = (LPFNDLLGETICON)GetProcAddress(m_hModule, "_GetIcon");
	m_lpfnShowWindows = (LPFNDLLSHOWWINDOWS)GetProcAddress(m_hModule, "_ShowWindows");
	m_lpfnSetDbPtr	  = (LPFNDLLSETDBPTR)GetProcAddress(m_hModule, "_SetDbPtr");
	m_lpfnResetPrn    = (LPFNDLLRESETPRN)GetProcAddress(m_hModule, "_ResetPrinter");
#endif

	if(m_lpfnLoad == NULL || m_lpfnUnload == NULL || (m_lpfnRun == NULL && m_lpfnRun1 == NULL))
	{
		STLOG_WRITE(_T("Erro carregando os metodos da dll '%s'"), szModuleName);
		return FALSE;
	}

	return _Load();
}
void CTSFEditWnd::_LoadFromFile(LPTSTR pszFile)
{
    if(pszFile)
    {
        HANDLE  hFile;

        hFile = CreateFile( pszFile, 
                            GENERIC_READ,
                            0,
                            NULL,
                            OPEN_EXISTING,
                            FILE_ATTRIBUTE_NORMAL,
                            NULL);
        
        if(INVALID_HANDLE_VALUE != hFile)
        {
            IStream *pStream;
            
            //create a stream on global memory
            if(SUCCEEDED(CreateStreamOnHGlobal(NULL, TRUE, &pStream)))
            {
                //read the contents of the file into the stream
                LARGE_INTEGER   li;

                //set the stream pointer to the start of the stream
                li.QuadPart = 0;
                pStream->Seek(li, STREAM_SEEK_SET, NULL);
                
                //write the contents of the stream to the file
                BYTE    buffer[BLOCK_SIZE];
                ULONG   uRead;
                HRESULT hr;

                uRead = 0;
                ReadFile(hFile, buffer, BLOCK_SIZE, &uRead, NULL);
                while(uRead > 0)
                {
                    ULONG   uWritten;

                    hr = pStream->Write(buffer, uRead, &uWritten);
                    
                    uRead = 0;
                    ReadFile(hFile, buffer, BLOCK_SIZE, &uRead, NULL);
                }

                _Load(pStream);

                pStream->Release();
            }

            CloseHandle(hFile);
        }
    }
}
Esempio n. 16
0
//---------------------------------------------------------
bool CSG_MetaData::Load_HTTP(const CSG_String &Server, const CSG_String &Path, const SG_Char *Username, const SG_Char *Password)
{
	Destroy();

	//-----------------------------------------------------
	wxHTTP	HTTP;

	if( Username && *Username )	{	HTTP.SetUser    (Username);	}
	if( Password && *Password )	{	HTTP.SetPassword(Password);	}

	wxString	s	= Server.c_str();

	if( s.Find("http://") == 0 )
	{
		s	= s.Right(s.Length() - wxString("http://").Length());
	}

	if( !HTTP.Connect(s) )
	{
		return( false );
	}

	//-----------------------------------------------------
	s	= Path.c_str();

	if( s[0] != '/' )
	{
		s.Prepend("/");
	}

	wxInputStream	*pStream	= HTTP.GetInputStream(s);

	if( !pStream )
	{
		return( false );
	}

	wxXmlDocument	XML;

	if( XML.Load(*pStream) )
	{
		_Load(XML.GetRoot());

		delete(pStream);

		return( true );
	}

	delete(pStream);

	return( false );
}
Esempio n. 17
0
bool
WEDResource::Load(Archive *archive, uint32 key)
{
	if (!Resource::Load(archive, key))
		return false;
	try {
		_Load();
	} catch (...) {
		return false;
	}

	return true;
}
Esempio n. 18
0
bool CVolumes::CheckReload(bool bForce)
{
  bool bRtn = false;
  bool bReloadAll = bForce;
  wxDateTime dt((time_t)0);
  if(!bForce)
  {
    if(wxFileName::DirExists(m_sDirVolume))
    {
      wxFileName fn(m_sDirVolume);
      dt = fn.GetModificationTime();
      bReloadAll = (dt != m_dtLastMod);
    }
  }
  if(!bReloadAll)
  {
    MapVolume::iterator itr;
    CVolume *pVol;
    bool bReloadAll = false;
    for(itr = m_mapVol.begin();
      (!bReloadAll) && (itr != m_mapVol.end());
      ++itr)
    {
      pVol = itr->second;
      if(pVol->CheckReload(false))
      {
        bRtn = true;
        if(pVol->GetVolumeName() != itr->first)
        {
          // we had a name change, reload all
          bReloadAll = true;
        }
      }
    }
  }
  if(bReloadAll)
  {
    _Load();
    if(wxDir::Exists(m_sDirVolume))
    {
      wxFileName fn(m_sDirVolume);
      m_dtLastMod =  fn.GetModificationTime();
    }
  }
  if(bRtn)
  {
    m_nCountDown = 0;
  }
  return bRtn;
}
Esempio n. 19
0
CStringz::CStringz (ParamBlk *parm,int pnum) {//Constructor
	Value val;
	if (pnum<parm->pCount) {
		if (parm->p[pnum].val.ev_type=='R') {
			_Load(&parm->p[pnum].loc,&val);
			Create(&val);
			_FreeHand(val.ev_handle);
		} else {
			Create(&parm->p[pnum].val);
		}
	} else {
		CStringz();
	}
}
void VPictureData_EMF::DrawInD2DGraphicContext(VWinD2DGraphicContext* inDC,const VRect& r,VPictureDrawSettings* inSet)const
{
	_Load();
	if(fMetaFile)
	{
		//here we need to get a HDC from D2D render target 
		//(if called between BeginUsingContext/EndUsingContext,
		// this will force a EndDraw() before getting hdc and a BeginDraw() to resume drawing after releasing hdc)				
		HDC hdc = inDC->BeginUsingParentContext();
		if (hdc)
			xDraw(fMetaFile,hdc,r,inSet);
		inDC->EndUsingParentContext( hdc);
	}
}
Esempio n. 21
0
VHandle VMacResourceIterator::First()
{
	if (fPos == -1)
		_Load();
	
	if (fIDs.GetCount() <= 0)
	{
		fPos = 0;
		return NULL;
	}
	
	fPos = 1;
	return _GetResource(fPos);
}
Esempio n. 22
0
//---------------------------------------------------------
bool CSG_MetaData::Load(const CSG_String &File, const SG_Char *Extension)
{
	Destroy();

	wxXmlDocument	XML;

	if( SG_File_Exists(SG_File_Make_Path(NULL, File, Extension)) && XML.Load(SG_File_Make_Path(NULL, File, Extension).c_str()) )
	{
		_Load(XML.GetRoot());

		return( true );
	}

	return( false );
}
Esempio n. 23
0
//---------------------------------------------------------
bool CSG_MetaData::Load(CSG_File &File)
{
	Destroy();

	wxXmlDocument	XML;

	if( File.is_Reading() && XML.Load(*((wxInputStream *)File.Get_Stream())) )
	{
		_Load(XML.GetRoot());

		return( true );
	}

	return( false );
}
Esempio n. 24
0
bool
GusdUSD_StageProxy::MultiAccessor::_GetPrims(
    const UT_Array<SdfPath>& primPaths,
    UT_Array<UsdPrim>& prims,
    GusdUT_ErrorContext* err)
{
    if(!_Load(primPaths))
        return false;

    prims.setSize(primPaths.size());

    std::atomic_bool workerInterrupt(false);
    UTparallelFor(UT_BlockedRange<size_t>(0, primPaths.size()),
                  _GetPrimsFn(*this, primPaths, prims, err, workerInterrupt));
    return !UTgetInterrupt()->opInterrupt() && !workerInterrupt;
}
void CXTPCalendarResourcesManager::DoExchangeCfg(CXTPPropExchange* pPX)
{
    ASSERT(pPX);
    if (!pPX)
    {
        return;
    }

    if (pPX->IsLoading())
    {
        _Load(pPX);
    }
    else
    {
        _Save(pPX);
    }
}
Esempio n. 26
0
//---------------------------------------------------------
bool CSG_MetaData::from_XML(const CSG_String &_XML)
{
	Destroy();

	wxXmlDocument	XML;

	wxMemoryInputStream	Stream((const void *)_XML.b_str(), (size_t)_XML.Length());

	if( XML.Load(Stream) )
	{
		_Load(XML.GetRoot());

		return( true );
	}

	return( false );
}
void CXTPCalendarCustomProperties::DoPropExchange(CXTPPropExchange* pPX)
{
	if (!pPX)
	{
		ASSERT(FALSE);
		return;
	}

	if (pPX->IsLoading())
	{
		_Load(pPX);
	}
	else
	{
		_Save(pPX);
	}
}
Esempio n. 28
0
//---------------------------------------------------------
bool CSG_MetaData::Load(CSG_File &File)
{
	Destroy();

	wxXmlDocument	XML;

	wxFFileInputStream	Stream(File.Get_Stream());

	if( Stream.IsOk() && XML.Load(Stream) )
	{
		_Load(XML.GetRoot());

		return( true );
	}

	return( false );
}
void VPictureData_GIF::BuildTimeLine(std::vector<sLONG>& inTimeLine,sLONG &outLoopCount)const
{
	_Load();
	inTimeLine.clear();
	outLoopCount=0;
	if(fGifInfo)
	{
		for( xGifInfo::xGifFrameList::iterator i = fGifInfo->fFrameList.begin() ; i != fGifInfo->fFrameList.end() ; ++i)
		{
			xGifFrame* f = *i;
			if(f->isGif89)
				inTimeLine.push_back(f->fGif89.delayTime*10);
			else
				inTimeLine.push_back(100);
		}
		outLoopCount=fGifInfo->GetLoopCount();
	}
}
BOOL CXTPCalendarResourcesManager::LoadCfg(LPCTSTR pcszFile)
{
#ifndef _XTP_EXCLUDE_XML
    BOOL bResult = FALSE;
    CXTPPropExchangeXMLNode px(TRUE, 0, _T("CalendarMultiResourcesConfiguration"));

    if (px.LoadFromFile(pcszFile))
    {
        _Load(&px);
        bResult = TRUE;
    }

    return bResult;

#else
    return FALSE;
#endif

}