diff options
Diffstat (limited to 'src/kvirc/kernel/kvi_iconmanager.h')
-rw-r--r-- | src/kvirc/kernel/kvi_iconmanager.h | 90 |
1 files changed, 46 insertions, 44 deletions
diff --git a/src/kvirc/kernel/kvi_iconmanager.h b/src/kvirc/kernel/kvi_iconmanager.h index d8f2abb9..62188f9d 100644 --- a/src/kvirc/kernel/kvi_iconmanager.h +++ b/src/kvirc/kernel/kvi_iconmanager.h @@ -30,9 +30,9 @@ #include "kvi_avatar.h" #include "kvi_time.h" -#include <qpixmap.h> -#include <qobject.h> -#include <qwidget.h> +#include <tqpixmap.h> +#include <tqobject.h> +#include <tqwidget.h> #include "kvi_pointerhashtable.h" @@ -45,7 +45,7 @@ #define KVI_SMALLICON_DEFAULTICON 5 #define KVI_SMALLICON_DOCK 6 #define KVI_SMALLICON_UNDOCK 7 -#define KVI_SMALLICON_QUITAPP 8 +#define KVI_SMALLICON_TQUITAPP 8 #define KVI_SMALLICON_CONSOLE 9 #define KVI_SMALLICON_FLOPPY 10 #define KVI_SMALLICON_PARSERERROR 11 @@ -84,8 +84,8 @@ #define KVI_SMALLICON_DISCARD 44 #define KVI_SMALLICON_OWNPRIVMSG 45 #define KVI_SMALLICON_CHANPRIVMSG 46 -#define KVI_SMALLICON_QUERY 47 -#define KVI_SMALLICON_QUERYPRIVMSG 48 +#define KVI_SMALLICON_TQUERY 47 +#define KVI_SMALLICON_TQUERYPRIVMSG 48 #define KVI_SMALLICON_HELP 49 #define KVI_SMALLICON_MDIHELP 50 #define KVI_SMALLICON_CTCPREPLY 51 @@ -95,9 +95,9 @@ #define KVI_SMALLICON_CTCPREQUESTUNKNOWN 55 #define KVI_SMALLICON_ACTION 56 #define KVI_SMALLICON_AVATAR 57 -#define KVI_SMALLICON_QUIT 58 +#define KVI_SMALLICON_TQUIT 58 #define KVI_SMALLICON_SPLIT 59 -#define KVI_SMALLICON_QUITSPLIT 60 +#define KVI_SMALLICON_TQUITSPLIT 60 #define KVI_SMALLICON_NICK 61 #define KVI_SMALLICON_DEOP 62 #define KVI_SMALLICON_DEVOICE 63 @@ -139,7 +139,7 @@ #define KVI_SMALLICON_UNLOCKEDOFF 99 #define KVI_SMALLICON_OWNPRIVMSGCRYPTED 100 #define KVI_SMALLICON_CHANPRIVMSGCRYPTED 101 -#define KVI_SMALLICON_QUERYPRIVMSGCRYPTED 102 +#define KVI_SMALLICON_TQUERYPRIVMSGCRYPTED 102 #define KVI_SMALLICON_DCCCHATMSG 103 #define KVI_SMALLICON_DCCCHATMSGCRYPTED 104 #define KVI_SMALLICON_IRC 105 @@ -160,11 +160,11 @@ #define KVI_SMALLICON_SPAM 120 #define KVI_SMALLICON_FILE 121 #define KVI_SMALLICON_ICQ 122 -#define KVI_SMALLICON_ICQYELLOW 123 -#define KVI_SMALLICON_ICQRED 124 -#define KVI_SMALLICON_ICQBLUE 125 -#define KVI_SMALLICON_ICQLIGHTGREEN 126 -#define KVI_SMALLICON_ICQLIGHTYELLOW 127 +#define KVI_SMALLICON_ICTQYELLOW 123 +#define KVI_SMALLICON_ICTQRED 124 +#define KVI_SMALLICON_ICTQBLUE 125 +#define KVI_SMALLICON_ICTQLIGHTGREEN 126 +#define KVI_SMALLICON_ICTQLIGHTYELLOW 127 #define KVI_SMALLICON_MESSAGE 128 #define KVI_SMALLICON_MESSAGESENT 129 #define KVI_SMALLICON_BLUESQUARE 130 @@ -192,8 +192,8 @@ #define KVI_SMALLICON_ALIAS 152 #define KVI_SMALLICON_CHANNELNOTICE 153 #define KVI_SMALLICON_CHANNELNOTICECRYPTED 154 -#define KVI_SMALLICON_QUERYNOTICE 155 -#define KVI_SMALLICON_QUERYNOTICECRYPTED 156 +#define KVI_SMALLICON_TQUERYNOTICE 155 +#define KVI_SMALLICON_TQUERYNOTICECRYPTED 156 // FIXME: rename the icon 157: it was colliding with 141 #define KVI_SMALLICON_SERVNOTICE 157 #define KVI_SMALLICON_POPUP 158 @@ -219,7 +219,7 @@ #define KVI_SMALLICON_LOOK 178 #define KVI_SMALLICON_INPUT 179 #define KVI_SMALLICON_MESSAGES 180 -#define KVI_SMALLICON_QUERYTRACE 181 +#define KVI_SMALLICON_TQUERYTRACE 181 #define KVI_SMALLICON_NOCHANNEL 182 #define KVI_SMALLICON_BROADCASTPRIVMSG 183 #define KVI_SMALLICON_BROADCASTNOTICE 184 @@ -271,7 +271,7 @@ #define KVI_SMALLICON_CRY 230 #define KVI_SMALLICON_EYE 231 #define KVI_SMALLICON_DEADCHANNEL 232 -#define KVI_SMALLICON_DEADQUERY 233 +#define KVI_SMALLICON_DEADTQUERY 233 #define KVI_SMALLICON_SOUND 234 #define KVI_SMALLICON_TOOLBAR 235 #define KVI_SMALLICON_TEXTENCODING 236 @@ -376,34 +376,35 @@ class KviIconManager; class KVIRC_API KviCachedPixmap { public: - // the pixmap MUST be allocated with new QPixmap() + // the pixmap MUST be allocated with new TQPixmap() // this calss takes the ownership - KviCachedPixmap(QPixmap * ptr,const QString &szPath); + KviCachedPixmap(TQPixmap * ptr,const TQString &szPath); ~KviCachedPixmap(); private: - QString m_szPath; + TQString m_szPath; kvi_time_t m_tLastAccess; - QPixmap * m_pPixmap; + TQPixmap * m_pPixmap; unsigned int m_uSize; public: - QPixmap * pixmap(){ return m_pPixmap; }; - const QString & path(){ return m_szPath; }; + TQPixmap * pixmap(){ return m_pPixmap; }; + const TQString & path(){ return m_szPath; }; unsigned int size(){ return m_uSize; }; kvi_time_t lastAccessTime(){ return m_tLastAccess; }; void updateLastAccessTime(); }; -class KVIRC_API KviIconWidget : public QWidget +class KVIRC_API KviIconWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: KviIconWidget(); - KviIconWidget(QWidget * par); + KviIconWidget(TQWidget * par); ~KviIconWidget(); protected: void init(); - virtual void closeEvent(QCloseEvent *e); - virtual bool eventFilter(QObject * o,QEvent *e); + virtual void closeEvent(TQCloseEvent *e); + virtual bool eventFilter(TQObject * o,TQEvent *e); signals: void closed(); void selected(int iIcon); @@ -420,7 +421,7 @@ signals: // since it's a linear search...), are 16x16 in size and are indexed by numbers in a way that their // access is really fast. The icons used here are used mostly in KviIrcView (but not exclusively). // -// The generic images are just "any" image that the underlying Qt engine +// The generic images are just "any" image that the underlying TQt engine // is able to load. They are loaded by (relative) path and // cached by name. // @@ -430,66 +431,67 @@ signals: // to the size of 32x32 as a big icon too. // -class KVIRC_API KviIconManager : public QObject +class KVIRC_API KviIconManager : public TQObject { Q_OBJECT + TQ_OBJECT public: KviIconManager(); ~KviIconManager(); private: - QPixmap * m_smallIcons[KVI_NUM_SMALL_ICONS]; + TQPixmap * m_smallIcons[KVI_NUM_SMALL_ICONS]; KviIconWidget * m_pIconWidget; - KviPointerHashTable<QString,KviCachedPixmap> * m_pCachedImages; - KviPointerHashTable<QString,int> * m_pIconNames; + KviPointerHashTable<TQString,KviCachedPixmap> * m_pCachedImages; + KviPointerHashTable<TQString,int> * m_pIconNames; unsigned int m_uCacheTotalSize; unsigned int m_uCacheMaxSize; public: // WARNING: Don't store this pointer! // id == filename | number that indicates an internal pixmap // 0 stands for "any" - QPixmap * getImage(const char * id,bool bCanBeNumber = true,QString* pRetPath = 0); + TQPixmap * getImage(const char * id,bool bCanBeNumber = true,TQString* pRetPath = 0); // The returned pointer is owned by the icon manager // and can be deleted at any time : so don't store it - KviCachedPixmap * getPixmapWithCache(const QString &szName); + KviCachedPixmap * getPixmapWithCache(const TQString &szName); // The returned pointer is owned by the icon manager // and can be deleted at any time : so don't store it - KviCachedPixmap * getPixmapWithCacheScaleOnLoad(const QString &szName,int iMaxWidth,int iMaxHeight); + KviCachedPixmap * getPixmapWithCacheScaleOnLoad(const TQString &szName,int iMaxWidth,int iMaxHeight); // The returned pointer is owned by the icon manager // and can be deleted at any time : so don't store it - QPixmap * getPixmap(const QString &szName) + TQPixmap * getPixmap(const TQString &szName) { KviCachedPixmap * p = getPixmapWithCache(szName); return p ? p->pixmap() : 0; }; // this one never fails... if the image can't be found // a default 32x32 image is returned - QPixmap * getBigIcon(const QString &szName); + TQPixmap * getBigIcon(const TQString &szName); // this one never fails... if the icon isn't there // then a default 16x16 image is returned - QPixmap * getSmallIcon(int idx){ return idx < KVI_NUM_SMALL_ICONS ? (m_smallIcons[idx] ? m_smallIcons[idx] : loadSmallIcon(idx) ) : 0; }; + TQPixmap * getSmallIcon(int idx){ return idx < KVI_NUM_SMALL_ICONS ? (m_smallIcons[idx] ? m_smallIcons[idx] : loadSmallIcon(idx) ) : 0; }; const char * getSmallIconName(int idx); - int getSmallIconIdFromName(const QString &szName); + int getSmallIconIdFromName(const TQString &szName); // if szLocalPath is empty then szName can be the identification // string for the avatar // if szName is empty then it is found from szLocalPath - KviAvatar * getAvatar(const QString &szLocalPath,const QString &szName); + KviAvatar * getAvatar(const TQString &szLocalPath,const TQString &szName); void urlToCachedFileName(KviStr &szFName); - void urlToCachedFileName(QString &szFName); + void urlToCachedFileName(TQString &szFName); void clearCache(); void reloadImages(); void cacheCleanup(); protected: - void addToCache(const QString &szName,KviCachedPixmap * p); + void addToCache(const TQString &szName,KviCachedPixmap * p); //void loadSmallIcons(); - QPixmap * loadSmallIcon(int idx); + TQPixmap * loadSmallIcon(int idx); public slots: void showIconWidget(); protected slots: |