Subversion Repositories tpanel

Rev

Rev 339 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 339 Rev 404
Line 647... Line 647...
647
    DECL_TRACER("TSystemDraw::getBorder(const string &family, LINE_TYPE_t lt, BORDER_t *border, const string& family2, bool info)");
647
    DECL_TRACER("TSystemDraw::getBorder(const string &family, LINE_TYPE_t lt, BORDER_t *border, const string& family2, bool info)");
648
 
648
 
649
    if (!border || family.empty() || mDraw.borders.size() == 0)
649
    if (!border || family.empty() || mDraw.borders.size() == 0)
650
        return false;
650
        return false;
651
 
651
 
-
 
652
    string basePath = mPath + "/borders/";
652
    // Find the border details
653
    // Find the border details
653
    vector<FAMILY_t>::iterator iter;
654
    vector<FAMILY_t>::iterator iter;
654
    bool found = false;
655
    bool found = false;
655
    string fullName;
656
    string fullName;
656
 
657
 
Line 718... Line 719...
718
        MSG_WARNING("Border " << family << " not found!");
719
        MSG_WARNING("Border " << family << " not found!");
719
        return false;
720
        return false;
720
    }
721
    }
721
 
722
 
722
    MSG_DEBUG("External system border " << family << " found.");
723
    MSG_DEBUG("External system border " << family << " found.");
723
    dir::TDirectory dir(mPath + "/borders");
724
    dir::TDirectory dir(basePath);
724
    dir.setStripPath(true);
725
    dir.setStripPath(true);
725
    vector<BORDER_DATA_t>::iterator brdIter;
726
    vector<BORDER_DATA_t>::iterator brdIter;
726
    string dataName = (family2.length() > 0 ? family2 : fullName);
727
    string dataName = (family2.length() > 0 ? family2 : fullName);
727
 
728
 
728
    for (brdIter = mDraw.borderData.begin(); brdIter != mDraw.borderData.end(); brdIter++)
729
    for (brdIter = mDraw.borderData.begin(); brdIter != mDraw.borderData.end(); brdIter++)
Line 734... Line 735...
734
                int num = dir.scanFiles(brdIter->baseFile + "_", true);
735
                int num = dir.scanFiles(brdIter->baseFile + "_", true);
735
 
736
 
736
                if (num < 8)
737
                if (num < 8)
737
                    continue;
738
                    continue;
738
 
739
 
739
                border->b = mPath + "/borders/" + getDirEntry(&dir, "_b", (lt == LT_ON) ? true : false);
740
                border->b = basePath + getDirEntry(&dir, "_b", false);
740
                border->bl = mPath + "/borders/" + getDirEntry(&dir, "_bl", (lt == LT_ON) ? true : false);
741
                border->bl = basePath + getDirEntry(&dir, "_bl", false);
741
                border->br = mPath + "/borders/" + getDirEntry(&dir, "_br", (lt == LT_ON) ? true : false);
742
                border->br = basePath + getDirEntry(&dir, "_br", false);
742
                border->l = mPath + "/borders/" + getDirEntry(&dir, "_l", (lt == LT_ON) ? true : false);
743
                border->l = basePath + getDirEntry(&dir, "_l", false);
743
                border->r = mPath + "/borders/" + getDirEntry(&dir, "_r", (lt == LT_ON) ? true : false);
744
                border->r = basePath + getDirEntry(&dir, "_r", false);
744
                border->t = mPath + "/borders/" + getDirEntry(&dir, "_t", (lt == LT_ON) ? true : false);
745
                border->t = basePath + getDirEntry(&dir, "_t", false);
745
                border->tl = mPath + "/borders/" + getDirEntry(&dir, "_tl", (lt == LT_ON) ? true : false);
746
                border->tl = basePath + getDirEntry(&dir, "_tl", false);
746
                border->tr = mPath + "/borders/" + getDirEntry(&dir, "_tr", (lt == LT_ON) ? true : false);
747
                border->tr = basePath + getDirEntry(&dir, "_tr", false);
-
 
748
                border->b_alpha = basePath + getDirEntry(&dir, "_b");
-
 
749
                border->bl_alpha = basePath + getDirEntry(&dir, "_bl");
-
 
750
                border->br_alpha = basePath + getDirEntry(&dir, "_br");
-
 
751
                border->l_alpha = basePath + getDirEntry(&dir, "_l");
-
 
752
                border->r_alpha = basePath + getDirEntry(&dir, "_r");
-
 
753
                border->t_alpha = basePath + getDirEntry(&dir, "_t");
-
 
754
                border->tl_alpha = basePath + getDirEntry(&dir, "_tl");
-
 
755
                border->tr_alpha = basePath + getDirEntry(&dir, "_tr");
747
                border->border = *brdIter;
756
                border->border = *brdIter;
748
                MSG_DEBUG("Bottom      : " << border->b);
757
                MSG_DEBUG("Bottom        : " << border->b);
749
                MSG_DEBUG("Top         : " << border->t);
758
                MSG_DEBUG("Top           : " << border->t);
750
                MSG_DEBUG("Left        : " << border->l);
759
                MSG_DEBUG("Left          : " << border->l);
751
                MSG_DEBUG("Right       : " << border->r);
760
                MSG_DEBUG("Right         : " << border->r);
752
                MSG_DEBUG("Top left    : " << border->tl);
761
                MSG_DEBUG("Top left      : " << border->tl);
753
                MSG_DEBUG("Top right   : " << border->tr);
