summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/delphi/m_helpers.inc36
-rw-r--r--include/delphi/m_skin.inc38
-rw-r--r--include/m_skin.h107
3 files changed, 59 insertions, 122 deletions
diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc
index 9fbd21c671..86bee1a2d6 100644
--- a/include/delphi/m_helpers.inc
+++ b/include/delphi/m_helpers.inc
@@ -53,12 +53,6 @@ procedure Srmm_RemoveIcon(sid: PStatusIconData);
procedure Srmm_ModifyIcon(hContact:TMCONTACT; sid:PStatusIconData);
function Srmm_GetNthIcon(hContact:TMCONTACT; index:int):pStatusIconData;
-function LoadSkinnedIcon (id: int): HICON;
-function LoadSkinnedIconHandle(id: int): THANDLE;
-function LoadSkinnedIconBig (id: int): HICON;
-function LoadSkinnedIconName (id: int): PAnsiChar;
-
-function LoadSkinnedProtoIcon(const szProto: PAnsiChar; status: int): THANDLE;
function SkinAddNewSound(const name, description, defaultFile: PAnsiChar): int_ptr;
function SkinPlaySound (const name: PAnsiChar): int_ptr;
@@ -400,36 +394,6 @@ begin
result:=PStatusIconData(CallService(MS_MSG_GETNTHICON, hContact, index));
end;
-function LoadSkinnedIcon(id: int): HICON;
- {$IFDEF AllowInline}inline;{$ENDIF}
-begin
- Result := HICON(CallService(MS_SKIN_LOADICON, id, 0));
-end;
-
-function LoadSkinnedIconHandle(id: int): THANDLE;
- {$IFDEF AllowInline}inline;{$ENDIF}
-begin
- Result := THANDLE(CallService(MS_SKIN_LOADICON, id, 1));
-end;
-
-function LoadSkinnedIconBig(id: int): HICON;
- {$IFDEF AllowInline}inline;{$ENDIF}
-begin
- Result := HICON(CallService(MS_SKIN_LOADICON, id, 2));
-end;
-
-function LoadSkinnedIconName(id: int): PAnsiChar;
- {$IFDEF AllowInline}inline;{$ENDIF}
-begin
- Result := PAnsiChar(CallService(MS_SKIN_LOADICON, id, 3));
-end;
-
-function LoadSkinnedProtoIcon(const szProto: PAnsiChar; status: int): THANDLE;
- {$IFDEF AllowInline}inline;{$ENDIF}
-begin
- Result := CallService(MS_SKIN_LOADPROTOICON, wParam(szProto), status);
-end;
-
function SkinAddNewSound(const name, description, defaultFile: PAnsiChar): int_ptr;
var
ssd: TSKINSOUNDDESCEX;
diff --git a/include/delphi/m_skin.inc b/include/delphi/m_skin.inc
index fcc4911e94..5c07d87008 100644
--- a/include/delphi/m_skin.inc
+++ b/include/delphi/m_skin.inc
@@ -88,22 +88,18 @@ const
SKINICON_AUTH_REQUEST = 248;
SKINICON_AUTH_GRANT = 249;
SKINICON_AUTH_REVOKE = 250;
-{
- SKINICON_EVENT_MESSAGE_BIG = 300;
- SKINICON_EVENT_URL_BIG = 301;
- SKINICON_EVENT_FILE_BIG = 302;
- SKINICON_OTHER_MIRANDA_BIG = 303;
- SKINICON_OTHER_ADDCONTACT_BIG = 304;
- SKINICON_OTHER_USERDETAILS_BIG = 305;
- SKINICON_OTHER_HISTORY_BIG = 306;
- SKINICON_OTHER_FINDUSER_BIG = 307;
- SKINICON_OTHER_OPTIONS_BIG = 308;
- SKINICON_OTHER_ACCMGR_BIG = 309;
-}
- // menu icons are owned by the module that uses them so are not and should
- // not be skinnable. Except exit and show/hide
- // status mode icons. NOTE: These are deprecated in favour of LoadSkinnedProtoIcon()
+function Skin_LoadIcon(iconId:int; big:byte) : HICON; stdcall;
+ external AppDLL name 'Skin_LoadIcon';
+
+function Skin_GetIconHandle(iconId:int) : THANDLE; stdcall;
+ external AppDLL name 'Skin_GetIconHandle';
+
+function Skin_GetIconName(iconId:int) : PAnsiChar; stdcall;
+ external AppDLL name 'Skin_GetIconName';
+
+// status mode icons. NOTE: These are deprecated in favour of LoadSkinnedProtoIcon()
+const
SKINICON_STATUS_OFFLINE = 0;
SKINICON_STATUS_ONLINE = 1;
SKINICON_STATUS_AWAY = 2;
@@ -115,6 +111,9 @@ const
SKINICON_STATUS_ONTHEPHONE = 8;
SKINICON_STATUS_OUTTOLUNCH = 9;
+function Skin_LoadProtoIcon(protoName:PAnsiChar; iconId:int; big:byte) : HICON; stdcall;
+ external AppDLL name 'Skin_LoadProtoIcon';
+
const
SSDF_UNICODE = $0001;
type
@@ -130,11 +129,6 @@ type
const
{
- wParam : ICON_ID
- lParam : 0 - return HICON
- 1 - return icolib handle
- 2 - return big icon HICON
- 3 - return icolib icon name
Affect : Load an icon from the user's custom skin lib, or from the exe
if there isn't one loaded, see notes
Return : HICON for the new icon, do *not* DestroyIcon() the return value
@@ -143,16 +137,12 @@ const
MS_SKIN_LOADICON:PAnsiChar = 'Skin/Icons/Load';
{
- wParam : null terminated string containing the protocol name
- lParam : status_wanted
Affect : Load an icon representing the status_wanted for a particular protocol, see notes
Returns: an HICON for the new icon, do NOT DestroyIcon() the return value
returns NULL(0) on failure.
Notes : If wParam is NULL(0) the service will load the user's selected
'all protocols' status icon
}
- MS_SKIN_LOADPROTOICON :PAnsiChar = 'Skin/Icons/LoadProto';
- MS_SKIN_LOADPROTOICONBIG:PAnsiChar = 'Skin/Icons/LoadProtoBig';
{
wParam : hLangpack
diff --git a/include/m_skin.h b/include/m_skin.h
index 7537e4a918..46e7d06299 100644
--- a/include/m_skin.h
+++ b/include/m_skin.h
@@ -30,26 +30,6 @@ extern int hLangpack;
#include <m_core.h>
#endif
-//loads an icon from the user's custom skin library, or from the exe if there
-//isn't one of them
-//wParam = id of icon to load - see below
-//lParam = 0
-//returns an hIcon for the new icon. Do *not* DestroyIcon() the return value
-//returns NULL if id is invalid, but will always succeed for a valid id
-#define MS_SKIN_LOADICON "Skin/Icons/Load"
-//nice function to wrap this:
-__forceinline HICON LoadSkinnedIcon(int id) { return (HICON) CallService(MS_SKIN_LOADICON, id, 0); }
-__forceinline HANDLE LoadSkinnedIconHandle(int id) { return (HANDLE)CallService(MS_SKIN_LOADICON, id, 1); }
-__forceinline HICON LoadSkinnedIconBig(int id) { return (HICON) CallService(MS_SKIN_LOADICON, id, 2); }
-__forceinline LPCSTR LoadSkinnedIconName(int id) { return (LPCSTR)CallService(MS_SKIN_LOADICON, id, 3); }
-
-///////////////////////////////////////////////////////////////////////////////
-// Miranda skin
-
-MIR_APP_DLL(HICON) LoadSkinProtoIcon(const char *szProto, int status, bool big = false);
-MIR_APP_DLL(HICON) LoadSkinIcon(int idx, bool big = false);
-MIR_APP_DLL(HANDLE) GetSkinIconHandle(int idx);
-
// event icons
#define SKINICON_EVENT_MESSAGE 100
#define SKINICON_EVENT_URL 101
@@ -114,10 +94,15 @@ MIR_APP_DLL(HANDLE) GetSkinIconHandle(int idx);
#define SKINICON_AUTH_GRANT 249
#define SKINICON_AUTH_REVOKE 250
-//menu icons are owned by the module that uses them so are not and should not
-//be skinnable. Except exit and show/hide
+/////////////////////////////////////////////////////////////////////////////////////////
+// Miranda skin
+// in all these functions idx = SKINICON_* constant
-//status mode icons. NOTE: These are deprecated in favour of LoadSkinnedProtoIcon()
+EXTERN_C MIR_APP_DLL(HICON) Skin_LoadIcon(int idx, bool big = false);
+EXTERN_C MIR_APP_DLL(HANDLE) Skin_GetIconHandle(int idx);
+EXTERN_C MIR_APP_DLL(char*) Skin_GetIconName(int idx);
+
+// status mode icons. NOTE: These are deprecated in favour of LoadSkinProtoIcon()
#define SKINICON_STATUS_OFFLINE 0
#define SKINICON_STATUS_ONLINE 1
#define SKINICON_STATUS_AWAY 2
@@ -129,23 +114,20 @@ MIR_APP_DLL(HANDLE) GetSkinIconHandle(int idx);
#define SKINICON_STATUS_ONTHEPHONE 8
#define SKINICON_STATUS_OUTTOLUNCH 9
-//Loads an icon representing the status mode for a particular protocol.
-//wParam = (WPARAM)(const char*)szProto
-//lParam = status
-//returns an hIcon for the new icon. Do *not* DestroyIcon() the return value
-//returns NULL on failure
-//if szProto is NULL the function will load the user's selected 'all protocols'
-//status icon.
-#define MS_SKIN_LOADPROTOICON "Skin/Icons/LoadProto"
-#define MS_SKIN_LOADPROTOICONBIG "Skin/Icons/LoadProtoBig"
-//nice function to wrap this:
-__forceinline HICON LoadSkinnedProtoIcon(const char *szProto, int status) {return (HICON)CallService(MS_SKIN_LOADPROTOICON, (WPARAM)szProto, status);}
-__forceinline HICON LoadSkinnedProtoIconBig(const char *szProto, int status) {return (HICON)CallService(MS_SKIN_LOADPROTOICONBIG, (WPARAM)szProto, status);}
-
-//add a new sound so it has a default and can be changed in the options dialog
-//wParam = hLangpack
-//lParam = (LPARAM)(SKINSOUNDDESC*)ssd;
-//returns 0 on success, nonzero otherwise
+/////////////////////////////////////////////////////////////////////////////////////////
+// Loads an icon representing the status mode for a particular protocol.
+// returns an hIcon for the new icon. Do *not* DestroyIcon() the return value
+// returns NULL on failure
+// if szProto is NULL the function will load the user's selected 'all protocols'
+// status icon.
+
+EXTERN_C MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big = false);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// add a new sound so it has a default and can be changed in the options dialog
+// wParam = hLangpack
+// lParam = (LPARAM)(SKINSOUNDDESC*)ssd;
+// returns 0 on success, nonzero otherwise
#define SSDF_UNICODE 0x0001
@@ -210,11 +192,13 @@ __forceinline INT_PTR Skin_AddSound(SKINSOUNDDESCEX *ssd)
return CallService("Skin/Sounds/AddNew", hLangpack, (LPARAM)ssd);
}
-//plays a named sound event
-//wParam = 0
-//lParam = (LPARAM)(const char*)pszName
-//pszName should have been added with Skin/Sounds/AddNew, but if not the
-//function will not fail, it will play the Windows default sound instead.
+/////////////////////////////////////////////////////////////////////////////////////////
+// plays a named sound event
+// wParam = 0
+// lParam = (LPARAM)(const char*)pszName
+// pszName should have been added with Skin/Sounds/AddNew, but if not the
+// function will not fail, it will play the Windows default sound instead.
+
#define MS_SKIN_PLAYSOUND "Skin/Sounds/Play"
__forceinline INT_PTR SkinPlaySound(const char *name)
@@ -222,9 +206,11 @@ __forceinline INT_PTR SkinPlaySound(const char *name)
return CallService(MS_SKIN_PLAYSOUND, 0, (LPARAM)name);
}
-//plays any sound file
-//wParam = 0
-//lParam = (LPARAM)(const TCHAR*)ptszFileName
+/////////////////////////////////////////////////////////////////////////////////////////
+// plays any sound file
+// wParam = 0
+// lParam = (LPARAM)(const TCHAR*)ptszFileName
+
#define MS_SKIN_PLAYSOUNDFILE "Skin/Sounds/PlayFile"
__forceinline INT_PTR SkinPlaySoundFile(const TCHAR *ptszFileName)
@@ -232,23 +218,20 @@ __forceinline INT_PTR SkinPlaySoundFile(const TCHAR *ptszFileName)
return CallService(MS_SKIN_PLAYSOUNDFILE, 0, (LPARAM)ptszFileName);
}
-//sent when the icons DLL has been changed in the options dialog, and everyone
-//should re-make their image lists
-//wParam = lParam = 0
+/////////////////////////////////////////////////////////////////////////////////////////
+// sent when the icons DLL has been changed in the options dialog, and everyone
+// should re-make their image lists
+// wParam = lParam = 0
+
#define ME_SKIN_ICONSCHANGED "Skin/IconsChanged"
+/////////////////////////////////////////////////////////////////////////////////////////
+// wParam: 0 when playing sound (1 when sound is being previewed)
+// lParam: (TCHAR*) pszSoundFile
+// Affect: This hook is fired when the sound module needs to play a sound
+// Note : This event has default processing, if no one HookEvent()'s this event then it will
+// use the default hook code, which uses PlaySound()
-/*
- wParam: 0 when playing sound (1 when sound is being previewed)
- lParam: (TCHAR*) pszSoundFile
- Affect: This hook is fired when the sound module needs to play a sound
- Note : This event has default processing, if no one HookEvent()'s this event then it will
- use the default hook code, which uses PlaySound()
- Version: 0.3.4a (2004/09/15)
-*/
#define ME_SKIN_PLAYINGSOUND "Skin/Sounds/Playing"
-//random ideas for the future:
-// Skin/LoadNetworkAnim - get some silly spinner thing when we want to be busy
-
#endif //M_SKIN_H__