diff --git a/data/drules_proto.txt b/data/drules_proto.txt index 89081634be..76dc701e43 100644 --- a/data/drules_proto.txt +++ b/data/drules_proto.txt @@ -4722,6 +4722,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11537 } } @@ -4735,6 +4736,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11770 } } @@ -5752,6 +5754,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11538 } } @@ -5789,6 +5792,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11771 } } @@ -6373,6 +6377,7 @@ cont { path_text { height: 9 color: 0x0 + stroke_color: 0xFFFFFF priority: 10609 } } @@ -6386,6 +6391,7 @@ cont { path_text { height: 9 color: 0x0 + stroke_color: 0xFFFFFF priority: 10820 } } @@ -6399,6 +6405,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11546 } } @@ -6412,6 +6419,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11779 } } @@ -6828,6 +6836,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11532 } } @@ -6841,6 +6850,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11765 } } @@ -7765,6 +7775,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11529 } } @@ -7778,6 +7789,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11762 } } @@ -8286,6 +8298,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11528 } } @@ -8299,6 +8312,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11761 } } @@ -9668,6 +9682,7 @@ cont { path_text { height: 9 color: 0x0 + stroke_color: 0xFFFFFF priority: 10819 } } @@ -9695,6 +9710,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11545 } } @@ -9722,6 +9738,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11778 } } @@ -10198,6 +10215,7 @@ cont { path_text { height: 9 color: 0x0 + stroke_color: 0xFFFFFF priority: 10607 } } @@ -10211,6 +10229,7 @@ cont { path_text { height: 9 color: 0x0 + stroke_color: 0xFFFFFF priority: 10818 } } @@ -10224,6 +10243,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11544 } } @@ -10237,6 +10257,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11777 } } @@ -11031,6 +11052,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 10625 } } @@ -11044,6 +11066,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 10892 } } @@ -11057,6 +11080,7 @@ cont { path_text { height: 16 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11552 } } @@ -11070,6 +11094,7 @@ cont { path_text { height: 16 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11785 } } @@ -12337,6 +12362,7 @@ cont { path_text { height: 8 color: 0x0 + stroke_color: 0xFFFFFF priority: 10617 } } @@ -12350,6 +12376,7 @@ cont { path_text { height: 12 color: 0x0 + stroke_color: 0xFFFFFF priority: 10828 } } @@ -12363,6 +12390,7 @@ cont { path_text { height: 12 color: 0x0 + stroke_color: 0xFFFFFF priority: 11459 } } @@ -12376,6 +12404,7 @@ cont { path_text { height: 12 color: 0x0 + stroke_color: 0xFFFFFF priority: 11737 } } @@ -13144,6 +13173,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11536 } } @@ -13157,6 +13187,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11769 } } @@ -13407,6 +13438,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11534 } } @@ -13420,6 +13452,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11767 } } @@ -14392,6 +14425,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11535 } } @@ -14405,6 +14439,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11768 } } @@ -15050,6 +15085,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11530 } } @@ -15063,6 +15099,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11763 } } @@ -15505,6 +15542,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 10623 } } @@ -15518,6 +15556,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 10890 } } @@ -15531,6 +15570,7 @@ cont { path_text { height: 16 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11550 } } @@ -15544,6 +15584,7 @@ cont { path_text { height: 16 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11783 } } @@ -16447,6 +16488,7 @@ cont { path_text { height: 8 color: 0x0 + stroke_color: 0xFFFFFF priority: 10615 } } @@ -16460,6 +16502,7 @@ cont { path_text { height: 12 color: 0x0 + stroke_color: 0xFFFFFF priority: 10826 } } @@ -16473,6 +16516,7 @@ cont { path_text { height: 12 color: 0x0 + stroke_color: 0xFFFFFF priority: 11457 } } @@ -16486,6 +16530,7 @@ cont { path_text { height: 12 color: 0x0 + stroke_color: 0xFFFFFF priority: 11735 } } @@ -17914,6 +17959,7 @@ cont { path_text { height: 9 color: 0x0 + stroke_color: 0xFFFFFF priority: 10817 } } @@ -17927,6 +17973,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11543 } } @@ -17940,6 +17987,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11776 } } @@ -18718,6 +18766,7 @@ cont { path_text { height: 9 color: 0x0 + stroke_color: 0xFFFFFF priority: 10610 } } @@ -18731,6 +18780,7 @@ cont { path_text { height: 9 color: 0x0 + stroke_color: 0xFFFFFF priority: 10821 } } @@ -18744,6 +18794,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11547 } } @@ -18757,6 +18808,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11780 } } @@ -19442,6 +19494,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 10622 } } @@ -19455,6 +19508,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 10889 } } @@ -19468,6 +19522,7 @@ cont { path_text { height: 16 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11549 } } @@ -19481,6 +19536,7 @@ cont { path_text { height: 16 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11782 } } @@ -20344,6 +20400,7 @@ cont { path_text { height: 8 color: 0x0 + stroke_color: 0xFFFFFF priority: 10613 } } @@ -20357,6 +20414,7 @@ cont { path_text { height: 10 color: 0x0 + stroke_color: 0xFFFFFF priority: 10824 } } @@ -20370,6 +20428,7 @@ cont { path_text { height: 12 color: 0x0 + stroke_color: 0xFFFFFF priority: 11455 } } @@ -20383,6 +20442,7 @@ cont { path_text { height: 12 color: 0x0 + stroke_color: 0xFFFFFF priority: 11733 } } @@ -21254,6 +21314,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11541 } } @@ -21267,6 +21328,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11774 } } @@ -22660,6 +22722,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11527 } } @@ -22707,6 +22770,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11760 } } @@ -23501,6 +23565,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 10888 } } @@ -23514,6 +23579,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11548 } } @@ -23527,6 +23593,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11781 } } @@ -24396,6 +24463,7 @@ cont { path_text { height: 10 color: 0x0 + stroke_color: 0xFFFFFF priority: 10822 } } @@ -24409,6 +24477,7 @@ cont { path_text { height: 10 color: 0x0 + stroke_color: 0xFFFFFF priority: 11453 } } @@ -24422,6 +24491,7 @@ cont { path_text { height: 10 color: 0x0 + stroke_color: 0xFFFFFF priority: 11731 } } @@ -25288,6 +25358,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11539 } } @@ -25301,6 +25372,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11772 } } @@ -27516,6 +27588,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 10624 } } @@ -27534,6 +27607,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 10891 } } @@ -27552,6 +27626,7 @@ cont { path_text { height: 16 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11551 } } @@ -27575,6 +27650,7 @@ cont { path_text { height: 16 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11784 } } @@ -28918,6 +28994,7 @@ cont { path_text { height: 8 color: 0x0 + stroke_color: 0xFFFFFF priority: 10616 } } @@ -28936,6 +29013,7 @@ cont { path_text { height: 12 color: 0x0 + stroke_color: 0xFFFFFF priority: 10827 } } @@ -28954,6 +29032,7 @@ cont { path_text { height: 12 color: 0x0 + stroke_color: 0xFFFFFF priority: 11458 } } @@ -28972,6 +29051,7 @@ cont { path_text { height: 12 color: 0x0 + stroke_color: 0xFFFFFF priority: 11736 } } @@ -29920,6 +30000,7 @@ cont { path_text { height: 9 color: 0x0 + stroke_color: 0xFFFFFF priority: 10816 } } @@ -29933,6 +30014,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11542 } } @@ -29946,6 +30028,7 @@ cont { path_text { height: 12 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11775 } } @@ -30748,6 +30831,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11540 } } @@ -30761,6 +30845,7 @@ cont { path_text { height: 10 color: 0x606060 + stroke_color: 0xFFFFFF priority: 11773 } } @@ -55012,6 +55097,7 @@ cont { path_text { height: 6 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 10602 } } @@ -55030,6 +55116,7 @@ cont { path_text { height: 12 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 10813 } } @@ -55048,6 +55135,7 @@ cont { path_text { height: 12 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 11429 } } @@ -55066,6 +55154,7 @@ cont { path_text { height: 12 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 11707 } } @@ -55249,6 +55338,7 @@ cont { path_text { height: 12 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 11419 } } @@ -55267,6 +55357,7 @@ cont { path_text { height: 12 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 11697 } } @@ -55602,6 +55693,7 @@ cont { path_text { height: 12 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 11421 } } @@ -55620,6 +55712,7 @@ cont { path_text { height: 12 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 11699 } } @@ -55868,6 +55961,7 @@ cont { path_text { height: 6 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 10604 } } @@ -55886,6 +55980,7 @@ cont { path_text { height: 6 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 10815 } } @@ -55904,6 +55999,7 @@ cont { path_text { height: 8 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 11433 } } @@ -55922,6 +56018,7 @@ cont { path_text { height: 12 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 11711 } } @@ -56257,6 +56354,7 @@ cont { path_text { height: 12 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 11431 } } @@ -56275,6 +56373,7 @@ cont { path_text { height: 12 color: 0xFFFFFF + stroke_color: 0xFF00 priority: 11709 } } diff --git a/indexer/drawing_rules.cpp b/indexer/drawing_rules.cpp index e1b15b2160..8b6bcfcbe4 100644 --- a/indexer/drawing_rules.cpp +++ b/indexer/drawing_rules.cpp @@ -575,7 +575,8 @@ namespace drule { virtual double GetTextHeight() const { return m_params.get<5>().m_v; } virtual int GetFillColor() const { return m_params.get<6>().m_v; } - virtual int GetColor() const {return m_params.get<8>().m_v; } + virtual unsigned char GetAlpha() const { return alpha_opacity(m_params.get<7>()); } + virtual int GetColor() const { return m_params.get<8>().m_v; } static string arrKeys[9]; }; @@ -648,7 +649,9 @@ namespace drule { virtual void Write(FileWriterStream & ar) const { write_rules(ar, this); } virtual double GetTextHeight() const { return m_params.get<6>().m_v; } - virtual int GetFillColor() const {return m_params.get<7>().m_v;} + virtual int GetFillColor() const { return m_params.get<7>().m_v; } + virtual unsigned char GetAlpha() const { return alpha_opacity(m_params.get<8>()); } + virtual int GetColor() const { return m_params.get<9>().m_v; } static string arrKeys[10]; }; @@ -1146,19 +1149,24 @@ namespace pDest->set_name(s); } - void ConvertImpl(BaseRule const * pSrc, CaptionRuleProto * pDest) const + template + void ConvertCaptionT(BaseRule const * pSrc, T * pDest) const { pDest->set_height(ToPixels(pSrc->GetTextHeight())); - pDest->set_color(GetFillColor(pSrc)); + pDest->set_color((pSrc->GetFillColor() != -1) ? GetFillColor(pSrc) : 0); if (pSrc->GetColor() != -1) pDest->set_stroke_color(GetColor(pSrc)); } + void ConvertImpl(BaseRule const * pSrc, CaptionRuleProto * pDest) const + { + ConvertCaptionT(pSrc, pDest); + } + void ConvertImpl(BaseRule const * pSrc, PathTextRuleProto * pDest) const { - pDest->set_height(ToPixels(pSrc->GetTextHeight())); - pDest->set_color(GetFillColor(pSrc)); + ConvertCaptionT(pSrc, pDest); } void ConvertImpl(BaseRule const * pSrc, CircleRuleProto * pDest) const @@ -1368,11 +1376,11 @@ namespace } }; - class Caption : public MyBase + template class CaptionT : public MyBase { - CaptionRuleProto m_caption; + T m_caption; public: - Caption(CaptionRuleProto const & r) : m_caption(r) {} + CaptionT(T const & r) : m_caption(r) {} virtual int GetColor() const { @@ -1394,6 +1402,9 @@ namespace } }; + typedef CaptionT Caption; + typedef CaptionT PathText; + class Circle : public MyBase { CircleRuleProto m_circle; @@ -1409,26 +1420,6 @@ namespace return m_circle.radius(); } }; - - class PathText : public MyBase - { - PathTextRuleProto m_text; - public: - PathText(PathTextRuleProto const & r) : m_text(r) {} - - virtual int GetFillColor() const - { - return m_text.color(); - } - virtual double GetTextHeight() const - { - return m_text.height(); - } - virtual unsigned char GetAlpha() const - { - return AlphaFromColor(GetFillColor()); - } - }; } class DoSetIndex diff --git a/indexer/drules_struct.pb.cc b/indexer/drules_struct.pb.cc index 3891db1df1..89394c292d 100644 --- a/indexer/drules_struct.pb.cc +++ b/indexer/drules_struct.pb.cc @@ -160,9 +160,10 @@ void protobuf_AssignDesc_drules_5fstruct_2eproto() { ::google::protobuf::MessageFactory::generated_factory(), sizeof(CircleRuleProto)); PathTextRuleProto_descriptor_ = file->message_type(6); - static const int PathTextRuleProto_offsets_[3] = { + static const int PathTextRuleProto_offsets_[4] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PathTextRuleProto, height_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PathTextRuleProto, color_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PathTextRuleProto, stroke_color_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PathTextRuleProto, priority_), }; PathTextRuleProto_reflection_ = @@ -306,18 +307,19 @@ void protobuf_AddDesc_drules_5fstruct_2eproto() { "olor\030\002 \002(\r\022\024\n\014stroke_color\030\003 \001(\r\022\020\n\010prio" "rity\030\004 \002(\005\"b\n\017CircleRuleProto\022\016\n\006radius\030" "\001 \002(\001\022\r\n\005color\030\002 \002(\r\022\036\n\006border\030\003 \001(\0132\016.L" - "ineRuleProto\022\020\n\010priority\030\004 \002(\005\"D\n\021PathTe" + "ineRuleProto\022\020\n\010priority\030\004 \002(\005\"Z\n\021PathTe" "xtRuleProto\022\016\n\006height\030\001 \002(\005\022\r\n\005color\030\002 \002" - "(\r\022\020\n\010priority\030\003 \002(\005\"\355\001\n\020DrawElementProt" - "o\022\r\n\005scale\030\001 \002(\005\022\035\n\005lines\030\002 \003(\0132\016.LineRu" - "leProto\022\034\n\004area\030\003 \001(\0132\016.AreaRuleProto\022 \n" - "\006symbol\030\004 \001(\0132\020.SymbolRuleProto\022\"\n\007capti" - "on\030\005 \001(\0132\021.CaptionRuleProto\022 \n\006circle\030\006 " - "\001(\0132\020.CircleRuleProto\022%\n\tpath_text\030\007 \001(\013" - "2\022.PathTextRuleProto\"G\n\023ClassifElementPr" - "oto\022\014\n\004name\030\001 \002(\t\022\"\n\007element\030\002 \003(\0132\021.Dra" - "wElementProto\"4\n\016ContainerProto\022\"\n\004cont\030" - "\001 \003(\0132\024.ClassifElementProto", 947); + "(\r\022\024\n\014stroke_color\030\003 \001(\r\022\020\n\010priority\030\004 \002" + "(\005\"\355\001\n\020DrawElementProto\022\r\n\005scale\030\001 \002(\005\022\035" + "\n\005lines\030\002 \003(\0132\016.LineRuleProto\022\034\n\004area\030\003 " + "\001(\0132\016.AreaRuleProto\022 \n\006symbol\030\004 \001(\0132\020.Sy" + "mbolRuleProto\022\"\n\007caption\030\005 \001(\0132\021.Caption" + "RuleProto\022 \n\006circle\030\006 \001(\0132\020.CircleRulePr" + "oto\022%\n\tpath_text\030\007 \001(\0132\022.PathTextRulePro" + "to\"G\n\023ClassifElementProto\022\014\n\004name\030\001 \002(\t\022" + "\"\n\007element\030\002 \003(\0132\021.DrawElementProto\"4\n\016C" + "ontainerProto\022\"\n\004cont\030\001 \003(\0132\024.ClassifEle" + "mentProto", 969); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "drules_struct.proto", &protobuf_RegisterTypes); DashDotProto::default_instance_ = new DashDotProto(); @@ -2201,6 +2203,7 @@ void CircleRuleProto::Swap(CircleRuleProto* other) { #ifndef _MSC_VER const int PathTextRuleProto::kHeightFieldNumber; const int PathTextRuleProto::kColorFieldNumber; +const int PathTextRuleProto::kStrokeColorFieldNumber; const int PathTextRuleProto::kPriorityFieldNumber; #endif // !_MSC_VER @@ -2222,6 +2225,7 @@ void PathTextRuleProto::SharedCtor() { _cached_size_ = 0; height_ = 0; color_ = 0u; + stroke_color_ = 0u; priority_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -2259,6 +2263,7 @@ void PathTextRuleProto::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { height_ = 0; color_ = 0u; + stroke_color_ = 0u; priority_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); @@ -2285,7 +2290,7 @@ bool PathTextRuleProto::MergePartialFromCodedStream( if (input->ExpectTag(16)) goto parse_color; break; } - + // required uint32 color = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == @@ -2298,12 +2303,28 @@ bool PathTextRuleProto::MergePartialFromCodedStream( } else { goto handle_uninterpreted; } - if (input->ExpectTag(24)) goto parse_priority; + if (input->ExpectTag(24)) goto parse_stroke_color; break; } - - // required int32 priority = 3; + + // optional uint32 stroke_color = 3; case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_stroke_color: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stroke_color_))); + set_has_stroke_color(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(32)) goto parse_priority; + break; + } + + // required int32 priority = 4; + case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_priority: @@ -2317,7 +2338,7 @@ bool PathTextRuleProto::MergePartialFromCodedStream( if (input->ExpectAtEnd()) return true; break; } - + default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == @@ -2340,17 +2361,22 @@ void PathTextRuleProto::SerializeWithCachedSizes( if (has_height()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->height(), output); } - + // required uint32 color = 2; if (has_color()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->color(), output); } - - // required int32 priority = 3; - if (has_priority()) { - ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->priority(), output); + + // optional uint32 stroke_color = 3; + if (has_stroke_color()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->stroke_color(), output); } - + + // required int32 priority = 4; + if (has_priority()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->priority(), output); + } + if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); @@ -2363,17 +2389,22 @@ void PathTextRuleProto::SerializeWithCachedSizes( if (has_height()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->height(), target); } - + // required uint32 color = 2; if (has_color()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->color(), target); } - - // required int32 priority = 3; - if (has_priority()) { - target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->priority(), target); + + // optional uint32 stroke_color = 3; + if (has_stroke_color()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->stroke_color(), target); } - + + // required int32 priority = 4; + if (has_priority()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->priority(), target); + } + if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); @@ -2383,7 +2414,7 @@ void PathTextRuleProto::SerializeWithCachedSizes( int PathTextRuleProto::ByteSize() const { int total_size = 0; - + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // required int32 height = 1; if (has_height()) { @@ -2391,21 +2422,28 @@ int PathTextRuleProto::ByteSize() const { ::google::protobuf::internal::WireFormatLite::Int32Size( this->height()); } - + // required uint32 color = 2; if (has_color()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->color()); } - - // required int32 priority = 3; + + // optional uint32 stroke_color = 3; + if (has_stroke_color()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stroke_color()); + } + + // required int32 priority = 4; if (has_priority()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->priority()); } - + } if (!unknown_fields().empty()) { total_size += @@ -2439,6 +2477,9 @@ void PathTextRuleProto::MergeFrom(const PathTextRuleProto& from) { if (from.has_color()) { set_color(from.color()); } + if (from.has_stroke_color()) { + set_stroke_color(from.stroke_color()); + } if (from.has_priority()) { set_priority(from.priority()); } @@ -2459,8 +2500,8 @@ void PathTextRuleProto::CopyFrom(const PathTextRuleProto& from) { } bool PathTextRuleProto::IsInitialized() const { - if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false; - + if ((_has_bits_[0] & 0x0000000b) != 0x0000000b) return false; + return true; } @@ -2468,6 +2509,7 @@ void PathTextRuleProto::Swap(PathTextRuleProto* other) { if (other != this) { std::swap(height_, other->height_); std::swap(color_, other->color_); + std::swap(stroke_color_, other->stroke_color_); std::swap(priority_, other->priority_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); @@ -2675,7 +2717,7 @@ bool DrawElementProto::MergePartialFromCodedStream( if (input->ExpectTag(58)) goto parse_path_text; break; } - + // optional .PathTextRuleProto path_text = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == @@ -2748,7 +2790,7 @@ void DrawElementProto::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 7, this->path_text(), output); } - + if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); @@ -2803,7 +2845,7 @@ void DrawElementProto::SerializeWithCachedSizes( WriteMessageNoVirtualToArray( 7, this->path_text(), target); } - + if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); @@ -2856,7 +2898,7 @@ int DrawElementProto::ByteSize() const { ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->path_text()); } - + } // repeated .LineRuleProto lines = 2; total_size += 1 * this->lines_size(); diff --git a/indexer/drules_struct.pb.h b/indexer/drules_struct.pb.h index 7bd03c2369..a41012ecf0 100644 --- a/indexer/drules_struct.pb.h +++ b/indexer/drules_struct.pb.h @@ -689,29 +689,29 @@ class PathTextRuleProto : public ::google::protobuf::Message { public: PathTextRuleProto(); virtual ~PathTextRuleProto(); - + PathTextRuleProto(const PathTextRuleProto& from); - + inline PathTextRuleProto& operator=(const PathTextRuleProto& from) { CopyFrom(from); return *this; } - + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { return _unknown_fields_; } - + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { return &_unknown_fields_; } - + static const ::google::protobuf::Descriptor* descriptor(); static const PathTextRuleProto& default_instance(); - + void Swap(PathTextRuleProto* other); - + // implements Message ---------------------------------------------- - + PathTextRuleProto* New() const; void CopyFrom(const ::google::protobuf::Message& from); void MergeFrom(const ::google::protobuf::Message& from); @@ -719,7 +719,7 @@ class PathTextRuleProto : public ::google::protobuf::Message { void MergeFrom(const PathTextRuleProto& from); void Clear(); bool IsInitialized() const; - + int ByteSize() const; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input); @@ -732,56 +732,66 @@ class PathTextRuleProto : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - + ::google::protobuf::Metadata GetMetadata() const; - + // nested types ---------------------------------------------------- - + // accessors ------------------------------------------------------- - + // required int32 height = 1; inline bool has_height() const; inline void clear_height(); static const int kHeightFieldNumber = 1; inline ::google::protobuf::int32 height() const; inline void set_height(::google::protobuf::int32 value); - + // required uint32 color = 2; inline bool has_color() const; inline void clear_color(); static const int kColorFieldNumber = 2; inline ::google::protobuf::uint32 color() const; inline void set_color(::google::protobuf::uint32 value); - - // required int32 priority = 3; + + // optional uint32 stroke_color = 3; + inline bool has_stroke_color() const; + inline void clear_stroke_color(); + static const int kStrokeColorFieldNumber = 3; + inline ::google::protobuf::uint32 stroke_color() const; + inline void set_stroke_color(::google::protobuf::uint32 value); + + // required int32 priority = 4; inline bool has_priority() const; inline void clear_priority(); - static const int kPriorityFieldNumber = 3; + static const int kPriorityFieldNumber = 4; inline ::google::protobuf::int32 priority() const; inline void set_priority(::google::protobuf::int32 value); - + // @@protoc_insertion_point(class_scope:PathTextRuleProto) private: inline void set_has_height(); inline void clear_has_height(); inline void set_has_color(); inline void clear_has_color(); + inline void set_has_stroke_color(); + inline void clear_has_stroke_color(); inline void set_has_priority(); inline void clear_has_priority(); - + ::google::protobuf::UnknownFieldSet _unknown_fields_; - + ::google::protobuf::int32 height_; ::google::protobuf::uint32 color_; + ::google::protobuf::uint32 stroke_color_; ::google::protobuf::int32 priority_; - + mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; - + ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32]; + friend void protobuf_AddDesc_drules_5fstruct_2eproto(); friend void protobuf_AssignDesc_drules_5fstruct_2eproto(); friend void protobuf_ShutdownFile_drules_5fstruct_2eproto(); - + void InitAsDefaultInstance(); static PathTextRuleProto* default_instance_; }; @@ -899,7 +909,7 @@ class DrawElementProto : public ::google::protobuf::Message { inline const ::PathTextRuleProto& path_text() const; inline ::PathTextRuleProto* mutable_path_text(); inline ::PathTextRuleProto* release_path_text(); - + // @@protoc_insertion_point(class_scope:DrawElementProto) private: inline void set_has_scale(); @@ -1694,16 +1704,38 @@ inline void PathTextRuleProto::set_color(::google::protobuf::uint32 value) { color_ = value; } -// required int32 priority = 3; -inline bool PathTextRuleProto::has_priority() const { +// optional uint32 stroke_color = 3; +inline bool PathTextRuleProto::has_stroke_color() const { return (_has_bits_[0] & 0x00000004u) != 0; } -inline void PathTextRuleProto::set_has_priority() { +inline void PathTextRuleProto::set_has_stroke_color() { _has_bits_[0] |= 0x00000004u; } -inline void PathTextRuleProto::clear_has_priority() { +inline void PathTextRuleProto::clear_has_stroke_color() { _has_bits_[0] &= ~0x00000004u; } +inline void PathTextRuleProto::clear_stroke_color() { + stroke_color_ = 0u; + clear_has_stroke_color(); +} +inline ::google::protobuf::uint32 PathTextRuleProto::stroke_color() const { + return stroke_color_; +} +inline void PathTextRuleProto::set_stroke_color(::google::protobuf::uint32 value) { + set_has_stroke_color(); + stroke_color_ = value; +} + +// required int32 priority = 4; +inline bool PathTextRuleProto::has_priority() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void PathTextRuleProto::set_has_priority() { + _has_bits_[0] |= 0x00000008u; +} +inline void PathTextRuleProto::clear_has_priority() { + _has_bits_[0] &= ~0x00000008u; +} inline void PathTextRuleProto::clear_priority() { priority_ = 0; clear_has_priority(); diff --git a/indexer/drules_struct.proto b/indexer/drules_struct.proto index aab10134ce..065447b5b7 100644 --- a/indexer/drules_struct.proto +++ b/indexer/drules_struct.proto @@ -48,7 +48,8 @@ message PathTextRuleProto { required int32 height = 1; required uint32 color = 2; - required int32 priority = 3; + optional uint32 stroke_color = 3; + required int32 priority = 4; } // WayMarkerRule not used yet