summaryrefslogtreecommitdiff
path: root/src/mir_app/src/IcoLib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir_app/src/IcoLib.h')
-rw-r--r--src/mir_app/src/IcoLib.h42
1 files changed, 28 insertions, 14 deletions
diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h
index a51c9903e2..acaa11b327 100644
--- a/src/mir_app/src/IcoLib.h
+++ b/src/mir_app/src/IcoLib.h
@@ -40,23 +40,40 @@ struct IconSourceFile
TCHAR file[MAX_PATH];
};
-struct IconSourceItem : public MZeroedObject
+struct IconSourceItemKey
{
+ IconSourceFile* file;
+ int indx;
+ int cx, cy;
+};
+
+class IconSourceItem : public MZeroedObject, public IconSourceItemKey
+{
+ int ref_count;
+
+ BYTE* icon_data;
+ int icon_size;
+
+public:
__inline IconSourceItem(IconSourceFile *_file, int _indx, int _cxIcon, int _cyIcon) :
- file(_file), indx(_indx), cx(_cxIcon), cy(_cyIcon), ref_count(1)
- {}
+ ref_count(1)
+ {
+ file = _file; indx = _indx; cx = _cxIcon; cy = _cyIcon;
+ }
+ ~IconSourceItem();
- IconSourceFile* file;
- int indx;
- int cx, cy;
+ __inline void addRef() { ref_count++; }
+ int release();
- int ref_count;
+ HICON getIcon();
+ int getIconData(HICON icon);
+ int releaseIcon();
- HICON icon;
- int icon_ref_count;
+ static int compare(const IconSourceItem *p1, const IconSourceItem *p2);
- BYTE* icon_data;
- int icon_size;
+public:
+ HICON icon;
+ int icon_ref_count;
};
struct IcolibItem : public MZeroedObject
@@ -90,9 +107,6 @@ UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HIC
void __fastcall SafeDestroyIcon(HICON &icon);
-int IconSourceItem_Release(IconSourceItem* &pitem);
-int IconSourceItem_ReleaseIcon(IconSourceItem *item);
-HICON IconSourceItem_GetIcon(IconSourceItem *item);
IconSourceItem* GetIconSourceItem(const TCHAR* file, int indx, int cxIcon, int cyIcon);
IcolibItem* IcoLib_FindHIcon(HICON hIcon, bool &big);