diff options
Diffstat (limited to 'plugins/MirandaG15/src')
20 files changed, 203 insertions, 203 deletions
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 323c1b7c70..3abdd9c0cb 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -24,7 +24,7 @@ CAppletManager *CAppletManager::GetInstance() CAppletManager::CAppletManager() { m_uiTimer = NULL; - m_pLastScreen = NULL; + m_pLastScreen = nullptr; } @@ -84,8 +84,8 @@ bool CAppletManager::Initialize(tstring strAppletName) int iCount; int iProtoCount = 0; PROTOACCOUNT **ppAccounts; - CProtocolData *pProtoData = NULL; - CIRCConnection *pIRCConnection = NULL; + CProtocolData *pProtoData = nullptr; + CIRCConnection *pIRCConnection = nullptr; Proto_EnumAccounts(&iCount, &ppAccounts); for (int i = 0; i < iCount; i++) { @@ -127,7 +127,7 @@ bool CAppletManager::Initialize(tstring strAppletName) m_ahLargeEventBitmaps[3] = (HBITMAP)LoadImage(hInstance, MAKEINTRESOURCE(IDB_EVENT_INFO_LARGE), IMAGE_BITMAP, 8, 8, LR_MONOCHROME); // start the update timer - m_uiTimer = SetTimer(0, 0, 1000 / 10, CAppletManager::UpdateTimer); + m_uiTimer = SetTimer(nullptr, 0, 1000 / 10, CAppletManager::UpdateTimer); return true; } @@ -141,7 +141,7 @@ bool CAppletManager::Shutdown() return false; // stop the update timer - KillTimer(0, m_uiTimer); + KillTimer(nullptr, m_uiTimer); // delete status bitmaps for (int i = 0; i < 8; i++) @@ -230,7 +230,7 @@ CProtocolData* CAppletManager::GetProtocolData(tstring strProtocol) if (m_vProtocolData[i]->strProtocol == strProtocol) return m_vProtocolData[i]; } - return NULL; + return nullptr; } //************************************************************************ @@ -568,7 +568,7 @@ void CAppletManager::HandleEvent(CEvent *pEvent) // check for protocol filters if (pEvent->hContact != NULL && pEvent->eType != EVENT_CONTACT_ADDED) { char *szProto = GetContactProto(pEvent->hContact); - if (szProto == NULL || !CConfig::GetProtocolNotificationFilter(toTstring(szProto))) + if (szProto == nullptr || !CConfig::GetProtocolNotificationFilter(toTstring(szProto))) pEvent->bNotification = false; } pEvent->bLog = pEvent->bNotification; @@ -666,9 +666,9 @@ void CAppletManager::FinishMessageJob(SMessageJob *pJob) dbei.eventType = EVENTTYPE_MESSAGE; dbei.flags = DBEF_SENT | DBEF_UTF; dbei.szModule = szProto; - dbei.timestamp = time(NULL); + dbei.timestamp = time(nullptr); // Check if protocoll is valid - if (dbei.szModule == NULL) + if (dbei.szModule == nullptr) return; dbei.cbBlob = pJob->iBufferSize; @@ -970,7 +970,7 @@ CIRCConnection *CAppletManager::GetIRCConnection(tstring strProtocol) return *iter; iter++; } - return NULL; + return nullptr; } //************************************************************************ @@ -998,7 +998,7 @@ CIRCHistory *CAppletManager::GetIRCHistory(MCONTACT hContact) return *iter; iter++; } - return NULL; + return nullptr; } CIRCHistory *CAppletManager::GetIRCHistoryByName(tstring strProtocol, tstring strChannel) @@ -1009,7 +1009,7 @@ CIRCHistory *CAppletManager::GetIRCHistoryByName(tstring strProtocol, tstring st return *iter; iter++; } - return NULL; + return nullptr; } //************************************************************************ @@ -1041,7 +1041,7 @@ CIRCHistory *CAppletManager::CreateIRCHistory(MCONTACT hContact, tstring strChan { char *szProto = GetContactProto(hContact); if (!szProto) - return NULL; + return nullptr; CIRCHistory *pHistory = GetIRCHistoryByName(toTstring(szProto), strChannel); if (pHistory) { @@ -1085,7 +1085,7 @@ CIRCHistory *CAppletManager::CreateIRCHistoryByName(tstring strProtocol, tstring int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) { GCEVENT *gce = (GCEVENT*)lParam; - if (gce == NULL) { + if (gce == nullptr) { TRACE(L"<< [%s] skipping invalid event\n"); return 0; } @@ -1116,7 +1116,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) Event.iValue = gce->iType; Event.hValue = lParam; - CIRCHistory *pHistory = NULL; + CIRCHistory *pHistory = nullptr; if (gce->ptszID) { tstring strChannel = toTstring(gce->ptszID); tstring::size_type pos = strChannel.find('-'); @@ -1146,7 +1146,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) Event.hContact = NULL; // Ignore events from hidden chatrooms, except for join events - if (gce->ptszID != NULL && db_get_b(Event.hContact, "CList", "Hidden", 0)) { + if (gce->ptszID != nullptr && db_get_b(Event.hContact, "CList", "Hidden", 0)) { if (gce->iType == GC_EVENT_JOIN && pHistory) pHistory->LUsers.push_back(toTstring(gce->ptszNick)); @@ -1282,7 +1282,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) TRACE(L"OK!\n"); return 0; } - if (gce->bIsMe || gce->ptszID == NULL) + if (gce->bIsMe || gce->ptszID == nullptr) Event.bNotification = false; // set the event's timestamp @@ -1335,7 +1335,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) TRACE(L"OK!\n"); return 0; } - else if (gce->ptszID != NULL) { + else if (gce->ptszID != nullptr) { TRACE(L"OK!\n"); return 0; } @@ -1429,7 +1429,7 @@ int CAppletManager::HookStatusChanged(WPARAM wParam, LPARAM lParam) tstring strProto = toTstring(szProto); CProtocolData *pProtocolData = CAppletManager::GetInstance()->GetProtocolData(toTstring(szProto)); - if (pProtocolData == NULL) + if (pProtocolData == nullptr) return false; // Fetch the contacts name @@ -1553,7 +1553,7 @@ int CAppletManager::HookProtoAck(WPARAM, LPARAM lParam) return 0; CProtocolData *pProtoData = CAppletManager::GetInstance()->GetProtocolData(strProto); - if (pProtoData == NULL) + if (pProtoData == nullptr) return 0; // Skip connecting status diff --git a/plugins/MirandaG15/src/CChatScreen.cpp b/plugins/MirandaG15/src/CChatScreen.cpp index 12020a9630..132b5ad2f2 100644 --- a/plugins/MirandaG15/src/CChatScreen.cpp +++ b/plugins/MirandaG15/src/CChatScreen.cpp @@ -172,14 +172,14 @@ void CChatScreen::UpdateLabels() tstring strProto = L"";
tstring strStatus = L"";
- if(szProto != NULL)
+ if(szProto != nullptr)
{
strProto = L"(" + toTstring(szProto) + L")";
m_iStatus = db_get_w(m_hContact,szProto,"Status",ID_STATUS_OFFLINE);
}
wchar_t *szStatus = pcli->pfnGetStatusModeDescription(m_iStatus, 0);
- if(szStatus != NULL)
+ if(szStatus != nullptr)
strStatus = toTstring(szStatus);
m_UserName.SetText(strNickname.c_str());
@@ -459,7 +459,7 @@ void CChatScreen::ActivateMessageMode() {
m_InfoText.Show(0);
m_TextLog.Show(0);
- m_TextLog.SetScrollbar(NULL);
+ m_TextLog.SetScrollbar(nullptr);
m_Input.SetScrollbar(&m_Scrollbar);
if(m_eReplyState != REPLY_STATE_FAILED)
@@ -532,7 +532,7 @@ void CChatScreen::DeactivateMessageMode() {
m_Input.Reset();
- m_Input.SetScrollbar(NULL);
+ m_Input.SetScrollbar(nullptr);
m_TextLog.SetScrollbar(&m_Scrollbar);
m_TextLog.Show(1);
diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index 87e3b43883..351755a572 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -7,7 +7,7 @@ #define FONTF_BOLD 1
#define FONTF_ITALIC 2
-HANDLE CConfig::m_hOptionsInitHook = NULL;
+HANDLE CConfig::m_hOptionsInitHook = nullptr;
bool CConfig::m_bInitializingDialog = false;
bool CConfig::m_abBoolSettings[BOOL_SETTINGS];
int CConfig::m_aiIntSettings[INT_SETTINGS];
@@ -16,7 +16,7 @@ LOGFONT CConfig::m_templogfont[FONT_SETTINGS]; HANDLE CConfig::m_hSampleFont[FONT_SETTINGS];
TEXTMETRIC CConfig::m_tmFontInfo[FONT_SETTINGS];
vector<CProtoFilter*> CConfig::m_ProtoList;
-HWND CConfig::hDeviceBox = NULL;
+HWND CConfig::hDeviceBox = nullptr;
void CConfig::Initialize()
{
@@ -234,7 +234,7 @@ void CConfig::UpdateFontSettings(int iFont) if (m_hSampleFont[iFont])
DeleteObject(m_hSampleFont[iFont]);
m_hSampleFont[iFont] = CreateFontIndirect(&m_logfont[iFont]);
- HDC hDC = CreateCompatibleDC(NULL);
+ HDC hDC = CreateCompatibleDC(nullptr);
SelectObject(hDC, m_hSampleFont[iFont]);
GetTextMetrics(hDC, &m_tmFontInfo[iFont]);
DeleteObject(hDC);
@@ -893,7 +893,7 @@ void CConfig::FillDeviceBox(HWND hBox) int count = 0;
for (int i = 0; i < 10; i++) {
CLCDDevice *device = connection->GetAttachedDevice(i);
- if (device != NULL) {
+ if (device != nullptr) {
SendMessage(hBox, CB_ADDSTRING, 0, (LPARAM)device->GetDisplayName().c_str());
count++;
}
@@ -915,7 +915,7 @@ void CConfig::FillTree(HWND hTree, bool bCList) TreeView_DeleteAllItems(hTree);
TVINSERTSTRUCT tvis;
- tvis.hParent = NULL;
+ tvis.hParent = nullptr;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index d8bd87325d..672e686129 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -98,14 +98,14 @@ tstring CContactList::GetContactGroupPath(MCONTACT hContact) //************************************************************************
void CContactList::AddContact(MCONTACT hContact)
{
- CListContainer<CContactListEntry*,CContactListGroup*> *pGroup = NULL;
+ CListContainer<CContactListEntry*,CContactListGroup*> *pGroup = nullptr;
tstring strName = CAppletManager::GetContactDisplayname(hContact);
char *szProto = GetContactProto(hContact);
tstring strGroup = GetContactGroupPath(hContact);
// ignore contacts without a valid protocoll
- if(szProto == NULL)
+ if(szProto == nullptr)
return;
int iStatus = db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE);
@@ -119,7 +119,7 @@ void CContactList::AddContact(MCONTACT hContact) psContact->iStatus = iStatus;
- if(szStatus != NULL)
+ if(szStatus != nullptr)
psContact->strStatus =toTstring(szStatus);
psContact->strProto = toTstring(szProto);
@@ -136,7 +136,7 @@ void CContactList::AddContact(MCONTACT hContact) strGroup = L"";
strGroup += (strGroup.empty()?L"":L"\\")+psContact->strName;
pGroup = GetGroupByString(strGroup);
- if(pGroup == NULL)
+ if(pGroup == nullptr)
pGroup = AddGroupByString(strGroup);
pGroup->GetGroupData()->hMetaContact = hContact;
pGroup->GetGroupData()->pContactListEntry = psContact;
@@ -164,7 +164,7 @@ void CContactList::AddContact(MCONTACT hContact) AddContact(hMetaContact);
}
- CListItem<CContactListEntry*,CContactListGroup*> *pItem = NULL;
+ CListItem<CContactListEntry*,CContactListGroup*> *pItem = nullptr;
if((!db_mc_isSub(hContact) && !CConfig::GetBoolSetting(CLIST_USEGROUPS)) || strGroup.empty())
{
pItem = AddItem(psContact);
@@ -173,7 +173,7 @@ void CContactList::AddContact(MCONTACT hContact) else
{
pGroup = GetGroupByString(strGroup);
- if(pGroup == NULL) {
+ if(pGroup == nullptr) {
pGroup = AddGroupByString(strGroup);
}
pItem = pGroup->AddItem(psContact);
@@ -239,7 +239,7 @@ bool CContactList::IsVisible(CContactListEntry *pEntry) { // removes a contact from the list
//************************************************************************
void CContactList::RemoveContact(MCONTACT hContact) {
- CListContainer<CContactListEntry*,CContactListGroup*> *pGroup = NULL;
+ CListContainer<CContactListEntry*,CContactListGroup*> *pGroup = nullptr;
///tstring strGroup = GetContactGroupPath(hContact);
@@ -255,7 +255,7 @@ void CContactList::RemoveContact(MCONTACT hContact) { RemoveGroup(((CListContainer<CContactListEntry*,CContactListGroup*>*)pContactEntry)->GetGroupData());
} else {
pGroup = (CListContainer<CContactListEntry*,CContactListGroup*>*)pContactEntry->GetParent();
- ASSERT(pGroup != NULL);
+ ASSERT(pGroup != nullptr);
CContactListEntry *pEntry = GetContactData(pContactEntry);
if(!pEntry) {
@@ -285,7 +285,7 @@ void CContactList::RemoveContact(MCONTACT hContact) { }
CListContainer<CContactListEntry*,CContactListGroup*> *pParent = (CListContainer<CContactListEntry*,CContactListGroup*>*)pGroup->GetParent();
- while(pParent != NULL && pGroup->IsEmpty() && !pGroup->GetGroupData()->hMetaContact)
+ while(pParent != nullptr && pGroup->IsEmpty() && !pGroup->GetGroupData()->hMetaContact)
{
pParent->RemoveGroup(pGroup->GetGroupData());
pGroup = pParent;
@@ -308,8 +308,8 @@ CListContainer<CContactListEntry*,CContactListGroup*> *CContactList::GetGroupByS strParse = strParse.substr(pos+1);
pGroup = FindGroupInGroup(strGroup,pGroup);
- if(pGroup == NULL)
- return NULL;
+ if(pGroup == nullptr)
+ return nullptr;
}
pGroup = FindGroupInGroup(strParse,pGroup);
return pGroup;
@@ -324,7 +324,7 @@ CListContainer<CContactListEntry*,CContactListGroup*> *CContactList::AddGroupByS tstring strPath = L"";
CListContainer<CContactListEntry*,CContactListGroup*> *pGroup = (CListContainer<CContactListEntry*,CContactListGroup*>*)this;
- CListContainer<CContactListEntry*,CContactListGroup*> *pGroup2 = NULL;
+ CListContainer<CContactListEntry*,CContactListGroup*> *pGroup2 = nullptr;
tstring::size_type pos;
while((pos = strParse.find('\\')) != tstring::npos )
{
@@ -343,7 +343,7 @@ CListContainer<CContactListEntry*,CContactListGroup*> *CContactList::AddGroupByS pGroup->sort(CContactList::CompareEntries);
pGroup = pGroup2;
}
- ASSERT(pGroup != NULL);
+ ASSERT(pGroup != nullptr);
strPath += L"\\";
}
strPath += strParse;
@@ -399,7 +399,7 @@ void CContactList::DeleteGroup(CContactListGroup*) //************************************************************************
void CContactList::DrawEntry(CLCDGfx *pGfx,CContactListEntry *pEntry,bool bSelected)
{
- if(pEntry == NULL)
+ if(pEntry == nullptr)
return;
tstring strText = L"";
@@ -431,7 +431,7 @@ void CContactList::DrawEntry(CLCDGfx *pGfx,CContactListEntry *pEntry,bool bSelec //************************************************************************
void CContactList::DrawGroup(CLCDGfx *pGfx,CContactListGroup *pGroup,bool bOpen,bool bSelected)
{
- if(pGroup == NULL || ( pGroup->hMetaContact && pGroup->pContactListEntry == NULL)) {
+ if(pGroup == nullptr || ( pGroup->hMetaContact && pGroup->pContactListEntry == nullptr)) {
return;
}
@@ -540,7 +540,7 @@ void CContactList::RefreshList() m_bUseGroups = CConfig::GetBoolSetting(CLIST_USEGROUPS);
m_bUseMetaContacts = db_get_b(NULL,"MetaContacts","Enabled",1) != 0;
- CListEntry<CContactListEntry*,CContactListGroup*> *pContactEntry = NULL;
+ CListEntry<CContactListEntry*,CContactListGroup*> *pContactEntry = nullptr;
MCONTACT hContact = db_find_first();
while(hContact != NULL)
{
@@ -589,7 +589,7 @@ CListContainer<CContactListEntry*,CContactListGroup*> *CContactList::FindGroup(t CListContainer<CContactListEntry*,CContactListGroup*> *CContactList::FindGroupInGroup(tstring strGroup,CListContainer<CContactListEntry*,CContactListGroup*> *pGroup)
{
CListContainer<CContactListEntry*,CContactListGroup*>::iterator iter = pGroup->begin();
- CListContainer<CContactListEntry*,CContactListGroup*> *pItem = NULL;
+ CListContainer<CContactListEntry*,CContactListGroup*> *pItem = nullptr;
while(!pGroup->empty() && iter != pGroup->end())
{
if((*iter)->GetType() == CONTAINER)
@@ -604,7 +604,7 @@ CListContainer<CContactListEntry*,CContactListGroup*> *CContactList::FindGroupIn }
iter++;
}
- return NULL;
+ return nullptr;
}
//************************************************************************
@@ -613,7 +613,7 @@ CListContainer<CContactListEntry*,CContactListGroup*> *CContactList::FindGroupIn CListEntry<CContactListEntry*,CContactListGroup*> *CContactList::FindContact(MCONTACT hContact)
{
if(hContact == NULL)
- return NULL;
+ return nullptr;
return FindContactInGroup(hContact,(CListContainer<CContactListEntry*,CContactListGroup*>*)this);
}
@@ -624,11 +624,11 @@ CListEntry<CContactListEntry*,CContactListGroup*> *CContactList::FindContact(MCO CListEntry<CContactListEntry*,CContactListGroup*> *CContactList::FindContactInGroup(MCONTACT hContact,CListContainer<CContactListEntry*,CContactListGroup*> *pGroup)
{
if(hContact == NULL)
- return NULL;
+ return nullptr;
- CListItem<CContactListEntry*,CContactListGroup*> *pItemEntry = NULL;
- CListEntry<CContactListEntry*,CContactListGroup*> *pEntry = NULL;
- CListContainer<CContactListEntry*,CContactListGroup*> *pGroupEntry = NULL;
+ CListItem<CContactListEntry*,CContactListGroup*> *pItemEntry = nullptr;
+ CListEntry<CContactListEntry*,CContactListGroup*> *pEntry = nullptr;
+ CListContainer<CContactListEntry*,CContactListGroup*> *pGroupEntry = nullptr;
CListContainer<CContactListEntry*,CContactListGroup*>::iterator iter = pGroup->begin();
while(iter != pGroup->end())
{
@@ -650,7 +650,7 @@ CListEntry<CContactListEntry*,CContactListGroup*> *CContactList::FindContactInGr }
iter++;
}
- return NULL;
+ return nullptr;
}
@@ -722,7 +722,7 @@ void CContactList::OnStatusChange(MCONTACT hContact,int iStatus) // Update the list entry
wchar_t *szStatus = pcli->pfnGetStatusModeDescription(iStatus, 0);
- if(szStatus != NULL)
+ if(szStatus != nullptr)
pItemData->strStatus =toTstring(szStatus);
pItemData->iStatus = iStatus;
@@ -828,7 +828,7 @@ void CContactList::OnContactGroupChanged(MCONTACT hContact,tstring strGroup) // Decrease the membercount of the old group
CListEntry<CContactListEntry *,CContactListGroup*> *pContactEntry = FindContact(hContact);
- CContactListGroup *pOldGroup = NULL;
+ CContactListGroup *pOldGroup = nullptr;
// If the contactentry was not found, try adding the contact (metacontacts fix)
if(!pContactEntry) {
return;
@@ -1037,7 +1037,7 @@ CContactListGroup *CContactList::GetGroupObjectByPath(tstring strPath) {
ASSERT(!strPath.empty());
- CContactListGroup *pGroup = NULL;
+ CContactListGroup *pGroup = nullptr;
vector<CContactListGroup*>::iterator iter = m_Groups.begin();
for(;iter != m_Groups.end();iter++)
{
@@ -1058,7 +1058,7 @@ CContactListGroup *CContactList::CreateGroupObjectByPath(tstring strPath) ASSERT(!strPath.empty());
CContactListGroup *pNewGroup = new CContactListGroup();
- CContactListGroup *pParentGroup = NULL;
+ CContactListGroup *pParentGroup = nullptr;
tstring strParsePath = L"";
tstring strName = strPath;
@@ -1085,7 +1085,7 @@ CContactListGroup *CContactList::CreateGroupObjectByPath(tstring strPath) pNewGroup->iGroups = 0;
pNewGroup->iEvents = 0;
pNewGroup->hMetaContact = NULL;
- pNewGroup->pContactListEntry = NULL;
+ pNewGroup->pContactListEntry = nullptr;
m_Groups.push_back(pNewGroup);
diff --git a/plugins/MirandaG15/src/CEventScreen.cpp b/plugins/MirandaG15/src/CEventScreen.cpp index e03a36301e..1d240265a8 100644 --- a/plugins/MirandaG15/src/CEventScreen.cpp +++ b/plugins/MirandaG15/src/CEventScreen.cpp @@ -107,7 +107,7 @@ void CEventScreen::OnConfigChanged() // Update all timestamps
list<CListEntry<CEventLogEntry*>*>::iterator iter = m_EventLog.begin();
- CListItem<CEventLogEntry*> *pItem = NULL;
+ CListItem<CEventLogEntry*> *pItem = nullptr;
while(iter != m_EventLog.end())
{
pItem = static_cast<CListItem<CEventLogEntry*>*>(*iter);
diff --git a/plugins/MirandaG15/src/CNotificationScreen.cpp b/plugins/MirandaG15/src/CNotificationScreen.cpp index 26955ebf78..671c315276 100644 --- a/plugins/MirandaG15/src/CNotificationScreen.cpp +++ b/plugins/MirandaG15/src/CNotificationScreen.cpp @@ -8,7 +8,7 @@ //************************************************************************
CNotificationScreen::CNotificationScreen()
{
- m_pEntry = NULL;
+ m_pEntry = nullptr;
//m_bMessageMode = false;
}
@@ -65,7 +65,7 @@ bool CNotificationScreen::Initialize() //************************************************************************
bool CNotificationScreen::Shutdown()
{
- CNotificationEntry *pEntry = NULL;
+ CNotificationEntry *pEntry = nullptr;
while(!m_LNotifications.empty())
{
pEntry = *(m_LNotifications.begin());
@@ -117,7 +117,7 @@ bool CNotificationScreen::Draw(CLCDGfx *pGfx) //************************************************************************
void CNotificationScreen::DisplayNotification(CNotificationEntry *pEntry)
{
- if(m_pEntry != NULL)
+ if(m_pEntry != nullptr)
delete m_pEntry;
@@ -359,7 +359,7 @@ void CNotificationScreen::OnDeactivation() void CNotificationScreen::OnExpiration()
{
// clear the cached events
- CNotificationEntry *pEntry = NULL;
+ CNotificationEntry *pEntry = nullptr;
while(!m_LNotifications.empty())
{
pEntry = *(m_LNotifications.begin());
@@ -370,5 +370,5 @@ void CNotificationScreen::OnExpiration() m_EventText.SetText(L"");
m_MessageText.SetText(L"");
- m_pEntry = NULL;
+ m_pEntry = nullptr;
}
\ No newline at end of file diff --git a/plugins/MirandaG15/src/CScreen.cpp b/plugins/MirandaG15/src/CScreen.cpp index a49207baf1..3ba1fb845b 100644 --- a/plugins/MirandaG15/src/CScreen.cpp +++ b/plugins/MirandaG15/src/CScreen.cpp @@ -31,7 +31,7 @@ bool CScreen::Initialize() m_aButtons[i].SetSize(17, 3);
m_aButtons[i].Show(0);
m_abShowButtons[i] = false;
- m_ahBitmaps[i] = NULL;
+ m_ahBitmaps[i] = nullptr;
if(GetWidth() == 160) {
m_aButtons[i].SetOrigin(10+i*29+(i/2)*36, GetHeight()-3);
} else {
@@ -65,7 +65,7 @@ bool CScreen::Shutdown() return false;
for(int i=0; i < 4; i++)
- if(m_ahBitmaps[i] != NULL)
+ if(m_ahBitmaps[i] != nullptr)
DeleteObject(m_ahBitmaps[i]);
return true;
@@ -114,7 +114,7 @@ void CScreen::SetButtonBitmap(int iButton, int iBitmap) }
else
{
- if(m_ahBitmaps[iButton] != NULL)
+ if(m_ahBitmaps[iButton] != nullptr)
DeleteObject(m_ahBitmaps[iButton]);
m_ahBitmaps[iButton] = (HBITMAP)LoadImage(hInstance, MAKEINTRESOURCE(iBitmap),
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDBitmap.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDBitmap.cpp index 5ce448769d..b9aadd3bfc 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDBitmap.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDBitmap.cpp @@ -3,7 +3,7 @@ CLCDBitmap::CLCDBitmap()
{
- m_hBitmap = NULL;
+ m_hBitmap = nullptr;
}
CLCDBitmap::~CLCDBitmap()
@@ -43,6 +43,6 @@ bool CLCDBitmap::Draw(CLCDGfx *pGfx) void CLCDBitmap::SetBitmap(HBITMAP hBitmap)
{
- ASSERT(NULL != hBitmap);
+ ASSERT(nullptr != hBitmap);
m_hBitmap = hBitmap;
}
\ No newline at end of file diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnection.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDConnection.cpp index 6b449f5db2..929f801d8e 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDConnection.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnection.cpp @@ -133,7 +133,7 @@ int CLCDConnection::GetColorCount() //************************************************************************
PBYTE CLCDConnection::GetPixelBuffer()
{
- return NULL;
+ return nullptr;
}
//************************************************************************
@@ -141,7 +141,7 @@ PBYTE CLCDConnection::GetPixelBuffer() //************************************************************************
CLCDDevice* CLCDConnection::GetAttachedDevice(int)
{
- return NULL;
+ return nullptr;
}
//************************************************************************
@@ -173,5 +173,5 @@ void CLCDConnection::SetReconnect(bool bSet) //************************************************************************
CLCDDevice* CLCDConnection::GetConnectedDevice()
{
- return NULL;
+ return nullptr;
}
\ No newline at end of file diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp index 768e586c39..2ec4f18332 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp @@ -27,8 +27,8 @@ void __cdecl initializeDrawingThread(void *pParam) }
void CLCDConnectionLogitech::runDrawingThread() {
- m_hStopEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- m_hDrawEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ m_hStopEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
+ m_hDrawEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
DWORD dwRes = 0;
@@ -70,7 +70,7 @@ void CLCDConnectionLogitech::runDrawingThread() { }
// the connection instance
-CLCDConnectionLogitech *CLCDConnectionLogitech::m_pInstance = NULL;
+CLCDConnectionLogitech *CLCDConnectionLogitech::m_pInstance = nullptr;
//************************************************************************
// returns the connection type
@@ -88,9 +88,9 @@ CLCDConnectionLogitech::CLCDConnectionLogitech() m_iNumQVGADevices = 0;
m_iNumBWDevices = 0;
- m_pDrawingBuffer = NULL;
- m_pConnectedDevice = NULL;
- m_hKeyboardHook = NULL;
+ m_pDrawingBuffer = nullptr;
+ m_pConnectedDevice = nullptr;
+ m_hKeyboardHook = nullptr;
m_bVolumeWheelHook = false;
m_dwButtonState = 0;
@@ -98,14 +98,14 @@ CLCDConnectionLogitech::CLCDConnectionLogitech() m_bSetAsForeground = false;
m_dwForegroundCheck = 0;
- m_hHIDDeviceHandle = NULL;
+ m_hHIDDeviceHandle = nullptr;
m_hConnection = LGLCD_INVALID_CONNECTION;
m_hDevice = LGLCD_INVALID_DEVICE;
m_bIsForeground = false;
- m_hDrawEvent = NULL;
- m_hStopEvent = NULL;
+ m_hDrawEvent = nullptr;
+ m_hStopEvent = nullptr;
CLCDConnectionLogitech::m_pInstance = this;
@@ -121,7 +121,7 @@ CLCDConnectionLogitech::~CLCDConnectionLogitech() SetEvent(m_hStopEvent);
} while (WaitForSingleObject(m_hDrawingThread, 500) == WAIT_TIMEOUT);
- if (m_pDrawingBuffer != NULL) {
+ if (m_pDrawingBuffer != nullptr) {
free(m_pDrawingBuffer);
}
SetVolumeWheelHook(false);
@@ -152,9 +152,9 @@ bool CLCDConnectionLogitech::Initialize(tstring strAppletName, bool bAutostart, m_connectContext.onConfigure.configCallback = CLCDOutputManager::configDialogCallback;
}
else {
- m_connectContext.onConfigure.configCallback = NULL;
+ m_connectContext.onConfigure.configCallback = nullptr;
}
- m_connectContext.onConfigure.configContext = NULL;
+ m_connectContext.onConfigure.configContext = nullptr;
lgLcdSetDeviceFamiliesToUse(m_connectContext.connection, LGLCD_DEVICE_FAMILY_ALL, NULL);
@@ -184,7 +184,7 @@ CLgLCDDevice* CLCDConnectionLogitech::GetAttachedDevice(int iIndex) { }
}
- return NULL;
+ return nullptr;
}
//************************************************************************
@@ -194,9 +194,9 @@ bool CLCDConnectionLogitech::Disconnect() { if (!m_bConnected)
return false;
- if (m_pConnectedDevice != NULL) {
+ if (m_pConnectedDevice != nullptr) {
delete m_pConnectedDevice;
- m_pConnectedDevice = NULL;
+ m_pConnectedDevice = nullptr;
}
m_bReconnect = false;
@@ -246,10 +246,10 @@ bool CLCDConnectionLogitech::Connect(int iIndex) // check if the specified device exists
m_pConnectedDevice = GetAttachedDevice(iIndex);
- if (m_pConnectedDevice == NULL) {
+ if (m_pConnectedDevice == nullptr) {
iIndex = (!iIndex || iIndex == LGLCD_DEVICE_BW) ? LGLCD_DEVICE_BW : LGLCD_DEVICE_QVGA;
m_pConnectedDevice = GetAttachedDevice(iIndex);
- if (m_pConnectedDevice == NULL) {
+ if (m_pConnectedDevice == nullptr) {
return false;
}
}
@@ -279,7 +279,7 @@ bool CLCDConnectionLogitech::Connect(int iIndex) // Create the pixel buffer
m_lcdBitmap.hdr.Format = OpenContext.deviceType == LGLCD_DEVICE_QVGA ? LGLCD_BMP_FORMAT_QVGAx32 : LGLCD_BMP_FORMAT_160x43x1;
- if (m_pDrawingBuffer != NULL) {
+ if (m_pDrawingBuffer != nullptr) {
free(m_pDrawingBuffer);
}
@@ -323,7 +323,7 @@ bool CLCDConnectionLogitech::Shutdown() //************************************************************************
bool CLCDConnectionLogitech::HIDReadData(BYTE* data) {
static OVERLAPPED olRead;
- static HANDLE hReadEvent = CreateEvent(NULL, false, true, L"ReadEvent");
+ static HANDLE hReadEvent = CreateEvent(nullptr, false, true, L"ReadEvent");
static BYTE privateBuffer[9];
DWORD TransBytes;
@@ -613,7 +613,7 @@ int CLCDConnectionLogitech::GetColorCount() PBYTE CLCDConnectionLogitech::GetPixelBuffer()
{
if (!GetConnectionState() == CONNECTED)
- return NULL;
+ return nullptr;
return (PBYTE)m_pDrawingBuffer;
}
@@ -676,8 +676,8 @@ bool CLCDConnectionLogitech::HIDInit() LONG Result;
DWORD Length = 0;
- PSP_DEVICE_INTERFACE_DETAIL_DATA detailData = NULL;
- HANDLE hDevInfo = NULL;
+ PSP_DEVICE_INTERFACE_DETAIL_DATA detailData = nullptr;
+ HANDLE hDevInfo = nullptr;
GUID HidGuid;
ULONG Required = 0;
@@ -699,8 +699,8 @@ bool CLCDConnectionLogitech::HIDInit() hDevInfo = SetupDiGetClassDevs
(&HidGuid,
- NULL,
- NULL,
+ nullptr,
+ nullptr,
DIGCF_PRESENT | DIGCF_INTERFACEDEVICE);
devInfoData.cbSize = sizeof(devInfoData);
@@ -725,7 +725,7 @@ bool CLCDConnectionLogitech::HIDInit() Result = SetupDiEnumDeviceInterfaces
(hDevInfo,
- 0,
+ nullptr,
&HidGuid,
MemberIndex,
&devInfoData);
@@ -758,10 +758,10 @@ bool CLCDConnectionLogitech::HIDInit() Result = SetupDiGetDeviceInterfaceDetail
(hDevInfo,
&devInfoData,
- NULL,
+ nullptr,
0,
&Length,
- NULL);
+ nullptr);
//Allocate memory for the hDevInfo structure, using the returned Length.
@@ -779,7 +779,7 @@ bool CLCDConnectionLogitech::HIDInit() detailData,
Length,
&Required,
- NULL);
+ nullptr);
// Open a handle to the device.
// To enable retrieving information about a system mouse or keyboard,
@@ -797,10 +797,10 @@ bool CLCDConnectionLogitech::HIDInit() (detailData->DevicePath,
FILE_GENERIC_READ | FILE_GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
- (LPSECURITY_ATTRIBUTES)NULL,
+ nullptr,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
- NULL);
+ nullptr);
/*
API function: HidD_GetAttributes
@@ -875,7 +875,7 @@ bool CLCDConnectionLogitech::HIDDeInit() return false;
CloseHandle(m_hHIDDeviceHandle);
- m_hHIDDeviceHandle = NULL;
+ m_hHIDDeviceHandle = nullptr;
return true;
}
@@ -1001,7 +1001,7 @@ void CLCDConnectionLogitech::SetVolumeWheelHook(bool bEnable) m_bVolumeWheelHook = bEnable;
if (bEnable)
- m_hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, CLCDConnectionLogitech::KeyboardHook, GetModuleHandle(NULL), 0);
+ m_hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, CLCDConnectionLogitech::KeyboardHook, GetModuleHandle(nullptr), 0);
else if (m_hKeyboardHook)
UnhookWindowsHookEx(m_hKeyboardHook);
}
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp index f7bed6776c..8dfc6c98e3 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp @@ -23,13 +23,13 @@ CLCDGfx::CLCDGfx(void) {
m_nWidth = 0;
m_nHeight = 0;
- m_pBitmapInfo = NULL;
- m_hDC = NULL;
- m_hBitmap = NULL;
- m_hPrevBitmap = NULL;
- m_pBitmapBits = NULL;
- m_pLcdBitmapBits = NULL;
- m_pSavedBitmapBits = NULL;
+ m_pBitmapInfo = nullptr;
+ m_hDC = nullptr;
+ m_hBitmap = nullptr;
+ m_hPrevBitmap = nullptr;
+ m_pBitmapBits = nullptr;
+ m_pLcdBitmapBits = nullptr;
+ m_pSavedBitmapBits = nullptr;
m_bInitialized = false;
m_bTransition = false;
@@ -57,8 +57,8 @@ bool CLCDGfx::Initialize(int nWidth, int nHeight, int nBPP, PBYTE pLcdBitmapBits m_nHeight = nHeight;
m_nBPP = nBPP;
- m_hDC = CreateCompatibleDC(NULL);
- if(NULL == m_hDC)
+ m_hDC = CreateCompatibleDC(nullptr);
+ if(nullptr == m_hDC)
{
TRACE(L"CLCDGfx::Initialize(): failed to create compatible DC.\n");
Shutdown();
@@ -67,7 +67,7 @@ bool CLCDGfx::Initialize(int nWidth, int nHeight, int nBPP, PBYTE pLcdBitmapBits int nBMISize = sizeof(BITMAPINFO) + 256 * sizeof(RGBQUAD);
m_pBitmapInfo = (BITMAPINFO *) new BYTE [nBMISize];
- if(NULL == m_pBitmapInfo)
+ if(nullptr == m_pBitmapInfo)
{
TRACE(L"CLCDGfx::Initialize(): failed to allocate bitmap info.\n");
Shutdown();
@@ -97,8 +97,8 @@ bool CLCDGfx::Initialize(int nWidth, int nHeight, int nBPP, PBYTE pLcdBitmapBits }
}
- m_hBitmap = CreateDIBSection(m_hDC, m_pBitmapInfo, DIB_RGB_COLORS, (PVOID *) &m_pBitmapBits, NULL, 0);
- if(NULL == m_hBitmap)
+ m_hBitmap = CreateDIBSection(m_hDC, m_pBitmapInfo, DIB_RGB_COLORS, (PVOID *) &m_pBitmapBits, nullptr, 0);
+ if(nullptr == m_hBitmap)
{
TRACE(L"CLCDGfx::Initialize(): failed to create bitmap.\n");
Shutdown();
@@ -125,26 +125,26 @@ bool CLCDGfx::Shutdown(void) {
EndTransition();
- if(NULL != m_hBitmap)
+ if(nullptr != m_hBitmap)
{
DeleteObject(m_hBitmap);
- m_hBitmap = NULL;
- m_pBitmapBits = NULL;
+ m_hBitmap = nullptr;
+ m_pBitmapBits = nullptr;
}
- ASSERT(NULL == m_hPrevBitmap);
- m_hPrevBitmap = NULL;
+ ASSERT(nullptr == m_hPrevBitmap);
+ m_hPrevBitmap = nullptr;
- if(NULL != m_pBitmapInfo)
+ if(nullptr != m_pBitmapInfo)
{
delete [] m_pBitmapInfo;
- m_pBitmapInfo = NULL;
+ m_pBitmapInfo = nullptr;
}
- if(NULL != m_hDC)
+ if(nullptr != m_hDC)
{
DeleteDC(m_hDC);
- m_hDC = NULL;
+ m_hDC = nullptr;
}
m_nWidth = 0;
@@ -159,7 +159,7 @@ bool CLCDGfx::Shutdown(void) //************************************************************************
void CLCDGfx::SetClipRegion(int iX,int iY,int iWidth,int iHeight)
{
- ASSERT(NULL != m_hPrevBitmap);
+ ASSERT(nullptr != m_hPrevBitmap);
m_rClipRegion.left = iX;
m_rClipRegion.right = iX+iWidth;
@@ -184,11 +184,11 @@ RECT CLCDGfx::GetClipRegion() //************************************************************************
void CLCDGfx::BeginDraw(void)
{
- ASSERT(NULL != m_hBitmap);
- if(m_hPrevBitmap != NULL)
+ ASSERT(nullptr != m_hBitmap);
+ if(m_hPrevBitmap != nullptr)
Sleep(1);
- ASSERT(NULL == m_hPrevBitmap);
- if(NULL == m_hPrevBitmap)
+ ASSERT(nullptr == m_hPrevBitmap);
+ if(nullptr == m_hPrevBitmap)
{
m_hPrevBitmap = (HBITMAP) SelectObject(m_hDC, m_hBitmap);
SetTextColor(m_hDC, RGB(255, 255, 255));
@@ -202,7 +202,7 @@ void CLCDGfx::BeginDraw(void) void CLCDGfx::ClearScreen(void)
{
// this means, we're inside BeginDraw()/EndDraw()
- ASSERT(NULL != m_hPrevBitmap);
+ ASSERT(nullptr != m_hPrevBitmap);
RECT rc = { 0, 0, m_nWidth, m_nHeight };
FillRect(m_hDC, &rc, (HBRUSH) GetStockObject(BLACK_BRUSH));
}
@@ -219,7 +219,7 @@ COLORREF CLCDGfx::GetPixel(int nX, int nY) { //************************************************************************
void CLCDGfx::SetPixel(int nX, int nY, COLORREF color) {
// this means, we're inside BeginDraw()/EndDraw()
- ASSERT(NULL != m_hPrevBitmap);
+ ASSERT(nullptr != m_hPrevBitmap);
::SetPixel(m_hDC, nX, nY, color);
}
@@ -241,10 +241,10 @@ void CLCDGfx::SetPixel(int nX, int nY, BYTE r, BYTE g, BYTE b) void CLCDGfx::DrawLine(int nX1, int nY1, int nX2, int nY2)
{
// this means, we're inside BeginDraw()/EndDraw()
- ASSERT(NULL != m_hPrevBitmap);
+ ASSERT(nullptr != m_hPrevBitmap);
HPEN hPrevPen = (HPEN) SelectObject(m_hDC, GetStockObject(WHITE_PEN));
- ::MoveToEx(m_hDC, nX1, nY1, NULL);
+ ::MoveToEx(m_hDC, nX1, nY1, nullptr);
::LineTo(m_hDC, nX2, nY2);
SelectObject(m_hDC, hPrevPen);
}
@@ -258,7 +258,7 @@ void CLCDGfx::DrawLine(int nX1, int nY1, int nX2, int nY2) void CLCDGfx::DrawFilledRect(int nX, int nY, int nWidth, int nHeight)
{
// this means, we're inside BeginDraw()/EndDraw()
- ASSERT(NULL != m_hPrevBitmap);
+ ASSERT(nullptr != m_hPrevBitmap);
HBRUSH hPrevBrush = (HBRUSH) SelectObject(m_hDC, GetStockObject(WHITE_BRUSH));
RECT r = { nX, nY, nX + nWidth, nY + nHeight };
@@ -272,7 +272,7 @@ void CLCDGfx::DrawFilledRect(int nX, int nY, int nWidth, int nHeight) void CLCDGfx::DrawRect(int iX, int iY, int iWidth, int iHeight)
{
// this means, we're inside BeginDraw()/EndDraw()
- ASSERT(NULL != m_hPrevBitmap);
+ ASSERT(nullptr != m_hPrevBitmap);
HBRUSH hPrevBrush = (HBRUSH) SelectObject(m_hDC, GetStockObject(WHITE_BRUSH));
@@ -355,13 +355,13 @@ void CLCDGfx::DrawBitmap(int nX, int nY,int nWidth, int nHeight, HBITMAP hBitmap //************************************************************************
void CLCDGfx::EndDraw(void)
{
- ASSERT(NULL != m_hPrevBitmap);
- if(NULL != m_hPrevBitmap)
+ ASSERT(nullptr != m_hPrevBitmap);
+ if(nullptr != m_hPrevBitmap)
{
GdiFlush();
m_hPrevBitmap = (HBITMAP) SelectObject(m_hDC, m_hPrevBitmap);
ASSERT(m_hPrevBitmap == m_hBitmap);
- m_hPrevBitmap = NULL;
+ m_hPrevBitmap = nullptr;
}
if(m_nBPP != 1 || !m_bTransition)
@@ -486,7 +486,7 @@ void CLCDGfx::EndDraw(void) double dPixelPercent = dPercent;
memset(m_pLcdBitmapBits,0x00,m_nHeight * m_nWidth);
- SLCDPixel *pPixel = NULL;
+ SLCDPixel *pPixel = nullptr;
vector<SLCDPixel*>::iterator iter = m_LMovingPixels.begin();
int iIndex = 0,iMoved = 0;
@@ -542,7 +542,7 @@ void CLCDGfx::EndDraw(void) //************************************************************************
HDC CLCDGfx::GetHDC(void)
{
- ASSERT(NULL != m_hDC);
+ ASSERT(nullptr != m_hDC);
return m_hDC;
}
@@ -551,7 +551,7 @@ HDC CLCDGfx::GetHDC(void) //************************************************************************
BITMAPINFO *CLCDGfx::GetBitmapInfo(void)
{
- ASSERT(NULL != m_pBitmapInfo);
+ ASSERT(nullptr != m_pBitmapInfo);
return m_pBitmapInfo;
}
@@ -561,7 +561,7 @@ BITMAPINFO *CLCDGfx::GetBitmapInfo(void) HBITMAP CLCDGfx::GetHBITMAP(void)
{
- ASSERT(NULL != m_hBitmap);
+ ASSERT(nullptr != m_hBitmap);
return m_hBitmap;
}
@@ -609,8 +609,8 @@ void CLCDGfx::Cache() // Initialize pixels
if(m_eTransition == TRANSITION_MORPH)
{
- SLCDPixel *pPixel = NULL;
- SLCDPixel *pSource = NULL;
+ SLCDPixel *pPixel = nullptr;
+ SLCDPixel *pSource = nullptr;
int iIndex = 0;
bool bBreak = false;
@@ -732,7 +732,7 @@ void CLCDGfx::StartTransition(ETransitionType eType,LPRECT rect) if(!m_bInitialized)
return;
- if(rect != NULL) {
+ if(rect != nullptr) {
m_rTransitionRegion.left = rect->left;
m_rTransitionRegion.right = rect->right;
m_rTransitionRegion.top = rect->top;
@@ -751,7 +751,7 @@ void CLCDGfx::StartTransition(ETransitionType eType,LPRECT rect) memcpy(m_pBitmapBits,m_pLcdBitmapBits,sizeof(BYTE)*m_nWidth*m_nHeight*m_nBPP);
}
- if(m_pSavedBitmapBits == NULL)
+ if(m_pSavedBitmapBits == nullptr)
m_pSavedBitmapBits = (BYTE*)malloc(sizeof(BYTE)*m_nWidth*m_nHeight*m_nBPP);
memcpy(m_pSavedBitmapBits, m_pBitmapBits,sizeof(BYTE)* m_nWidth * m_nHeight * m_nBPP);
@@ -763,10 +763,10 @@ void CLCDGfx::StartTransition(ETransitionType eType,LPRECT rect) void CLCDGfx::EndTransition()
{
- if(m_pSavedBitmapBits != NULL)
+ if(m_pSavedBitmapBits != nullptr)
free(m_pSavedBitmapBits);
- m_pSavedBitmapBits = NULL;
+ m_pSavedBitmapBits = nullptr;
if(!m_LMovingPixels.empty())
{
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp index 2a121c22c1..92723e0501 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp @@ -5,9 +5,9 @@ //************************************************************************
// CLCDInput::CLCDInput
//************************************************************************
-CLCDInput::CLCDInput() : m_hKBHook(0), m_bShowSymbols(true), m_bShowMarker(false),
+CLCDInput::CLCDInput() : m_hKBHook(nullptr), m_bShowSymbols(true), m_bShowMarker(false),
m_lInputTime(0), m_iLinePosition(0), m_iLineCount(0), m_iBreakKeys(KEYS_RETURN),
- m_lBlinkTimer(0), m_pScrollbar(NULL)
+ m_lBlinkTimer(0), m_pScrollbar(nullptr)
{
memset(&m_Marker, 0, sizeof(m_Marker));
@@ -101,7 +101,7 @@ bool CLCDInput::Draw(CLCDGfx *pGfx) int iLine = m_iLinePosition;
int iEndLine = m_iLinePosition + m_iLineCount;
int iLen = 0;
- wchar_t *pcOffset = NULL;
+ wchar_t *pcOffset = nullptr;
while(iLine < iEndLine && iLine < m_vLineOffsets.size())
{
// Calculate the text length
@@ -174,7 +174,7 @@ void CLCDInput::SetBreakKeys(int iKeys) //************************************************************************
bool CLCDInput::IsInputActive()
{
- return m_pInput != NULL;
+ return m_pInput != nullptr;
}
@@ -241,7 +241,7 @@ void CLCDInput::ActivateInput() CLCDConnection *pLCDCon = CLCDOutputManager::GetInstance()->GetLCDConnection();
pLCDCon->SetAsForeground(1);
- m_hKBHook = SetWindowsHookEx(WH_KEYBOARD_LL, CLCDInput::KeyboardHook, GetModuleHandle(NULL), 0);
+ m_hKBHook = SetWindowsHookEx(WH_KEYBOARD_LL, CLCDInput::KeyboardHook, GetModuleHandle(nullptr), 0);
if(!m_hKBHook)
return;
m_pInput = this;
@@ -256,9 +256,9 @@ void CLCDInput::DeactivateInput() if(!m_pInput)
return;
UnhookWindowsHookEx(m_hKBHook);
- m_hKBHook = NULL;
+ m_hKBHook = nullptr;
- m_pInput = NULL;
+ m_pInput = nullptr;
CLCDConnection *pLCDCon = CLCDOutputManager::GetInstance()->GetLCDConnection();
pLCDCon->SetAsForeground(0);
@@ -267,7 +267,7 @@ void CLCDInput::DeactivateInput() //************************************************************************
// CLCDInput::KeyboardHook
//************************************************************************
-CLCDInput* CLCDInput::m_pInput = NULL;
+CLCDInput* CLCDInput::m_pInput = nullptr;
LRESULT CALLBACK CLCDInput::KeyboardHook(int Code, WPARAM wParam, LPARAM lParam)
{
@@ -484,8 +484,8 @@ void CLCDInput::MoveMarker(int iDir,int iMove,bool bShift) else
iLen = (int)m_strText.length() - m_vLineOffsets[m_Marker[0].iLine].iOffset;
- HDC hDC = CreateCompatibleDC(NULL);
- if(NULL == hDC)
+ HDC hDC = CreateCompatibleDC(nullptr);
+ if(nullptr == hDC)
return;
SelectObject(hDC, m_hFont);
m_Marker[0].iXWidth = 1;
@@ -590,8 +590,8 @@ void CLCDInput::UpdateOffsets(int iModified) if(m_vLineOffsets.size() == 0 && m_strText.empty())
return;
- HDC hDC = CreateCompatibleDC(NULL);
- if(NULL == hDC)
+ HDC hDC = CreateCompatibleDC(nullptr);
+ if(nullptr == hDC)
return;
// Reset the marker
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp index e416be2810..3a87774f97 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp @@ -130,10 +130,10 @@ void CLCDLabel::UpdateCutOffIndex() }
// variables
- HDC hDC = CreateCompatibleDC(NULL);
+ HDC hDC = CreateCompatibleDC(nullptr);
SelectObject(hDC, m_hFont);
- if(NULL == hDC)
+ if(nullptr == hDC)
return;
int iWidth = GetWidth();
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDOutputManager.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDOutputManager.cpp index cf8c680d12..a40b18d2a8 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDOutputManager.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDOutputManager.cpp @@ -9,16 +9,16 @@ #include "CLCDOutputManager.h" #include <time.h> -CLCDOutputManager *CLCDOutputManager::m_pInstance = NULL; +CLCDOutputManager *CLCDOutputManager::m_pInstance = nullptr; //************************************************************************ // Constructor //************************************************************************ -CLCDOutputManager::CLCDOutputManager() : m_dwButtonRepeatDelay(300), m_pGfx(0), - m_pdwButtonRepeatTimers(0), m_pdwButtonRepeatStarts(0), m_pbButtonStates(0), - m_pLcdConnection(0), m_bInitialized(false), m_dwLastUpdate(0), m_pActiveScreen(NULL) +CLCDOutputManager::CLCDOutputManager() : m_dwButtonRepeatDelay(300), m_pGfx(nullptr), + m_pdwButtonRepeatTimers(nullptr), m_pdwButtonRepeatStarts(nullptr), m_pbButtonStates(nullptr), + m_pLcdConnection(nullptr), m_bInitialized(false), m_dwLastUpdate(0), m_pActiveScreen(nullptr) { - ASSERT(m_pInstance == NULL); + ASSERT(m_pInstance == nullptr); m_pInstance = this; m_strAppletName = L""; @@ -29,7 +29,7 @@ CLCDOutputManager::CLCDOutputManager() : m_dwButtonRepeatDelay(300), m_pGfx(0), //************************************************************************ CLCDOutputManager::~CLCDOutputManager() { - m_pInstance = NULL; + m_pInstance = nullptr; } //************************************************************************ @@ -37,7 +37,7 @@ CLCDOutputManager::~CLCDOutputManager() //************************************************************************ CLCDOutputManager* CLCDOutputManager::GetInstance() { - ASSERT(m_pInstance != NULL); + ASSERT(m_pInstance != nullptr); return m_pInstance; } @@ -47,7 +47,7 @@ CLCDOutputManager* CLCDOutputManager::GetInstance() //************************************************************************ CLCDConnection *CLCDOutputManager::GetLCDConnection() { - ASSERT(m_pLcdConnection != NULL); + ASSERT(m_pLcdConnection != nullptr); return m_pLcdConnection; } @@ -64,7 +64,7 @@ CLCDScreen *CLCDOutputManager::GetActiveScreen() //************************************************************************ bool CLCDOutputManager::Initialize(tstring strAppletName,bool bAutostart, bool bConfigDialog) { - srand ( time(NULL) ); + srand ( time(nullptr) ); InitDebug(); @@ -96,8 +96,8 @@ bool CLCDOutputManager::IsInitialized() //************************************************************************ bool CLCDOutputManager::Shutdown() { - ASSERT(NULL != m_pLcdConnection); - ASSERT(NULL != m_pGfx); + ASSERT(nullptr != m_pLcdConnection); + ASSERT(nullptr != m_pGfx); // Shutdown all screens vector<CLCDScreen*>::iterator iter = m_Screens.begin(); @@ -194,7 +194,7 @@ bool CLCDOutputManager::Update() ASSERT(m_bInitialized); // Update the active screen - if(m_pActiveScreen != NULL) + if(m_pActiveScreen != nullptr) { m_pActiveScreen->Update(); // Check if the active screen has expired @@ -256,7 +256,7 @@ bool CLCDOutputManager::Update() // Draw - if(m_pActiveScreen != NULL && m_pGfx->IsInitialized()) + if(m_pActiveScreen != nullptr && m_pGfx->IsInitialized()) { m_pGfx->BeginDraw(); m_pGfx->ClearScreen(); @@ -278,11 +278,11 @@ bool CLCDOutputManager::Update() //************************************************************************ bool CLCDOutputManager::DeactivateScreen() { - if(m_pActiveScreen == NULL) + if(m_pActiveScreen == nullptr) return false; CLCDScreen *pActiveScreen = m_pActiveScreen; - m_pActiveScreen = NULL; + m_pActiveScreen = nullptr; if(pActiveScreen->HasExpired()) { @@ -306,7 +306,7 @@ bool CLCDOutputManager::ActivateScreen(CLCDScreen *pScreen) return false; // If another screen is currently active, deactivate it - if(m_pActiveScreen != NULL) + if(m_pActiveScreen != nullptr) DeactivateScreen(); m_pActiveScreen = pScreen; diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDScreen.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDScreen.cpp index d599220b69..9373977239 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDScreen.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDScreen.cpp @@ -72,7 +72,7 @@ bool CLCDScreen::Update() {
// Loop through all objects and call their update function
vector<CLCDObject*>::iterator iter = m_Objects.begin();
- CLCDObject *pObject = NULL;
+ CLCDObject *pObject = nullptr;
while(iter != m_Objects.end())
{
pObject = *(iter);
@@ -91,7 +91,7 @@ bool CLCDScreen::Draw(CLCDGfx *pGfx) POINT ptPrevViewportOrg = { 0, 0 };
// Loop through all objects and call their draw function
vector<CLCDObject*>::iterator iter = m_Objects.begin();
- CLCDObject *pObject = NULL;
+ CLCDObject *pObject = nullptr;
while(iter != m_Objects.end())
{
pObject = *(iter);
@@ -126,13 +126,13 @@ bool CLCDScreen::Draw(CLCDGfx *pGfx) iter++;
}
// set the clipping region to nothing
- SelectClipRgn(pGfx->GetHDC(), NULL);
+ SelectClipRgn(pGfx->GetHDC(), nullptr);
// restore the viewport origin
SetViewportOrgEx(pGfx->GetHDC(),
0,
0,
- NULL);
+ nullptr);
return true;
}
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp index bbb9b689df..7c8ec5ca69 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp @@ -12,7 +12,7 @@ CLCDTextLog::CLCDTextLog() m_iLogSize = 10;
m_iPosition = 0;
m_iTextLines = 0;
- m_pScrollbar = NULL;
+ m_pScrollbar = nullptr;
m_eExpandMode = EXPAND_SCROLL;
m_eAutoScroll = SCROLL_MESSAGE;
m_iLastScrollDirection = 0;
@@ -78,7 +78,7 @@ bool CLCDTextLog::Draw(CLCDGfx *pGfx) int iSpacing = (GetHeight() - iLineCount*m_iFontHeight)/2;
list<CLogEntry*>::iterator iter = m_Entrys.begin();
- CLogEntry *pEntry = NULL;
+ CLogEntry *pEntry = nullptr;
RECT rBoundary = { 0, iSpacing,GetWidth() , GetHeight()-iSpacing};
int iPosition = 0;
int iLinesDrawn = 0;
@@ -291,10 +291,10 @@ void CLCDTextLog::WrapMessage(CLogEntry *pEntry) pEntry->vLines.clear();
tstring strString = pEntry->strString;
- HDC hDC = CreateCompatibleDC(NULL);
+ HDC hDC = CreateCompatibleDC(nullptr);
SelectObject(hDC, m_hFont);
- if(NULL == hDC)
+ if(nullptr == hDC)
return;
int iLen = (int)strString.size();
@@ -422,7 +422,7 @@ void CLCDTextLog::RefreshLines() m_iTextLines = 0;
- CLogEntry *pEntry = NULL;
+ CLogEntry *pEntry = nullptr;
list<CLogEntry*>::iterator iter = m_Entrys.begin();
while(iter != m_Entrys.end())
{
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp index 236cefc71b..01026cf43d 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp @@ -6,7 +6,7 @@ //************************************************************************
// constructor
//************************************************************************
-CLCDTextObject::CLCDTextObject() : m_bWordWrap(false), m_hFont(NULL), m_iFontHeight(0)
+CLCDTextObject::CLCDTextObject() : m_bWordWrap(false), m_hFont(nullptr), m_iFontHeight(0)
{
// Initialize DRAWTEXTPARAMS
memset(&m_dtp, 0, sizeof(DRAWTEXTPARAMS));
@@ -32,7 +32,7 @@ CLCDTextObject::~CLCDTextObject() bool CLCDTextObject::Initialize()
{
m_hFont = (HFONT) GetStockObject(DEFAULT_GUI_FONT);
- if(NULL != m_hFont)
+ if(nullptr != m_hFont)
{
SetFontFaceName(L"Small Fonts");
SetFontPointSize(6);
@@ -72,7 +72,7 @@ bool CLCDTextObject::SetFont(LOGFONT& lf) if (m_hFont)
{
DeleteObject(m_hFont);
- m_hFont = NULL;
+ m_hFont = nullptr;
}
m_hFont = CreateFontIndirect(&lf);
@@ -81,7 +81,7 @@ bool CLCDTextObject::SetFont(LOGFONT& lf) return false;
// Calculate the font's height
- HDC hDC = CreateCompatibleDC(NULL);
+ HDC hDC = CreateCompatibleDC(nullptr);
SelectObject(hDC, m_hFont);
TEXTMETRIC tmFontInfo;
diff --git a/plugins/MirandaG15/src/LCDFramework/ConStream.cpp b/plugins/MirandaG15/src/LCDFramework/ConStream.cpp Binary files differindex c9b7c2689c..88b2510e1f 100644 --- a/plugins/MirandaG15/src/LCDFramework/ConStream.cpp +++ b/plugins/MirandaG15/src/LCDFramework/ConStream.cpp diff --git a/plugins/MirandaG15/src/LCDFramework/misc.cpp b/plugins/MirandaG15/src/LCDFramework/misc.cpp index d71597c745..f3397cd7ee 100644 --- a/plugins/MirandaG15/src/LCDFramework/misc.cpp +++ b/plugins/MirandaG15/src/LCDFramework/misc.cpp @@ -36,14 +36,14 @@ BOOL IsUnicodeAscii(const wchar_t* pBuffer, int nSize) wstring
toWideString( const char* pStr , int len )
{
- if ( pStr == NULL )
+ if ( pStr == nullptr )
return L"" ;
//ASSERT_PTR( pStr ) ;
ASSERT( len >= 0 || len == -1);
// figure out how many wide characters we are going to get
- int nChars = MultiByteToWideChar( CP_ACP , 0 , pStr , len , NULL , 0 ) ;
+ int nChars = MultiByteToWideChar( CP_ACP , 0 , pStr , len , nullptr , 0 ) ;
if ( len == -1 )
-- nChars ;
if ( nChars == 0 )
@@ -69,7 +69,7 @@ toNarrowString( const wchar_t* pStr , int len ) // figure out how many narrow characters we are going to get
int nChars = WideCharToMultiByte( CP_ACP , 0 ,
- pStr , len , NULL , 0 , NULL , NULL ) ;
+ pStr , len , nullptr , 0 , nullptr , nullptr ) ;
if ( len == -1 )
-- nChars ;
if ( nChars == 0 )
@@ -81,7 +81,7 @@ toNarrowString( const wchar_t* pStr , int len ) buf.resize( nChars ) ;
//char *test = (char*)malloc((nChars+1)*sizeof(char));
WideCharToMultiByte( CP_ACP , 0 , pStr , len ,
- const_cast<char*>(buf.c_str()), nChars , NULL , NULL ) ;
+ const_cast<char*>(buf.c_str()), nChars , nullptr , nullptr ) ;
return buf ;
}
@@ -112,14 +112,14 @@ tstring Utf8_Decode(const char *str) int i;
char *p;
- WCHAR *wszTemp = NULL;
+ WCHAR *wszTemp = nullptr;
- if (str == NULL)
+ if (str == nullptr)
return strRes;
size_t len = mir_strlen(str);
- if ((wszTemp = (WCHAR *) malloc(sizeof(wchar_t) * (len + 2))) == NULL)
+ if ((wszTemp = (WCHAR *) malloc(sizeof(wchar_t) * (len + 2))) == nullptr)
return strRes;
p = (char *) str;
@@ -154,11 +154,11 @@ string Utf8_Encode(const WCHAR *str) {
string strRes = "";
- unsigned char *szOut = NULL;
+ unsigned char *szOut = nullptr;
int len, i;
const WCHAR *wszTemp, *w;
- if (str == NULL)
+ if (str == nullptr)
return strRes;
wszTemp = str;
@@ -171,7 +171,7 @@ string Utf8_Encode(const WCHAR *str) else len += 3;
}
- if ((szOut = (unsigned char *) malloc(len + 2)) == NULL)
+ if ((szOut = (unsigned char *) malloc(len + 2)) == nullptr)
return strRes;
i = 0;
diff --git a/plugins/MirandaG15/src/Miranda.cpp b/plugins/MirandaG15/src/Miranda.cpp index 9c447d28e3..7da57367f3 100644 --- a/plugins/MirandaG15/src/Miranda.cpp +++ b/plugins/MirandaG15/src/Miranda.cpp @@ -163,7 +163,7 @@ int Init(WPARAM, LPARAM) if(CConfig::GetBoolSetting(SKIP_DRIVER_ERROR)) {
tstring text = L"Failed to initialize the LCD connection\n Make sure you have the newest Logitech drivers installed (>=1.03).\n";
tstring title = _A2W(APP_SHORTNAME);
- MessageBox(NULL, text.c_str(), title.c_str(), MB_OK | MB_ICONEXCLAMATION);
+ MessageBox(nullptr, text.c_str(), title.c_str(), MB_OK | MB_ICONEXCLAMATION);
}
TRACE(L"Initialization failed!.\n");
|