diff options
| author | George Hazan <george.hazan@gmail.com> | 2015-09-29 12:47:03 +0000 | 
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2015-09-29 12:47:03 +0000 | 
| commit | 8235db586d12c56b18ebf4d1279c873b4fe7cac7 (patch) | |
| tree | 65dad18d6c198dd5699aaf4e212c29430aacfeaf | |
| parent | 22cc827dbc2eeba695f853a3960436931365b01b (diff) | |
- unused code removed;
- minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@15470 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
| -rw-r--r-- | plugins/Clist_modern/src/modern_commonprototypes.h | 1 | ||||
| -rw-r--r-- | plugins/Clist_modern/src/modern_skinbutton.cpp | 2 | ||||
| -rw-r--r-- | plugins/Clist_modern/src/modern_skinselector.cpp | 314 | ||||
| -rw-r--r-- | plugins/Clist_modern/src/modern_skinselector.h | 1 | 
4 files changed, 133 insertions, 185 deletions
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h index 790ce5c7c2..00e87952a3 100644 --- a/plugins/Clist_modern/src/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/modern_commonprototypes.h @@ -184,7 +184,6 @@ HRESULT BackgroundsLoadModule();  int     BackgroundsUnloadModule();
  INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);   //RowTemplate.c
  BOOL    FindMenuHanleByGlobalID(HMENU hMenu, int globalID, struct _MenuItemHandles * dat);   //GenMenu.c
 -BOOL    MatchMask(char *name, char *mask);                                    //mod_skin_selector.c
  char*   GetContactCachedProtocol(MCONTACT hContact);                                 //clistsettings.c
  char*   GetParamN(char *string, char *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces);  //mod_skin_selector.c
  WCHAR*  GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim, BOOL SkipSpaces);
 diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp index 8215b7e1fc..ad1facd9bc 100644 --- a/plugins/Clist_modern/src/modern_skinbutton.cpp +++ b/plugins/Clist_modern/src/modern_skinbutton.cpp @@ -35,7 +35,6 @@ This file contains code related to new modern free positioned skinned buttons  BOOL ModernSkinButtonModuleIsLoaded = FALSE;  static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);  int ModernSkinButtonUnloadModule(WPARAM wParam, LPARAM lParam); -int SkinSelector_DeleteMask(MODERNMASK *mm);  HWND SetToolTip(HWND hwnd, TCHAR * tip);  typedef struct _ModernSkinButtonCtrl @@ -164,7 +163,6 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)  		}  		SkinDrawGlyphMask(hdc, &rc, &rc, &Request);  		SkinSelector_DeleteMask(&Request); -		// DeleteObject(br);  	}  	if (!whdc && g_CluiData.fLayered) { diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp index a7921a1c4d..9eb678bc24 100644 --- a/plugins/Clist_modern/src/modern_skinselector.cpp +++ b/plugins/Clist_modern/src/modern_skinselector.cpp @@ -33,21 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  #include "modern_commonprototypes.h"
  /// IMPLEMENTATIONS
 -char* ModernMaskToString(MODERNMASK *mm, char * buf, UINT bufsize)
 -{
 -	for (int i = 0; i < (int)mm->dwParamCnt; i++) {
 -		if (mm->pl_Params[i].bMaskParamFlag) {
 -			if (i>0)
 -				mir_snprintf(buf, bufsize, "%s%%", buf);
 -			if (mm->pl_Params[i].bMaskParamFlag &MPF_DIFF)
 -				mir_snprintf(buf, bufsize, "%s = %s", mm->pl_Params[i].szName, mm->pl_Params[i].szValue);
 -			else
 -				mir_snprintf(buf, bufsize, "%s^%s", mm->pl_Params[i].szName, mm->pl_Params[i].szValue);
 -		}
 -		else break;
 -	}
 -	return buf;
 -}
 +
  int SkinSelector_DeleteMask(MODERNMASK *mm)
  {
  	if (!mm->pl_Params) return 0;
 @@ -59,29 +45,6 @@ int SkinSelector_DeleteMask(MODERNMASK *mm)  	return 1;
  }
 -BOOL MatchMask(char * name, char * mask)
 -{
 -	if (!mask || !name) return mask == name;
 -	if (*mask != '|') return wildcmpi(name, mask);
 -
 -	int s = 1, e = 1;
 -	char * temp;
 -	while (mask[e] != '\0') {
 -		s = e;
 -		while (mask[e] != '\0' && mask[e] != '|') e++;
 -		temp = (char*)malloc(e - s + 1);
 -		memcpy(temp, mask + s, e - s);
 -		temp[e - s] = '\0';
 -		if (wildcmpi(name, temp)) {
 -			free(temp);
 -			return TRUE;
 -		}
 -		free(temp);
 -		if (mask[e] != '\0') e++;
 -		else return FALSE;
 -	}
 -	return FALSE;
 -}
  #if __GNUC__
  #define NOINLINEASM
  #endif
 @@ -175,8 +138,7 @@ int ExchangeMasksByID(DWORD mID1, DWORD mID2, LISTMODERNMASK * mmTemplateList)  	if (mID2 >= mmTemplateList->dwMaskCnt) return 0;
  	if (mID1 == mID2) return 0;
  	{
 -		MODERNMASK mm;
 -		mm = mmTemplateList->pl_Masks[mID1];
 +		MODERNMASK mm = mmTemplateList->pl_Masks[mID1];
  		mmTemplateList->pl_Masks[mID1] = mmTemplateList->pl_Masks[mID2];
  		mmTemplateList->pl_Masks[mID2] = mm;
  	}
 @@ -206,10 +168,11 @@ enum  	EXCEPTION_NOT_EQUAL = 1,
  	EXCEPTION_WILD = 2,
  };
 -static BOOL _GetParamValue(char * szText, unsigned int& start, unsigned int length, char* ¶m, unsigned int& paramlen, char* &value, unsigned int& valuelen, int& except)
 +
 +static BOOL _GetParamValue(char *szText, unsigned int &start, unsigned int length, char* ¶m, unsigned int& paramlen, char* &value, unsigned int &valuelen, int &except)
  {
 -	char * curChar = szText + start;
 -	char * lastChar = szText + length;
 +	char *curChar = szText + start;
 +	char *lastChar = szText + length;
  	enum { STATE_PARAM, STATE_VALUE };
  	int state = STATE_PARAM;
 @@ -304,33 +267,30 @@ int ParseToModernMask(MODERNMASK *mm, char *szText)  	unsigned int textLen = (unsigned)mir_strlen(szText);
  	BYTE curParam = 0;
 -	MASKPARAM param = { 0 };
 -
  	unsigned int startPos = 0;
 -	char * pszParam;
 -	char * pszValue;
 +	char *pszParam;
 +	char *pszValue;
  	unsigned int paramlen;
  	unsigned int valuelen;
  	int except;
  	while (_GetParamValue(szText, startPos, textLen, pszParam, paramlen, pszValue, valuelen, except)) {
 +		MASKPARAM param = { 0 };
  		if (except & EXCEPTION_NOT_EQUAL)
  			param.bMaskParamFlag = MPF_NOT_EQUAL;
  		else
  			param.bMaskParamFlag = MPF_EQUAL;
 -		//Get param name
 +		// Get param name
  		if (pszParam && paramlen) {
  			param.szName = strdupn(pszParam, paramlen);
  			param.dwId = mod_CalcHash(param.szName);
  		}
 -		else //ParamName = 'Module'
 -		{
 +		else { // ParamName = 'Module'
  			param.szName = _strdup("Module");
  			param.dwId = mod_CalcHash(param.szName);
  		}
 -
  		param.szValue = strdupn(pszValue, valuelen);
  		if (!(except & EXCEPTION_WILD)) {
 @@ -341,9 +301,8 @@ int ParseToModernMask(MODERNMASK *mm, char *szText)  			mm->pl_Params = (MASKPARAM*)realloc(mm->pl_Params, (mm->dwParamCnt + 1)*sizeof(MASKPARAM));
  			mm->dwParamCnt++;
  		}
 -		memmove(&(mm->pl_Params[curParam]), ¶m, sizeof(MASKPARAM));
 +		mm->pl_Params[curParam] = param;
  		curParam++;
 -		memset(¶m, 0, sizeof(MASKPARAM));
  	}
  	return 0;
  };
 @@ -399,10 +358,12 @@ BOOL CompareStrWithModernMask(char *szValue, MODERNMASK *mmTemplate)  // AddingMask
  int AddStrModernMaskToList(DWORD maskID, char *szStr, char *objectName, LISTMODERNMASK *mmTemplateList)
  {
 -	if (!szStr || !mmTemplateList) return -1;
 +	if (!szStr || !mmTemplateList)
 +		return -1;
  	MODERNMASK mm = { 0 };
 -	if (ParseToModernMask(&mm, szStr)) return -1;
 +	if (ParseToModernMask(&mm, szStr))
 +		return -1;
  	mm.bObjectFound = FALSE;
  	mm.szObjectName = mir_strdup(objectName);
 @@ -411,7 +372,7 @@ int AddStrModernMaskToList(DWORD maskID, char *szStr, char *objectName, LISTMODE  	return AddModernMaskToList(&mm, mmTemplateList);
  }
 -SKINOBJECTDESCRIPTOR *skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK *mmTemplateList)
 +SKINOBJECTDESCRIPTOR* skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK *mmTemplateList)
  {
  	for (DWORD i = 0; i < mmTemplateList->dwMaskCnt; i++)
  		if (CompareModernMask(mm, &(mmTemplateList->pl_Masks[i])))
 @@ -420,16 +381,15 @@ SKINOBJECTDESCRIPTOR *skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK *mmTe  	return NULL;
  }
 -SKINOBJECTDESCRIPTOR *skin_FindObjectByRequest(char * szValue, LISTMODERNMASK *mmTemplateList)
 +SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mmTemplateList)
  {
 -	MODERNMASK mm = { 0 };
  	if (!mmTemplateList)
 -		if (g_SkinObjectList.pMaskList)
 -			mmTemplateList = g_SkinObjectList.pMaskList;
 -		else
 -			return NULL;
 +		mmTemplateList = g_SkinObjectList.pMaskList;
 -	if (!mmTemplateList) return NULL;
 +	if (!mmTemplateList)
 +		return NULL;
 +
 +	MODERNMASK mm = { 0 };
  	ParseToModernMask(&mm, szValue);
  	SKINOBJECTDESCRIPTOR *res = skin_FindObjectByMask(&mm, mmTemplateList);
  	SkinSelector_DeleteMask(&mm);
 @@ -460,7 +420,7 @@ WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim  		if (SkipSpaces) { //remove spaces
  			while (string[start] == ' ' && (int)start < mir_tstrlen(string))
  				start++;
 -			while (i>1 && string[i - 1] == ' ' && i > (int)start)
 +			while (i > 1 && string[i - 1] == ' ' && i > (int)start)
  				i--;
  		}
  		len = ((int)(i - start) < buflen) ? i - start : buflen;
 @@ -471,7 +431,7 @@ WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim  	return buf;
  }
 -char * GetParamN(char * string, char * buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
 +char* GetParamN(char *string, char *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
  {
  	size_t i = 0, start = 0, CurentCount = 0, len;
  	while (i < mir_strlen(string)) {
 @@ -486,7 +446,7 @@ char * GetParamN(char * string, char * buf, int buflen, BYTE paramN, char Delim,  		if (SkipSpaces) { //remove spaces
  			while (string[start] == ' ' && (int)start < mir_strlen(string))
  				start++;
 -			while (i>1 && string[i - 1] == ' ' && i > (int)start)
 +			while (i > 1 && string[i - 1] == ' ' && i > (int)start)
  				i--;
  		}
  		len = ((int)(i - start) < buflen) ? i - start + 1 : buflen;
 @@ -497,55 +457,53 @@ char * GetParamN(char * string, char * buf, int buflen, BYTE paramN, char Delim,  	return buf;
  }
 -//Parse DB string and add buttons
 +// Parse DB string and add buttons
  int RegisterButtonByParce(char * ObjectName, char * Params)
  {
  	char buf[255];
 -	int res;
  	GetParamN(Params, buf, _countof(buf), 0, ',', 0);
 -	// if (boolstrcmpi("Push",buf)
 -	{   //Push type
 -		char buf2[20] = { 0 };
 -		char pServiceName[255] = { 0 };
 -		char pStatusServiceName[255] = { 0 };
 -		int Left, Top, Right, Bottom;
 -		int MinWidth, MinHeight;
 -		char TL[9] = { 0 };
 -		TCHAR Hint[250] = { 0 };
 -		char Section[250] = { 0 };
 -		char Type[250] = { 0 };
 -
 -		DWORD alingnto;
 -		int a = ((int)!mir_strcmpi(buf, "Switch")) * 2;
 -
 -		GetParamN(Params, pServiceName, _countof(pServiceName), 1, ',', 0);
 -		// if (a) GetParamN(Params,pStatusServiceName, sizeof(pStatusServiceName),a+1,',',0);
 -		Left = atoi(GetParamN(Params, buf2, _countof(buf2), a + 2, ',', 0));
 -		Top = atoi(GetParamN(Params, buf2, _countof(buf2), a + 3, ',', 0));
 -		Right = atoi(GetParamN(Params, buf2, _countof(buf2), a + 4, ',', 0));
 -		Bottom = atoi(GetParamN(Params, buf2, _countof(buf2), a + 5, ',', 0));
 -		GetParamN(Params, TL, _countof(TL), a + 6, ',', 0);
 -
 -		MinWidth = atoi(GetParamN(Params, buf2, _countof(buf2), a + 7, ',', 0));
 -		MinHeight = atoi(GetParamN(Params, buf2, _countof(buf2), a + 8, ',', 0));
 -		GetParamNT(Params, Hint, _countof(Hint), a + 9, ',', 0);
 -		if (a) {
 -			GetParamN(Params, Section, _countof(Section), 2, ',', 0);
 -			GetParamN(Params, Type, _countof(Type), 3, ',', 0);
 -		}
 -		alingnto = ((TL[0] == 'R') ? SBF_ALIGN_TL_RIGHT : 0)
 -			+ ((TL[0] == 'C') ? SBF_ALIGN_TL_HCENTER : 0)
 -			+ ((TL[1] == 'B') ? SBF_ALIGN_TL_BOTTOM : 0)
 -			+ ((TL[1] == 'C') ? SBF_ALIGN_TL_VCENTER : 0)
 -			+ ((TL[2] == 'R') ? SBF_ALIGN_BR_RIGHT : 0)
 -			+ ((TL[2] == 'C') ? SBF_ALIGN_BR_HCENTER : 0)
 -			+ ((TL[3] == 'B') ? SBF_ALIGN_BR_BOTTOM : 0)
 -			+ ((TL[3] == 'C') ? SBF_ALIGN_BR_VCENTER : 0)
 -			+ ((TL[4] == 'I') ? SBF_CALL_ON_PRESS : 0);
 -		if (a) res = ModernSkinButton_AddButton(pcli->hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateTS(Hint), Section, Type, MinWidth, MinHeight);
 -		else res = ModernSkinButton_AddButton(pcli->hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateTS(Hint), NULL, NULL, MinWidth, MinHeight);
 +
 +	// Push type
 +	char buf2[20] = { 0 };
 +	char pServiceName[255] = { 0 };
 +	char pStatusServiceName[255] = { 0 };
 +	int Left, Top, Right, Bottom;
 +	int MinWidth, MinHeight;
 +	char TL[9] = { 0 };
 +	TCHAR Hint[250] = { 0 };
 +	char Section[250] = { 0 };
 +	char Type[250] = { 0 };
 +
 +	DWORD alingnto;
 +	int a = ((int)!mir_strcmpi(buf, "Switch")) * 2;
 +
 +	GetParamN(Params, pServiceName, _countof(pServiceName), 1, ',', 0);
 +	// if (a) GetParamN(Params,pStatusServiceName, sizeof(pStatusServiceName),a+1,',',0);
 +	Left = atoi(GetParamN(Params, buf2, _countof(buf2), a + 2, ',', 0));
 +	Top = atoi(GetParamN(Params, buf2, _countof(buf2), a + 3, ',', 0));
 +	Right = atoi(GetParamN(Params, buf2, _countof(buf2), a + 4, ',', 0));
 +	Bottom = atoi(GetParamN(Params, buf2, _countof(buf2), a + 5, ',', 0));
 +	GetParamN(Params, TL, _countof(TL), a + 6, ',', 0);
 +
 +	MinWidth = atoi(GetParamN(Params, buf2, _countof(buf2), a + 7, ',', 0));
 +	MinHeight = atoi(GetParamN(Params, buf2, _countof(buf2), a + 8, ',', 0));
 +	GetParamNT(Params, Hint, _countof(Hint), a + 9, ',', 0);
 +	if (a) {
 +		GetParamN(Params, Section, _countof(Section), 2, ',', 0);
 +		GetParamN(Params, Type, _countof(Type), 3, ',', 0);
  	}
 -	return res;
 +	alingnto = ((TL[0] == 'R') ? SBF_ALIGN_TL_RIGHT : 0)
 +		+ ((TL[0] == 'C') ? SBF_ALIGN_TL_HCENTER : 0)
 +		+ ((TL[1] == 'B') ? SBF_ALIGN_TL_BOTTOM : 0)
 +		+ ((TL[1] == 'C') ? SBF_ALIGN_TL_VCENTER : 0)
 +		+ ((TL[2] == 'R') ? SBF_ALIGN_BR_RIGHT : 0)
 +		+ ((TL[2] == 'C') ? SBF_ALIGN_BR_HCENTER : 0)
 +		+ ((TL[3] == 'B') ? SBF_ALIGN_BR_BOTTOM : 0)
 +		+ ((TL[3] == 'C') ? SBF_ALIGN_BR_VCENTER : 0)
 +		+ ((TL[4] == 'I') ? SBF_CALL_ON_PRESS : 0);
 +	if (a)
 +		return ModernSkinButton_AddButton(pcli->hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateTS(Hint), Section, Type, MinWidth, MinHeight);
 +	return ModernSkinButton_AddButton(pcli->hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateTS(Hint), NULL, NULL, MinWidth, MinHeight);
  }
  //Parse DB string and add object
 @@ -553,82 +511,76 @@ int RegisterButtonByParce(char * ObjectName, char * Params)  // Glyph,None
  // Glyph,Solid, < ColorR>, < ColorG>, < ColorB>, < Alpha>
  // Glyph,Image,Filename,(TileBoth|TileVert|TileHor|StretchBoth), < MarginLeft>, < MarginTop>, < MarginRight>, < MarginBottom>, < Alpha>
 -int RegisterObjectByParce(char * ObjectName, char * Params)
 +int RegisterObjectByParce(char *ObjectName, char *Params)
  {
  	if (!ObjectName || !Params) return 0;
 -	{
 -		SKINOBJECTDESCRIPTOR obj = { 0 };
 -		char buf[250];
 -		obj.szObjectID = mir_strdup(ObjectName);
 -		GetParamN(Params, buf, _countof(buf), 0, ',', 0);
 -		if (!mir_strcmpi(buf, "Glyph"))
 -			obj.bType = OT_GLYPHOBJECT;
 -		else if (!mir_strcmpi(buf, "Font"))
 -			obj.bType = OT_FONTOBJECT;
 -
 -		switch (obj.bType) {
 -		case OT_GLYPHOBJECT:
 -		{
 -			GLYPHOBJECT gl = { 0 };
 -			GetParamN(Params, buf, _countof(buf), 1, ',', 0);
 -			if (!mir_strcmpi(buf, "Solid")) {
 -				// Solid
 -				gl.Style = ST_BRUSH;
 -				int r = atoi(GetParamN(Params, buf, _countof(buf), 2, ',', 0));
 -				int g = atoi(GetParamN(Params, buf, _countof(buf), 3, ',', 0));
 -				int b = atoi(GetParamN(Params, buf, _countof(buf), 4, ',', 0));
 -				gl.dwAlpha = atoi(GetParamN(Params, buf, _countof(buf), 5, ',', 0));
 -				gl.dwColor = RGB(r, g, b);
 -			}
 -			else if (!mir_strcmpi(buf, "Image")) {
 -				// Image
 -				gl.Style = ST_IMAGE;
 -				gl.szFileName = mir_strdup(GetParamN(Params, buf, _countof(buf), 2, ',', 0));
 -				gl.dwLeft = atoi(GetParamN(Params, buf, _countof(buf), 4, ',', 0));
 -				gl.dwTop = atoi(GetParamN(Params, buf, _countof(buf), 5, ',', 0));
 -				gl.dwRight = atoi(GetParamN(Params, buf, _countof(buf), 6, ',', 0));
 -				gl.dwBottom = atoi(GetParamN(Params, buf, _countof(buf), 7, ',', 0));
 -				gl.dwAlpha = atoi(GetParamN(Params, buf, _countof(buf), 8, ',', 0));
 -				GetParamN(Params, buf, _countof(buf), 3, ',', 0);
 -				if (!mir_strcmpi(buf, "TileBoth")) gl.FitMode = FM_TILE_BOTH;
 -				else if (!mir_strcmpi(buf, "TileVert")) gl.FitMode = FM_TILE_VERT;
 -				else if (!mir_strcmpi(buf, "TileHorz")) gl.FitMode = FM_TILE_HORZ;
 -				else gl.FitMode = 0;
 -			}
 -			else if (!mir_strcmpi(buf, "Fragment")) {
 -				//Image
 -				gl.Style = ST_FRAGMENT;
 -				gl.szFileName = mir_strdup(GetParamN(Params, buf, _countof(buf), 2, ',', 0));
 -
 -				gl.clipArea.x = atoi(GetParamN(Params, buf, _countof(buf), 3, ',', 0));
 -				gl.clipArea.y = atoi(GetParamN(Params, buf, _countof(buf), 4, ',', 0));
 -				gl.szclipArea.cx = atoi(GetParamN(Params, buf, _countof(buf), 5, ',', 0));
 -				gl.szclipArea.cy = atoi(GetParamN(Params, buf, _countof(buf), 6, ',', 0));
 -
 -				gl.dwLeft = atoi(GetParamN(Params, buf, _countof(buf), 8, ',', 0));
 -				gl.dwTop = atoi(GetParamN(Params, buf, _countof(buf), 9, ',', 0));
 -				gl.dwRight = atoi(GetParamN(Params, buf, _countof(buf), 10, ',', 0));
 -				gl.dwBottom = atoi(GetParamN(Params, buf, _countof(buf), 11, ',', 0));
 -				gl.dwAlpha = atoi(GetParamN(Params, buf, _countof(buf), 12, ',', 0));
 -				GetParamN(Params, buf, _countof(buf), 7, ',', 0);
 -				if (!mir_strcmpi(buf, "TileBoth")) gl.FitMode = FM_TILE_BOTH;
 -				else if (!mir_strcmpi(buf, "TileVert")) gl.FitMode = FM_TILE_VERT;
 -				else if (!mir_strcmpi(buf, "TileHorz")) gl.FitMode = FM_TILE_HORZ;
 -				else gl.FitMode = 0;
 -			}
 -			else {
 -				//None
 -				gl.Style = ST_SKIP;
 -			}
 -			obj.Data = ≷
 -			int res = ske_AddDescriptorToSkinObjectList(&obj, NULL);
 -			mir_free_and_nil(obj.szObjectID);
 -			mir_free_and_nil(gl.szFileName);
 -			return res;
 +
 +	SKINOBJECTDESCRIPTOR obj = { 0 };
 +	char buf[250];
 +	obj.szObjectID = mir_strdup(ObjectName);
 +	GetParamN(Params, buf, _countof(buf), 0, ',', 0);
 +	if (!mir_strcmpi(buf, "Glyph"))
 +		obj.bType = OT_GLYPHOBJECT;
 +	else if (!mir_strcmpi(buf, "Font"))
 +		obj.bType = OT_FONTOBJECT;
 +
 +	if (obj.bType == OT_GLYPHOBJECT) {
 +		GLYPHOBJECT gl = { 0 };
 +		GetParamN(Params, buf, _countof(buf), 1, ',', 0);
 +		if (!mir_strcmpi(buf, "Solid")) {
 +			// Solid
 +			gl.Style = ST_BRUSH;
 +			int r = atoi(GetParamN(Params, buf, _countof(buf), 2, ',', 0));
 +			int g = atoi(GetParamN(Params, buf, _countof(buf), 3, ',', 0));
 +			int b = atoi(GetParamN(Params, buf, _countof(buf), 4, ',', 0));
 +			gl.dwAlpha = atoi(GetParamN(Params, buf, _countof(buf), 5, ',', 0));
 +			gl.dwColor = RGB(r, g, b);
  		}
 -		break;
 +		else if (!mir_strcmpi(buf, "Image")) {
 +			// Image
 +			gl.Style = ST_IMAGE;
 +			gl.szFileName = mir_strdup(GetParamN(Params, buf, _countof(buf), 2, ',', 0));
 +			gl.dwLeft = atoi(GetParamN(Params, buf, _countof(buf), 4, ',', 0));
 +			gl.dwTop = atoi(GetParamN(Params, buf, _countof(buf), 5, ',', 0));
 +			gl.dwRight = atoi(GetParamN(Params, buf, _countof(buf), 6, ',', 0));
 +			gl.dwBottom = atoi(GetParamN(Params, buf, _countof(buf), 7, ',', 0));
 +			gl.dwAlpha = atoi(GetParamN(Params, buf, _countof(buf), 8, ',', 0));
 +			GetParamN(Params, buf, _countof(buf), 3, ',', 0);
 +			if (!mir_strcmpi(buf, "TileBoth")) gl.FitMode = FM_TILE_BOTH;
 +			else if (!mir_strcmpi(buf, "TileVert")) gl.FitMode = FM_TILE_VERT;
 +			else if (!mir_strcmpi(buf, "TileHorz")) gl.FitMode = FM_TILE_HORZ;
 +			else gl.FitMode = 0;
  		}
 +		else if (!mir_strcmpi(buf, "Fragment")) {
 +			// Image
 +			gl.Style = ST_FRAGMENT;
 +			gl.szFileName = mir_strdup(GetParamN(Params, buf, _countof(buf), 2, ',', 0));
 +
 +			gl.clipArea.x = atoi(GetParamN(Params, buf, _countof(buf), 3, ',', 0));
 +			gl.clipArea.y = atoi(GetParamN(Params, buf, _countof(buf), 4, ',', 0));
 +			gl.szclipArea.cx = atoi(GetParamN(Params, buf, _countof(buf), 5, ',', 0));
 +			gl.szclipArea.cy = atoi(GetParamN(Params, buf, _countof(buf), 6, ',', 0));
 +
 +			gl.dwLeft = atoi(GetParamN(Params, buf, _countof(buf), 8, ',', 0));
 +			gl.dwTop = atoi(GetParamN(Params, buf, _countof(buf), 9, ',', 0));
 +			gl.dwRight = atoi(GetParamN(Params, buf, _countof(buf), 10, ',', 0));
 +			gl.dwBottom = atoi(GetParamN(Params, buf, _countof(buf), 11, ',', 0));
 +			gl.dwAlpha = atoi(GetParamN(Params, buf, _countof(buf), 12, ',', 0));
 +			GetParamN(Params, buf, _countof(buf), 7, ',', 0);
 +			if (!mir_strcmpi(buf, "TileBoth")) gl.FitMode = FM_TILE_BOTH;
 +			else if (!mir_strcmpi(buf, "TileVert")) gl.FitMode = FM_TILE_VERT;
 +			else if (!mir_strcmpi(buf, "TileHorz")) gl.FitMode = FM_TILE_HORZ;
 +			else gl.FitMode = 0;
 +		}
 +		else gl.Style = ST_SKIP; // None
 +
 +		obj.Data = ≷
 +		int res = ske_AddDescriptorToSkinObjectList(&obj, NULL);
 +		mir_free_and_nil(obj.szObjectID);
 +		mir_free_and_nil(gl.szFileName);
 +		return res;
  	}
 +
  	return 0;
  }
 diff --git a/plugins/Clist_modern/src/modern_skinselector.h b/plugins/Clist_modern/src/modern_skinselector.h index 51805a6ecf..36de4fdf02 100644 --- a/plugins/Clist_modern/src/modern_skinselector.h +++ b/plugins/Clist_modern/src/modern_skinselector.h @@ -78,7 +78,6 @@ BOOL CompareModernMask(MODERNMASK *mmValue, MODERNMASK *mmTemplate);  BOOL CompareStrWithModernMask(char * szValue, MODERNMASK *mmTemplate);
  MODERNMASK * FindMaskByStr(char * szValue, LISTMODERNMASK * mmTemplateList);
  DWORD mod_CalcHash(const char * a);
 -char * ModernMaskToString(MODERNMASK *mm, char *buf, UINT bufsize);
  int RegisterObjectByParce(char * ObjectName, char *Params);
  SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mmTemplateList);
  SKINOBJECTDESCRIPTOR* skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK *mmTemplateList);
  | 
