Subversion Repositories tpanel

Rev

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

Rev 113 Rev 118
Line 665... Line 665...
665
 
665
 
666
    // Get the images, if there any
666
    // Get the images, if there any
667
    vector<SR_T>::iterator srIter;
667
    vector<SR_T>::iterator srIter;
668
    int i = 0;
668
    int i = 0;
669
 
669
 
670
    for (srIter = sr.begin(); srIter != sr.end(); srIter++)
670
    for (srIter = sr.begin(); srIter != sr.end(); ++srIter)
671
    {
671
    {
672
        int number = srIter->number;
672
        int number = srIter->number;
673
        IMAGE_t img;
673
        IMAGE_t img;
674
 
674
 
675
        if (srIter->sb > 0)
675
        if (srIter->sb > 0)
Line 2158... Line 2158...
2158
        if (iter->compare(func) == 0)
2158
        if (iter->compare(func) == 0)
2159
        {
2159
        {
2160
            bool found = false;
2160
            bool found = false;
2161
            vector<PUSH_FUNC_T>::iterator iterPf;
2161
            vector<PUSH_FUNC_T>::iterator iterPf;
2162
 
2162
 
2163
            for (iterPf = pushFunc.begin(); iterPf != pushFunc.end(); iterPf++)
2163
            for (iterPf = pushFunc.begin(); iterPf != pushFunc.end(); ++iterPf)
2164
            {
2164
            {
2165
                if (iterPf->pfType.compare(func) == 0)
2165
                if (iterPf->pfType.compare(func) == 0)
2166
                {
2166
                {
2167
                    iterPf->pfName = page;
2167
                    iterPf->pfName = page;
2168
                    found = true;
2168
                    found = true;
Line 2190... Line 2190...
2190
    if (pushFunc.empty())
2190
    if (pushFunc.empty())
2191
        return;
2191
        return;
2192
 
2192
 
2193
    vector<PUSH_FUNC_T>::iterator iter;
2193
    vector<PUSH_FUNC_T>::iterator iter;
2194
 
2194
 
2195
    for (iter = pushFunc.begin(); iter != pushFunc.end(); iter++)
2195
    for (iter = pushFunc.begin(); iter != pushFunc.end(); ++iter)
2196
    {
2196
    {
2197
        if (iter->pfName.compare(action) == 0)
2197
        if (iter->pfName.compare(action) == 0)
2198
        {
2198
        {
2199
            pushFunc.erase(iter);
2199
            pushFunc.erase(iter);
2200
            return;
2200
            return;
Line 3433... Line 3433...
3433
            int maxWidth = 0;
3433
            int maxWidth = 0;
3434
 
3434
 
3435
            if (textLines.size() > 0)
3435
            if (textLines.size() > 0)
3436
            {
3436
            {
3437
                // Calculate the maximum width
3437
                // Calculate the maximum width
3438
                for (iter = textLines.begin(); iter != textLines.end(); iter++)
3438
                for (iter = textLines.begin(); iter != textLines.end(); ++iter)
3439
                {
3439
                {
3440
                    SkRect rect;
3440
                    SkRect rect;
3441
                    skFont.measureText(iter->c_str(), iter->length(), SkTextEncoding::kUTF8, &rect, &paint);
3441
                    skFont.measureText(iter->c_str(), iter->length(), SkTextEncoding::kUTF8, &rect, &paint);
3442
 
3442
 
3443
                    if (rect.width() > maxWidth)
3443
                    if (rect.width() > maxWidth)
Line 3453... Line 3453...
3453
                    return false;
3453
                    return false;
3454
                }
3454
                }
3455
 
3455
 
3456
                SkScalar lnHt = metrics.fAscent * -1;
3456
                SkScalar lnHt = metrics.fAscent * -1;
3457
 
3457
 
3458
                for (iter = textLines.begin(); iter != textLines.end(); iter++)
3458
                for (iter = textLines.begin(); iter != textLines.end(); ++iter)
3459
                {
3459
                {
3460
                    sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromString(iter->c_str(), skFont);
3460
                    sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromString(iter->c_str(), skFont);
3461
                    MSG_DEBUG("Triing to print line: " << *iter);
3461
                    MSG_DEBUG("Triing to print line: " << *iter);
3462
                    // We want to take care about the horizontal position.
3462
                    // We want to take care about the horizontal position.
3463
                    SkRect rect;
3463
                    SkRect rect;
Line 4015... Line 4015...
4015
        return lines;
4015
        return lines;
4016
    }
4016
    }
4017
 
4017
 
4018
    string::const_iterator iter;
4018
    string::const_iterator iter;
4019
 
4019
 
4020
    for (iter = str.begin(); iter != str.end(); iter++)
4020
    for (iter = str.begin(); iter != str.end(); ++iter)
4021
    {
4021
    {
4022
        if (*iter == '\n')
4022
        if (*iter == '\n')
4023
            lines++;
4023
            lines++;
4024
    }
4024
    }
4025
 
4025
 
Line 5570... Line 5570...
5570
    }
5570
    }
5571
 
5571
 
5572
    vector<SR_T>::iterator iter;
5572
    vector<SR_T>::iterator iter;
5573
    tm = sstr.str();
5573
    tm = sstr.str();
5574
 
5574
 
5575
    for (iter = sr.begin(); iter != sr.end(); iter++)
5575
    for (iter = sr.begin(); iter != sr.end(); ++iter)
5576
        iter->te = tm;
5576
        iter->te = tm;
5577
 
5577
 
5578
    if (visible)
5578
    if (visible)
5579
        makeElement(mActInstance);
5579
        makeElement(mActInstance);
5580
 
5580
 
Line 6016... Line 6016...
6016
    if (!pushFunc.empty() && pressed)
6016
    if (!pushFunc.empty() && pressed)
6017
    {
6017
    {
6018
        MSG_DEBUG("Executing a push function ...");
6018
        MSG_DEBUG("Executing a push function ...");
6019
        vector<PUSH_FUNC_T>::iterator iter;
6019
        vector<PUSH_FUNC_T>::iterator iter;
6020
 
6020
 
6021
        for (iter = pushFunc.begin(); iter != pushFunc.end(); iter++)
6021
        for (iter = pushFunc.begin(); iter != pushFunc.end(); ++iter)
6022
        {
6022
        {
6023
            MSG_DEBUG("Testing for function " << iter->pfType);
6023
            MSG_DEBUG("Testing for function " << iter->pfType);
6024
 
6024
 
6025
            if (iter->pfType == "sShow")            // show popup
6025
            if (iter->pfType == "sShow")            // show popup
6026
            {
6026
            {