src/gui/image/qimagepixmapcleanuphooks_p.h
branchRCL_3
changeset 8 3f74d0d4af4c
parent 4 3b1da2848fc7
equal deleted inserted replaced
6:dee5afe5301f 8:3f74d0d4af4c
    56 #include <QtGui/qpixmap.h>
    56 #include <QtGui/qpixmap.h>
    57 
    57 
    58 QT_BEGIN_NAMESPACE
    58 QT_BEGIN_NAMESPACE
    59 
    59 
    60 typedef void (*_qt_image_cleanup_hook_64)(qint64);
    60 typedef void (*_qt_image_cleanup_hook_64)(qint64);
    61 typedef void (*_qt_pixmap_cleanup_hook_pm)(QPixmap*);
    61 typedef void (*_qt_pixmap_cleanup_hook_pmd)(QPixmapData*);
       
    62 
    62 
    63 
    63 class QImagePixmapCleanupHooks;
    64 class QImagePixmapCleanupHooks;
    64 
    65 
    65 class Q_GUI_EXPORT QImagePixmapCleanupHooks
    66 class Q_GUI_EXPORT QImagePixmapCleanupHooks
    66 {
    67 {
    69 
    70 
    70     static void enableCleanupHooks(const QImage &image);
    71     static void enableCleanupHooks(const QImage &image);
    71     static void enableCleanupHooks(const QPixmap &pixmap);
    72     static void enableCleanupHooks(const QPixmap &pixmap);
    72     static void enableCleanupHooks(QPixmapData *pixmapData);
    73     static void enableCleanupHooks(QPixmapData *pixmapData);
    73 
    74 
    74     // Gets called when a pixmap is about to be modified:
    75     static bool isImageCached(const QImage &image);
    75     void addPixmapModificationHook(_qt_pixmap_cleanup_hook_pm);
    76     static bool isPixmapCached(const QPixmap &pixmap);
    76 
    77 
    77     // Gets called when a pixmap is about to be destroyed:
    78     // Gets called when a pixmap data is about to be modified:
    78     void addPixmapDestructionHook(_qt_pixmap_cleanup_hook_pm);
    79     void addPixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd);
       
    80 
       
    81     // Gets called when a pixmap data is about to be destroyed:
       
    82     void addPixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd);
    79 
    83 
    80     // Gets called when an image is about to be modified or destroyed:
    84     // Gets called when an image is about to be modified or destroyed:
    81     void addImageHook(_qt_image_cleanup_hook_64);
    85     void addImageHook(_qt_image_cleanup_hook_64);
    82 
    86 
    83     void removePixmapModificationHook(_qt_pixmap_cleanup_hook_pm);
    87     void removePixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd);
    84     void removePixmapDestructionHook(_qt_pixmap_cleanup_hook_pm);
    88     void removePixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd);
    85     void removeImageHook(_qt_image_cleanup_hook_64);
    89     void removeImageHook(_qt_image_cleanup_hook_64);
    86 
    90 
    87     static void executePixmapModificationHooks(QPixmap*);
    91     static void executePixmapDataModificationHooks(QPixmapData*);
    88     static void executePixmapDestructionHooks(QPixmap*);
    92     static void executePixmapDataDestructionHooks(QPixmapData*);
    89     static void executeImageHooks(qint64 key);
    93     static void executeImageHooks(qint64 key);
    90 
    94 
    91 private:
    95 private:
    92     QList<_qt_image_cleanup_hook_64> imageHooks;
    96     QList<_qt_image_cleanup_hook_64> imageHooks;
    93     QList<_qt_pixmap_cleanup_hook_pm> pixmapModificationHooks;
    97     QList<_qt_pixmap_cleanup_hook_pmd> pixmapModificationHooks;
    94     QList<_qt_pixmap_cleanup_hook_pm> pixmapDestructionHooks;
    98     QList<_qt_pixmap_cleanup_hook_pmd> pixmapDestructionHooks;
    95 };
    99 };
    96 
   100 
    97 QT_END_NAMESPACE
   101 QT_END_NAMESPACE
    98 
   102 
    99 #endif // QIMAGEPIXMAP_CLEANUPHOOKS_P_H
   103 #endif // QIMAGEPIXMAP_CLEANUPHOOKS_P_H