void DebugInfoLabels::AddLabel(ref_ptr<dp::TextureManager> tex, std::string const & caption, TUpdateDebugLabelFn const & onUpdateFn) { std::string alphabet; std::set<char> symbols; AddSymbols(caption, symbols); AddSymbols("0123456789.-e", symbols); alphabet.reserve(symbols.size()); for (auto const & ch : symbols) alphabet.push_back(ch); MutableLabelDrawer::Params params; params.m_anchor = dp::LeftTop; params.m_alphabet = alphabet; params.m_maxLength = 100; params.m_font = DrapeGui::GetGuiTextFont(); params.m_font.m_color = dp::Color(0, 0, 255, 255); params.m_font.m_size *= 1.2; params.m_pivot = m_position.m_pixelPivot; #ifdef RENDER_DEBUG_INFO_LABELS uint32_t const id = GuiHandleDebugLabel + m_labelsCount; params.m_handleCreator = [id, onUpdateFn, tex](dp::Anchor anchor, m2::PointF const & pivot) { return make_unique_dp<DebugLabelHandle>(id, anchor, pivot, tex, onUpdateFn); }; #endif m_labelsParams.push_back(params); ++m_labelsCount; }
Token & TONot:: NUD(SyntaxHandler & sh) { AddSymbols(sh, sh.Expression(150)); return *this; }
void CPythonContext::AddSymbol(const std::string& name, object obj) { dict symbols; symbols[name] = obj; AddSymbols(symbols); }
Token & TOInc:: NUD(SyntaxHandler & sh) { // Prefix SetType(TokenType::TO_INC_PRE); AddSymbols(sh, sh.Expression(150)); // Check right hand valididty return *this; }
void ExportPass::execute() { assert(theEnv != NULL) ; OutputInformation("Export pass begins") ; // Get the information regarding the current procedure by looking at // the first procedure from the first file in the file set block. Iter<FileBlock*> temp = theEnv->get_file_set_block()->get_file_block_iterator() ; Iter<ProcedureDefinition*> temp2 = (temp.current())->get_definition_block()->get_procedure_definition_iterator() ; originalProcedure = temp2.current() ; assert(originalProcedure != NULL) ; // Modules have been transformed into structs so all the previous // passes work, and here we have to do a little bit of backtracking // and convert them to the straight model. BrickAnnote* rocccType = dynamic_cast<BrickAnnote*>(originalProcedure->lookup_annote_by_name("FunctionType")) ; assert(rocccType != NULL) ; IntegerBrick* valueBrick = dynamic_cast<IntegerBrick*>(rocccType->get_brick(0)) ; assert(valueBrick != NULL) ; int functionType = valueBrick->get_value().c_int() ; delete rocccType->remove_brick(0) ; delete originalProcedure->remove_annote_by_name("FunctionType") ; if (functionType == 1) // Module { // De-modulize it ConstructModuleSymbols() ; } else if (functionType == 2 || functionType == 3) // Systems { // Just create clones ConstructSystemSymbols() ; } else { assert(0 && "Trying to export something unknown") ; } ReadRepository() ; AddSymbols() ; DumpRepository() ; OutputInformation("Export pass ends") ; }