From a040f3a8dbcc17d8a3a50a9594b3226dce28788c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 28 Jan 2016 13:05:28 +0000 Subject: - local structure declarations moved to the global header; - structure definition optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@16178 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clistevents.cpp | 39 +++++++++------------- plugins/Clist_modern/src/modern_commonprototypes.h | 4 +-- 2 files changed, 17 insertions(+), 26 deletions(-) (limited to 'plugins/Clist_modern/src') diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 0b365ea153..6ea11cdc73 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -48,15 +48,6 @@ void EventArea_ConfigureEventArea(); HWND g_hwndEventArea = 0; -struct CListEvent { - int imlIconIndex; - int flashesDone; - CLISTEVENT cle; - - int menuId; - int imlIconOverlayIndex; -}; - static CListEvent *event; static int eventCount; static int disableTrayFlash; @@ -86,7 +77,7 @@ static CLISTEVENT* MyGetEvent(int iSelection) for (int i = 0; i < pcli->events.count; i++) { CListEvent *p = pcli->events.items[i]; if (p->menuId == iSelection) - return &p->cle; + return p; } return NULL; } @@ -104,31 +95,31 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) if (p == NULL) return NULL; - if (p->cle.hContact != 0 && p->cle.hDbEvent != 1 && !(p->cle.flags & CLEF_ONLYAFEW)) { + if (p->hContact != 0 && p->hDbEvent != 1 && !(p->flags & CLEF_ONLYAFEW)) { MENUITEMINFO mii = { 0 }; mii.cbSize = sizeof(mii); mii.fMask = MIIM_DATA | MIIM_BITMAP | MIIM_ID; - if (p->cle.pszService && - (!strncmp("SRMsg/ReadMessage", p->cle.pszService, _countof("SRMsg/ReadMessage")) || - !strncmp("GChat/DblClickEvent", p->cle.pszService, _countof("GChat/DblClickEvent")))) + if (p->pszService && + (!strncmp("SRMsg/ReadMessage", p->pszService, _countof("SRMsg/ReadMessage")) || + !strncmp("GChat/DblClickEvent", p->pszService, _countof("GChat/DblClickEvent")))) { // dup check only for msg events for (int j = 0; j < GetMenuItemCount(g_CluiData.hMenuNotify); j++) { if (GetMenuItemInfo(g_CluiData.hMenuNotify, j, TRUE, &mii) != 0) { NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData; - if (nmi != 0 && (HANDLE)nmi->hContact == (HANDLE)p->cle.hContact && nmi->iIcon == p->imlIconIndex) + if (nmi != 0 && (HANDLE)nmi->hContact == (HANDLE)p->hContact && nmi->iIcon == p->imlIconIndex) return p; } } } - char *szProto = GetContactProto(p->cle.hContact); - TCHAR *szName = pcli->pfnGetContactDisplayName(p->cle.hContact, 0); + char *szProto = GetContactProto(p->hContact); + TCHAR *szName = pcli->pfnGetContactDisplayName(p->hContact, 0); if (szProto && szName) { NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) malloc(sizeof(struct NotifyMenuItemExData)); if (nmi) { TCHAR szBuffer[128]; - TCHAR* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->cle.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0); + TCHAR* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0); TCHAR szwProto[64]; MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64); szwProto[63] = 0; @@ -136,10 +127,10 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) szBuffer[127] = 0; AppendMenu(g_CluiData.hMenuNotify, MF_BYCOMMAND | MF_STRING, g_CluiData.wNextMenuID, szBuffer); mii.hbmpItem = HBMMENU_CALLBACK; - nmi->hContact = p->cle.hContact; + nmi->hContact = p->hContact; nmi->iIcon = p->imlIconIndex; - nmi->hIcon = p->cle.hIcon; - nmi->hDbEvent = p->cle.hDbEvent; + nmi->hIcon = p->hIcon; + nmi->hDbEvent = p->hDbEvent; mii.dwItemData = (ULONG_PTR)nmi; mii.wID = g_CluiData.wNextMenuID; SetMenuItemInfo(g_CluiData.hMenuNotify, g_CluiData.wNextMenuID, FALSE, &mii); @@ -151,9 +142,9 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) } } } - else if (p->cle.hContact != 0 && (p->cle.flags & CLEF_ONLYAFEW)) { + else if (p->hContact != 0 && (p->flags & CLEF_ONLYAFEW)) { g_CluiData.iIconNotify = p->imlIconIndex; - g_CluiData.hUpdateContact = p->cle.hContact; + g_CluiData.hUpdateContact = p->hContact; } if (pcli->events.count > 0) { @@ -174,7 +165,7 @@ int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) // Find the event that should be removed int i; for (i = 0; i < pcli->events.count; i++) - if ((pcli->events.items[i]->cle.hContact == hContact) && (pcli->events.items[i]->cle.hDbEvent == hDbEvent)) + if ((pcli->events.items[i]->hContact == hContact) && (pcli->events.items[i]->hDbEvent == hDbEvent)) break; // Event was not found diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h index 00e87952a3..4e7833944c 100644 --- a/plugins/Clist_modern/src/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/modern_commonprototypes.h @@ -270,8 +270,8 @@ TCHAR* cli_GetGroupCountsText(ClcData *dat, ClcContact *contact); void cli_ChangeContactIcon(MCONTACT hContact, int iIcon, int add); void cli_SetContactCheckboxes(ClcContact*, int); LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam); -struct CListEvent* cliCreateEvent(void); -struct CListEvent* cli_AddEvent(CLISTEVENT *cle); +CListEvent* cliCreateEvent(void); +CListEvent* cli_AddEvent(CLISTEVENT *cle); LRESULT CALLBACK cli_ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); int cliShowHide(WPARAM wParam, LPARAM lParam); BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect, BOOL bErase); -- cgit v1.2.3