BOOL CAboutDialog::OnInitDialog() { CDialog::OnInitDialog(); // TODO: この位置に初期化の補足処理を追加してください m_cPgbPhysical.SetRange( 0, 100); if( WINTYPE_98 == m_nWinType) { m_cPgbUSER.SetRange( 0, 100); m_cPgbGDI.SetRange( 0, 100); m_cPgbSYSTEM.SetRange( 0, 100); // リソースチェックを含むDLLを明示的にリンクします。 m_hInst = LoadLibrary( "RSRC32.DLL"); // リンクが正常になされた? if( NULL != m_hInst) { // リソースチェックのDLLから、目的の関数ポインタを取得します。 m_lpGetFreeSystemResource = ( GetFreeSystemResource)GetProcAddress( m_hInst, "_MyGetFreeSystemResources32@4"); } } else { m_cPgbPagefile.SetRange( 0, 100); } CheckResources(); SetTimer( 4096, 500, NULL); return TRUE; // コントロールにフォーカスを設定しないとき、戻り値は TRUE となります // 例外: OCX プロパティ ページの戻り値は FALSE となります }
void CAboutDialog::OnTimer(UINT nIDEvent) { // TODO: この位置にメッセージ ハンドラ用のコードを追加するかまたはデフォルトの処理を呼び出してください CheckResources(); CDialog::OnTimer(nIDEvent); }
dbc::TransactionGuardImpl::TransactionGuardImpl(TransactionsResourcesGuard resources) : m_resources(resources) , m_committed(false) { CheckResources(); m_transactionName = m_resources->NextTransactionName(); TransactionQueryImpl("SAVEPOINT " + m_transactionName + ";"); }
ribi::WtRandomCodeMenuDialog::WtRandomCodeMenuDialog() { CheckResources(); this->setContentAlignment(Wt::AlignCenter); { Wt::WText * const title = new Wt::WText("RandomCode"); title->setStyleClass("title"); this->addWidget(title); } //Menu { Wt::WStackedWidget * const contents = new Wt::WStackedWidget; Wt::WMenu * const menu = new Wt::WMenu(contents,Wt::Horizontal); //Using CSS styleclass is the best (only?) way to display the menu well menu->setStyleClass("menu"); { Wt::WMenuItem * const item = new Wt::WMenuItem( "Welcome", CreateNewWelcomeDialog()); menu->addItem(item); } { Wt::WMenuItem * const item = new Wt::WMenuItem( "Start", CreateNewGenerateDialog()); menu->addItem(item); } { Wt::WMenuItem * const item = new Wt::WMenuItem( "About", CreateNewAboutDialog()); menu->addItem(item); } //Display menu on top this->addWidget(menu); this->addWidget(new Wt::WBreak); //Display contents below menu this->addWidget(contents); } }
CPDF_DataAvail::DocAvailStatus CPDF_DataAvail::IsPageAvail( uint32_t dwPage, DownloadHints* pHints) { if (!m_pDocument) return DataError; if (IsFirstCheck(dwPage)) { m_bCurPageDictLoadOK = false; m_bPageLoadedOK = false; m_bAnnotsLoad = false; m_bNeedDownLoadResource = false; m_objs_array.clear(); m_ObjectSet.clear(); } if (pdfium::ContainsKey(m_pagesLoadState, dwPage)) return DataAvailable; if (m_pLinearized) { if (dwPage == m_pLinearized->GetFirstPageNo()) { DocAvailStatus nRet = CheckLinearizedFirstPage(dwPage, pHints); if (nRet == DataAvailable) m_pagesLoadState.insert(dwPage); return nRet; } DocAvailStatus nResult = CheckLinearizedData(pHints); if (nResult != DataAvailable) return nResult; if (m_pHintTables) { nResult = m_pHintTables->CheckPage(dwPage, pHints); if (nResult != DataAvailable) return nResult; m_pagesLoadState.insert(dwPage); return GetPage(dwPage) ? DataAvailable : DataError; } if (m_bMainXRefLoadedOK) { if (m_bTotalLoadPageTree) { if (!LoadPages(pHints)) return DataNotAvailable; } else { if (!m_bCurPageDictLoadOK && !CheckPage(dwPage, pHints)) return DataNotAvailable; } } else { if (!LoadAllFile(pHints)) return DataNotAvailable; m_pDocument->GetParser()->RebuildCrossRef(); ResetFirstCheck(dwPage); return DataAvailable; } } else { if (!m_bTotalLoadPageTree && !m_bCurPageDictLoadOK && !CheckPage(dwPage, pHints)) { return DataNotAvailable; } } if (m_bHaveAcroForm && !m_bAcroFormLoad) { if (!CheckAcroFormSubObject(pHints)) return DataNotAvailable; m_bAcroFormLoad = true; } if (!m_bPageLoadedOK) { if (m_objs_array.empty()) { m_ObjectSet.clear(); FX_SAFE_INT32 safePage = pdfium::base::checked_cast<int32_t>(dwPage); m_pPageDict = m_pDocument->GetPage(safePage.ValueOrDie()); if (!m_pPageDict) { ResetFirstCheck(dwPage); // This is XFA page. return DataAvailable; } std::vector<CPDF_Object*> obj_array; obj_array.push_back(m_pPageDict); if (!AreObjectsAvailable(obj_array, true, pHints, m_objs_array)) return DataNotAvailable; m_objs_array.clear(); } else { std::vector<CPDF_Object*> new_objs_array; if (!AreObjectsAvailable(m_objs_array, false, pHints, new_objs_array)) { m_objs_array = new_objs_array; return DataNotAvailable; } } m_objs_array.clear(); m_bPageLoadedOK = true; } if (!m_bAnnotsLoad) { if (!CheckPageAnnots(dwPage, pHints)) return DataNotAvailable; m_bAnnotsLoad = true; } if (m_pPageDict && !m_bNeedDownLoadResource) { m_pPageResource = m_pPageDict->GetObjectFor("Resources"); m_bNeedDownLoadResource = m_pPageResource || HaveResourceAncestor(m_pPageDict); } if (m_bNeedDownLoadResource) { if (!CheckResources(pHints)) return DataNotAvailable; m_bNeedDownLoadResource = false; } m_bPageLoadedOK = false; m_bAnnotsLoad = false; m_bCurPageDictLoadOK = false; ResetFirstCheck(dwPage); m_pagesLoadState.insert(dwPage); const bool is_page_valid = ValidatePage(dwPage); (void)is_page_valid; ASSERT(is_page_valid); return DataAvailable; }
void Renderer::Render( Context& context, SceneGraph::TextureCache& textureCache, BufferIndex bufferIndex, const SceneGraph::NodeDataProvider& node, SceneGraph::Shader& defaultShader, const Matrix& modelViewMatrix, const Matrix& viewMatrix, const Matrix& projectionMatrix, bool cull, bool blend ) { NewRenderer* renderer = GetNewRenderer(); // avoid a dynamic cast per item per frame if( renderer ) { // Get the shader from the material: mShader = &renderer->mRenderDataProvider->GetShader(); } // if mShader is NULL it means we're set to default if( !mShader ) { mShader = &defaultShader; } if( !CheckResources() ) { // CheckResources() is overriden in derived classes. // Prevents modify the GL state if resources are not ready and nothing is to be rendered. return; } // Get the program to use: Program* program = mShader->GetProgram(); if( !program ) { // if program is NULL it means this is a custom shader with non matching geometry type so we need to use default shaders program program = defaultShader.GetProgram(); DALI_ASSERT_DEBUG( program && "Default shader should always have a program available." ); if( !program ) { DALI_LOG_ERROR( "Failed to get program for shader at address %p.", (void*) &*mShader ); return; } } // Take the program into use so we can send uniforms to it program->Use(); DoSetCullFaceMode( context, bufferIndex ); DoSetBlending( context, bufferIndex, blend ); // Ignore missing uniforms - custom shaders and flat color shaders don't have SAMPLER // set projection and view matrix if program has not yet received them yet this frame const Matrix& modelMatrix = node.GetModelMatrix( bufferIndex ); SetMatrices( *program, modelMatrix, viewMatrix, projectionMatrix, modelViewMatrix ); // set color uniform GLint loc = program->GetUniformLocation( Program::UNIFORM_COLOR ); if( Program::UNIFORM_UNKNOWN != loc ) { const Vector4& color = node.GetRenderColor( bufferIndex ); program->SetUniform4f( loc, color.r, color.g, color.b, color.a ); } //@todo MESH_REWORK Remove after removing ImageRenderer DoSetUniforms(context, bufferIndex, mShader, program ); // subclass rendering and actual draw call DoRender( context, textureCache, node, bufferIndex, *program, modelViewMatrix, viewMatrix ); }