summaryrefslogtreecommitdiff
path: root/src/core/stdmsg
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r--src/core/stdmsg/src/globals.cpp37
-rw-r--r--src/core/stdmsg/src/msglog.cpp4
2 files changed, 7 insertions, 34 deletions
diff --git a/src/core/stdmsg/src/globals.cpp b/src/core/stdmsg/src/globals.cpp
index d60ce6d3fc..52e69a8860 100644
--- a/src/core/stdmsg/src/globals.cpp
+++ b/src/core/stdmsg/src/globals.cpp
@@ -26,43 +26,16 @@ static int dbaddedevent(WPARAM wParam, LPARAM lParam);
static int ackevent(WPARAM wParam, LPARAM lParam);
static int AvatarChanged(WPARAM wParam, LPARAM lParam);
-typedef struct IconDefStruct
+IconItem iconList[] =
{
- char *szName;
- char *szDescr;
- int defIconID;
-} IconList;
-
-static const IconList iconList[] =
-{
- { "INCOMING", LPGEN("Incoming message (10x10)"), IDI_INCOMING },
- { "OUTGOING", LPGEN("Outgoing message (10x10)"), IDI_OUTGOING },
- { "NOTICE", LPGEN("Notice (10x10)"), IDI_NOTICE },
+ { LPGEN("Incoming message (10x10)"), "INCOMING", IDI_INCOMING, 10 },
+ { LPGEN("Outgoing message (10x10)"), "OUTGOING", IDI_OUTGOING, 10 },
+ { LPGEN("Notice (10x10)"), "NOTICE", IDI_NOTICE, 10 },
};
-
-HANDLE hIconLibItem[SIZEOF(iconList)];
-
static void InitIcons(void)
{
- char szSettingName[100];
-
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(g_hInst, szFile, SIZEOF(szFile));
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.ptszDefaultFile = szFile;
- sid.pszName = szSettingName;
- sid.pszSection = LPGEN("Messaging");
- sid.flags = SIDF_PATH_TCHAR;
- sid.cx = 10; sid.cy = 10;
-
- for (int i=0; i < SIZEOF(iconList); i++) {
- mir_snprintf(szSettingName, sizeof(szSettingName), "SRMM_%s", iconList[i].szName);
- sid.pszDescription = iconList[i].szDescr;
- sid.iDefaultIndex = -iconList[i].defIconID;
- hIconLibItem[i] = Skin_AddIcon(&sid);
- }
+ Icon_Register(g_hInst, LPGEN("Messaging"), iconList, SIZEOF(iconList), "SRMM");
}
static int IconsChanged(WPARAM wParam, LPARAM lParam)
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp
index 3596233975..89647cd226 100644
--- a/src/core/stdmsg/src/msglog.cpp
+++ b/src/core/stdmsg/src/msglog.cpp
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "commonheaders.h"
-extern HANDLE hIconLibItem[];
+extern IconItem iconList[];
static int logPixelSY;
#define LOGICON_MSG_IN 0
@@ -609,7 +609,7 @@ void LoadMsgLogIcons(void)
pBmpBits = (PBYTE) mir_alloc(widthBytes * bih.biHeight);
for (i = 0; i < SIZEOF(pLogIconBmpBits); i++) {
- hIcon = Skin_GetIconByHandle(hIconLibItem[i]);
+ hIcon = Skin_GetIconByHandle(iconList[i].hIcolib);
pLogIconBmpBits[i] = (PBYTE) mir_alloc(RTFPICTHEADERMAXSIZE + (bih.biSize + widthBytes * bih.biHeight) * 2);
//I can't seem to get binary mode working. No matter.
rtfHeaderSize = sprintf((char*)pLogIconBmpBits[i], "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, bih.biWidth, bih.biHeight);