diff options
Diffstat (limited to 'plugins/NewStory/src')
-rw-r--r-- | plugins/NewStory/src/calendartool.cpp | 18 | ||||
-rw-r--r-- | plugins/NewStory/src/fonts.cpp | 18 | ||||
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 26 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 26 | ||||
-rw-r--r-- | plugins/NewStory/src/history_dlg.cpp | 217 | ||||
-rw-r--r-- | plugins/NewStory/src/history_log.cpp | 27 | ||||
-rw-r--r-- | plugins/NewStory/src/history_menus.cpp | 24 | ||||
-rw-r--r-- | plugins/NewStory/src/history_svc.cpp | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/main.cpp | 80 | ||||
-rw-r--r-- | plugins/NewStory/src/options.cpp | 28 | ||||
-rw-r--r-- | plugins/NewStory/src/quicklist.h | 34 | ||||
-rw-r--r-- | plugins/NewStory/src/stdafx.cxx | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/stdafx.h | 23 | ||||
-rw-r--r-- | plugins/NewStory/src/templates.cpp | 18 | ||||
-rw-r--r-- | plugins/NewStory/src/utils.cpp | 18 | ||||
-rw-r--r-- | plugins/NewStory/src/version.h | 2 |
16 files changed, 354 insertions, 207 deletions
diff --git a/plugins/NewStory/src/calendartool.cpp b/plugins/NewStory/src/calendartool.cpp index 79461ebbbe..7349cad35f 100644 --- a/plugins/NewStory/src/calendartool.cpp +++ b/plugins/NewStory/src/calendartool.cpp @@ -1,3 +1,21 @@ +/* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + #include "stdafx.h" INT_PTR CALLBACK CalendarToolDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) diff --git a/plugins/NewStory/src/fonts.cpp b/plugins/NewStory/src/fonts.cpp index 0180ab6251..f7e32c1ef9 100644 --- a/plugins/NewStory/src/fonts.cpp +++ b/plugins/NewStory/src/fonts.cpp @@ -1,3 +1,21 @@ +/* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + #include "stdafx.h" MyColourID g_colorTable[COLOR_COUNT] = diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 238bd3b36d..efd3fe9267 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -1,3 +1,21 @@ +/* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + #include "stdafx.h" extern HANDLE htuLog; @@ -153,7 +171,7 @@ bool ItemData::isLink(POINT pt, CMStringW *pwszUrl) const int cp = MTextSendMessage(0, data, EM_CHARFROMPOS, 0, LPARAM(&pt)); if (cp == -1) return false; - + if (!isLinkChar(cp)) return false; @@ -161,7 +179,7 @@ bool ItemData::isLink(POINT pt, CMStringW *pwszUrl) const CHARRANGE sel = { cp, cp }; while (isLinkChar(sel.cpMin-1)) sel.cpMin--; - + while (isLinkChar(sel.cpMax)) sel.cpMax++; @@ -288,7 +306,7 @@ void ItemData::load(bool bFullLoad) db_event_markRead(hContact, hEvent); Clist_RemoveEvent(-1, hEvent); } - + // uncomment this to use RTF engine // m_bRtf = true; __fallthrough; @@ -532,7 +550,7 @@ int HistoryArray::find(int id, int dir, const Filter &filter) for (int i = id + dir; i >= 0 && i < count; i += dir) if (filter.check(get(i))) return i; - + return -1; } diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 4ece082244..1e3cf1cd89 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -1,3 +1,21 @@ +/* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + #include "stdafx.h" #define AVERAGE_ITEM_HEIGHT 100 @@ -51,12 +69,12 @@ void NewstoryListData::OnContextMenu(int index, POINT pt) ItemData *item = LoadItem(index); if (item == nullptr) return; - + HMENU hMenu = NSMenu_Build(this, item); if (pMsgDlg != nullptr && pMsgDlg->isChat()) Chat_CreateMenu(hMenu, pMsgDlg->getChat(), nullptr); - + TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, m_hwnd, nullptr); Menu_DestroyNestedMenu(hMenu); } @@ -147,7 +165,7 @@ bool NewstoryListData::AtTop(void) const if (scrollTopItem == 0 && scrollTopPixel == 0) return true; - + return false; } @@ -443,7 +461,7 @@ int NewstoryListData::GetItemFromPixel(int yPos) { if (!totalCount) return -1; - + RECT rc; GetClientRect(m_hwnd, &rc); diff --git a/plugins/NewStory/src/history_dlg.cpp b/plugins/NewStory/src/history_dlg.cpp index 27ab1c9f72..c9f8a06a10 100644 --- a/plugins/NewStory/src/history_dlg.cpp +++ b/plugins/NewStory/src/history_dlg.cpp @@ -1,8 +1,20 @@ -//////////////////////////////////////////////////////////////////////// -// NewStory -- new history viewer for Miranda IM -// (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) -// Visit http://miranda-im.org/ for details on Miranda Instant Messenger -//////////////////////////////////////////////////////////////////////// +/* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ #include "stdafx.h" @@ -60,7 +72,7 @@ void LayoutFilterBar(HDWP hDwp, int x, int y, int w, InfoBarEvents *ib) x + 32 + WND_SPACING, y + (16 + WND_SPACING) * 2, w - WND_SPACING - 32, 16, SWP_NOZORDER); } -static const char* pSettings[] = +static const char *pSettings[] = { LPGEN("FirstName"), LPGEN("LastName"), @@ -377,7 +389,7 @@ public: m_toolbar.push_back(Button(btnOptions, Button::RIGHT)); m_timeTree.OnSelChanged = Callback(this, &CHistoryDlg::onSelChanged_TimeTree); - + edtSearchText.OnChange = Callback(this, &CHistoryDlg::onChange_SearchText); splitTime.OnChange = Callback(this, &CHistoryDlg::onChange_Splitter); @@ -402,11 +414,11 @@ public: CheckMenuItem(hMenu, ID_FILTER_INCOMING, (showFlags & HIST_SHOW_IN) ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu, ID_FILTER_OUTGOING, (showFlags & HIST_SHOW_OUT) ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu, ID_FILTER_MESSAGES, (showFlags & HIST_SHOW_MSGS) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, ID_FILTER_FILES, (showFlags & HIST_SHOW_FILES) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, ID_FILTER_URLS, (showFlags & HIST_SHOW_URLS) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, ID_FILTER_STATUS, (showFlags & HIST_SHOW_STATUS) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, ID_FILTER_OTHER, (showFlags & HIST_SHOW_OTHER) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hMenu, ID_FILTER_AUTO, (showFlags & HIST_AUTO_FILTER) ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hMenu, ID_FILTER_FILES, (showFlags & HIST_SHOW_FILES) ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hMenu, ID_FILTER_URLS, (showFlags & HIST_SHOW_URLS) ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hMenu, ID_FILTER_STATUS, (showFlags & HIST_SHOW_STATUS) ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hMenu, ID_FILTER_OTHER, (showFlags & HIST_SHOW_OTHER) ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hMenu, ID_FILTER_AUTO, (showFlags & HIST_AUTO_FILTER) ? MF_CHECKED : MF_UNCHECKED); } bool OnInitDialog() override @@ -449,7 +461,7 @@ public: ibFiles.hwndTxtIn = GetDlgItem(m_hwnd, IDC_TXT_FILES_IN); ibFiles.hwndIcoOut = GetDlgItem(m_hwnd, IDC_ICO_FILES_OUT); - SendMessage(ibFiles.hwndIcoOut, BUTTONSETASFLATBTN, 0, 0); + SendMessage(ibFiles.hwndIcoOut, BUTTONSETASFLATBTN, 0, 0); SendMessage(ibFiles.hwndIcoOut, BUTTONSETASPUSHBTN, 0, 0); SendMessage(ibFiles.hwndIcoOut, BM_SETCHECK, BST_CHECKED, 0); ibFiles.hwndTxtOut = GetDlgItem(m_hwnd, IDC_TXT_FILES_OUT); @@ -518,15 +530,15 @@ public: SendMessage(ibMessages.hwndIco, STM_SETICON, (LPARAM)g_plugin.getIcon(IDI_SENDMSG), 0); SendMessage(ibMessages.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGIN)); SendMessage(ibMessages.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGOUT)); - + SendMessage(ibFiles.hwndIco, STM_SETICON, (LPARAM)Skin_LoadIcon(SKINICON_EVENT_FILE), 0); SendMessage(ibFiles.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGIN)); SendMessage(ibFiles.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGOUT)); - + SendMessage(ibUrls.hwndIco, STM_SETICON, (LPARAM)Skin_LoadIcon(SKINICON_EVENT_URL), 0); SendMessage(ibUrls.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGIN)); SendMessage(ibUrls.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGOUT)); - + SendMessage(ibTotal.hwndIco, STM_SETICON, (LPARAM)g_plugin.getIcon(IDI_UNKNOWN), 0); SendMessage(ibTotal.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGIN)); SendMessage(ibTotal.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGOUT)); @@ -549,7 +561,7 @@ public: SetWindowTextW(m_hwndStatus, TranslateT("Passed the end of history")); else SetWindowTextW(m_hwndStatus, L""); - + return false; } @@ -678,8 +690,8 @@ public: hDwp = DeferWindowPos(hDwp, splitTime.GetHwnd(), 0, hTimeTree, iClientTop, WND_SPACING, iClientBottom, SWP_NOZORDER | SWP_NOACTIVATE); } - hDwp = DeferWindowPos(hDwp, m_histWindow.GetHwnd(), 0, - WND_SPACING + hTimeTree, iClientTop, + hDwp = DeferWindowPos(hDwp, m_histWindow.GetHwnd(), 0, + WND_SPACING + hTimeTree, iClientTop, w - WND_SPACING * 2 - hTimeTree, iClientBottom, SWP_NOZORDER | SWP_NOACTIVATE); @@ -697,10 +709,10 @@ public: g_plugin.setWord(0, "showFlags", showFlags); g_plugin.setDword(0, "dwOptions", m_dwOptions); - + Window_FreeIcon_IcoLib(m_hwnd); WindowList_Remove(g_hNewstoryWindows, m_hwnd); - + if (m_hwndStatus != nullptr) { DestroyWindow(m_hwndStatus); m_hwndStatus = nullptr; @@ -729,7 +741,7 @@ public: TimeTreeBuild(); } - void onClick_TimeTree(CCtrlButton*) + void onClick_TimeTree(CCtrlButton *) { if (m_dwOptions & WND_OPT_TIMETREE) m_dwOptions &= ~WND_OPT_TIMETREE; @@ -764,11 +776,11 @@ public: MessageBox(m_hwnd, MessageText, TranslateT("Export warning"), MB_OK | MB_ICONWARNING); return; } - - char* szProto = Proto_GetBaseAccountName(m_hContact); + + char *szProto = Proto_GetBaseAccountName(m_hContact); ptrW id(Contact::GetInfo(CNF_UNIQUEID, m_hContact, szProto)); ptrW nick(Contact::GetInfo(CNF_DISPLAY, m_hContact, szProto)); - const char* uid = Proto_GetUniqueId(szProto); + const char *uid = Proto_GetUniqueId(szProto); OPENFILENAME ofn = { 0 }; ofn.lStructSize = sizeof(ofn); @@ -806,13 +818,13 @@ public: if (id != NULL) pInfo.push_back(JSONNode(uid, T2Utf(id).get())); - for (auto& it : pSettings) { + for (auto &it : pSettings) { wchar_t *szValue = db_get_wsa(m_hContact, szProto, it); if (szValue) pInfo.push_back(JSONNode(it, T2Utf(szValue).get())); mir_free(szValue); } - + pRoot.push_back(pInfo); pHist.set_name("history"); @@ -909,13 +921,13 @@ public: { RECT rc; GetWindowRect(pButton->GetHwnd(), &rc); - + HMENU hMenu = Menu_BuildContactMenu(m_hContact); TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, m_hwnd, NULL); DestroyMenu(hMenu); } - void onChange_SearchText(CCtrlEdit*) + void onChange_SearchText(CCtrlEdit *) { m_bSearchChanged = true; @@ -924,7 +936,7 @@ public: PostMessage(m_hwnd, UM_REBUILDLIST, 0, 0); } - void onChange_Splitter(CSplitter*) + void onChange_Splitter(CSplitter *) { m_iSplitter = splitTime.GetPos(); } @@ -965,77 +977,77 @@ public: return TRUE; break; - /* - GetWindowRect(GetDlgItem(m_hwnd, LOWORD(wParam)), &rc); - // uint32_t itemID = 0; - bool doFilter = true; - switch (TrackPopupMenu(GetSubMenu(hMenu, 1), TPM_RETURNCMD, rc.left, rc.bottom, 0, m_hwnd, NULL)) + /* + GetWindowRect(GetDlgItem(m_hwnd, LOWORD(wParam)), &rc); +// uint32_t itemID = 0; + bool doFilter = true; + switch (TrackPopupMenu(GetSubMenu(hMenu, 1), TPM_RETURNCMD, rc.left, rc.bottom, 0, m_hwnd, NULL)) + { + case ID_FILTER_INCOMING: + { + showFlags = toggleBit(showFlags, HIST_SHOW_IN); + CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_INCOMING, + showFlags&HIST_SHOW_IN ? MF_CHECKED : MF_UNCHECKED); + break; + } + case ID_FILTER_OUTGOING: + { + showFlags = toggleBit(showFlags, HIST_SHOW_OUT); + CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_OUTGOING, + showFlags&HIST_SHOW_OUT ? MF_CHECKED : MF_UNCHECKED); + break; + } + case ID_FILTER_MESSAGES: { - case ID_FILTER_INCOMING: - { - showFlags = toggleBit(showFlags, HIST_SHOW_IN); - CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_INCOMING, - showFlags&HIST_SHOW_IN ? MF_CHECKED : MF_UNCHECKED); - break; - } - case ID_FILTER_OUTGOING: - { - showFlags = toggleBit(showFlags, HIST_SHOW_OUT); - CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_OUTGOING, - showFlags&HIST_SHOW_OUT ? MF_CHECKED : MF_UNCHECKED); - break; - } - case ID_FILTER_MESSAGES: - { - showFlags = toggleBit(showFlags, HIST_SHOW_MSGS); - CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_MESSAGES, - showFlags&HIST_SHOW_MSGS ? MF_CHECKED : MF_UNCHECKED); - break; - } - case ID_FILTER_FILES: - { - showFlags = toggleBit(showFlags, HIST_SHOW_FILES); - CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_FILES, - showFlags&HIST_SHOW_FILES ? MF_CHECKED : MF_UNCHECKED); - break; - } - case ID_FILTER_URLS: - { - showFlags = toggleBit(showFlags, HIST_SHOW_URLS); - CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_URLS, - showFlags&HIST_SHOW_URLS ? MF_CHECKED : MF_UNCHECKED); - break; - } - case ID_FILTER_STATUS: - { - showFlags = toggleBit(showFlags, HIST_SHOW_STATUS); - CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_STATUS, - showFlags&HIST_SHOW_STATUS ? MF_CHECKED : MF_UNCHECKED); - break; - } - case ID_FILTER_OTHER: - { - showFlags = toggleBit(showFlags, HIST_SHOW_OTHER); - CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_OTHER, - showFlags&HIST_SHOW_OTHER ? MF_CHECKED : MF_UNCHECKED); - break; - } - case ID_FILTER_AUTO: - { - showFlags = toggleBit(showFlags, HIST_AUTO_FILTER); - CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_AUTO, - showFlags&HIST_AUTO_FILTER ? MF_CHECKED : MF_UNCHECKED); - break; - } - default: - { - doFilter = false; - break; - } + showFlags = toggleBit(showFlags, HIST_SHOW_MSGS); + CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_MESSAGES, + showFlags&HIST_SHOW_MSGS ? MF_CHECKED : MF_UNCHECKED); + break; } - if (doFilter) - PostMessage(m_hwnd, UM_REBUILDLIST, 0, 0); - break;*/ + case ID_FILTER_FILES: + { + showFlags = toggleBit(showFlags, HIST_SHOW_FILES); + CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_FILES, + showFlags&HIST_SHOW_FILES ? MF_CHECKED : MF_UNCHECKED); + break; + } + case ID_FILTER_URLS: + { + showFlags = toggleBit(showFlags, HIST_SHOW_URLS); + CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_URLS, + showFlags&HIST_SHOW_URLS ? MF_CHECKED : MF_UNCHECKED); + break; + } + case ID_FILTER_STATUS: + { + showFlags = toggleBit(showFlags, HIST_SHOW_STATUS); + CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_STATUS, + showFlags&HIST_SHOW_STATUS ? MF_CHECKED : MF_UNCHECKED); + break; + } + case ID_FILTER_OTHER: + { + showFlags = toggleBit(showFlags, HIST_SHOW_OTHER); + CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_OTHER, + showFlags&HIST_SHOW_OTHER ? MF_CHECKED : MF_UNCHECKED); + break; + } + case ID_FILTER_AUTO: + { + showFlags = toggleBit(showFlags, HIST_AUTO_FILTER); + CheckMenuItem(GetSubMenu(hMenu, 1), ID_FILTER_AUTO, + showFlags&HIST_AUTO_FILTER ? MF_CHECKED : MF_UNCHECKED); + break; + } + default: + { + doFilter = false; + break; + } + } + if (doFilter) + PostMessage(m_hwnd, UM_REBUILDLIST, 0, 0); + break;*/ case WM_USER + 0x600: if (wParam) @@ -1047,7 +1059,7 @@ public: void onSelChanged_TimeTree(CCtrlTreeView::TEventInfo *) { - wchar_t* val1, *val2, *val3; + wchar_t *val1, *val2, *val3; int yearsel = 0, monthsel = 0, daysel = 1; bool monthfound = false; if (disableTimeTreeChange) @@ -1059,7 +1071,7 @@ public: tvi.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_PARAM; tvi.cchTextMax = MAX_PATH; tvi.lParam = 0; - tvi.pszText = (wchar_t*)_alloca(MAX_PATH * sizeof(wchar_t)); + tvi.pszText = (wchar_t *)_alloca(MAX_PATH * sizeof(wchar_t)); m_timeTree.GetItem(&tvi); val1 = tvi.pszText; @@ -1080,7 +1092,8 @@ public: if (tvi.lParam) { monthsel = tvi.lParam; monthfound = true; - } else + } + else yearsel = _wtoi(val2); HTREEITEM hti3 = m_timeTree.GetParent(hti2); if (hti3) { diff --git a/plugins/NewStory/src/history_log.cpp b/plugins/NewStory/src/history_log.cpp index 573c47ac57..31ed9d9655 100644 --- a/plugins/NewStory/src/history_log.cpp +++ b/plugins/NewStory/src/history_log.cpp @@ -1,3 +1,21 @@ +/* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + #include "stdafx.h" class CNewStoryLogWindow : public CSimpleLogWindow @@ -8,15 +26,14 @@ class CNewStoryLogWindow : public CSimpleLogWindow public: CNewStoryLogWindow(CMsgDialog &pDlg) : CSimpleLogWindow(pDlg) - { - } + {} void Attach() override { RECT rc; GetClientRect(GetDlgItem(m_pDlg.GetHwnd(), IDC_SRMM_LOG), &rc); - m_hwnd = ::CreateWindowW(_T(NEWSTORYLIST_CLASS), L"NewStory", WS_VISIBLE | WS_CHILD | WS_TABSTOP, + m_hwnd = ::CreateWindowW(_T(NEWSTORYLIST_CLASS), L"NewStory", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, rc.left - rc.right, rc.bottom - rc.top, m_pDlg.GetHwnd(), 0, m_pDlg.GetInst(), 0); m_histCtrl = (NewstoryListData *)GetWindowLongPtr(m_hwnd, 0); @@ -45,7 +62,7 @@ public: return m_hwnd; } - wchar_t* GetSelection() override + wchar_t *GetSelection() override { return nullptr; } @@ -90,7 +107,7 @@ public: } }; -CSrmmLogWindow* __cdecl NewStory_Stub(CMsgDialog &pDlg) +CSrmmLogWindow *__cdecl NewStory_Stub(CMsgDialog &pDlg) { return new CNewStoryLogWindow(pDlg); } diff --git a/plugins/NewStory/src/history_menus.cpp b/plugins/NewStory/src/history_menus.cpp index c03c8587f3..71bdb16ce8 100644 --- a/plugins/NewStory/src/history_menus.cpp +++ b/plugins/NewStory/src/history_menus.cpp @@ -1,3 +1,21 @@ +/* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + #include "stdafx.h" enum @@ -26,7 +44,7 @@ HMENU NSMenu_Build(NewstoryListData *data, ItemData *item) } Menu_ShowItem(hmiQuote, data->pMsgDlg != nullptr); - + bool bShowEventActions = item->hEvent != 0; Menu_ShowItem(hmiEdit, bShowEventActions); Menu_ShowItem(hmiDelete, bShowEventActions); @@ -56,7 +74,7 @@ bool NSMenu_Process(int iCommand, NewstoryListData *data) static INT_PTR NSMenuHelper(WPARAM wParam, LPARAM lParam) { auto *pData = (NewstoryListData *)lParam; - + switch (wParam) { case MENU_COPY: pData->Copy(false); @@ -94,7 +112,7 @@ static INT_PTR NSMenuHelper(WPARAM wParam, LPARAM lParam) pData->ToggleBookmark(); break; } - + return 0; } diff --git a/plugins/NewStory/src/history_svc.cpp b/plugins/NewStory/src/history_svc.cpp index 6ddaae2add..0ba3cbf426 100644 --- a/plugins/NewStory/src/history_svc.cpp +++ b/plugins/NewStory/src/history_svc.cpp @@ -1,4 +1,5 @@ /* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) This program is free software; you can redistribute it and/or diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp index d877250f28..f274e2d246 100644 --- a/plugins/NewStory/src/main.cpp +++ b/plugins/NewStory/src/main.cpp @@ -1,13 +1,20 @@ -//////////////////////////////////////////////////////////////////////// -// NewStory -- new history viewer for Miranda IM -// (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) -// Visit http://miranda-im.org/ for details on Miranda Instant Messenger -//////////////////////////////////////////////////////////////////////// -// File: main.cpp -// Created by: Victor Pavlychko -// Description: -// Main module. Responsible for startup/cleanup and Miranda bindings -//////////////////////////////////////////////////////////////////////// +/* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ #include "stdafx.h" @@ -38,8 +45,7 @@ CMPlugin::CMPlugin() : PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx), bOptVScroll(MODULENAME, "VScroll", true), bSortAscending(MODULENAME, "SortAscending", true) -{ -} +{} ///////////////////////////////////////////////////////////////////////////////////////// @@ -49,31 +55,31 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_UIHIST static IconItem icons[] = { - { LPGEN("Main icon"), "main", IDI_NEWSTORY }, - { LPGEN("User info"), "userinfo", IDI_USERINFO }, - { LPGEN("User menu"), "usermenu", IDI_USERMENU }, - { LPGEN("Search"), "search", IDI_SEARCH }, - { LPGEN("Options"), "options", IDI_OPTIONS }, - { LPGEN("Filter"), "filter", IDI_FILTER }, - { LPGEN("Export"), "export", IDI_EXPORT }, - { LPGEN("Copy"), "copy", IDI_COPY }, - { LPGEN("Bookmark"), "bookmark", IDI_BOOKMARK }, - { LPGEN("Send message"), "message", IDI_SENDMSG }, - - { LPGEN("Incoming message"), "msgin", IDI_MSGIN }, - { LPGEN("Outgoing message"), "msgout", IDI_MSGOUT }, - { LPGEN("User signed in"), "signin", IDI_SIGNIN }, - { LPGEN("Unknown event"), "unknown", IDI_UNKNOWN }, - - { LPGEN("Find previous"), "findprev", IDI_FINDPREV }, - { LPGEN("Find next"), "findnext", IDI_FINDNEXT }, - { LPGEN("Jump to date"), "calendar", IDI_CALENDAR }, - { LPGEN("Conversations"), "timetree", IDI_TIMETREE }, - - { LPGEN("Template group"), "tplgroup", IDI_TPLGROUP }, - { LPGEN("Cancel edit"), "reset", IDI_RESET }, - { LPGEN("Update preview"), "preview", IDI_PREVIEW }, - { LPGEN("Help"), "varhelp", IDI_VARHELP } + { LPGEN("Main icon"), "main", IDI_NEWSTORY }, + { LPGEN("User info"), "userinfo", IDI_USERINFO }, + { LPGEN("User menu"), "usermenu", IDI_USERMENU }, + { LPGEN("Search"), "search", IDI_SEARCH }, + { LPGEN("Options"), "options", IDI_OPTIONS }, + { LPGEN("Filter"), "filter", IDI_FILTER }, + { LPGEN("Export"), "export", IDI_EXPORT }, + { LPGEN("Copy"), "copy", IDI_COPY }, + { LPGEN("Bookmark"), "bookmark", IDI_BOOKMARK }, + { LPGEN("Send message"), "message", IDI_SENDMSG }, + + { LPGEN("Incoming message"), "msgin", IDI_MSGIN }, + { LPGEN("Outgoing message"), "msgout", IDI_MSGOUT }, + { LPGEN("User signed in"), "signin", IDI_SIGNIN }, + { LPGEN("Unknown event"), "unknown", IDI_UNKNOWN }, + + { LPGEN("Find previous"), "findprev", IDI_FINDPREV }, + { LPGEN("Find next"), "findnext", IDI_FINDNEXT }, + { LPGEN("Jump to date"), "calendar", IDI_CALENDAR }, + { LPGEN("Conversations"), "timetree", IDI_TIMETREE }, + + { LPGEN("Template group"), "tplgroup", IDI_TPLGROUP }, + { LPGEN("Cancel edit"), "reset", IDI_RESET }, + { LPGEN("Update preview"), "preview", IDI_PREVIEW }, + { LPGEN("Help"), "varhelp", IDI_VARHELP } }; static int SmartSendEvent(int iEvent, MCONTACT hContact, LPARAM lParam) diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp index 1b59265315..2d5f355e1b 100644 --- a/plugins/NewStory/src/options.cpp +++ b/plugins/NewStory/src/options.cpp @@ -1,3 +1,21 @@ +/* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + #include "stdafx.h" ///////////////////////////////////////////////////////////////////////////////////////// @@ -56,7 +74,7 @@ class CTemplateOptsDlg : public CBaseOptsDlg MEVENT m_hDbEVent; TemplateInfo *m_curr = 0; - void UpdatePreview(CCtrlButton*) + void UpdatePreview(CCtrlButton *) { replaceStrW(m_curr->tmpValue, m_edit.GetText()); @@ -64,8 +82,8 @@ class CTemplateOptsDlg : public CBaseOptsDlg item.hContact = m_hContact; item.hEvent = m_hDbEVent; item.load(true); - - CMStringW wszText(TplFormatStringEx(int(m_curr-templates), m_curr->tmpValue, &item)); + + CMStringW wszText(TplFormatStringEx(int(m_curr - templates), m_curr->tmpValue, &item)); preview.SetText(wszText); gpreview.SetText(wszText); } @@ -204,7 +222,7 @@ public: UpdatePreview(0); } - void onVarHelp(CCtrlButton*) + void onVarHelp(CCtrlButton *) { CMStringW wszVarHelp; wszVarHelp.Format(L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s", @@ -262,7 +280,7 @@ public: if (m_curr != nullptr) replaceStrW(m_curr->tmpValue, m_edit.GetText()); - m_curr = (TemplateInfo*)tvi.lParam; + m_curr = (TemplateInfo *)tvi.lParam; if (m_curr->tmpValue) m_edit.SetText(m_curr->tmpValue); diff --git a/plugins/NewStory/src/quicklist.h b/plugins/NewStory/src/quicklist.h deleted file mode 100644 index 3c5b44a78f..0000000000 --- a/plugins/NewStory/src/quicklist.h +++ /dev/null @@ -1,34 +0,0 @@ -template <class T> -class QuickList -{ -private: - struct Item - { - T data; - Item* prev, * next; - }; - struct CacheItem - { - CacheItem() : item(0), no(0) {} - Item* item; - int no; - }; - Item* head, * tail; - int cacheSize, cacheStep, cacheUsed; - CacheItem* cache; - CacheItem last; - -public: - QuickList(int theCacheSize = 100, int theCacheStep = ) - { - head = tail = 0; - cacheSize = theCacheSize; - cacheStep = theCacheStep; - cacheUsed = 0; - cache = new CacheItem[cacheSize]; - } - ~QuickList() - { - delete[] cache; - } -}; diff --git a/plugins/NewStory/src/stdafx.cxx b/plugins/NewStory/src/stdafx.cxx index ebbde0ade1..49c6cfcd6b 100644 --- a/plugins/NewStory/src/stdafx.cxx +++ b/plugins/NewStory/src/stdafx.cxx @@ -1,4 +1,5 @@ /*
+Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua)
Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org)
This program is free software; you can redistribute it and/or
diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h index 60d64e7637..c22b02d497 100644 --- a/plugins/NewStory/src/stdafx.h +++ b/plugins/NewStory/src/stdafx.h @@ -1,20 +1,19 @@ /* -Copyright (C) 2012 Mataes +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) -This is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. -This is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this file; see the file license.txt. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index 3dfc7f2188..cab175563a 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -1,3 +1,21 @@ +/* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + #include "stdafx.h" wchar_t *weekDays[7] = { LPGENW("Sunday"), LPGENW("Monday"), LPGENW("Tuesday"), LPGENW("Wednesday"), LPGENW("Thursday"), LPGENW("Friday"), LPGENW("Saturday") }; diff --git a/plugins/NewStory/src/utils.cpp b/plugins/NewStory/src/utils.cpp index bb2d788b35..e5fce8ffc6 100644 --- a/plugins/NewStory/src/utils.cpp +++ b/plugins/NewStory/src/utils.cpp @@ -1,3 +1,21 @@ +/* +Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) +Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + #include "stdafx.h" uint32_t toggleBit(uint32_t dw, uint32_t bit) diff --git a/plugins/NewStory/src/version.h b/plugins/NewStory/src/version.h index 2d6e561e22..b23dcd2b60 100644 --- a/plugins/NewStory/src/version.h +++ b/plugins/NewStory/src/version.h @@ -10,4 +10,4 @@ #define __DESCRIPTION "History viewer for Miranda NG."
#define __AUTHOR "nullbie"
#define __AUTHORWEB "https://miranda-ng.org/p/NewStory"
-#define __COPYRIGHT "© 2005 Victor Pavlychko, 2018-23 Miranda NG team"
+#define __COPYRIGHT "© 2005 Victor Pavlychko, 2012-23 Miranda NG team"
|