bool RenderThemeSymbian::paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
    if (!m_radioButtonOn) {
        m_radioButtonOn = Image::loadPlatformResource("radioButtonOn");
        m_radioButtonOff = Image::loadPlatformResource("radioButtonOff");
    }    
    paintButtonDecorations(o, i, r);
    MScrollView* wv = scrollView(i);
    // don't scale the checkbox if scalingFactor is 100% or  we are in the process of scaling another image
    if (wv->scalingFactor() <= 100  || m_bitmapScaler) {
        i.context->drawImage(isChecked(o)?m_radioButtonOn:m_radioButtonOff,r);
    }
    // use the cached scaled image if it has the same scaling factor
    else if (wv->scalingFactor() == (isChecked(o) ? m_scalingForRadioOn : m_scalingForRadioOff)) {
        i.context->drawImage(isChecked(o) ? m_scaledRadioOn : m_scaledRadioOff, r);
    }
    // scale
    else {
        scaleImage(isChecked(o) ? ERadioOn : ERadioOff, wv->scalingFactor());
        if (wv->scalingFactor() == (isChecked(o) ? m_scalingForRadioOn : m_scalingForRadioOff)) {
            i.context->drawImage(isChecked(o) ? m_scaledRadioOn : m_scaledRadioOff, r);
        }
        else {        
            i.context->drawImage(isChecked(o)?m_radioButtonOn:m_radioButtonOff,r);
        }
    }
    return false;
}
Beispiel #2
0
bool RenderTheme::paintDecorations(const RenderBox& box, const PaintInfo& paintInfo, const LayoutRect& rect)
{
    if (paintInfo.context().paintingDisabled())
        return false;

    IntRect integralSnappedRect = snappedIntRect(rect);
    FloatRect devicePixelSnappedRect = snapRectToDevicePixels(rect, box.document().deviceScaleFactor());

    // Call the appropriate paint method based off the appearance value.
    switch (box.style().appearance()) {
    case MenulistButtonPart:
        return paintMenuListButtonDecorations(box, paintInfo, devicePixelSnappedRect);
    case TextFieldPart:
        return paintTextFieldDecorations(box, paintInfo, devicePixelSnappedRect);
    case TextAreaPart:
        return paintTextAreaDecorations(box, paintInfo, devicePixelSnappedRect);
    case CheckboxPart:
        return paintCheckboxDecorations(box, paintInfo, integralSnappedRect);
    case RadioPart:
        return paintRadioDecorations(box, paintInfo, integralSnappedRect);
    case PushButtonPart:
        return paintPushButtonDecorations(box, paintInfo, integralSnappedRect);
    case SquareButtonPart:
        return paintSquareButtonDecorations(box, paintInfo, integralSnappedRect);
    case ButtonPart:
        return paintButtonDecorations(box, paintInfo, integralSnappedRect);
    case MenulistPart:
        return paintMenuListDecorations(box, paintInfo, integralSnappedRect);
    case SliderThumbHorizontalPart:
    case SliderThumbVerticalPart:
        return paintSliderThumbDecorations(box, paintInfo, integralSnappedRect);
    case SearchFieldPart:
        return paintSearchFieldDecorations(box, paintInfo, integralSnappedRect);
#if ENABLE(METER_ELEMENT)
    case MeterPart:
    case RelevancyLevelIndicatorPart:
    case ContinuousCapacityLevelIndicatorPart:
    case DiscreteCapacityLevelIndicatorPart:
    case RatingLevelIndicatorPart:
#endif
    case ProgressBarPart:
    case SliderHorizontalPart:
    case SliderVerticalPart:
    case ListboxPart:
    case DefaultButtonPart:
    case SearchFieldCancelButtonPart:
    case SearchFieldDecorationPart:
    case SearchFieldResultsDecorationPart:
    case SearchFieldResultsButtonPart:
#if ENABLE(SERVICE_CONTROLS)
    case ImageControlsButtonPart:
#endif
    default:
        break;
    }

    return false;
}
Beispiel #3
0
bool RenderTheme::paintDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
{
    if (paintInfo.context->paintingDisabled())
        return false;

    // Call the appropriate paint method based off the appearance value.
    switch (renderer->style().appearance()) {
    case MenulistButtonPart:
        return paintMenuListButtonDecorations(renderer, paintInfo, rect);
    case TextFieldPart:
        return paintTextFieldDecorations(renderer, paintInfo, rect);
    case TextAreaPart:
        return paintTextAreaDecorations(renderer, paintInfo, rect);
    case CheckboxPart:
        return paintCheckboxDecorations(renderer, paintInfo, rect);
    case RadioPart:
        return paintRadioDecorations(renderer, paintInfo, rect);
    case PushButtonPart:
        return paintPushButtonDecorations(renderer, paintInfo, rect);
    case SquareButtonPart:
        return paintSquareButtonDecorations(renderer, paintInfo, rect);
    case ButtonPart:
        return paintButtonDecorations(renderer, paintInfo, rect);
    case MenulistPart:
        return paintMenuListDecorations(renderer, paintInfo, rect);
    case SliderThumbHorizontalPart:
    case SliderThumbVerticalPart:
        return paintSliderThumbDecorations(renderer, paintInfo, rect);
    case SearchFieldPart:
        return paintSearchFieldDecorations(renderer, paintInfo, rect);
#if ENABLE(METER_ELEMENT)
    case MeterPart:
    case RelevancyLevelIndicatorPart:
    case ContinuousCapacityLevelIndicatorPart:
    case DiscreteCapacityLevelIndicatorPart:
    case RatingLevelIndicatorPart:
#endif
#if ENABLE(PROGRESS_ELEMENT)
    case ProgressBarPart:
#endif
    case SliderHorizontalPart:
    case SliderVerticalPart:
    case ListboxPart:
    case DefaultButtonPart:
    case SearchFieldCancelButtonPart:
    case SearchFieldDecorationPart:
    case SearchFieldResultsDecorationPart:
    case SearchFieldResultsButtonPart:
#if ENABLE(INPUT_SPEECH)
    case InputSpeechButtonPart:
#endif
    default:
        break;
    }

    return false;
}
bool RenderThemeSymbian::paintMenuListButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{          
    if (!m_selectArrow) {
        m_selectArrow = Image::loadPlatformResource("selectArrow");
    }
    IntSize s = m_selectArrow->size();

    // draw the bounding area
    i.context->save();
    //i.context->setPen(Pen(Color::black,1));
    i.context->setFillColor(Color::lightGray);
    
    IntRect brect(r.x() + r.width() - s.width(), r.y(), s.width(), r.height() - 3 );
    i.context->drawRect(r);
    paintButtonDecorations(o, i, r);

    // draw the arrow 
    int y = (r.height() - s.height())/2 + r.y();
    IntRect arrowRect(IntPoint(r.x() + r.width() - s.width(), y), s);
    MScrollView* wv = scrollView(i);
    // don't scale the checkbox if scalingFactor is 100% or  we are in the process of scaling another image
    if (wv->scalingFactor() <= 100  || m_bitmapScaler) {
        i.context->drawImage(m_selectArrow, arrowRect);
    }
    // use the cached scaled image if it has the same scaling factor
    else if (wv->scalingFactor() == (m_scalingForSelectArrow)) {
        i.context->drawImage(m_scaledSelectArrow, arrowRect);
    }
    // scale
    else {
        scaleImage(ESelectArrow, wv->scalingFactor());
        if (wv->scalingFactor() == m_scalingForSelectArrow) {
            i.context->drawImage(m_scaledSelectArrow, arrowRect);
        }
        else {        
            i.context->drawImage(m_selectArrow, arrowRect);
        }
    }
    i.context->restore();
    return false;    
}
bool RenderThemeSymbian::paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
    paintButtonDecorations(o, i, r);
    MScrollView* wv = scrollView(i);
    // don't scale the checkbox if scalingFactor is 100% or  we are in the process of scaling another image
    if (wv->scalingFactor() <= 100  || m_bitmapScaler) {
        i.context->drawImage(isChecked(o)?m_checkBoxOn:m_checkBoxOff,r);
    }
    // use the cached scaled image if it has the same scaling factor
    else if (wv->scalingFactor() == (isChecked(o) ? m_scalingForCheckBoxOn : m_scalingForCheckBoxOff)) {
        i.context->drawImage(isChecked(o) ? m_scaledCheckBoxOn : m_scaledCheckBoxOff, r);
    }
    // scale
    else {
        scaleImage(isChecked(o) ? ECheckBoxOn : ECheckBoxOff, wv->scalingFactor());
        if (wv->scalingFactor() == (isChecked(o) ? m_scalingForCheckBoxOn : m_scalingForCheckBoxOff)) {
            i.context->drawImage(isChecked(o) ? m_scaledCheckBoxOn : m_scaledCheckBoxOff, r);
        }
        else {        
            i.context->drawImage(isChecked(o)?m_checkBoxOn:m_checkBoxOff,r);
        }
    }
    return false;
}