762
                MSG_DEBUG("Top right     : " << border->tr);
754
                MSG_DEBUG("Bottom left : " << border->bl);
763
                MSG_DEBUG("Bottom left   : " << border->bl);
755
                MSG_DEBUG("Bottom right: " << border->br);
764
                MSG_DEBUG("Bottom right  : " << border->br);
-
 
765
                MSG_DEBUG("Bottom A      : " << border->b_alpha);
-
 
766
                MSG_DEBUG("Top A         : " << border->t_alpha);
-
 
767
                MSG_DEBUG("Left A        : " << border->l_alpha);
-
 
768
                MSG_DEBUG("Right A       : " << border->r_alpha);
-
 
769
                MSG_DEBUG("Top left A    : " << border->tl_alpha);
-
 
770
                MSG_DEBUG("Top right A   : " << border->tr_alpha);
-
 
771
                MSG_DEBUG("Bottom left A : " << border->bl_alpha);
-
 
772
                MSG_DEBUG("Bottom right A: " << border->br_alpha);
-
 
773
                // Eliminate equal paths
-
 
774
                if (border->b == border->b_alpha)
-
 
775
                {
-
 
776
                    if (StrContains(border->b, "_alpha"))
-
 
777
                        border->b.clear();
-
 
778
                    else
-
 
779
                        border->b_alpha.clear();
-
 
780
                }
-
 
781
 
-
 
782
                if (border->t == border->t_alpha)
-
 
783
                {
-
 
784
                    if (StrContains(border->t, "_alpha"))
-
 
785
                        border->t.clear();
-
 
786
                    else
-
 
787
                        border->t_alpha.clear();
-
 
788
                }
-
 
789
 
-
 
790
                if (border->l == border->l_alpha)
-
 
791
                {
-
 
792
                    if (StrContains(border->l, "_alpha"))
-
 
793
                        border->l.clear();
-
 
794
                    else
-
 
795
                        border->l_alpha.clear();
-
 
796
                }
-
 
797
 
-
 
798
                if (border->r == border->r_alpha)
-
 
799
                {
-
 
800
                    if (StrContains(border->r, "_alpha"))
-
 
801
                        border->r.clear();
-
 
802
                    else
-
 
803
                        border->r_alpha.clear();
-
 
804
                }
-
 
805
 
-
 
806
                if (border->tl == border->tl_alpha)
-
 
807
                {
-
 
808
                    if (StrContains(border->tl, "_alpha"))
-
 
809
                        border->tl.clear();
-
 
810
                    else
-
 
811
                        border->tl_alpha.clear();
-
 
812
                }
-
 
813
 
-
 
814
                if (border->tr == border->tr_alpha)
-
 
815
                {
-
 
816
                    if (StrContains(border->tr, "_alpha"))
-
 
817
                        border->tr.clear();
-
 
818
                    else
-
 
819
                        border->tr_alpha.clear();
-
 
820
                }
-
 
821
 
-
 
822
                if (border->bl == border->bl_alpha)
-
 
823
                {
-
 
824
                    if (StrContains(border->bl, "_alpha"))
-
 
825
                        border->bl.clear();
-
 
826
                    else
-
 
827
                        border->bl_alpha.clear();
-
 
828
                }
-
 
829
 
-
 
830
                if (border->br == border->br_alpha)
-
 
831
                {
-
 
832
                    if (StrContains(border->br, "_alpha"))
-
 
833
                        border->br.clear();
-
 
834
                    else
-
 
835
                        border->br_alpha.clear();
-
 
836
                }
756
            }
837
            }
757
            else
838
            else
758
                border->border = *brdIter;
839
                border->border = *brdIter;
759
 
840
 
760
            return true;
841
            return true;
Line 964... Line 1045...
964
 
1045
 
965
    if (parts.empty())
1046
    if (parts.empty())
966
        return false;
1047
        return false;
967
 
1048
 
968
    size_t found = 0;
1049
    size_t found = 0;
-
 
1050
    vector<string> nameParts = StrSplit(name, " ", true);
969
    vector<string>::const_iterator iter;
1051
    vector<string>::const_iterator iter;
970
 
1052
 
-
 
1053
    // First find the minimum number of parts who must match
-
 
1054
    size_t minParts = 0;
-
 
1055
 
-
 
1056
    for (size_t i = 0; i < nameParts.size(); ++i)
-
 
1057
    {
-
 
1058
        if (strCaseCompare(nameParts[i], "raised") == 0 ||
-
 
1059
            strCaseCompare(nameParts[i], "inset") == 0 ||
-
 
1060
            strCaseCompare(nameParts[i], "active") == 0 ||
-
 
1061
            strCaseCompare(nameParts[i], "inactive") == 0)
-
 
1062
            continue;
-
 
1063
 
-
 
1064
        minParts++;
-
 
1065
    }
-
 
1066
 
-
 
1067
    // Compare the parts and count the matching parts
971
    for (iter = parts.begin(); iter != parts.end(); ++iter)
1068
    for (iter = parts.begin(); iter != parts.end(); ++iter)
972
    {
1069
    {
973
        if (StrContains(name, *iter))
1070
        if (StrContains(name, *iter))
974
            found++;
1071
            found++;
975
    }
1072
    }
976
 
1073
 
977
    if (found == parts.size())
1074
    if (found == nameParts.size() || found >= minParts)
978
        return true;
1075
        return true;
979
 
1076
 
980
    return false;
1077
    return false;
981
}
1078
}