src/hbcore/image/hbpixmapiconimpl_p.cpp
changeset 28 b7da29130b0e
parent 21 4633027730f5
child 30 80e4d18b72f5
equal deleted inserted replaced
23:e6ad4ef83b23 28:b7da29130b0e
    38 
    38 
    39 struct HbPixmapMaskedIcon {
    39 struct HbPixmapMaskedIcon {
    40     QPixmap currentPixmap;
    40     QPixmap currentPixmap;
    41 };
    41 };
    42 
    42 
    43 HbPixmapIconImpl::HbPixmapIconImpl(HbSharedIconInfo iconData, QString &name,
    43 HbPixmapIconImpl::HbPixmapIconImpl(HbSharedIconInfo iconData,
       
    44                                    const QString &name,
    44                                    const QSizeF &keySize,
    45                                    const QSizeF &keySize,
    45                                    Qt::AspectRatioMode aspectRatioMode,
    46                                    Qt::AspectRatioMode aspectRatioMode,
    46                                    QIcon::Mode mode,
    47                                    QIcon::Mode mode,
    47                                    bool mirrored,
    48                                    bool mirrored,
    48                                    HbRenderingMode renderMode):
    49                                    HbRenderingMode renderMode)
    49     HbIconImpl(iconData,
    50     : HbIconImpl(iconData,
    50                name,
    51                name,
    51                keySize,
    52                keySize,
    52                aspectRatioMode,
    53                aspectRatioMode,
    53                mode,
    54                mode,
    54                mirrored,
    55                mirrored,
    57 {
    58 {
    58     retrievePixmapData();
    59     retrievePixmapData();
    59     pixmapIconRenderer = new HbPixmapIconRenderer(pixmapData, this);
    60     pixmapIconRenderer = new HbPixmapIconRenderer(pixmapData, this);
    60 }
    61 }
    61 
    62 
    62 HbPixmapIconImpl::HbPixmapIconImpl(const QPixmap &pixmap, const QString &name):
    63 HbPixmapIconImpl::HbPixmapIconImpl(const QPixmap &pixmap,
    63     pixmapData(pixmap),
    64                                    const QString &name)
       
    65     : pixmapData(pixmap),
    64     pixmapIconRenderer(0)
    66     pixmapIconRenderer(0)
    65 {
    67 {
    66     pixmapIconRenderer = new HbPixmapIconRenderer(pixmapData, this);
    68     pixmapIconRenderer = new HbPixmapIconRenderer(pixmapData, this);
       
    69     fileName = name;
       
    70     cacheKeySize = size();
       
    71     renderMode = ESWRendering;
       
    72     createdOnServer = false;
    67     aspectRatioMode = Qt::KeepAspectRatio;
    73     aspectRatioMode = Qt::KeepAspectRatio;
    68     mode = QIcon::Normal;
    74     mode = QIcon::Normal;
    69     mirrored = false;
    75     mirrored = false;
       
    76 }
       
    77 
       
    78 HbPixmapIconImpl::HbPixmapIconImpl(const QPixmap &pixmap,
       
    79                                    const QString &name,
       
    80                                    const QSizeF &keySize,
       
    81                                    Qt::AspectRatioMode aspectRatioMode_,
       
    82                                    QIcon::Mode mode_,
       
    83                                    bool mirrored_)
       
    84     : pixmapData(pixmap),
       
    85       pixmapIconRenderer(0)
       
    86 {
       
    87     pixmapIconRenderer = new HbPixmapIconRenderer(pixmapData, this);
       
    88     fileName = name;
       
    89     cacheKeySize = keySize;
       
    90     renderMode = ESWRendering;
    70     createdOnServer = false;
    91     createdOnServer = false;
    71     fileName = name;
    92     aspectRatioMode = aspectRatioMode_;
       
    93     mode = mode_;
       
    94     mirrored = mirrored_;
    72 }
    95 }
    73 
    96 
    74 HbPixmapIconImpl::~HbPixmapIconImpl()
    97 HbPixmapIconImpl::~HbPixmapIconImpl()
    75 {
    98 {
    76     if (pixmapIconRenderer) {
    99     if (pixmapIconRenderer) {