summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin10/lib/Miranda32.libbin0 -> 5202 bytes
-rw-r--r--bin10/lib/Miranda64.libbin0 -> 5070 bytes
-rw-r--r--bin10/mir_full.sln16
-rw-r--r--bin10/mir_full_pro.sln245
-rw-r--r--include/m_addcontact.h4
-rw-r--r--include/m_awaymsg.h8
-rw-r--r--include/m_clc.h102
-rw-r--r--include/m_clist.h176
-rw-r--r--include/m_clui.h48
-rw-r--r--include/m_database.h180
-rw-r--r--include/m_email.h4
-rw-r--r--include/m_file.h16
-rw-r--r--include/m_findadd.h2
-rw-r--r--include/m_fuse.h4
-rw-r--r--include/m_history.h4
-rw-r--r--include/m_hotkeys.h16
-rw-r--r--include/m_icq.h46
-rw-r--r--include/m_ignore.h18
-rw-r--r--include/m_json.h102
-rw-r--r--include/m_langpack.h28
-rw-r--r--include/m_message.h22
-rw-r--r--include/m_netlib.h124
-rw-r--r--include/m_options.h14
-rw-r--r--include/m_popup.h6
-rw-r--r--include/m_protocols.h52
-rw-r--r--include/m_protomod.h38
-rw-r--r--include/m_protosvc.h234
-rw-r--r--include/m_skin.h20
-rw-r--r--include/m_system.h41
-rw-r--r--include/m_system_cpp.h6
-rw-r--r--include/m_url.h4
-rw-r--r--include/m_userinfo.h20
-rw-r--r--include/m_utils.h96
-rw-r--r--include/m_xml.h10
-rw-r--r--include/newpluginapi.h8
-rw-r--r--include/win2k.h12
-rw-r--r--plugins/Clist_nicer/SRC/clc.cpp12
-rw-r--r--plugins/Clist_nicer/SRC/clcpaint.cpp24
-rw-r--r--plugins/Clist_nicer/SRC/clui.cpp1
-rw-r--r--plugins/Clist_nicer/SRC/init.cpp65
-rw-r--r--plugins/Clist_nicer/SRC/statusbar.cpp2
-rw-r--r--plugins/Mir_core/Miranda32.libbin2204 -> 0 bytes
-rw-r--r--plugins/Mir_core/Miranda64.libbin2186 -> 0 bytes
-rw-r--r--plugins/Mir_core/mir_core_10.vcxproj12
-rw-r--r--plugins/TabSRMM/include/themes.h1
-rw-r--r--plugins/TabSRMM/src/themes.cpp11
-rw-r--r--src/core/commonheaders.h1
-rw-r--r--src/core/miranda.cpp55
-rw-r--r--src/core/miranda.h21
-rw-r--r--src/core/modules.cpp10
-rw-r--r--src/core/stdplug.h23
-rw-r--r--src/core/stduserinfo/commonheaders.cpp2
-rw-r--r--src/core/stduserinfo/commonheaders.h96
-rw-r--r--src/core/stduserinfo/contactinfo.cpp528
-rw-r--r--src/core/stduserinfo/main.cpp90
-rw-r--r--src/core/stduserinfo/res/cursor_hyperlink.curbin0 -> 326 bytes
-rw-r--r--src/core/stduserinfo/resource.rc303
-rw-r--r--src/core/stduserinfo/stdinfo.cpp (renamed from src/modules/userinfo/stdinfo.cpp)126
-rw-r--r--src/core/stduserinfo/stduserinfo_10.vcxproj218
-rw-r--r--src/core/stduserinfo/stduserinfo_10.vcxproj.filters50
-rw-r--r--src/core/stduserinfo/userinfo.cpp (renamed from src/modules/userinfo/userinfo.cpp)189
-rw-r--r--src/core/stduserinfo/version.h14
-rw-r--r--src/core/stduserinfo/version.rc38
-rw-r--r--src/miranda32.def20
-rw-r--r--src/miranda32_10.vcxproj10
-rw-r--r--src/miranda32_10.vcxproj.filters15
-rw-r--r--src/modules/addcontact/addcontact.cpp16
-rw-r--r--src/modules/button/button.cpp26
-rw-r--r--src/modules/clist/Docking.cpp2
-rw-r--r--src/modules/clist/clc.cpp12
-rw-r--r--src/modules/clist/clcfiledrop.cpp4
-rw-r--r--src/modules/clist/clcitems.cpp16
-rw-r--r--src/modules/clist/clcutils.cpp6
-rw-r--r--src/modules/clist/clistevents.cpp66
-rw-r--r--src/modules/clist/clistmenus.cpp104
-rw-r--r--src/modules/clist/clistmod.cpp14
-rw-r--r--src/modules/clist/clistsettings.cpp2
-rw-r--r--src/modules/clist/clisttray.cpp58
-rw-r--r--src/modules/clist/clui.cpp18
-rw-r--r--src/modules/clist/cluiservices.cpp6
-rw-r--r--src/modules/clist/contact.cpp4
-rw-r--r--src/modules/clist/genmenu.cpp48
-rw-r--r--src/modules/clist/genmenuopt.cpp166
-rw-r--r--src/modules/clist/groups.cpp12
-rw-r--r--src/modules/clist/keyboard.cpp42
-rw-r--r--src/modules/clist/movetogroup.cpp26
-rw-r--r--src/modules/clist/protocolorder.cpp34
-rw-r--r--src/modules/contacts/contacts.cpp42
-rw-r--r--src/modules/database/database.cpp54
-rw-r--r--src/modules/database/dbini.cpp96
-rw-r--r--src/modules/database/dbutils.cpp6
-rw-r--r--src/modules/database/profilemanager.cpp98
-rw-r--r--src/modules/database/profilemanager.h10
-rw-r--r--src/modules/findadd/findadd.cpp314
-rw-r--r--src/modules/findadd/searchresults.cpp88
-rw-r--r--src/modules/fonts/FontOptions.cpp74
-rw-r--r--src/modules/fonts/services.cpp22
-rw-r--r--src/modules/help/about.cpp14
-rw-r--r--src/modules/help/help.cpp6
-rw-r--r--src/modules/history/history.cpp66
-rw-r--r--src/modules/icolib/extracticon.cpp8
-rw-r--r--src/modules/icolib/skin2icons.cpp20
-rw-r--r--src/modules/icolib/skin2opts.cpp14
-rw-r--r--src/modules/idle/idle.cpp18
-rw-r--r--src/modules/ignore/ignore.cpp148
-rw-r--r--src/modules/json/JSONChildren.cpp50
-rw-r--r--src/modules/json/JSONDebug.cpp54
-rw-r--r--src/modules/json/JSONIterators.cpp56
-rw-r--r--src/modules/json/JSONMemory.cpp50
-rw-r--r--src/modules/json/JSONMemory.h2
-rw-r--r--src/modules/json/JSONNode.cpp52
-rw-r--r--src/modules/json/JSONNode.h4
-rw-r--r--src/modules/json/JSONWorker.cpp42
-rw-r--r--src/modules/json/JSONWriter.cpp4
-rw-r--r--src/modules/json/JSON_Base64.cpp58
-rw-r--r--src/modules/json/NumberToString.h4
-rw-r--r--src/modules/json/json.cpp8
-rw-r--r--src/modules/netlib/netlib.cpp164
-rw-r--r--src/modules/netlib/netlib.h4
-rw-r--r--src/modules/netlib/netlibautoproxy.cpp12
-rw-r--r--src/modules/netlib/netlibbind.cpp4
-rw-r--r--src/modules/netlib/netlibhttp.cpp23
-rw-r--r--src/modules/netlib/netlibhttpproxy.cpp36
-rw-r--r--src/modules/netlib/netliblog.cpp106
-rw-r--r--src/modules/netlib/netlibopenconn.cpp40
-rw-r--r--src/modules/netlib/netlibopts.cpp134
-rw-r--r--src/modules/netlib/netlibpktrecver.cpp32
-rw-r--r--src/modules/netlib/netlibsecurity.cpp6
-rw-r--r--src/modules/netlib/netlibsock.cpp10
-rw-r--r--src/modules/netlib/netlibssl.cpp116
-rw-r--r--src/modules/netlib/netlibupnp.cpp50
-rw-r--r--src/modules/options/descbutton.cpp78
-rw-r--r--src/modules/options/filter.cpp8
-rw-r--r--src/modules/options/filter.h14
-rw-r--r--src/modules/options/headerbar.cpp80
-rw-r--r--src/modules/options/iconheader.cpp128
-rw-r--r--src/modules/options/options.cpp38
-rw-r--r--src/modules/plugins/newplugins.cpp142
-rw-r--r--src/modules/plugins/pluginopts.cpp26
-rw-r--r--src/modules/plugins/plugins.h16
-rw-r--r--src/modules/protocols/protoaccs.cpp10
-rw-r--r--src/modules/protocols/protochains.cpp8
-rw-r--r--src/modules/protocols/protocols.cpp22
-rw-r--r--src/modules/protocols/protoopts.cpp16
-rw-r--r--src/modules/skin/hotkey_opts.cpp14
-rw-r--r--src/modules/skin/hotkeys.cpp30
-rw-r--r--src/modules/skin/skinicons.cpp36
-rw-r--r--src/modules/skin/sounds.cpp10
-rw-r--r--src/modules/srauth/auth.cpp2
-rw-r--r--src/modules/srauth/authdialogs.cpp24
-rw-r--r--src/modules/srawaymsg/awaymsg.cpp14
-rw-r--r--src/modules/srawaymsg/sendmsg.cpp6
-rw-r--r--src/modules/sremail/email.cpp4
-rw-r--r--src/modules/srfile/file.cpp46
-rw-r--r--src/modules/srfile/file.h10
-rw-r--r--src/modules/srfile/fileexistsdlg.cpp80
-rw-r--r--src/modules/srfile/fileopts.cpp18
-rw-r--r--src/modules/srfile/filerecvdlg.cpp70
-rw-r--r--src/modules/srfile/filesenddlg.cpp36
-rw-r--r--src/modules/srfile/filexferdlg.cpp124
-rw-r--r--src/modules/srfile/ftmanager.cpp20
-rw-r--r--src/modules/srurl/url.cpp46
-rw-r--r--src/modules/srurl/urldialogs.cpp152
-rw-r--r--src/modules/updatenotify/updatenotify.cpp2
-rw-r--r--src/modules/userinfo/contactinfo.cpp515
-rw-r--r--src/modules/useronline/useronline.cpp22
-rw-r--r--src/modules/utils/bmpfilter.cpp72
-rw-r--r--src/modules/utils/colourpicker.cpp44
-rw-r--r--src/modules/utils/hyperlink.cpp106
-rw-r--r--src/modules/utils/imgconv.cpp2
-rw-r--r--src/modules/utils/path.cpp4
-rw-r--r--src/modules/utils/resizer.cpp52
-rw-r--r--src/modules/utils/timeutils.cpp2
-rw-r--r--src/modules/utils/timezones.cpp34
-rw-r--r--src/modules/utils/utils.cpp26
-rw-r--r--src/modules/utils/windowlist.cpp18
-rw-r--r--src/modules/visibility/visibility.cpp96
-rw-r--r--src/modules/xml/xmlApi.cpp104
-rw-r--r--src/modules/xml/xmlParser.cpp944
-rw-r--r--src/modules/xml/xmlParser.h162
-rw-r--r--src/resource.rc238
181 files changed, 5491 insertions, 4844 deletions
diff --git a/bin10/lib/Miranda32.lib b/bin10/lib/Miranda32.lib
new file mode 100644
index 0000000000..7aafc9e156
--- /dev/null
+++ b/bin10/lib/Miranda32.lib
Binary files differ
diff --git a/bin10/lib/Miranda64.lib b/bin10/lib/Miranda64.lib
new file mode 100644
index 0000000000..a399a5f10a
--- /dev/null
+++ b/bin10/lib/Miranda64.lib
Binary files differ
diff --git a/bin10/mir_full.sln b/bin10/mir_full.sln
index 72187ed962..30f45701c3 100644
--- a/bin10/mir_full.sln
+++ b/bin10/mir_full.sln
@@ -257,10 +257,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AutoShutdown", "..\plugins\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvatarHistory", "..\plugins\AvatarHistory\AvatarHistory.vcxproj", "{7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stduserinfo", "..\src\core\stduserinfo\stduserinfo_10.vcxproj", "{1C856B14-54CD-4D07-B18B-5F7DB073AB51}"
+EndProject
Global
- GlobalSection(DPCodeReviewSolutionGUID) = preSolution
- DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
- EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
@@ -1279,8 +1278,19 @@ Global
{7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}.Release|Win32.Build.0 = Release|Win32
{7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}.Release|x64.ActiveCfg = Release|x64
{7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}.Release|x64.Build.0 = Release|x64
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Debug|Win32.Build.0 = Debug|Win32
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Debug|x64.ActiveCfg = Debug|x64
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Debug|x64.Build.0 = Debug|x64
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|Win32.ActiveCfg = Release|Win32
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|Win32.Build.0 = Release|Win32
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|x64.ActiveCfg = Release|x64
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(DPCodeReviewSolutionGUID) = preSolution
+ DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
+ EndGlobalSection
EndGlobal
diff --git a/bin10/mir_full_pro.sln b/bin10/mir_full_pro.sln
index e67617a796..1f3b737852 100644
--- a/bin10/mir_full_pro.sln
+++ b/bin10/mir_full_pro.sln
@@ -255,7 +255,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cryptlib", "..\plugins\Cryp
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AutoShutdown", "..\plugins\AutoShutdown\shutdown.vcxproj", "{F8776664-EFE8-CDD6-ACFD-3136E7FE2724}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvatarHistory", "..\plugins\AvatarHistory\AvatarHistory.vcxproj", "{82B3575E-44B2-A9DB-FC7D-605296DEE123}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvatarHistory", "..\plugins\AvatarHistory\AvatarHistory.vcxproj", "{7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contact Lists", "Contact Lists", "{0D22875F-6B96-49C3-BA4F-D7E573A1515B}"
EndProject
@@ -291,6 +291,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Messaging Enhancements Modu
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stduserinfo", "..\src\core\stduserinfo\stduserinfo_10.vcxproj", "{1C856B14-54CD-4D07-B18B-5F7DB073AB51}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -1302,149 +1304,158 @@ Global
{F8776664-EFE8-CDD6-ACFD-3136E7FE2724}.Release|Win32.Build.0 = Release|Win32
{F8776664-EFE8-CDD6-ACFD-3136E7FE2724}.Release|x64.ActiveCfg = Release|x64
{F8776664-EFE8-CDD6-ACFD-3136E7FE2724}.Release|x64.Build.0 = Release|x64
- {82B3575E-44B2-A9DB-FC7D-605296DEE123}.Debug|Win32.ActiveCfg = Debug|Win32
- {82B3575E-44B2-A9DB-FC7D-605296DEE123}.Debug|Win32.Build.0 = Debug|Win32
- {82B3575E-44B2-A9DB-FC7D-605296DEE123}.Debug|x64.ActiveCfg = Debug|x64
- {82B3575E-44B2-A9DB-FC7D-605296DEE123}.Debug|x64.Build.0 = Debug|x64
- {82B3575E-44B2-A9DB-FC7D-605296DEE123}.Release|Win32.ActiveCfg = Release|Win32
- {82B3575E-44B2-A9DB-FC7D-605296DEE123}.Release|Win32.Build.0 = Release|Win32
- {82B3575E-44B2-A9DB-FC7D-605296DEE123}.Release|x64.ActiveCfg = Release|x64
- {82B3575E-44B2-A9DB-FC7D-605296DEE123}.Release|x64.Build.0 = Release|x64
+ {7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}.Debug|Win32.ActiveCfg = Debug|Win32
+ {7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}.Debug|Win32.Build.0 = Debug|Win32
+ {7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}.Debug|x64.ActiveCfg = Debug|x64
+ {7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}.Debug|x64.Build.0 = Debug|x64
+ {7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}.Release|Win32.ActiveCfg = Release|Win32
+ {7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}.Release|Win32.Build.0 = Release|Win32
+ {7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}.Release|x64.ActiveCfg = Release|x64
+ {7A50C5F4-866B-B8BD-D5FA-0EE6745194C6}.Release|x64.Build.0 = Release|x64
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Debug|Win32.Build.0 = Debug|Win32
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Debug|x64.ActiveCfg = Debug|x64
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Debug|x64.Build.0 = Debug|x64
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|Win32.ActiveCfg = Release|Win32
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|Win32.Build.0 = Release|Win32
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|x64.ActiveCfg = Release|x64
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {E71C1722-A41D-4475-87F4-29961A3654BB} = {0D22875F-6B96-49C3-BA4F-D7E573A1515B}
- {D9057E63-AAAA-4FE7-800A-20C02F4761F3} = {0D22875F-6B96-49C3-BA4F-D7E573A1515B}
- {56997126-0098-407A-94E1-7C5748C1C9EF} = {0D22875F-6B96-49C3-BA4F-D7E573A1515B}
- {3C42510C-A29E-4A53-899C-203BFA874E0B} = {0D22875F-6B96-49C3-BA4F-D7E573A1515B}
- {987F026D-EB1F-4013-ADA8-2406ACCDA526} = {0D22875F-6B96-49C3-BA4F-D7E573A1515B}
- {6E233FE8-8D90-454F-A9DC-AC2B5555D137} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
- {8B778B6A-F5EF-49A4-8437-424832F2B280} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
- {20D781FB-4A20-4B75-B863-304A47182966} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
- {6D3DC604-9CA0-45A2-85D7-1EFE3309F23B} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
- {2D0BB338-FF3A-4FB5-A7A5-32B63967678C} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
- {EAEA72C2-11FB-433D-8D79-8F88CDEE52A7} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
- {A2E9DA24-95E4-4414-94AF-488A382E276A} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
- {751ED05D-AD3E-4EC6-A485-4ECDF1FE6068} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
- {F60935E3-8F27-46E2-8598-013E7D4C90E7} = {EAEA72C2-11FB-433D-8D79-8F88CDEE52A7}
- {7E88D7F5-8B0A-4B79-84CD-D7982D4E0D4D} = {EAEA72C2-11FB-433D-8D79-8F88CDEE52A7}
- {541BE2B3-4320-47B8-AB64-C7F7ED0EFABA} = {EAEA72C2-11FB-433D-8D79-8F88CDEE52A7}
- {E38B4212-53BC-49A7-B821-9A99DB4774C6} = {EAEA72C2-11FB-433D-8D79-8F88CDEE52A7}
- {268BD296-8DD3-4715-A386-CF120398EC98} = {87D96006-542C-4396-87EF-68E3C3D2797F}
- {99D26CA1-BFD4-4E77-9A1E-919E54CF33F7} = {87D96006-542C-4396-87EF-68E3C3D2797F}
- {F47EAB99-C78F-4A92-87D5-B0E16FE5A133} = {87D96006-542C-4396-87EF-68E3C3D2797F}
- {B8928210-546C-4AE3-956B-E2B724E6B8E5} = {87D96006-542C-4396-87EF-68E3C3D2797F}
- {B988F96C-F87A-484C-AB15-D0674B22F291} = {87D96006-542C-4396-87EF-68E3C3D2797F}
- {B6FC188B-8E54-4197-9444-8BADE9AA75E2} = {31B8FE37-AC37-40AC-85AC-78B04C2CAC17}
- {726460C7-E1F1-4C37-B64F-DA8A8DD26D70} = {31B8FE37-AC37-40AC-85AC-78B04C2CAC17}
- {E26D2311-C164-48CF-BA24-5CEDA873D1B2} = {31B8FE37-AC37-40AC-85AC-78B04C2CAC17}
- {576EEEFD-E423-482B-879A-F0515D40B8E1} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {9C6040B8-1173-40FA-A3DB-DE044CCD8250} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {3CE5572B-B7B0-4D1C-9D10-4622FBA6198E} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {8190CFAA-3B73-43D8-9101-8368E21F1864} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {914B61B9-3383-4FA1-9BA9-350200B734B5} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {4C1CE389-7129-45FC-83C2-E9C310AC0427} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {21F6C0E4-DD1A-49E6-82FD-64574BB902BD} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {3038EF69-85BE-4D92-9864-CD6A5EBB558A} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {7711F563-6473-4ABD-B5E3-477CE8384AD6} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
{D0C4EACD-F264-4CFA-9AFC-3918FEC31A9A} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {153DD132-084C-4DE4-8F40-A088BCB22723} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
{2CF5BEA8-BD73-ED7B-FC7C-32E7E972A630} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {B57D997C-73E1-D5F7-ECCA-C204345C04A3} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {F8776664-EFE8-CDD6-ACFD-3136E7FE2724} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {5F09C93B-463A-4BF5-A85E-6E4E916AA8F8} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {A231E008-2D1A-4F24-95DD-59F56F85A499} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
{B4361FA0-4073-4B60-EE72-F5C08E6EDF61} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {019FAEBD-BD7B-4470-A15B-A7DB1787E6BD} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
{2CBA4321-8FA3-4385-BAB6-5387668FBBC4} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {153DD132-084C-4DE4-8F40-A088BCB22723} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {A231E008-2D1A-4F24-95DD-59F56F85A499} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {5A6095F4-B037-4DA8-8410-8004A90C961A} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {914B61B9-3383-4FA1-9BA9-350200B734B5} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {019FAEBD-BD7B-4470-A15B-A7DB1787E6BD} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {8190CFAA-3B73-43D8-9101-8368E21F1864} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {21F6C0E4-DD1A-49E6-82FD-64574BB902BD} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
{728CF16E-F3FF-4DEB-88C5-E9118F61ACD5} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {F2ABCBFB-FEB8-49DF-B166-C2FA5148ACE1} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {5A6095F4-B037-4DA8-8410-8004A90C961A} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {9C6040B8-1173-40FA-A3DB-DE044CCD8250} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
{92E3BDEE-DD17-4619-AD61-70C0ADE04217} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
- {803DA965-4B1C-4BF3-A35E-A3A12D4121D3} = {76177119-A395-4739-AECE-25D4864198AD}
- {3E727941-2854-4F64-ADA5-BF3BF104A4A3} = {76177119-A395-4739-AECE-25D4864198AD}
- {88E47CF7-7B40-4312-A35A-9B28885FFED9} = {76177119-A395-4739-AECE-25D4864198AD}
- {3E6CEC79-5E93-4607-B10E-498586ECF6A6} = {76177119-A395-4739-AECE-25D4864198AD}
- {4AC1E062-0236-4E49-AA04-F732043D2DCF} = {803DA965-4B1C-4BF3-A35E-A3A12D4121D3}
- {290C5ED4-71A7-4040-AD26-4820CF7A9E60} = {803DA965-4B1C-4BF3-A35E-A3A12D4121D3}
- {4ADADECA-99D7-410D-8127-CB27210DCC6A} = {803DA965-4B1C-4BF3-A35E-A3A12D4121D3}
- {40FE7861-E54E-4DA9-BE4D-A5178014E477} = {3E727941-2854-4F64-ADA5-BF3BF104A4A3}
- {1423FC8F-AA52-4562-8275-4BF0838CA378} = {3E727941-2854-4F64-ADA5-BF3BF104A4A3}
- {2C050CAF-D8AA-468A-B1A7-89F3BE99D3C8} = {3E727941-2854-4F64-ADA5-BF3BF104A4A3}
- {53F841E8-284F-4545-9176-B131896E43F8} = {3E727941-2854-4F64-ADA5-BF3BF104A4A3}
- {66503A70-B1E8-4545-B4FF-2108DFB40C72} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
- {D548A54E-310B-4A86-A545-64BDD5748745} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
- {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
- {6A516E27-AC50-5374-756B-A1558DB2EFA9} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
- {D3D80E27-D099-41EC-AFB2-A891A33F1608} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
- {2AD2FF74-06E1-4BD8-984A-526F3C6315B3} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
- {63E05ECA-0A63-479E-86BD-2CAF53869BDA} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
- {2E0A2793-94C3-82E7-2AB0-FD421816CFBF} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
- {D726A7E5-CF4C-4CF2-A2D3-073DECEC0260} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
- {F29CCB9B-79CF-4341-AA05-3626A036D3E3} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
- {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
- {EFD45F48-63D5-48AE-96CD-8ADB3545A4EE} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
- {6A1969EA-9657-4828-93E0-8D21A970F868} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
- {A9265E36-7F2D-440C-BF3E-F447FDB6200F} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
- {E37561EB-B9C5-4215-9FF9-DB559916FBA2} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
- {1948EAEA-4C25-4F6B-AD9E-5891F656EADA} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
- {3933E789-D185-41DC-8169-9FF4365B6015} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
- {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
- {736E59E5-CDCE-4C88-9C3A-E7913D45C9EC} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
- {2A737817-2443-48FF-A2E8-CA8D69E450F3} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
- {01DDCB36-4DE2-405D-BC36-2C8BDEB86659} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {3038EF69-85BE-4D92-9864-CD6A5EBB558A} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {576EEEFD-E423-482B-879A-F0515D40B8E1} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {4C1CE389-7129-45FC-83C2-E9C310AC0427} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {5F09C93B-463A-4BF5-A85E-6E4E916AA8F8} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {F2ABCBFB-FEB8-49DF-B166-C2FA5148ACE1} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {B57D997C-73E1-D5F7-ECCA-C204345C04A3} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {3CE5572B-B7B0-4D1C-9D10-4622FBA6198E} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {F8776664-EFE8-CDD6-ACFD-3136E7FE2724} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {7711F563-6473-4ABD-B5E3-477CE8384AD6} = {A93476F5-9C4C-48A6-A8A4-C79D804A3228}
+ {B8928210-546C-4AE3-956B-E2B724E6B8E5} = {87D96006-542C-4396-87EF-68E3C3D2797F}
+ {99D26CA1-BFD4-4E77-9A1E-919E54CF33F7} = {87D96006-542C-4396-87EF-68E3C3D2797F}
+ {F47EAB99-C78F-4A92-87D5-B0E16FE5A133} = {87D96006-542C-4396-87EF-68E3C3D2797F}
+ {B988F96C-F87A-484C-AB15-D0674B22F291} = {87D96006-542C-4396-87EF-68E3C3D2797F}
+ {268BD296-8DD3-4715-A386-CF120398EC98} = {87D96006-542C-4396-87EF-68E3C3D2797F}
+ {F9916510-9055-4C9F-997A-3755DEC1511B} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
+ {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
+ {E2A369CD-EDA3-414F-8AD0-E732CD7EE68C} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
+ {1C856B14-54CD-4D07-B18B-5F7DB073AB51} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
+ {20D781FB-4A20-4B75-B863-304A47182966} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
+ {A2E9DA24-95E4-4414-94AF-488A382E276A} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
+ {6D3DC604-9CA0-45A2-85D7-1EFE3309F23B} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
+ {751ED05D-AD3E-4EC6-A485-4ECDF1FE6068} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
+ {6E233FE8-8D90-454F-A9DC-AC2B5555D137} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
+ {2D0BB338-FF3A-4FB5-A7A5-32B63967678C} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
+ {EAEA72C2-11FB-433D-8D79-8F88CDEE52A7} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
+ {8B778B6A-F5EF-49A4-8437-424832F2B280} = {BB69C74C-04FF-498B-8288-8259C3C5A41C}
+ {4C132C24-F38A-41A4-99DB-E3CBD86E6714} = {48032210-388E-4227-8DE5-61680B2B3A30}
+ {9299B507-1AF9-4C93-9560-5F637D1E0C9E} = {48032210-388E-4227-8DE5-61680B2B3A30}
{6DA1396F-2A44-4D5C-8442-012F71006217} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
- {33276462-8313-4192-8306-13717ECCA60A} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
{3A12F777-56A8-42EC-BD17-8F325524241E} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
- {C5A87409-F08C-4A07-A8F9-1F5D52BA6D72} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
{E42870DB-9FED-44E7-9C93-4E64D0C87F51} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
- {6BFE3E13-BD5D-4C1C-BB29-A82FB51A16CE} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
- {12FFF2B0-0D0B-430B-A4C6-1577CA98F598} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
- {6DE11A47-2268-4B08-8DE5-15A1705FCE28} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {01DDCB36-4DE2-405D-BC36-2C8BDEB86659} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {33276462-8313-4192-8306-13717ECCA60A} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {7B0F213E-C15E-4219-8AE5-49DD3D3D553D} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {C5A87409-F08C-4A07-A8F9-1F5D52BA6D72} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {2A737817-2443-48FF-A2E8-CA8D69E450F3} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
{DADE9455-DC28-465A-9604-2CA28052B9FB} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
- {D5E2FEC1-B29A-476C-BD41-469FE282EE0F} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {6BFE3E13-BD5D-4C1C-BB29-A82FB51A16CE} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
{C619A811-8023-4441-B3D7-785388A09DF0} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
- {9299B507-1AF9-4C93-9560-5F637D1E0C9E} = {48032210-388E-4227-8DE5-61680B2B3A30}
- {4C132C24-F38A-41A4-99DB-E3CBD86E6714} = {48032210-388E-4227-8DE5-61680B2B3A30}
- {7DF5234A-A93A-47AD-8201-377ECF59AE5F} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B}
- {850EC838-0EAD-45EB-6F1B-16DC90DCE18D} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B}
- {82B3575E-44B2-A9DB-FC7D-605296DEE123} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B}
- {9DE1F0B0-B9D1-4681-82E7-13CC3E047445} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B}
- {07137F45-8B5F-4561-BEC8-B883E9123785} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B}
- {2C818919-A38F-44FF-BD91-A6A204AC592A} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
- {253ADD1D-F7C9-4643-A957-51BFCD61A5D2} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
+ {D5E2FEC1-B29A-476C-BD41-469FE282EE0F} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {6DE11A47-2268-4B08-8DE5-15A1705FCE28} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {12FFF2B0-0D0B-430B-A4C6-1577CA98F598} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {736E59E5-CDCE-4C88-9C3A-E7913D45C9EC} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4}
+ {987F026D-EB1F-4013-ADA8-2406ACCDA526} = {0D22875F-6B96-49C3-BA4F-D7E573A1515B}
+ {D9057E63-AAAA-4FE7-800A-20C02F4761F3} = {0D22875F-6B96-49C3-BA4F-D7E573A1515B}
+ {56997126-0098-407A-94E1-7C5748C1C9EF} = {0D22875F-6B96-49C3-BA4F-D7E573A1515B}
+ {E71C1722-A41D-4475-87F4-29961A3654BB} = {0D22875F-6B96-49C3-BA4F-D7E573A1515B}
+ {3C42510C-A29E-4A53-899C-203BFA874E0B} = {0D22875F-6B96-49C3-BA4F-D7E573A1515B}
+ {F4F2FD25-1553-FB72-F695-0701D20C3168} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
+ {778D0DEB-C798-45D3-98E0-ABAB242573C8} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
+ {2D0B4CB0-3ACA-4612-B745-FF3050E1500A} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
{AF7D71D4-19B7-42B8-91DD-701F155AC4AE} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
{9290A9CC-3FDA-4FD6-A8A2-04AD4BA1C856} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
- {210DD88D-649B-4695-8C5F-898A4F60A8CE} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
- {C09A0E86-E7C3-4229-B817-C86A0AE8ACE5} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
{9DF8913A-99A3-40D2-86FE-585EBDDCABB2} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
- {DB315D7D-00BB-43B2-93A6-0430CA2B9F28} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
{214F211F-1A2B-4F79-8993-B8DEE2EF7441} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
- {778D0DEB-C798-45D3-98E0-ABAB242573C8} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
- {86704897-EABF-439D-BE0E-52CEA67C2C43} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
- {F4F2FD25-1553-FB72-F695-0701D20C3168} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
- {2D0B4CB0-3ACA-4612-B745-FF3050E1500A} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
+ {210DD88D-649B-4695-8C5F-898A4F60A8CE} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
+ {C09A0E86-E7C3-4229-B817-C86A0AE8ACE5} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
+ {2C818919-A38F-44FF-BD91-A6A204AC592A} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
{AD3B6CDC-7B26-4338-B6AE-0306DEDA0D6A} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
+ {86704897-EABF-439D-BE0E-52CEA67C2C43} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
+ {253ADD1D-F7C9-4643-A957-51BFCD61A5D2} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
{ECE691D0-BFB3-483B-A699-084269EFCE89} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
- {5BBA7E51-B494-4462-BC4F-1AE5F57F9857} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
- {5DB86086-10E9-42E7-AC90-503D2678C2A2} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
- {D85D47E7-EAD3-71E0-EE3A-49A7821D4DE4} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
- {82F96271-4136-4B0E-AB6F-040DE7A4DD1E} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
- {0BB52326-02D5-4698-A180-24078DA5DA0E} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
- {98DF7761-41D7-4C5C-9FFE-E5CCB3997783} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
- {06C44834-7B7A-4074-A6D8-7F163B3FF707} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
+ {DB315D7D-00BB-43B2-93A6-0430CA2B9F28} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649}
+ {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
+ {D726A7E5-CF4C-4CF2-A2D3-073DECEC0260} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
+ {EFD45F48-63D5-48AE-96CD-8ADB3545A4EE} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
+ {1948EAEA-4C25-4F6B-AD9E-5891F656EADA} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
+ {E37561EB-B9C5-4215-9FF9-DB559916FBA2} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
+ {A9265E36-7F2D-440C-BF3E-F447FDB6200F} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
+ {6A1969EA-9657-4828-93E0-8D21A970F868} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
+ {2E0A2793-94C3-82E7-2AB0-FD421816CFBF} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
+ {F29CCB9B-79CF-4341-AA05-3626A036D3E3} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
+ {3933E789-D185-41DC-8169-9FF4365B6015} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46}
{0007BE9F-DD4D-4E9B-B1C8-C5049538F862} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
- {5FAA475D-0593-454F-8601-0D7150DCA4A0} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
{DD76B998-ED0D-4BFD-9660-3ADC3A334872} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
{27CA5499-B3F2-4FB6-8414-651819B0B96C} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
{37C2B9A4-63EF-49E8-BF23-677B5EBD73E9} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
+ {06C44834-7B7A-4074-A6D8-7F163B3FF707} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
+ {5BBA7E51-B494-4462-BC4F-1AE5F57F9857} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
+ {82F96271-4136-4B0E-AB6F-040DE7A4DD1E} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
+ {5DB86086-10E9-42E7-AC90-503D2678C2A2} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
+ {5FAA475D-0593-454F-8601-0D7150DCA4A0} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
+ {D85D47E7-EAD3-71E0-EE3A-49A7821D4DE4} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
+ {0BB52326-02D5-4698-A180-24078DA5DA0E} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
- {D9EFEA4B-B817-4DE1-BD62-68A5DB8F5F60} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
- {F9916510-9055-4C9F-997A-3755DEC1511B} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
- {E2A369CD-EDA3-414F-8AD0-E732CD7EE68C} = {CBBD3DE7-97CE-479D-87E3-8EACD035AF9B}
+ {98DF7761-41D7-4C5C-9FFE-E5CCB3997783} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626}
+ {803DA965-4B1C-4BF3-A35E-A3A12D4121D3} = {76177119-A395-4739-AECE-25D4864198AD}
+ {3E6CEC79-5E93-4607-B10E-498586ECF6A6} = {76177119-A395-4739-AECE-25D4864198AD}
+ {3E727941-2854-4F64-ADA5-BF3BF104A4A3} = {76177119-A395-4739-AECE-25D4864198AD}
+ {88E47CF7-7B40-4312-A35A-9B28885FFED9} = {76177119-A395-4739-AECE-25D4864198AD}
+ {66503A70-B1E8-4545-B4FF-2108DFB40C72} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
+ {D548A54E-310B-4A86-A545-64BDD5748745} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
+ {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
+ {6A516E27-AC50-5374-756B-A1558DB2EFA9} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
+ {D3D80E27-D099-41EC-AFB2-A891A33F1608} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
+ {2AD2FF74-06E1-4BD8-984A-526F3C6315B3} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D}
+ {9DE1F0B0-B9D1-4681-82E7-13CC3E047445} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B}
+ {07137F45-8B5F-4561-BEC8-B883E9123785} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B}
+ {7DF5234A-A93A-47AD-8201-377ECF59AE5F} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B}
+ {7A50C5F4-866B-B8BD-D5FA-0EE6745194C6} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B}
+ {850EC838-0EAD-45EB-6F1B-16DC90DCE18D} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B}
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70} = {31B8FE37-AC37-40AC-85AC-78B04C2CAC17}
+ {B6FC188B-8E54-4197-9444-8BADE9AA75E2} = {31B8FE37-AC37-40AC-85AC-78B04C2CAC17}
+ {E26D2311-C164-48CF-BA24-5CEDA873D1B2} = {31B8FE37-AC37-40AC-85AC-78B04C2CAC17}
+ {4AC1E062-0236-4E49-AA04-F732043D2DCF} = {803DA965-4B1C-4BF3-A35E-A3A12D4121D3}
+ {290C5ED4-71A7-4040-AD26-4820CF7A9E60} = {803DA965-4B1C-4BF3-A35E-A3A12D4121D3}
+ {4ADADECA-99D7-410D-8127-CB27210DCC6A} = {803DA965-4B1C-4BF3-A35E-A3A12D4121D3}
+ {F60935E3-8F27-46E2-8598-013E7D4C90E7} = {EAEA72C2-11FB-433D-8D79-8F88CDEE52A7}
+ {7E88D7F5-8B0A-4B79-84CD-D7982D4E0D4D} = {EAEA72C2-11FB-433D-8D79-8F88CDEE52A7}
+ {541BE2B3-4320-47B8-AB64-C7F7ED0EFABA} = {EAEA72C2-11FB-433D-8D79-8F88CDEE52A7}
+ {E38B4212-53BC-49A7-B821-9A99DB4774C6} = {EAEA72C2-11FB-433D-8D79-8F88CDEE52A7}
+ {40FE7861-E54E-4DA9-BE4D-A5178014E477} = {3E727941-2854-4F64-ADA5-BF3BF104A4A3}
+ {1423FC8F-AA52-4562-8275-4BF0838CA378} = {3E727941-2854-4F64-ADA5-BF3BF104A4A3}
+ {53F841E8-284F-4545-9176-B131896E43F8} = {3E727941-2854-4F64-ADA5-BF3BF104A4A3}
+ {2C050CAF-D8AA-468A-B1A7-89F3BE99D3C8} = {3E727941-2854-4F64-ADA5-BF3BF104A4A3}
EndGlobalSection
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
diff --git a/include/m_addcontact.h b/include/m_addcontact.h
index e6c0573821..be0e6a40ee 100644
--- a/include/m_addcontact.h
+++ b/include/m_addcontact.h
@@ -34,8 +34,8 @@ typedef struct{
/*
Description: Open the add contact dialog, see notes
- wParam=[ (WPARAM)hWndParent ]
- lParam=(LPARAM)(ADDCONTACTSTRUCT*)&acs
+ wParam = [ (WPARAM)hWndParent ]
+ lParam = (LPARAM)(ADDCONTACTSTRUCT*)&acs
Notes:
diff --git a/include/m_awaymsg.h b/include/m_awaymsg.h
index 5b2eb974ee..b53ff4f182 100644
--- a/include/m_awaymsg.h
+++ b/include/m_awaymsg.h
@@ -25,15 +25,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define M_AWAYMSG_H__ 1
//show the away/na/etc message for a contact v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//returns 0 on success or nonzero on failure
//returns immediately, without waiting for the message to retrieve
#define MS_AWAYMSG_SHOWAWAYMSG "SRAway/GetMessage"
//returns the default status message for a status
-//wParam=(int)status
-//lParam=(LPARAM)(char*)szProto
+//wParam = (int)status
+//lParam = (LPARAM)(char*)szProto
//returns status msg. Remember to free the return value
#define MS_AWAYMSG_GETSTATUSMSG "SRAway/GetStatusMessage"
#define MS_AWAYMSG_GETSTATUSMSGW "SRAway/GetStatusMessageW"
diff --git a/include/m_clc.h b/include/m_clc.h
index 4463b584b9..c71378bf54 100644
--- a/include/m_clc.h
+++ b/include/m_clc.h
@@ -58,32 +58,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define CLM_LAST 0x1100
//messages, compare with equivalent TVM_s in the MSDN
-#define CLM_ADDCONTACT (CLM_FIRST+0) //wParam=hContact
-#define CLM_ADDGROUP (CLM_FIRST+1) //wParam=hGroup
+#define CLM_ADDCONTACT (CLM_FIRST+0) //wParam = hContact
+#define CLM_ADDGROUP (CLM_FIRST+1) //wParam = hGroup
#define CLM_AUTOREBUILD (CLM_FIRST+2)
-#define CLM_DELETEITEM (CLM_FIRST+3) //wParam=hItem
-#define CLM_EDITLABEL (CLM_FIRST+4) //wParam=hItem
-#define CLM_ENDEDITLABELNOW (CLM_FIRST+5) //wParam=cancel, 0 to save
-#define CLM_ENSUREVISIBLE (CLM_FIRST+6) //wParam=hItem, lParam=partialOk
+#define CLM_DELETEITEM (CLM_FIRST+3) //wParam = hItem
+#define CLM_EDITLABEL (CLM_FIRST+4) //wParam = hItem
+#define CLM_ENDEDITLABELNOW (CLM_FIRST+5) //wParam = cancel, 0 to save
+#define CLM_ENSUREVISIBLE (CLM_FIRST+6) //wParam = hItem, lParam = partialOk
#define CLE_TOGGLE -1
#define CLE_COLLAPSE 0
#define CLE_EXPAND 1
#define CLE_INVALID 0xFFFF
-#define CLM_EXPAND (CLM_FIRST+7) //wParam=hItem, lParam=CLE_
-#define CLM_FINDCONTACT (CLM_FIRST+8) //wParam=hContact, returns an hItem
-#define CLM_FINDGROUP (CLM_FIRST+9) //wParam=hGroup, returns an hItem
+#define CLM_EXPAND (CLM_FIRST+7) //wParam = hItem, lParam = CLE_
+#define CLM_FINDCONTACT (CLM_FIRST+8) //wParam = hContact, returns an hItem
+#define CLM_FINDGROUP (CLM_FIRST+9) //wParam = hGroup, returns an hItem
#define CLM_GETBKCOLOR (CLM_FIRST+10) //returns a COLORREF
-#define CLM_GETCHECKMARK (CLM_FIRST+11) //wParam=hItem, returns 1 or 0
+#define CLM_GETCHECKMARK (CLM_FIRST+11) //wParam = hItem, returns 1 or 0
#define CLM_GETCOUNT (CLM_FIRST+12) //returns the total number of items
#define CLM_GETEDITCONTROL (CLM_FIRST+13) //returns the HWND, or NULL
-#define CLM_GETEXPAND (CLM_FIRST+14) //wParam=hItem, returns a CLE_, CLE_INVALID if not a group
+#define CLM_GETEXPAND (CLM_FIRST+14) //wParam = hItem, returns a CLE_, CLE_INVALID if not a group
#define CLM_GETEXTRACOLUMNS (CLM_FIRST+15) //returns number of extra columns
-#define CLM_GETEXTRAIMAGE (CLM_FIRST+16) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),0), returns iImage or 0xFF
+#define CLM_GETEXTRAIMAGE (CLM_FIRST+16) //wParam = hItem, lParam = MAKELPARAM(iColumn (0 based),0), returns iImage or 0xFF
#define CLM_GETEXTRAIMAGELIST (CLM_FIRST+17) //returns HIMAGELIST
-#define CLM_GETFONT (CLM_FIRST+18) //wParam=fontId, see clm_setfont. returns hFont.
-#define CLM_GETINDENT (CLM_FIRST+19) //wParam=new group indent
-#define CLM_GETISEARCHSTRING (CLM_FIRST+20) //lParam=(char*)pszStr, max 120 bytes, returns number of chars in string
-#define CLM_GETITEMTEXT (CLM_FIRST+21) //wParam=hItem, lParam=(TCHAR*)pszStr, max 120 bytes
+#define CLM_GETFONT (CLM_FIRST+18) //wParam = fontId, see clm_setfont. returns hFont.
+#define CLM_GETINDENT (CLM_FIRST+19) //wParam = new group indent
+#define CLM_GETISEARCHSTRING (CLM_FIRST+20) //lParam = (char*)pszStr, max 120 bytes, returns number of chars in string
+#define CLM_GETITEMTEXT (CLM_FIRST+21) //wParam = hItem, lParam = (TCHAR*)pszStr, max 120 bytes
#define CLM_GETSCROLLTIME (CLM_FIRST+22) //returns time in ms
#define CLM_GETSELECTION (CLM_FIRST+23) //returns hItem
#define CLCHT_ABOVE 0x0001 //above client area
@@ -99,8 +99,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define CLCHT_ONITEM 0x03E0
#define CLCHT_INLEFTMARGIN 0x0400
#define CLCHT_BELOWITEMS 0x0800 //in client area but below last item
-#define CLM_HITTEST (CLM_FIRST+25) //lParam=MAKELPARAM(x,y) (relative to control), wParam=(PDWORD)&hitTest (see encoding of HitTest() in clc.h, can be NULL) returns hItem or NULL
-#define CLM_SELECTITEM (CLM_FIRST+26) //wParam=hItem
+#define CLM_HITTEST (CLM_FIRST+25) //lParam = MAKELPARAM(x,y) (relative to control), wParam = (PDWORD)&hitTest (see encoding of HitTest() in clc.h, can be NULL) returns hItem or NULL
+#define CLM_SELECTITEM (CLM_FIRST+26) //wParam = hItem
#define CLB_TOPLEFT 0
#define CLB_STRETCHV 1
#define CLB_STRETCHH 2 //and tile vertically
@@ -110,12 +110,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define CLBF_TILEV 0x2000
#define CLBF_PROPORTIONAL 0x4000
#define CLBF_SCROLL 0x8000
-#define CLM_SETBKBITMAP (CLM_FIRST+27) //wParam=mode, lParam=hBitmap (don't delete it), NULL for none
-#define CLM_SETBKCOLOR (CLM_FIRST+28) //wParam=a COLORREF, default is GetSysColor(COLOR_3DFACE)
-#define CLM_SETCHECKMARK (CLM_FIRST+29) //wParam=hItem, lParam=1 or 0
-#define CLM_SETEXTRACOLUMNS (CLM_FIRST+30) //wParam=number of extra columns (zero to MAXEXTRACOLUMNS from clc.h, currently 16)
-#define CLM_SETEXTRAIMAGE (CLM_FIRST+31) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),iImage). iImage=0xFF is a blank
-#define CLM_SETEXTRAIMAGELIST (CLM_FIRST+32) //lParam=HIMAGELIST, wParam=WideImageList
+#define CLM_SETBKBITMAP (CLM_FIRST+27) //wParam = mode, lParam = hBitmap (don't delete it), NULL for none
+#define CLM_SETBKCOLOR (CLM_FIRST+28) //wParam = a COLORREF, default is GetSysColor(COLOR_3DFACE)
+#define CLM_SETCHECKMARK (CLM_FIRST+29) //wParam = hItem, lParam = 1 or 0
+#define CLM_SETEXTRACOLUMNS (CLM_FIRST+30) //wParam = number of extra columns (zero to MAXEXTRACOLUMNS from clc.h, currently 16)
+#define CLM_SETEXTRAIMAGE (CLM_FIRST+31) //wParam = hItem, lParam = MAKELPARAM(iColumn (0 based),iImage). iImage = 0xFF is a blank
+#define CLM_SETEXTRAIMAGELIST (CLM_FIRST+32) //lParam = HIMAGELIST, wParam = WideImageList
#define FONTID_CONTACTS 0
#define FONTID_INVIS 1
@@ -130,24 +130,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define FONTID_CONTACTSHOVER 10
#define FONTID_MAX 18
-#define CLM_SETFONT (CLM_FIRST+33) //wParam=hFont, lParam=MAKELPARAM(fRedraw,fontId)
-#define CLM_SETINDENT (CLM_FIRST+34) //wParam=new indent, default is 3 pixels
-#define CLM_SETITEMTEXT (CLM_FIRST+35) //wParam=hItem, lParam=(char*)pszNewText
-#define CLM_SETSCROLLTIME (CLM_FIRST+36) //wParam=time in ms, default 200
+#define CLM_SETFONT (CLM_FIRST+33) //wParam = hFont, lParam = MAKELPARAM(fRedraw,fontId)
+#define CLM_SETINDENT (CLM_FIRST+34) //wParam = new indent, default is 3 pixels
+#define CLM_SETITEMTEXT (CLM_FIRST+35) //wParam = hItem, lParam = (char*)pszNewText
+#define CLM_SETSCROLLTIME (CLM_FIRST+36) //wParam = time in ms, default 200
-#define CLM_SETHIDEEMPTYGROUPS (CLM_FIRST+38) //wParam=TRUE/FALSE
+#define CLM_SETHIDEEMPTYGROUPS (CLM_FIRST+38) //wParam = TRUE/FALSE
#define GREYF_UNFOCUS 0x80000000
#define MODEF_OFFLINE 0x40000000
//and use the PF2_ #defines from m_protosvc.h
-#define CLM_SETGREYOUTFLAGS (CLM_FIRST+39) //wParam=new flags
+#define CLM_SETGREYOUTFLAGS (CLM_FIRST+39) //wParam = new flags
#define CLM_GETHIDEOFFLINEROOT (CLM_FIRST+40) //returns TRUE/FALSE
-#define CLM_SETHIDEOFFLINEROOT (CLM_FIRST+41) //wParam=TRUE/FALSE
-#define CLM_SETUSEGROUPS (CLM_FIRST+42) //wParam=TRUE/FALSE
-#define CLM_SETOFFLINEMODES (CLM_FIRST+43) //for 'hide offline', wParam=PF2_ flags and MODEF_OFFLINE
+#define CLM_SETHIDEOFFLINEROOT (CLM_FIRST+41) //wParam = TRUE/FALSE
+#define CLM_SETUSEGROUPS (CLM_FIRST+42) //wParam = TRUE/FALSE
+#define CLM_SETOFFLINEMODES (CLM_FIRST+43) //for 'hide offline', wParam = PF2_ flags and MODEF_OFFLINE
#define CLM_GETEXSTYLE (CLM_FIRST+44) //returns CLS_EX_ flags
-#define CLM_SETEXSTYLE (CLM_FIRST+45) //wParam=CLS_EX_ flags
+#define CLM_SETEXSTYLE (CLM_FIRST+45) //wParam = CLS_EX_ flags
#define CLM_GETLEFTMARGIN (CLM_FIRST+46) //returns count of pixels
-#define CLM_SETLEFTMARGIN (CLM_FIRST+47) //wParam=pixels
+#define CLM_SETLEFTMARGIN (CLM_FIRST+47) //wParam = pixels
typedef struct {
int cbSize;
const TCHAR *pszText;
@@ -160,8 +160,8 @@ typedef struct {
#define CLCIIF_CHECKBOX 0x40 //give this item a check box
#define CLCIIF_GROUPFONT 0x80 //draw the item using FONTID_GROUPS
-#define CLM_ADDINFOITEMA (CLM_FIRST+48) //lParam=&cii, returns hItem
-#define CLM_ADDINFOITEMW (CLM_FIRST+53) //lParam=&cii, returns hItem
+#define CLM_ADDINFOITEMA (CLM_FIRST+48) //lParam = &cii, returns hItem
+#define CLM_ADDINFOITEMW (CLM_FIRST+53) //lParam = &cii, returns hItem
#if defined(_UNICODE)
#define CLM_ADDINFOITEM CLM_ADDINFOITEMW
#else
@@ -175,7 +175,7 @@ typedef struct {
#define CLCIT_CONTACT 1
#define CLCIT_DIVIDER 2
#define CLCIT_INFO 3
-#define CLM_GETITEMTYPE (CLM_FIRST+49) //wParam=hItem, returns a CLCIT_
+#define CLM_GETITEMTYPE (CLM_FIRST+49) //wParam = hItem, returns a CLCIT_
#define CLGN_ROOT 0
#define CLGN_CHILD 1
#define CLGN_PARENT 2
@@ -185,13 +185,13 @@ typedef struct {
#define CLGN_PREVIOUSCONTACT 6
#define CLGN_NEXTGROUP 7
#define CLGN_PREVIOUSGROUP 8
-#define CLM_GETNEXTITEM (CLM_FIRST+50) //wParam=flag, lParam=hItem, returns an hItem
-#define CLM_GETTEXTCOLOR (CLM_FIRST+51) //wParam=FONTID_, returns COLORREF
-#define CLM_SETTEXTCOLOR (CLM_FIRST+52) //wParam=FONTID_, lParam=COLORREF
+#define CLM_GETNEXTITEM (CLM_FIRST+50) //wParam = flag, lParam = hItem, returns an hItem
+#define CLM_GETTEXTCOLOR (CLM_FIRST+51) //wParam = FONTID_, returns COLORREF
+#define CLM_SETTEXTCOLOR (CLM_FIRST+52) //wParam = FONTID_, lParam = COLORREF
//DO NOT USE IT EXTERNALLY CAN BE NOT SUPPORTED BY CLIST
-#define CLM_SETWIDEEXTRAIMAGE (CLM_FIRST+60) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based), iImage). iImage=0xFFFF is a blank
-#define CLM_GETWIDEEXTRAIMAGE (CLM_FIRST+61) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based), 0), returns iImage or 0xFF
+#define CLM_SETWIDEEXTRAIMAGE (CLM_FIRST+60) //wParam = hItem, lParam = MAKELPARAM(iColumn (0 based), iImage). iImage = 0xFFFF is a blank
+#define CLM_GETWIDEEXTRAIMAGE (CLM_FIRST+61) //wParam = hItem, lParam = MAKELPARAM(iColumn (0 based), 0), returns iImage or 0xFF
#define CLM_GETWIDEEXTRAIMAGELIST (CLM_FIRST+62) //returns HWIDEIMAGELIST
//notifications (most are omitted because the control processes everything)
@@ -206,7 +206,7 @@ typedef struct {
POINT pt;
} NMCLISTCONTROL;
#define CLN_FIRST (0U-100U)
-#define CLN_EXPANDED (CLN_FIRST-0) //hItem=hGroup, action=CLE_*
+#define CLN_EXPANDED (CLN_FIRST-0) //hItem = hGroup, action = CLE_*
#define CLN_LISTREBUILT (CLN_FIRST-1)
#define CLN_ITEMCHECKED (CLN_FIRST-2) //todo //hItem, action, flags valid
#define CLN_DRAGGING (CLN_FIRST-3) //hItem, pt, flags valid. only sent when cursor outside window, return nonzero if processed
@@ -221,8 +221,8 @@ typedef struct {
//NM_KEYDOWN //NMKEY structure, only sent when key is not already processed, return nonzero to prevent further processing
//an infotip for an item should be shown now
-//wParam=0
-//lParam=(LPARAM)(CLCINFOTIP*)&it
+//wParam = 0
+//lParam = (LPARAM)(CLCINFOTIP*)&it
//Return nonzero if you process this, because it makes no sense for more than
//one plugin to grab it.
//It is up to the plugin to decide the best place to put the infotip. Normally
@@ -252,8 +252,8 @@ typedef struct {
#define ME_CLC_SHOWEXTRAINFOTIP "CLC/ShowExtraInfoTip"
//it's time to destroy an infotip
-//wParam=0
-//lParam=(LPARAM)(CLCINFOTIP*)&it
+//wParam = 0
+//lParam = (LPARAM)(CLCINFOTIP*)&it
//Only cbSize, isGroup and hItem are set
//Return nonzero if you process this.
//This is sent when the mouse moves off a contact when clc/showinfotip has
@@ -263,8 +263,8 @@ typedef struct {
#define ME_CLC_HIDEINFOTIP "CLC/HideInfoTip"
//set the hover time before the infotip hooks are called
-//wParam=newTime
-//lParam=0
+//wParam = newTime
+//lParam = 0
//Returns 0 on success or nonzero on failure
//The value of this setting is applied to all current CLC windows, and saved
//to be applied to all future windows, including after restarts.
@@ -273,7 +273,7 @@ typedef struct {
#define MS_CLC_SETINFOTIPHOVERTIME "CLC/SetInfoTipHoverTime"
//get the hover time before the infotip hooks are called
-//wParam=lParam=0
+//wParam = lParam = 0
//Returns the time in ms
#define MS_CLC_GETINFOTIPHOVERTIME "CLC/GetInfoTipHoverTime"
diff --git a/include/m_clist.h b/include/m_clist.h
index 7289f778f2..0536dedc54 100644
--- a/include/m_clist.h
+++ b/include/m_clist.h
@@ -39,25 +39,25 @@ extern int hLangpack;
#endif
//sent when the user asks to change their status
-//wParam=new status, from statusmodes.h
-//lParam=protocol name, NULL if for all protocols (added in v0.3.1alpha)
+//wParam = new status, from statusmodes.h
+//lParam = protocol name, NULL if for all protocols (added in v0.3.1alpha)
//also sent due to a ms_clist_setstatusmode call
#define ME_CLIST_STATUSMODECHANGE "CList/StatusModeChange"
//force a change of status mode
-//wParam=new status, from statusmodes.h
+//wParam = new status, from statusmodes.h
#define MS_CLIST_SETSTATUSMODE "CList/SetStatusMode"
//get the current status mode
-//wParam=lParam=0
+//wParam = lParam = 0
//returns the current status
//This is the status *as set by the user*, not any protocol-specific status
//All protocol modules will attempt to conform to this setting at all times
#define MS_CLIST_GETSTATUSMODE "CList/GetStatusMode"
//gets a textual description of the given status mode (v0.1.0.1+)
-//wParam=status mode, from statusmodes.h
-//lParam=flags, below
+//wParam = status mode, from statusmodes.h
+//lParam = flags, below
//returns a static buffer of the description of the given status mode
//returns NULL if the status mode was unknown
#define GSMDF_PREFIXONLINE 1 //prefix "Online: " to all status modes that
@@ -72,11 +72,11 @@ extern int hLangpack;
#define MS_CLIST_GETSTATUSMODEDESCRIPTION "CList/GetStatusModeDescription"
//add a new item to the main menu
-//wParam=0
-//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+//wParam = 0
+//lParam = (LPARAM)(CLISTMENUITEM*)&mi
//returns a handle to the new item, or NULL on failure
//the service that is called when the item is clicked is called with
-//wParam=0, lParam=hwndContactList
+//wParam = 0, lParam = hwndContactList
//dividers are inserted every 100000 positions
//pszContactOwner is ignored for this service.
//there is a #define PUTPOSITIONSINMENU in clistmenus.c which, when set, will
@@ -152,7 +152,7 @@ __inline static HGENMENU Menu_AddMainMenuItem(CLISTMENUITEM *mi)
//add a new item to the user contact menus
//identical to clist/addmainmenuitem except when item is selected the service
-//gets called with wParam=(WPARAM)(HANDLE)hContact
+//gets called with wParam = (WPARAM)(HANDLE)hContact
//pszContactOwner is obeyed.
//popup menus are not supported. pszPopupName and popupPosition are ignored.
//If ctrl is held down when right clicking, the menu position numbers will be
@@ -175,8 +175,8 @@ __inline static HGENMENU Menu_AddProtoMenuItem(CLISTMENUITEM *mi)
}
//modify an existing menu item v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hMenuItem
-//lParam=(LPARAM)(CLISTMENUITEM*)&clmi
+//wParam = (WPARAM)(HANDLE)hMenuItem
+//lParam = (LPARAM)(CLISTMENUITEM*)&clmi
//returns 0 on success, nonzero on failure
//hMenuItem will have been returned by clist/add*menuItem
//clmi.flags should contain cmim_ constants below specifying which fields to
@@ -189,17 +189,17 @@ __inline static HGENMENU Menu_AddProtoMenuItem(CLISTMENUITEM *mi)
#define MS_CLIST_MODIFYMENUITEM "CList/ModifyMenuItem"
//the context menu for a contact is about to be built v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//modules should use this to change menu items that are specific to the
//contact that has them
#define ME_CLIST_PREBUILDCONTACTMENU "CList/PreBuildContactMenu"
//sets the service to call when a contact is double-clicked
-//wParam=0
-//lParam=(LPARAM)(CLISTDOUBLECLICKACTION*)&dca
+//wParam = 0
+//lParam = (LPARAM)(CLISTDOUBLECLICKACTION*)&dca
//contactType is one or more of the constants below
-//pszService is called with wParam=hContact, lParam=0
+//pszService is called with wParam = hContact, lParam = 0
//pszService will only be called if there is no outstanding event on the
//selected contact
//returns 0 on success, nonzero on failure
@@ -220,8 +220,8 @@ typedef struct {
#define MS_CLIST_SETDOUBLECLICKACTION "CList/SetDoubleClickAction"
/*
-wParam=(WPARAM)hContact
-lParam=0
+wParam = (WPARAM)hContact
+lParam = 0
Event is fired when there is a double click on a CList contact,
it is upto the caller to check for the protocol & status
@@ -231,8 +231,8 @@ sense to store all this information in memory, etc.
*/
#define ME_CLIST_DOUBLECLICKED "CList/DoubleClicked"
//gets the string that the contact list will use to represent a contact
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=flags
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = flags
//returns a pointer to the name, will always succeed, even if it needs to
//return "(Unknown Contact)"
//this pointer is to a statically allocated buffer which will be overwritten
@@ -253,19 +253,19 @@ sense to store all this information in memory, etc.
#define MS_CLIST_GETCONTACTDISPLAYNAME "CList/GetContactDisplayName"
// Invalidates the display name cache
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=not used
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = not used
#define MS_CLIST_INVALIDATEDISPLAYNAME "CList/InvalidateDiplayName"
//adds an event to the contact list's queue
-//wParam=0
-//lParam=(LPARAM)(CLISTEVENT*)cle
+//wParam = 0
+//lParam = (LPARAM)(CLISTEVENT*)cle
//The contact list will flash hIcon next to the contact hContact (use NULL for
//a system message). szServiceName will be called when the user double clicks
//the icon, at which point the event will be removed from the contact list's
//queue automatically
-//pszService is called with wParam=(WPARAM)(HWND)hwndContactList,
-//lParam=(LPARAM)(CLISTEVENT*)cle. Its return value is ignored. cle is
+//pszService is called with wParam = (WPARAM)(HWND)hwndContactList,
+//lParam = (LPARAM)(CLISTEVENT*)cle. Its return value is ignored. cle is
//invalidated when your service returns, so take copies of any important
//information in it.
//hDbEvent should be unique since it and hContact are the identifiers used by
@@ -306,19 +306,19 @@ typedef struct {
#define MS_CLIST_ADDEVENT "CList/AddEvent"
//removes an event from the contact list's queue
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(HANDLE)hDbEvent
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(HANDLE)hDbEvent
//returns 0 if the event was successfully removed, or nonzero if the event
//was not found
#define MS_CLIST_REMOVEEVENT "Clist/RemoveEvent"
//gets the details of an event in the queue v0.1.2.1+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=iEvent
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = iEvent
//returns a CLISTEVENT* on success, NULL on failure
-//Returns the iEvent-th event from the queue for hContact, so iEvent=0 will
+//Returns the iEvent-th event from the queue for hContact, so iEvent = 0 will
//get the event that will be got when the user clicks on that contact.
-//Use hContact=INVALID_HANDLE_VALUE to search over all contacts, so iEvent=0
+//Use hContact = INVALID_HANDLE_VALUE to search over all contacts, so iEvent = 0
//will get the event that will be got if the user clicks the systray icon.
#define MS_CLIST_GETEVENT "CList/GetEvent"
@@ -335,14 +335,14 @@ typedef struct {
#define MS_CLIST_MENUDRAWITEM "CList/MenuDrawItem"
//builds the context menu for a specific contact v0.1.1.0+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//returns a HMENU identifying the menu. This should be DestroyMenu()ed when
//finished with.
#define MS_CLIST_MENUBUILDCONTACT "CList/MenuBuildContact"
//gets the image list with all the useful icons in it v0.1.1.0+
-//wParam=lParam=0
+//wParam = lParam = 0
//returns a HIMAGELIST
//the members of this image list are opaque, and you should trust what you
//are given
@@ -351,16 +351,16 @@ typedef struct {
#define IMAGE_GROUPSHUT 12
//get the icon that should be associated with a contact v0.1.2.0+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//returns an index into the contact list imagelist. See clist/geticonsimagelist
//If the contact is flashing an icon, this function will not return that
//flashing icon. Use me_clist_contacticonchanged to get info about that.
#define MS_CLIST_GETCONTACTICON "CList/GetContactIcon"
//The icon of a contact in the contact list has changed v0.1.2.0+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=iconId
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = iconId
//iconId is an offset into the clist's imagelist. See clist/geticonsimagelist
#define ME_CLIST_CONTACTICONCHANGED "CList/ContactIconChanged"
@@ -369,12 +369,12 @@ typedef struct {
// Stuff below here is ideally for the use of a CList UI module only.
//get a handle to the main Miranda menu v0.1.1.0+
-//wParam=lParam=0
+//wParam = lParam = 0
//returns a HMENU. This need not be freed since it's owned by clist
#define MS_CLIST_MENUGETMAIN "CList/MenuGetMain"
//get a handle to the Miranda status menu v0.1.1.0+
-//wParam=lParam=0
+//wParam = lParam = 0
//returns a HMENU. This need not be freed since it's owned by clist
#define MS_CLIST_MENUGETSTATUS "CList/MenuGetStatus"
@@ -382,8 +382,8 @@ typedef struct {
//processes a menu selection from a menu v0.1.1.0+
-//wParam=MAKEWPARAM(LOWORD(wParam from WM_COMMAND), flags)
-//lParam=(LPARAM)(HANDLE)hContact
+//wParam = MAKEWPARAM(LOWORD(wParam from WM_COMMAND), flags)
+//lParam = (LPARAM)(HANDLE)hContact
//returns TRUE if it processed the command, FALSE otherwise
//hContact is the currently selected contact. It it not used if this is a main
//menu command. If this is NULL and the command is a contact menu one, the
@@ -411,48 +411,48 @@ typedef struct {
#define MS_CLIST_MENUPROCESSCOMMAND "CList/MenuProcessCommand"
//processes a menu hotkey v0.1.1.0+
-//wParam=virtual key code
-//lParam=MPCF_ flags
+//wParam = virtual key code
+//lParam = MPCF_ flags
//returns TRUE if it processed the command, FALSE otherwise
//this should be called in WM_KEYDOWN
#define MS_CLIST_MENUPROCESSHOTKEY "CList/MenuProcessHotkey"
//process all the messages required for docking v0.1.1.0+
-//wParam=(WPARAM)(MSG*)&msg
-//lParam=(LPARAM)(LRESULT*)&lResult
+//wParam = (WPARAM)(MSG*)&msg
+//lParam = (LPARAM)(LRESULT*)&lResult
//returns TRUE if the message should not be processed further, FALSE otherwise
//only msg.hwnd, msg.message, msg.wParam and msg.lParam are used
//your wndproc should return lResult if and only if TRUE is returned
#define MS_CLIST_DOCKINGPROCESSMESSAGE "CList/DockingProcessMessage"
//determines whether the contact list is docked v0.1.1.0+
-//wParam=lParam=0
+//wParam = lParam = 0
//returns nonzero if the contact list is docked, of 0 if it is not
#define MS_CLIST_DOCKINGISDOCKED "CList/DockingIsDocked"
//process all the messages required for the tray icon v0.1.1.0+
-//wParam=(WPARAM)(MSG*)&msg
-//lParam=(LPARAM)(LRESULT*)&lResult
+//wParam = (WPARAM)(MSG*)&msg
+//lParam = (LPARAM)(LRESULT*)&lResult
//returns TRUE if the message should not be processed further, FALSE otherwise
//only msg.hwnd, msg.message, msg.wParam and msg.lParam are used
//your wndproc should return lResult if and only if TRUE is returned
#define MS_CLIST_TRAYICONPROCESSMESSAGE "CList/TrayIconProcessMessage"
//process all the messages required for hotkeys v0.1.1.0+
-//wParam=(WPARAM)(MSG*)&msg
-//lParam=(LPARAM)(LRESULT*)&lResult
+//wParam = (WPARAM)(MSG*)&msg
+//lParam = (LPARAM)(LRESULT*)&lResult
//returns TRUE if the message should not be processed further, FALSE otherwise
//only msg.hwnd, msg.message, msg.wParam and msg.lParam are used
//your wndproc should return lResult if and only if TRUE is returned
#define MS_CLIST_HOTKEYSPROCESSMESSAGE "CList/HotkeysProcessMessage"
//toggles the show/hide status of the contact list v0.1.1.0+
-//wParam=lParam=0
+//wParam = lParam = 0
//returns 0 on success, nonzero on failure
#define MS_CLIST_SHOWHIDE "CList/ShowHide"
//temporarily disable the autohide feature v0.1.2.1+
-//wParam=lParam=0
+//wParam = lParam = 0
//returns 0 on success, nonzero on failure
//This service will restart the autohide timer, so if you need to keep the
//window visible you'll have to be getting user input regularly and calling
@@ -461,8 +461,8 @@ typedef struct {
//sent when the group get modified (created, renamed or deleted)
//or contact is moving from group to group
-//wParam=hContact - NULL if operation on group
-//lParam=pointer to CLISTGROUPCHANGE
+//wParam = hContact - NULL if operation on group
+//lParam = pointer to CLISTGROUPCHANGE
typedef struct {
int cbSize; //size in bytes of this structure
TCHAR* pszOldName; //old group name
@@ -472,8 +472,8 @@ typedef struct {
#define ME_CLIST_GROUPCHANGE "CList/GroupChange"
//creates a new group and calls CLUI to display it v0.1.1.0+
-//wParam=hParentGroup
-//lParam=groupName
+//wParam = hParentGroup
+//lParam = groupName
//returns a handle to the new group
//hParentGroup is NULL to create the new group at the root, or can be the
//handle of the group of which the new group should be a subgroup.
@@ -482,30 +482,30 @@ typedef struct {
#define MS_CLIST_GROUPCREATE "CList/GroupCreate"
//deletes a group and calls CLUI to display the change v0.1.1.0+
-//wParam=(WPARAM)(HANDLE)hGroup
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hGroup
+//lParam = 0
//returns 0 on success, nonzero on failure
#define MS_CLIST_GROUPDELETE "CList/GroupDelete"
//change the expanded state flag for a group internally v0.1.1.0+
-//wParam=(WPARAM)(HANDLE)hGroup
-//lParam=newState
+//wParam = (WPARAM)(HANDLE)hGroup
+//lParam = newState
//returns 0 on success, nonzero on failure
//newState is nonzero if the group is expanded, 0 if it's collapsed
//CLUI is not called when this change is made
#define MS_CLIST_GROUPSETEXPANDED "CList/GroupSetExpanded"
//changes the flags for a group v0.1.2.1+
-//wParam=(WPARAM)(HANDLE)hGroup
-//lParam=MAKELPARAM(flags, flagsMask)
+//wParam = (WPARAM)(HANDLE)hGroup
+//lParam = MAKELPARAM(flags, flagsMask)
//returns 0 on success, nonzero on failure
//Only the flags given in flagsMask are altered.
//CLUI is called on changes to GROUPF_HIDEOFFLINE.
#define MS_CLIST_GROUPSETFLAGS "CList/GroupSetFlags"
//get the name of a group v0.1.1.0+
-//wParam=(WPARAM)(HANDLE)hGroup
-//lParam=(LPARAM)(int*)&isExpanded
+//wParam = (WPARAM)(HANDLE)hGroup
+//lParam = (LPARAM)(int*)&isExpanded
//returns a static buffer pointing to the name of the group
//returns NULL if hGroup is invalid.
//this buffer is only valid until the next call to this service
@@ -514,8 +514,8 @@ typedef struct {
#define MS_CLIST_GROUPGETNAME "CList/GroupGetName"
//get the name of a group v0.1.2.1+
-//wParam=(WPARAM)(HANDLE)hGroup
-//lParam=(LPARAM)(DWORD*)&flags
+//wParam = (WPARAM)(HANDLE)hGroup
+//lParam = (LPARAM)(DWORD*)&flags
//returns a static buffer pointing to the name of the group
//returns NULL if hGroup is invalid.
//this buffer is only valid until the next call to this service
@@ -525,8 +525,8 @@ typedef struct {
#define MS_CLIST_GROUPGETNAME2 "CList/GroupGetName2"
//move a group to directly before another group v0.1.2.1+
-//wParam=(WPARAM)(HANDLE)hGroup
-//lParam=(LPARAM)(HANDLE)hBeforeGroup
+//wParam = (WPARAM)(HANDLE)hGroup
+//lParam = (LPARAM)(HANDLE)hBeforeGroup
//returns the new handle of the group on success, NULL on failure
//The order is represented by the order in which MS_CLUI_GROUPADDED is called,
//however UIs are free to ignore this order and sort alphabetically if they
@@ -534,16 +534,16 @@ typedef struct {
#define MS_CLIST_GROUPMOVEBEFORE "CList/GroupMoveBefore"
//rename a group internally v0.1.1.0+
-//wParam=(WPARAM)(HANDLE)hGroup
-//lParam=(LPARAM)(char*)szNewName
+//wParam = (WPARAM)(HANDLE)hGroup
+//lParam = (LPARAM)(char*)szNewName
//returns 0 on success, nonzero on failure
//this will fail if the group name is a duplicate of an existing name
//CLUI is not called when this change is made
#define MS_CLIST_GROUPRENAME "CList/GroupRename"
//build a menu of the group tree v0.1.2.1+
-//wParam=0
-//lParam=0
+//wParam = 0
+//lParam = 0
//returns a HMENU on success, or NULL on failure
//The return value must be DestroyMenu()ed when you're done with it.
//NULL will be returned if the user doesn't have any groups
@@ -552,44 +552,44 @@ typedef struct {
#define MS_CLIST_GROUPBUILDMENU "CList/GroupBuildMenu"
//changes the 'hide offline contacts' flag and call CLUI v0.1.1.0+
-//wParam=newValue
-//lParam=0
+//wParam = newValue
+//lParam = 0
//returns 0 on success, nonzero on failure
//newValue is 0 to show all contacts, 1 to only show online contacts
//or -1 to toggle the value
#define MS_CLIST_SETHIDEOFFLINE "CList/SetHideOffline"
//do the message processing associated with double clicking a contact v0.1.1.0+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//returns 0 on success, nonzero on failure
#define MS_CLIST_CONTACTDOUBLECLICKED "CList/ContactDoubleClicked"
//do the processing for when some files are dropped on a contact v0.1.2.1+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(char**)ppFiles
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(char**)ppFiles
//returns 0 on success, nonzero on failure
//ppFiles is an array of fully qualified filenames, ending with a NULL.
#define MS_CLIST_CONTACTFILESDROPPED "CList/ContactFilesDropped"
//change the group a contact belongs to v0.1.1.0+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(HANDLE)hGroup
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(HANDLE)hGroup
//returns 0 on success, nonzero on failure
-//use hGroup=NULL to put the contact in no group
+//use hGroup = NULL to put the contact in no group
#define MS_CLIST_CONTACTCHANGEGROUP "CList/ContactChangeGroup"
//determines the ordering of two contacts v0.1.1.0+
-//wParam=(WPARAM)(HANDLE)hContact1
-//lParam=(LPARAM)(HANDLE)hContact2
+//wParam = (WPARAM)(HANDLE)hContact1
+//lParam = (LPARAM)(HANDLE)hContact2
//returns 0 if hContact1 is the same as hContact2
//returns +1 if hContact2 should be displayed after hContact1
//returns -1 if hContact1 should be displayed after hContact2
#define MS_CLIST_CONTACTSCOMPARE "CList/ContactsCompare"
/*
- wParam=0 (not used)
- lParam=(LPARAM) &MIRANDASYSTRAYNOTIFY
+ wParam = 0 (not used)
+ lParam = (LPARAM) &MIRANDASYSTRAYNOTIFY
Affects: Show a message in a ballon tip against a protocol icon (if installed)
Returns: 0 on success, non zero on failure
diff --git a/include/m_clui.h b/include/m_clui.h
index c02d8ed26c..9b4ae4977b 100644
--- a/include/m_clui.h
+++ b/include/m_clui.h
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//ui/contactlist/m_clist.h instead
//gets the handle for the contact list window
-//wParam=lParam=0
+//wParam = lParam = 0
//returns the HWND
//This call has a few very specific purposes internally in Miranda, and
//shouldn't be gratuitously used. In almost all cases there's another call to
@@ -40,16 +40,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_CLUI_GETHWNDTREE "CLUI/GetHwndTree"
//change protocol-specific status indicators
-//wParam=new status
-//lParam=(LPARAM)(const char*)szProtocolID
+//wParam = new status
+//lParam = (LPARAM)(const char*)szProtocolID
//returns 0 on success, nonzero on failure
//protocol modules don't want to call this. They want
//clist/protocolstatuschanged instead
#define MS_CLUI_PROTOCOLSTATUSCHANGED "CLUI/ProtocolStatusChanged"
//a new group was created. Add it to the list
-//wParam=(WPARAM)(HANDLE)hGroup
-//lParam=newGroup
+//wParam = (WPARAM)(HANDLE)hGroup
+//lParam = newGroup
//returns 0 on success, nonzero on failure
//newGroup is set to 1 if the user just created the group, and 0 otherwise
//this is also called when the contact list is being rebuilt
@@ -57,23 +57,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_CLUI_GROUPADDED "CLUI/GroupCreated"
//change the icon for a contact
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=iconid
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = iconid
//returns 0 on sucess, nonzero on failure
//iconid is an offset in the image list. see clist/geticonsimagelist
#define MS_CLUI_CONTACTSETICON "CLUI/ContactSetIcon"
//remove a contact from the list
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//returns 0 on success, nonzero on failure
//this is not necessarily the same as a contact being actually deleted, since
//if a contact goes offline while 'hide offline' is on, this will be called
#define MS_CLUI_CONTACTDELETED "CLUI/ContactDeleted"
//add a contact to the list
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=iconId
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = iconId
//returns 0 on success, nonzero on failure
//The caller processes the 'hide offline' setting, so the callee should not do
//further processing based on the value of this setting.
@@ -90,8 +90,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_CLUI_CONTACTADDED "CLUI/ContactAdded"
//rename a contact in the list
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//returns 0 on success, nonzero on failure
//you should not re-sort the list on this call. A separate resort request will
//be sent
@@ -99,7 +99,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_CLUI_CONTACTRENAMED "CLUI/ContactRenamed"
//start a rebuild of the contact list
-//wParam=lParam=0
+//wParam = lParam = 0
//returns 0 on success, nonzero on failure
//this is the cue to clear the existing contents of the list
//expect to get a series of clui/groupadded calls followed by a series of
@@ -107,22 +107,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_CLUI_LISTBEGINREBUILD "CLUI/ListBeginRebuild"
//end a rebuild of the contact list
-//wParam=lParam=0
+//wParam = lParam = 0
//returns 0 on success, nonzero on failure
//if you displayed an hourglass in beginrebuild, set it back here
//you do not need to explicitly sort the list
#define MS_CLUI_LISTENDREBUILD "CLUI/ListEndRebuild"
//sort the contact list now
-//wParam=lParam=0
+//wParam = lParam = 0
//returns 0 on success, nonzero on failure
//sorts are buffered so you won't get this message lots of times if the list
//needs to be re-sorted many times rapidly.
#define MS_CLUI_SORTLIST "CLUI/SortList"
//Gets a load of capabilities for the loaded CLUI v0.1.2.1+
-//wParam=capability, CLUICAPS_*
-//lParam=0
+//wParam = capability, CLUICAPS_*
+//lParam = 0
//returns the requested value, 0 if wParam is an unknown value
//If this service is not implemented, it is assumed to return 0 to all input
@@ -157,21 +157,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_CLUI_GETCAPS "CLUI/GetCaps"
//a contact is being dragged outside the main window v0.1.2.0+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=MAKELPARAM(screenX, screenY)
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = MAKELPARAM(screenX, screenY)
//return nonzero to make the cursor a 'can drop here', or zero for 'no'
#define ME_CLUI_CONTACTDRAGGING "CLUI/ContactDragging"
//a contact has just been dropped outside the main window v0.1.2.0+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=MAKELPARAM(screenX, screenY)
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = MAKELPARAM(screenX, screenY)
//return nonzero if your hook processed this, so no other hooks get it
#define ME_CLUI_CONTACTDROPPED "CLUI/ContactDropped"
//a contact that was being dragged outside the main window has gone back in to
//the main window. v0.1.2.1+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//return zero
#define ME_CLUI_CONTACTDRAGSTOP "CLUI/ContactDragStop"
diff --git a/include/m_database.h b/include/m_database.h
index 2dc03a5ff6..9fcce5bd8d 100644
--- a/include/m_database.h
+++ b/include/m_database.h
@@ -89,8 +89,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* DB/Contact/GetProfileName service
Gets the name of the profile currently being used by the database module. This
is the same as the filename of the database
- wParam=(WPARAM)(UINT)cbName
- lParam=(LPARAM)(char*)pszName
+ wParam = (WPARAM)(UINT)cbName
+ lParam = (LPARAM)(char*)pszName
pszName is a pointer to the buffer that receives the name of the profile
cbName is the size in bytes of the pszName buffer
Returns 0 on success or nonzero otherwise
@@ -103,8 +103,8 @@ Get the path of the base folder where Miranda will store all individual profiles
The returned path does NOT include a trailing backslash.
Essentially this is what has been set in mirandaboot.ini as ProfileDir.
For more options to retrieve profile paths check MS_UTILS_REPLACEVARS
- wParam=(WPARAM)(UINT)cbName
- lParam=(LPARAM)(char*)pszName
+ wParam = (WPARAM)(UINT)cbName
+ lParam = (LPARAM)(char*)pszName
pszName is a pointer to the buffer that receives the path of the profile
cbName is the size in bytes of the pszName buffer
Returns 0 on success or nonzero otherwise
@@ -124,8 +124,8 @@ Returns 0 on success or nonzero otherwise
/* DB/Contact/GetSetting service
Look up the value of a named setting for a specific contact in the database
- wParam=(WPARAM)(HANDLE)hContact
- lParam=(LPARAM)(DBCONTACTGETSETTING*)&dbcgs
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = (LPARAM)(DBCONTACTGETSETTING*)&dbcgs
hContact should have been returned by find*contact or addcontact
Caller is responsible for free()ing dbcgs.pValue->pszVal and pbVal if they are
returned. This should be done with db/contact/freevariant if you have your own
@@ -163,8 +163,8 @@ the dbcgs->type parameter
/* DB/Contact/GetSettingStatic service
Look up the value of a named setting for a specific contact in the database
- wParam=(WPARAM)(HANDLE)hContact
- lParam=(LPARAM)(DBCONTACTGETSETTING*)&dbcgs
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = (LPARAM)(DBCONTACTGETSETTING*)&dbcgs
hContact should have been returned by find*contact or addcontact
This service differs from db/contact/getsetting in that it won't malloc()
memory for the return value if it needs to do so. This introduces some extra
@@ -191,8 +191,8 @@ was invalid.
/* DB/Contact/FreeVariant service
Free the memory in a DBVARIANT that is allocated by a call to
db/contact/getsetting
- wParam=0
- lParam=(LPARAM)(DBVARIANT*)&dbv
+ wParam = 0
+ lParam = (LPARAM)(DBVARIANT*)&dbv
Returns 0 on success, nonzero otherwise
This service is actually just a wrapper around a call to free() and a test to
check that it is a string or a blob in the variant. It exists because DLLs have
@@ -209,8 +209,8 @@ There's a helper function for this at the bottom of this header too.
/* DB/Contact/WriteSetting service
Change the value of, or create a new value with, a named setting for a specific
contact in the database to the given value
- wParam=(WPARAM)(HANDLE)hContact
- lParam=(LPARAM)(DBCONTACTWRITESETTING*)&dbcws
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = (LPARAM)(DBCONTACTWRITESETTING*)&dbcws
hContact should have been returned by find*contact or addcontact
Returns 0 on success or nonzero if hContact was invalid
Note that DBCONTACTGETSETTING takes a pointer to a DBVARIANT, whereas
@@ -229,14 +229,14 @@ typedef struct {
/* DB/Contact/DeleteSetting service
Removes a named setting for a specific contact from the database
- wParam=(WPARAM)(HANDLE)hContact
- lParam=(LPARAM)(DBCONTACTGETSETTING*)&dbcgs
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = (LPARAM)(DBCONTACTGETSETTING*)&dbcgs
hContact should have been returned by find*contact or addcontact
pValue from dbcgs is not used.
Returns 0 on success or nonzero if the setting was not present or hContact was
invalid
Triggers a db/contact/settingchanged event before it deletes the setting. The
-'new value' of the setting is set to type=0 and all the other fields are
+'new value' of the setting is set to type = 0 and all the other fields are
undefined.
*/
#define MS_DB_CONTACT_DELETESETTING "DB/Contact/DeleteSetting"
@@ -244,8 +244,8 @@ undefined.
/* db/contact/enumsettings v0.1.0.1+
Lists all the settings a specific modules has stored in the database for a
specific contact.
-wParam=(WPARAM)(HANDLE)hContact
-lParam=(LPARAM)(DBCONTACTENUMSETTINGS*)&dbces
+wParam = (WPARAM)(HANDLE)hContact
+lParam = (LPARAM)(DBCONTACTENUMSETTINGS*)&dbces
Returns the return value of the last call to pfnEnumProc, or -1 if there are
no settings for that module/contact pair
Writing to or deleting from the database while enumerating will have
@@ -266,7 +266,7 @@ typedef struct {
/* DB/Contact/GetCount service
Gets the number of contacts in the database, which does not count the user
- wParam=lParam=0
+ wParam = lParam = 0
Returns the number of contacts. They can be retrieved using contact/findfirst
and contact/findnext
*/
@@ -275,7 +275,7 @@ and contact/findnext
/* DB/Contact/FindFirst service
Gets the handle of the first contact in the database. This handle can be used
with loads of functions. It does not need to be closed.
- wParam=lParam=0
+ wParam = lParam = 0
Returns a handle to the first contact in the db on success, or NULL if there
are no contacts in the db.
*/
@@ -284,8 +284,8 @@ are no contacts in the db.
/* DB/Contact/FindNext service
Gets the handle of the next contact after hContact in the database. This handle
can be used with loads of functions. It does not need to be closed.
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = 0
Returns a handle to the contact after hContact in the db on success or NULL if
hContact was the last contact in the db or hContact was invalid.
*/
@@ -294,10 +294,10 @@ hContact was the last contact in the db or hContact was invalid.
/* DB/Contact/Delete
Deletes the contact hContact from the database and all events and settings
associated with it.
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = 0
Returns 0 on success or nonzero if hContact was invalid
-Please don't try to delete the user contact (hContact=NULL)
+Please don't try to delete the user contact (hContact = NULL)
Triggers a db/contact/deleted event just *before* it removes anything
Because all events are deleted, lots of people may end up with invalid event
handles from this operation, which they should be prepared for.
@@ -307,7 +307,7 @@ handles from this operation, which they should be prepared for.
/* DB/Contact/Add
Adds a new contact to the database. New contacts initially have no settings
whatsoever, they must all be added with db/contacts/writesetting.
- wParam=lParam=0
+ wParam = lParam = 0
Returns a handle to the newly created contact on success, or NULL otherwise.
Triggers a db/contact/added event just before it returns.
*/
@@ -317,8 +317,8 @@ Triggers a db/contact/added event just before it returns.
Checks if a given value is a valid contact handle, note that due
to the nature of multiple threading, a valid contact can still become
invalid after a call to this service.
- wParam=(WPARAM)hContact
- lParam=0
+ wParam = (WPARAM)hContact
+ lParam = 0
Returns 1 if the contact is a contact, or 0 if the contact is not valid.
*/
#define MS_DB_CONTACT_IS "DB/Contact/Is"
@@ -332,8 +332,8 @@ will be called. For example, for module named 'foo' and event id 2000 a service
foo/GetEventText2000 should be defined to process this request. That handler should
decode a blob and return the event text in the required format, its prototype is identical
to a call of MS_DB_EVENT_GETTEXT (see below)
- wParam=0
- lParam=(LPARAM)(DBEVENTTYPEDESCR*)
+ wParam = 0
+ lParam = (LPARAM)(DBEVENTTYPEDESCR*)
Always returns 0.
*/
@@ -363,8 +363,8 @@ typedef struct
/* DB/EventType/Get service (0.7+)
Retrieves the previously registered database event type, by module & id.
- wParam=(WPARAM)(char*)szModule
- lParam=(LPARAM)(int)eventType
+ wParam = (WPARAM)(char*)szModule
+ lParam = (LPARAM)(int)eventType
Returns DBEVENTTYPEDESCR* or NULL, if an event isn't found.
*/
@@ -372,8 +372,8 @@ Returns DBEVENTTYPEDESCR* or NULL, if an event isn't found.
/* DB/Event/GetCount service
Gets the number of events in the chain belonging to a contact in the database.
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = 0
Returns the number of events in the chain owned by hContact or -1 if hContact
is invalid. They can be retrieved using the event/find* services.
*/
@@ -381,8 +381,8 @@ is invalid. They can be retrieved using the event/find* services.
/* DB/Event/Add
Adds a new event to a contact's event list
- wParam=(WPARAM)(HANDLE)hContact
- lParam=(LPARAM)(DBEVENTINFO*)&dbe
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = (LPARAM)(DBEVENTINFO*)&dbe
Returns a handle to the newly added event, or NULL on failure
Triggers a db/event/added event just before it returns.
Events are sorted chronologically as they are entered, so you cannot guarantee
@@ -426,8 +426,8 @@ typedef struct {
/* DB/Event/Delete
Removes a single event from the database
- wParam=(WPARAM)(HANDLE)hContact
- lParam=(LPARAM)(HANDLE)hDbEvent
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = (LPARAM)(HANDLE)hDbEvent
hDbEvent should have been returned by db/event/add or db/event/find*event
Returns 0 on success, or nonzero if hDbEvent was invalid
Triggers a db/event/deleted event just *before* the event is deleted
@@ -436,8 +436,8 @@ Triggers a db/event/deleted event just *before* the event is deleted
/* DB/Event/GetBlobSize
Retrieves the space in bytes required to store the blob in hDbEvent
- wParam=(WPARAM)(HANDLE)hDbEvent
- lParam=0
+ wParam = (WPARAM)(HANDLE)hDbEvent
+ lParam = 0
hDbEvent should have been returned by db/event/add or db/event/find*event
Returns the space required in bytes, or -1 if hDbEvent is invalid
*/
@@ -445,8 +445,8 @@ Returns the space required in bytes, or -1 if hDbEvent is invalid
/* DB/Event/Get
Retrieves all the information stored in hDbEvent
- wParam=(WPARAM)(HANDLE)hDbEvent
- lParam=(LPARAM)(DBEVENTINFO*)&dbe
+ wParam = (WPARAM)(HANDLE)hDbEvent
+ lParam = (LPARAM)(DBEVENTINFO*)&dbe
hDbEvent should have been returned by db/event/add or db/event/find*event
Returns 0 on success or nonzero if hDbEvent is invalid
Don't forget to set dbe.cbSize, dbe.pBlob and dbe.cbBlob before calling this
@@ -463,8 +463,8 @@ of modules. Look but don't touch.
/* DB/Event/GetText (0.7.0+)
Retrieves the event's text
- wParam=(WPARAM)0 (unused)
- lParam=(LPARAM)(DBEVENTGETTEXT*)egt - pointer to structure with parameters
+ wParam = (WPARAM)0 (unused)
+ lParam = (LPARAM)(DBEVENTGETTEXT*)egt - pointer to structure with parameters
egt->dbei should be the valid database event read via MS_DB_EVENT_GET
egt->datatype = DBVT_WCHAR or DBVT_ASCIIZ or DBVT_TCHAR. If a caller wants to
suppress Unicode part of event in answer, add DBVTF_DENYUNICODE to this field.
@@ -498,8 +498,8 @@ __inline static TCHAR* DbGetEventTextT(DBEVENTINFO* dbei, int codepage)
/* DB/Event/GetIcon (0.7.0.1+)
Retrieves the event's icon
- wParam=(WPARAM)(int)flags - use LR_SHARED for shared HICON
- lParam=(LPARAM)(DBEVENTINFO*)dbei
+ wParam = (WPARAM)(int)flags - use LR_SHARED for shared HICON
+ lParam = (LPARAM)(DBEVENTINFO*)dbei
dbei should be a valid database event read via MS_DB_EVENT_GET
Function returns HICON (use DestroyIcon to release resources if not LR_SHARED)
@@ -514,8 +514,8 @@ same parameters MS_DB_EVENT_GETICON does.
/* DB/Event/GetString (0.9.0+)
Converts the event's string to TCHAR* depending on the event's format
- wParam=(LPARAM)(DBEVENTINFO*)dbei
- lParam=(WPARAM)(char*)str - string to be converted
+ wParam = (LPARAM)(DBEVENTINFO*)dbei
+ lParam = (WPARAM)(char*)str - string to be converted
returns TCHAR* - the converted string
Caller must free the result using mir_free
*/
@@ -529,8 +529,8 @@ __inline static TCHAR* DbGetEventStringT(DBEVENTINFO* dbei, const char* str)
/* DB/Event/MarkRead
Changes the flags for an event to mark it as read.
- wParam=(WPARAM)(HANDLE)hContact
- lParam=(LPARAM)(HANDLE)hDbEvent
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = (LPARAM)(HANDLE)hDbEvent
hDbEvent should have been returned by db/event/add or db/event/find*event
Returns the entire flag DWORD for the event after the change, or -1 if hDbEvent
is invalid.
@@ -541,8 +541,8 @@ Modules should not save flags states for any length of time.
/* DB/Event/GetContact
Retrieves a handle to the contact that owns hDbEvent.
- wParam=(WPARAM)(HANDLE)hDbEvent
- lParam=0
+ wParam = (WPARAM)(HANDLE)hDbEvent
+ lParam = 0
hDbEvent should have been returned by db/event/add or db/event/find*event
NULL is a valid return value, meaning, as usual, the user.
Returns (HANDLE)(-1) if hDbEvent is invalid, or the handle to the contact on
@@ -554,8 +554,8 @@ all.
/* DB/Event/FindFirst
Retrieves a handle to the first event in the chain for hContact
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = 0
Returns the handle, or NULL if hContact is invalid or has no events
Events in a chain are sorted chronologically automatically
*/
@@ -563,8 +563,8 @@ Events in a chain are sorted chronologically automatically
/* DB/Event/FindFirstUnread
Retrieves a handle to the first unread event in the chain for hContact
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = 0
Returns the handle, or NULL if hContact is invalid or all its events have been
read
Events in a chain are sorted chronologically automatically, but this does not
@@ -577,8 +577,8 @@ unread from last time
/* DB/Event/FindLast
Retrieves a handle to the last event in the chain for hContact
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = 0
Returns the handle, or NULL if hContact is invalid or has no events
Events in a chain are sorted chronologically automatically
*/
@@ -586,8 +586,8 @@ Events in a chain are sorted chronologically automatically
/* DB/Event/FindNext
Retrieves a handle to the next event in a chain after hDbEvent
- wParam=(WPARAM)(HANDLE)hDbEvent
- lParam=0
+ wParam = (WPARAM)(HANDLE)hDbEvent
+ lParam = 0
Returns the handle, or NULL if hDbEvent is invalid or is the last event
Events in a chain are sorted chronologically automatically
*/
@@ -595,8 +595,8 @@ Events in a chain are sorted chronologically automatically
/* DB/Event/FindPrev
Retrieves a handle to the previous event in a chain before hDbEvent
- wParam=(WPARAM)(HANDLE)hDbEvent
- lParam=0
+ wParam = (WPARAM)(HANDLE)hDbEvent
+ lParam = 0
Returns the handle, or NULL if hDbEvent is invalid or is the first event
Events in a chain are sorted chronologically automatically
*/
@@ -606,8 +606,8 @@ Events in a chain are sorted chronologically automatically
/* DB/Crypt/EncodeString
Scrambles pszString in-place using a strange encryption algorithm
- wParam=(WPARAM)(int)cbString
- lParam=(LPARAM)(char*)pszString
+ wParam = (WPARAM)(int)cbString
+ lParam = (LPARAM)(char*)pszString
cbString is the size of the buffer pointed to by pszString, *not* the length
of pszString. This service may be changed at a later date such that it
increases the length of pszString
@@ -617,8 +617,8 @@ Returns 0 always
/* DB/Crypt/DecodeString
Descrambles pszString in-place using the strange encryption algorithm
- wParam=(WPARAM)(int)cbString
- lParam=(LPARAM)(char*)pszString
+ wParam = (WPARAM)(int)cbString
+ lParam = (LPARAM)(char*)pszString
Reverses the operation done by crypt/encodestring
cbString is the size of the buffer pointed to by pszString, *not* the length
of pszString.
@@ -630,8 +630,8 @@ Returns 0 always
/* DB/Time/TimestampToLocal
Converts a GMT timestamp into local time
- wParam=(WPARAM)(DWORD)timestamp
- lParam=0
+ wParam = (WPARAM)(DWORD)timestamp
+ lParam = 0
Returns the converted value
Timestamps have zero at midnight 1/1/1970 GMT, this service converts such a
value to be based at midnight 1/1/1970 local time.
@@ -648,8 +648,8 @@ disadvantages :-)).
/* DB/Time/TimestampToString
Converts a GMT timestamp into a customisable local time string
- wParam=(WPARAM)(DWORD)timestamp
- lParam=(LPARAM)(DBTIMETOSTRING*)&tts
+ wParam = (WPARAM)(DWORD)timestamp
+ lParam = (LPARAM)(DBTIMETOSTRING*)&tts
Returns 0 always
Uses db/time/timestamptolocal for the conversion so read that description to
see what's going on.
@@ -682,8 +682,8 @@ typedef struct {
/*
Switches safety settings on or off
-wParam=(WPARAM)(BOOL)newSetting
-lParam=0
+wParam = (WPARAM)(BOOL)newSetting
+lParam = 0
returns 0 always
newSetting is TRUE initially.
Miranda's database is normally protected against corruption by agressively
@@ -702,8 +702,8 @@ so you need not use this service for that purpose.
/* db/modules/enum v0.1.0.1+
Enumerates the names of all modules that have stored or requested information
from the database.
-wParam=lParam
-lParam=(WPARAM)(DBMODULEENUMPROC)dbmep
+wParam = lParam
+lParam = (WPARAM)(DBMODULEENUMPROC)dbmep
Returns the value returned by the last call to dbmep
This service is only really useful for debugging, in conjunction with
db/contact/enumsettings
@@ -718,7 +718,7 @@ szModuleName is only guaranteed to be valid for the duration of the callback.
If you want to keep it for longer you must allocation your own storage.
**BUG**: Prior to 0.1.2.0 dbmep was called as (lParam)(szMod, ofsMod, lParam).
This means that the lParam parameter to dbmep was useless, and explains the
- slightly odd 'wParam=lParam' in the definition.
+ slightly odd 'wParam = lParam' in the definition.
*/
typedef int (*DBMODULEENUMPROC)(const char *szModuleName, DWORD ofsModuleName, LPARAM lParam);
#define MS_DB_MODULES_ENUM "DB/Modules/Enum"
@@ -726,8 +726,8 @@ typedef int (*DBMODULEENUMPROC)(const char *szModuleName, DWORD ofsModuleName, L
/* DB/Module/Delete 0.8.0+
Removes all settings for the specified module.
-wParam=0 (unused)
-lParam=(LPARAM)(char*)szModuleName - the module name to be deleted
+wParam = 0 (unused)
+lParam = (LPARAM)(char*)szModuleName - the module name to be deleted
*/
#define MS_DB_MODULE_DELETE "DB/Module/Delete"
@@ -738,8 +738,8 @@ lParam=(LPARAM)(char*)szModuleName - the module name to be deleted
/* DB/Event/Added event
Called when a new event has been added to the event chain for a contact
- wParam=(WPARAM)(HANDLE)hContact
- lParam=(LPARAM)(HANDLE)hDbEvent
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = (LPARAM)(HANDLE)hDbEvent
hDbEvent is a valid handle to the event. hContact is a valid handle to the
contact to which hDbEvent refers.
Since events are sorted chronologically, you cannot guarantee that hDbEvent is
@@ -756,8 +756,8 @@ passed to MS_DB_EVENT_ADD.
The point of this hook is to stop any unwanted database events, to stop
an event being added, return 1, to allow the event to pass through return
0.
- wParam=(WPARAM)(HANDLE)hContact
- lParam=(LPARAM)&DBEVENTINFO
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = (LPARAM)&DBEVENTINFO
Any changed made to the said DBEVENTINFO are also passed along to the database,
therefore it is possible to shape the data, however DO NOT DO THIS.
@@ -766,8 +766,8 @@ therefore it is possible to shape the data, however DO NOT DO THIS.
/* DB/Event/Deleted event
Called when an event is about to be deleted from the event chain for a contact
- wParam=(WPARAM)(HANDLE)hContact
- lParam=(LPARAM)(HANDLE)hDbEvent
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = (LPARAM)(HANDLE)hDbEvent
hDbEvent is a valid handle to the event which is about to be deleted, but it
won't be once your hook has returned.
hContact is a valid handle to the contact to which hDbEvent refers, and will
@@ -779,8 +779,8 @@ usual, stop other hooks from being called.
/* DB/Contact/Added event
Called when a new contact has been added to the database
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = 0
hContact is a valid handle to the new contact.
Contacts are initially created without any settings, so if you hook this event
you will almost certainly also want to hook db/contact/settingchanged as well.
@@ -789,8 +789,8 @@ you will almost certainly also want to hook db/contact/settingchanged as well.
/* DB/Contact/Deleted event
Called when an contact is about to be deleted
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = 0
hContact is a valid handle to the contact which is about to be deleted, but it
won't be once your hook has returned.
Returning nonzero from your hook will not stop the deletion, but it will, as
@@ -801,8 +801,8 @@ Deleting a contact invalidates all events in its chain.
/* DB/Contact/SettingChanged event
Called when a contact has had one of its settings changed
- wParam=(WPARAM)(HANDLE)hContact
- lParam=(LPARAM)(DBCONTACTWRITESETTING*)&dbcws
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = (LPARAM)(DBCONTACTWRITESETTING*)&dbcws
hContact is a valid handle to the contact that has changed.
This event will be triggered many times rapidly when a whole bunch of values
are set.
@@ -816,8 +816,8 @@ don't change any of the members.
/* DB/Contact/SetSettingResident service (0.6+)
Disables a setting saving to the database.
- wParam=(WPARAM)(BOOL)bIsResident
- lParam=(LPARAM)(char*)pszSettingName
+ wParam = (WPARAM)(BOOL)bIsResident
+ lParam = (LPARAM)(char*)pszSettingName
*/
#define MS_DB_SETSETTINGRESIDENT "DB/SetSettingResident"
diff --git a/include/m_email.h b/include/m_email.h
index 5ff1962328..c19979ed5e 100644
--- a/include/m_email.h
+++ b/include/m_email.h
@@ -25,8 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define M_EMAIL_H__ 1
//send an e-mail to the specified contact v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//returns 0 on success or nonzero on failure
//if an error occurs the service will display a message box with the error
//text, so this service should not be used if you do not want this behaviour.
diff --git a/include/m_file.h b/include/m_file.h
index 44c9ff1c27..7285078a64 100644
--- a/include/m_file.h
+++ b/include/m_file.h
@@ -25,16 +25,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define M_FILE_H__ 1
//brings up the send file dialog for a contact
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//returns 0 on success or nonzero on failure
//returns immediately, without waiting for the send
#define MS_FILE_SENDFILE "SRFile/SendCommand"
//brings up the send file dialog with the specified files already chosen
//v0.1.2.1+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(const char**)ppFiles
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(const char**)ppFiles
//returns 0 on success or nonzero on failure
//returns immediately, without waiting for the send
//the user is not prevented from changing the filename with the 'choose again'
@@ -48,15 +48,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_FILE_SENDSPECIFICFILES "SRFile/SendSpecificFiles"
//v0.9.0+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(const TCHAR**)ppFiles
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(const TCHAR**)ppFiles
//returns 0 on success or nonzero on failure
//returns immediately, without waiting for the send
#define MS_FILE_SENDSPECIFICFILEST "SRFile/SendSpecificFilesT"
//get the received files folder v0.1.2.2+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(char *)pszOutput
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(char *)pszOutput
//returns 0 on success or nonzero on failure
//pszOutput must be at least MAX_PATH characters long
//If hContact is NULL this function will retrieve the received files folder
diff --git a/include/m_findadd.h b/include/m_findadd.h
index ed0cd60ec8..9e7d170595 100644
--- a/include/m_findadd.h
+++ b/include/m_findadd.h
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* Opens the find/add users dialog box, or gives it the focus if it's already
open.
-wParam=lParam=0
+wParam = lParam = 0
returns 0 always
*/
#define MS_FINDADD_FINDADD "FindAdd/FindAddCommand"
diff --git a/include/m_fuse.h b/include/m_fuse.h
index 7df4d1e89b..1c00720851 100644
--- a/include/m_fuse.h
+++ b/include/m_fuse.h
@@ -7,9 +7,9 @@
typedef int (*MIRANDAHOOK)(WPARAM, LPARAM);
typedef INT_PTR (*MIRANDASERVICE)(WPARAM, LPARAM);
-#define FUSE_INIT 0 // core started, Param=**FUSE_LINK
+#define FUSE_INIT 0 // core started, Param = **FUSE_LINK
#define FUSE_DEINIT 1 // core stopped
-#define FUSE_DEFMOD 3 // LoadDefaultModules() return code, Param=*int
+#define FUSE_DEFMOD 3 // LoadDefaultModules() return code, Param = *int
#define FUSE_DEATH 4 // DestroyingModularEngine() just got called
typedef struct {
diff --git a/include/m_history.h b/include/m_history.h
index cf6b85cf70..dba50b83bc 100644
--- a/include/m_history.h
+++ b/include/m_history.h
@@ -25,8 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define M_HISTORY_H__ 1
//show the History dialog box for a contact
-// wParam=(WPARAM)(HANDLE)hContact
-// lParam=0
+// wParam = (WPARAM)(HANDLE)hContact
+// lParam = 0
//hContact can be NULL to show system messages
#define MS_HISTORY_SHOWCONTACTHISTORY "History/ShowContactHistory"
diff --git a/include/m_hotkeys.h b/include/m_hotkeys.h
index 7d6acba08f..7bd596b3ed 100644
--- a/include/m_hotkeys.h
+++ b/include/m_hotkeys.h
@@ -63,8 +63,8 @@ extern int hLangpack;
/* CoreHotkeys/Register service
Registers new hotkey
- wParam=(WPARAM)0
- lParam=(LPARAM)(HOTKEYDESC *)hotkey
+ wParam = (WPARAM)0
+ lParam = (LPARAM)(HOTKEYDESC *)hotkey
Returns 0 on failure or hotkey atom id on success
*/
@@ -75,23 +75,23 @@ __inline static INT_PTR Hotkey_Register(HOTKEYDESC *hk)
/* CoreHotkeys/Unregister service
Unregister existing hotkey
- wParam=(WPARAM)0
- lParam=(LPARAM)(char *)pszName
+ wParam = (WPARAM)0
+ lParam = (LPARAM)(char *)pszName
Returns 0 on success or nonzero otherwise
*/
#define MS_HOTKEY_UNREGISTER "CoreHotkeys/Unregister"
/* CoreHotkeys/Check service
Checks if "manual" hotkey was activated and returns its id.
- wParam=(WPARAM)(MSG *)message
- lParam=(LPARAM)(char *)pszSection
+ wParam = (WPARAM)(MSG *)message
+ lParam = (LPARAM)(char *)pszSection
Returns lParam associated with activated hotkey
*/
#define MS_HOTKEY_CHECK "CoreHotkeys/Check"
/* Subclass/unsubclass edit box to act as hotkey control
- wParam=(WPARAM)(HWND)hwndEdit
- lParam=(LPARAM)0
+ wParam = (WPARAM)(HWND)hwndEdit
+ lParam = (LPARAM)0
Returns zero on success
You will get notification with LOWORD(wParam) == 0 when users sets hotkey.
diff --git a/include/m_icq.h b/include/m_icq.h
index eb585715c3..18b00fe5eb 100644
--- a/include/m_icq.h
+++ b/include/m_icq.h
@@ -46,38 +46,38 @@ typedef struct {
// Request authorization
-// wParam=(WPARAM)hContact
+// wParam = (WPARAM)hContact
#define MS_REQ_AUTH "/ReqAuth"
// Grant authorization
-// wParam=(WPARAM)hContact;
+// wParam = (WPARAM)hContact;
#define MS_GRANT_AUTH "/GrantAuth"
// Revoke authorization
-// wParam=(WPARAM)hContact
+// wParam = (WPARAM)hContact
#define MS_REVOKE_AUTH "/RevokeAuth"
// Open ICQ profile
-// wParam=(WPARAM)hContact
+// wParam = (WPARAM)hContact
#define MS_OPEN_PROFILE "/OpenProfile"
// Add contact to server-list
-// wParam=(WPARAM)hContact
+// wParam = (WPARAM)hContact
#define MS_ICQ_ADDSERVCONTACT "/AddServerContact"
// Display XStatus detail (internal use only)
-// wParam=(WPARAM)hContact;
+// wParam = (WPARAM)hContact;
#define MS_XSTATUS_SHOWDETAILS "/ShowXStatusDetails"
//Send an SMS via the ICQ network
-//wParam=(WPARAM)(const char*)szPhoneNumber
-//lParam=(LPARAM)(const char*)szMessage
+//wParam = (WPARAM)(const char*)szPhoneNumber
+//lParam = (LPARAM)(const char*)szMessage
//Returns a HANDLE to the send on success, or NULL on failure
//szPhoneNumber should be the full number with international code and preceeded
//by a +
//When the server acks the send, an ack will be broadcast:
-// type=ICQACKTYPE_SMS, result=ACKRESULT_SENTREQUEST, lParam=(LPARAM)(char*)szInfo
+// type = ICQACKTYPE_SMS, result = ACKRESULT_SENTREQUEST, lParam = (LPARAM)(char*)szInfo
//At this point the message is queued to be delivered. szInfo contains the raw
//XML data of the ack. Here's what I got when I tried:
//"<sms_response><source>airbornww.com</source><deliverable>Yes</deliverable><network>BT Cellnet, United Kingdom</network><message_id>[my uin]-1-1955988055-[destination phone#, without +]</message_id><messages_left>0</messages_left></sms_response>\r\n"
@@ -87,7 +87,7 @@ typedef struct {
//At a (possibly much) later time the SMS will have been delivered. An ack will
//be broadcast:
-// type=ICQACKTYPE_SMS, result=ACKRESULT_SUCCESS, hProcess=NULL, lParam=(LPARAM)(char*)szInfo
+// type = ICQACKTYPE_SMS, result = ACKRESULT_SUCCESS, hProcess = NULL, lParam = (LPARAM)(char*)szInfo
//Note that the result will always be success even if the send failed, just to
//save needing to have an attempt at an XML parser in the ICQ module.
//Here's the szInfo for a success:
@@ -126,23 +126,23 @@ typedef struct {
//for server-side lists, used internally only
-//hProcess=dwSequence
-//lParam=server's error code, 0 for success
+//hProcess = dwSequence
+//lParam = server's error code, 0 for success
#define ICQACKTYPE_SERVERCLIST 1003
//for rate warning distribution (mainly upload dlg)
-//hProcess=Rate class ID
-//lParam=server's status code
+//hProcess = Rate class ID
+//lParam = server's status code
#define ICQACKTYPE_RATEWARNING 1004
//received Xtraz Notify response
-//hProcess=dwSequence
-//lParam=contents of RES node
+//hProcess = dwSequence
+//lParam = contents of RES node
#define ICQACKTYPE_XTRAZNOTIFY_RESPONSE 1005
//received Custom Status details response
-//hProcess=dwSequence
-//lParam=0
+//hProcess = dwSequence
+//lParam = 0
#define ICQACKTYPE_XSTATUS_RESPONSE 1006
@@ -158,21 +158,21 @@ typedef struct {
#define CIXT_EXTRA 0x0080
#define CIXT_FULL 0x00FF
-//wParam=operationType
+//wParam = operationType
#define PS_CHANGEINFOEX "/ChangeInfoEx"
//Change nickname in White pages
-//lParam=(LPARAM)(const char*)szNewNickName
+//lParam = (LPARAM)(const char*)szNewNickName
#define PS_SET_NICKNAME "/SetNickname"
//Set password for current session
-//lParam=(LPARAM)(const char*)szPassword
+//lParam = (LPARAM)(const char*)szPassword
#define PS_ICQ_SETPASSWORD "/SetPassword"
//miranda/icqoscar/statusmsgreq event
//called when our status message is requested
-//wParam=(BYTE)msgType
-//lParam=(DWORD)uin
+//wParam = (BYTE)msgType
+//lParam = (DWORD)uin
//msgType is one of the ICQ_MSGTYPE_GET###MSG constants in icq_constants.h
//uin is the UIN of the contact requesting our status message
#define ME_ICQ_STATUSMSGREQ "/StatusMsgReq"
diff --git a/include/m_ignore.h b/include/m_ignore.h
index 9dd861bf3e..c20a029502 100644
--- a/include/m_ignore.h
+++ b/include/m_ignore.h
@@ -37,26 +37,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define IGNOREEVENT_TYPINGNOTIFY 7 // 0.7+
//determines if a message type to a contact should be ignored v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=message type, an ignoreevent_ constant
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = message type, an ignoreevent_ constant
//returns 0 if the message should be shown, or nonzero if it should be ignored
-//Use hContact=NULL to retrieve the setting for unknown contacts (not on the
+//Use hContact = NULL to retrieve the setting for unknown contacts (not on the
//contact list, as either permanent or temporary).
//don't use ignoreevent_all when calling this service
#define MS_IGNORE_ISIGNORED "Ignore/IsIgnored"
//ignore future messages from a contact v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=message type, an ignoreevent_ constant
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = message type, an ignoreevent_ constant
//returns 0 on success or nonzero on failure
-//Use hContact=NULL to retrieve the setting for unknown contacts
+//Use hContact = NULL to retrieve the setting for unknown contacts
#define MS_IGNORE_IGNORE "Ignore/Ignore"
//receive future messages from a contact v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=message type, an ignoreevent_ constant
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = message type, an ignoreevent_ constant
//returns 0 on success or nonzero on failure
-//Use hContact=NULL to retrieve the setting for unknown contacts
+//Use hContact = NULL to retrieve the setting for unknown contacts
#define MS_IGNORE_UNIGNORE "Ignore/Unignore"
diff --git a/include/m_json.h b/include/m_json.h
index 2326728302..38c3a5e44e 100644
--- a/include/m_json.h
+++ b/include/m_json.h
@@ -1,43 +1,43 @@
-/*
-
-Miranda IM: the free IM client for Microsoft* Windows*
-
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-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; either version 2
-of the License, or (at your option) any later version.
-
-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, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef MIM_LIBJSON_H
-#define MIM_LIBJSON_H
-
-#define IsJSONServiceAvailable() (ServiceExists(MS_JSON_FREE))
-#define json_getJSI(a) CallService(MS_JSON_GETINTERFACE,(WPARAM)a,0)
-
-#ifndef LIBJSON_H
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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; either version 2
+of the License, or (at your option) any later version.
+
+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, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef MIM_LIBJSON_H
+#define MIM_LIBJSON_H
+
+#define IsJSONServiceAvailable() (ServiceExists(MS_JSON_FREE))
+#define json_getJSI(a) CallService(MS_JSON_GETINTERFACE,(WPARAM)a,0)
+
+#ifndef LIBJSON_H
#define JSONNODE void //so that JSONNODE* is void*
typedef JSONNODE** JSONNODE_ITERATOR;
-#endif
-
-// This function get the service interface for direct calling
-// wParam=(WPARAM)(LPJSONSERVICEINTERFACE)
-// lParam=0
-// Return value ALWAYS 0
-
-typedef struct {
+#endif
+
+// This function get the service interface for direct calling
+// wParam = (WPARAM)(LPJSONSERVICEINTERFACE)
+// lParam = 0
+// Return value ALWAYS 0
+
+typedef struct {
/*
stuff that's in namespace libJSON
*/
@@ -139,13 +139,13 @@ typedef struct {
//comparison
int (*equal)(JSONNODE * node, JSONNODE * node2);
-} JSONSERVICEINTERFACE, *PJSONSERVICEINTERFACE, *LPJSONSERVICEINTERFACE;
-
-
-#ifndef _STATIC
-extern JSONSERVICEINTERFACE jsi;
-
-#ifndef LIBJSON_H
+} JSONSERVICEINTERFACE, *PJSONSERVICEINTERFACE, *LPJSONSERVICEINTERFACE;
+
+
+#ifndef _STATIC
+extern JSONSERVICEINTERFACE jsi;
+
+#ifndef LIBJSON_H
#define json_free(a) jsi.free(a)
#define json_delete(a) jsi.delete_(a)
// #ifdef JSON_MEMORY_MANAGE
@@ -226,9 +226,9 @@ extern JSONSERVICEINTERFACE jsi;
#define json_begin(a) jsi.begin(a)
#define json_end(a) jsi.end(a)
#define json_equal(a,b) jsi.equal(a,b)
-#endif
-#endif // _STATIC
-
-#define MS_JSON_GETINTERFACE "JSON/GetInterface"
-
-#endif // MIM_LIBJSON_H
+#endif
+#endif // _STATIC
+
+#define MS_JSON_GETINTERFACE "JSON/GetInterface"
+
+#endif // MIM_LIBJSON_H
diff --git a/include/m_langpack.h b/include/m_langpack.h
index efcca8d27c..61d8bcc78f 100644
--- a/include/m_langpack.h
+++ b/include/m_langpack.h
@@ -33,8 +33,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif
//translates a single string into the user's local language v0.1.1.0+
-//wParam=0
-//lParam=(LPARAM)(const char*)szEnglish
+//wParam = 0
+//lParam = (LPARAM)(const char*)szEnglish
//returns a pointer to the localised string. If there is no known translation
//it will return szEnglish. The return value does not need to be freed in any
//way
@@ -57,26 +57,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//Those macros do NOTHING. They are just markers for lpgen.pl.
//translates a menu into the user's local language v0.1.1.0+
-//wParam=(WPARAM)(HMENU)hMenu
-//lParam=langpack handle (v.0.10.0+)
+//wParam = (WPARAM)(HMENU)hMenu
+//lParam = langpack handle (v.0.10.0+)
//returns 0 on success, nonzero on failure
#define MS_LANGPACK_TRANSLATEMENU "LangPack/TranslateMenu"
//returns the codepage used in the language pack v0.4.3.0+
-//wParam=0
-//lParam=0
+//wParam = 0
+//lParam = 0
//returns the codepage stated in the langpack, or CP_ACP if no langpack is present
#define MS_LANGPACK_GETCODEPAGE "LangPack/GetCodePage"
//returns the locale id associated with the language pack v0.4.3.0+
-//wParam=0
-//lParam=0
+//wParam = 0
+//lParam = 0
//returns the Windows locale id stated in the langpack, or LOCALE_USER_DEFAULT if no langpack is present
#define MS_LANGPACK_GETLOCALE "LangPack/GetLocale"
//returns the strdup/wcsdup of lparam according to the langpack v0.4.3.0+
-//wParam=langpack handle (v.0.10.0+)
-//lParam=(LPARAM)(char*)source string
+//wParam = langpack handle (v.0.10.0+)
+//lParam = (LPARAM)(char*)source string
//returns a string converted from char* to TCHAR* using the langpack codepage.
//This string should be freed using mir_free() then
#define MS_LANGPACK_PCHARTOTCHAR "LangPack/PcharToTchar"
@@ -96,8 +96,8 @@ __inline static INT_PTR Langpack_PCharToTChar(const char* str)
#endif
//initializes the plugin-specific translation context v0.10.0+
-//wParam=pointer to the langpack handle
-//lParam=PLUGININFOEX* of the caller plugin
+//wParam = pointer to the langpack handle
+//lParam = PLUGININFOEX* of the caller plugin
//always returns 0
#define MS_LANGPACK_REGISTER "LangPack/Register"
@@ -108,8 +108,8 @@ __inline static void mir_getLP(const PLUGININFOEX* pInfo)
#endif
//reloads langpack
-//wParam=0 (ignored)
-//lParam=(LPARAM)(TCHAR*)langpack file name or NULL to reload the current one
+//wParam = 0 (ignored)
+//lParam = (LPARAM)(TCHAR*)langpack file name or NULL to reload the current one
//always returns 0
#define MS_LANGPACK_RELOAD "LangPack/Reload"
diff --git a/include/m_message.h b/include/m_message.h
index 4c503704ea..c5a8a484ec 100644
--- a/include/m_message.h
+++ b/include/m_message.h
@@ -25,12 +25,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define M_MESSAGE_H__ 1
//brings up the send message dialog for a contact
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(char*)szText
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(char*)szText
//returns 0 on success or nonzero on failure
//returns immediately, just after the dialog is shown
//szText is the text to put in the edit box of the window (but not send)
-//szText=NULL will not use any text
+//szText = NULL will not use any text
//szText != NULL is only supported on v0.1.2.0+
#define MS_MSG_SENDMESSAGE "SRMsg/SendCommand"
#define MS_MSG_SENDMESSAGEW "SRMsg/SendCommandW"
@@ -42,8 +42,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif
#define ME_MSG_WINDOWEVENT "MessageAPI/WindowEvent"
-//wparam=0
-//lparam=(WPARAM)(MessageWindowEventData*)hWindowEvent;
+//wparam = 0
+//lparam = (WPARAM)(MessageWindowEventData*)hWindowEvent;
//Event types
#define MSG_WINDOW_EVT_OPENING 1 //window is about to be opened
#define MSG_WINDOW_EVT_OPEN 2 //window has been opened
@@ -68,14 +68,14 @@ typedef struct {
} MessageWindowEventData;
#define MS_MSG_GETWINDOWAPI "MessageAPI/WindowAPI"
-//wparam=0
-//lparam=0
+//wparam = 0
+//lparam = 0
//Returns a dword with the current message api version
//Current version is 0, 0, 0, 4
#define MS_MSG_GETWINDOWCLASS "MessageAPI/WindowClass"
-//wparam=(char*)szBuf
-//lparam=(int)cbSize size of buffer
+//wparam = (char*)szBuf
+//lparam = (int)cbSize size of buffer
//Sets the window class name in wParam (ex. "SRMM" for srmm.dll)
typedef struct {
@@ -99,8 +99,8 @@ typedef struct {
} MessageWindowData;
#define MS_MSG_GETWINDOWDATA "MessageAPI/GetWindowData"
-//wparam=(MessageWindowInputData*)
-//lparam=(MessageWindowData*)
+//wparam = (MessageWindowInputData*)
+//lparam = (MessageWindowData*)
//returns 0 on success and returns non-zero (1) on error or if no window data exists for that hcontact
diff --git a/include/m_netlib.h b/include/m_netlib.h
index 20db435de5..fb0d13f27b 100644
--- a/include/m_netlib.h
+++ b/include/m_netlib.h
@@ -43,8 +43,8 @@ struct NETLIBOPENCONNECTION_tag;
typedef struct NETLIBOPENCONNECTION_tag NETLIBOPENCONNECTION;
//Initialises the netlib for a set of connections
-//wParam=0
-//lParam=(LPARAM)(NETLIBUSER*)&nu
+//wParam = 0
+//lParam = (LPARAM)(NETLIBUSER*)&nu
//Returns a HANDLE to be used for future netlib calls, NULL on failure
//NOTE: Netlib is loaded after any plugins, so you need to wait until
// ME_SYSTEM_MODULESLOADED before calling this function
@@ -95,14 +95,14 @@ typedef struct {
//Assign a Netlib user handle a set of dynamic HTTP headers to be used with all
//
//HTTP connections that enable the HTTP-use-sticky headers flag.
-//The headers persist until cleared with lParam=NULL.
+//The headers persist until cleared with lParam = NULL.
//
//All memory should be allocated by the caller using malloc() from MS_SYSTEM_GET_MMI
//Once it has passed to Netlib, Netlib is the owner of it, the caller should not refer to the memory
//In any way after this point.
//
-//wParam=(WPARAM)hNetLibUser
-//lParam=(LPARAM)(char*)szHeaders
+//wParam = (WPARAM)hNetLibUser
+//lParam = (LPARAM)(char*)szHeaders
//
//NOTE: The szHeaders parameter should be a NULL terminated string following the HTTP header syntax.
//This string will be injected verbatim, thus the user should be aware of setting strings that are not
@@ -172,8 +172,8 @@ should use the MSG_DUMPPROXY flag so that the logging is neat.
*/
//Gets the user-configured settings for a netlib user
-//wParam=(WPARAM)(HANDLE)hUser
-//lParam=(LPARAM)(NETLIBUSERSETTINGS*)&nlus
+//wParam = (WPARAM)(HANDLE)hUser
+//lParam = (LPARAM)(NETLIBUSERSETTINGS*)&nlus
//Returns nonzero on success, 0 on failure ( !! this is different to most of the rest of Miranda, but consistent with netlib)
//The pointers referred to in the returned struct will remain valid until
//the hUser handle is closed, or until the user changes the settings in the
@@ -205,8 +205,8 @@ typedef struct {
#define MS_NETLIB_GETUSERSETTINGS "Netlib/GetUserSettings"
//Changes the user-configurable settings for a netlib user
-//wParam=(WPARAM)(HANDLE)hUser
-//lParam=(LPARAM)(NETLIBUSERSETTINGS*)&nlus
+//wParam = (WPARAM)(HANDLE)hUser
+//lParam = (LPARAM)(NETLIBUSERSETTINGS*)&nlus
//Returns nonzero on success, 0 on failure ( !! this is different to most of the rest of Miranda, but consistent with netlib)
//This function is only really useful for people that specify NUF_NOOPTIONS
//and want to create their own options.
@@ -216,8 +216,8 @@ typedef struct {
#define MS_NETLIB_SETUSERSETTINGS "Netlib/SetUserSettings"
//Closes a netlib handle
-//wParam=(WPARAM)(HANDLE)hNetlibHandle
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hNetlibHandle
+//lParam = 0
//Returns nonzero on success, 0 on failure ( !! this is different to most of the rest of Miranda, but consistent with netlib)
//This function should be called on all handles returned by netlib functions
//once you are done with them. If it's called on a socket-type handle, the
@@ -227,8 +227,8 @@ typedef struct {
__inline static INT_PTR Netlib_CloseHandle(HANDLE h) {return CallService(MS_NETLIB_CLOSEHANDLE, (WPARAM)h, 0);}
//Open a port and wait for connections on it
-//wParam=(WPARAM)(HANDLE)hUser
-//lParam=(LPARAM)(NETLIBBIND*)&nlb
+//wParam = (WPARAM)(HANDLE)hUser
+//lParam = (LPARAM)(NETLIBBIND*)&nlb
//Returns a HANDLE on success, NULL on failure
//hUser should have been returned by MS_NETLIB_REGISTERUSER
//This function does the equivalent of socket(), bind(), getsockname(),
@@ -294,8 +294,8 @@ typedef struct {
#define MS_NETLIB_BINDPORT "Netlib/BindPort"
//Open a connection
-//wParam=(WPARAM)(HANDLE)hUser
-//lParam=(LPARAM)(NETLIBOPENCONNECTION*)&nloc
+//wParam = (WPARAM)(HANDLE)hUser
+//lParam = (LPARAM)(NETLIBOPENCONNECTION*)&nloc
//Returns a HANDLE to the new connection on success, NULL on failure
//hUser must have been returned by MS_NETLIB_REGISTERUSER
//Internally this function is the equivalent of socket(), gethostbyname(),
@@ -349,8 +349,8 @@ struct NETLIBOPENCONNECTION_tag {
#define MS_NETLIB_OPENCONNECTION "Netlib/OpenConnection"
//Sets the required information for an HTTP proxy connection
-//wParam=(WPARAM)(HANDLE)hConnection
-//lParam=(LPARAM)(NETLIBHTTPPROXYINFO*)&nlhpi
+//wParam = (WPARAM)(HANDLE)hConnection
+//lParam = (LPARAM)(NETLIBHTTPPROXYINFO*)&nlhpi
//Returns nonzero on success, 0 on failure ( !! this is different to most of the rest of Miranda, but consistent with netlib)
//This function is designed to be called from within pfnHttpGatewayInit
//See notes below MS_NETLIB_REGISTERUSER.
@@ -370,8 +370,8 @@ typedef struct {
#define MS_NETLIB_SETHTTPPROXYINFO "Netlib/SetHttpProxyInfo"
//Gets the SOCKET associated with a netlib handle
-//wParam=(WPARAM)(HANDLE)hNetlibHandle
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hNetlibHandle
+//lParam = 0
//Returns the SOCKET on success, INVALID_SOCKET on failure
//hNetlibHandle should have been returned by MS_NETLIB_BINDPORT or
//MS_NETLIB_OPENCONNECTION only.
@@ -381,8 +381,8 @@ typedef struct {
#define MS_NETLIB_GETSOCKET "Netlib/GetSocket"
//URL-encode a string for x-www-form-urlencoded (and other) transmission
-//wParam=0
-//lParam=(LPARAM)(const char *)pszString
+//wParam = 0
+//lParam = (LPARAM)(const char *)pszString
//Returns a char* containing the new string. This must be freed with
//HeapFree(GetProcessHeap(), 0, pszReturnString) when you're done with it.
//Returns NULL on error.
@@ -390,8 +390,8 @@ typedef struct {
#define MS_NETLIB_URLENCODE "Netlib/UrlEncode"
//Base64 decode a string. See rfc1421.
-//wParam=0
-//lParam=(LPARAM)(NETLIBBASE64*)&nlb64
+//wParam = 0
+//lParam = (LPARAM)(NETLIBBASE64*)&nlb64
//Returns nonzero on success, 0 on failure ( !! this is different to most of the rest of Miranda, but consistent with netlib)
//nlb64.pszEncoded and nlb64.cchEncoded contain the input string and its length
//(excluding terminating zero).
@@ -410,8 +410,8 @@ typedef struct {
#define MS_NETLIB_BASE64DECODE "Netlib/Base64Decode"
//Base64 encode a string. See rfc1421.
-//wParam=0
-//lParam=(LPARAM)(NETLIBBASE64*)&nlb64
+//wParam = 0
+//lParam = (LPARAM)(NETLIBBASE64*)&nlb64
//Returns nonzero on success, 0 on failure ( !! this is different to most of the rest of Miranda, but consistent with netlib)
//nlb64.pbDecoded and nlb64.cbDecoded contain the input buffer and its length
//nlb64.pszEncoded and nlb64.cchEncoded contain the buffer in which to put the
@@ -427,16 +427,16 @@ typedef struct {
// Converts string representation of IP and port into numerical SOCKADDR_INET
// IPv4 could supplied in formats address:port or address
// IPv6 could supplied in formats [address]:port or [address]
-// wParam=(WPARAM)(char*) string to convert
-// lParam=(LPARAM)(SOCKADDR_INET*) numeric IP address structure
+// wParam = (WPARAM)(char*) string to convert
+// lParam = (LPARAM)(SOCKADDR_INET*) numeric IP address structure
// Returns 0 on success
#define MS_NETLIB_STARINGTOADDRESS "Netlib/StringToAddress"
// Converts numerical representation of IP in SOCKADDR_INET into string representation with IP and port
// IPv4 will be supplied in formats address:port or address
// IPv6 will be supplied in formats [address]:port or [address]
-// wParam=(WPARAM)(int) 0 - lParam - (sockaddr_gen*); 1 - lParam - (unsigned) in host byte order
-// lParam=(LPARAM)(sockaddr_gen*) or (unsigned) numeric IP address structure
+// wParam = (WPARAM)(int) 0 - lParam - (sockaddr_gen*); 1 - lParam - (unsigned) in host byte order
+// lParam = (LPARAM)(sockaddr_gen*) or (unsigned) numeric IP address structure
// Returns pointer to the string or NULL if not successful
#define MS_NETLIB_ADDRESSTOSTRING "Netlib/AddressToString"
@@ -450,8 +450,8 @@ typedef struct {
// Get connection Information
// IPv4 will be supplied in formats address:port or address
// IPv6 will be supplied in formats [address]:port or [address]
-// wParam=(WPARAM)(HANDLE)hConnection
-// lParam=(LPARAM)(NETLIBCONNINFO*) pointer to the connection information structure to fill
+// wParam = (WPARAM)(HANDLE)hConnection
+// lParam = (LPARAM)(NETLIBCONNINFO*) pointer to the connection information structure to fill
// Returns 0 if successful
#define MS_NETLIB_GETCONNECTIONINFO "Netlib/GetConnectionInfo"
@@ -461,14 +461,14 @@ typedef struct {
} NETLIBIPLIST;
// Get connection Information
-// wParam=(WPARAM)IP filter 1 - return global only IPv6 address, 0 all IPs
+// wParam = (WPARAM)IP filter 1 - return global only IPv6 address, 0 all IPs
// Returns (INT_PTR)(NETLIBIPLIST*) numeric IP address address array
// the last element of the array is all 0s, 0 if not successful
#define MS_NETLIB_GETMYIP "Netlib/GetMyIP"
//Send an HTTP request over a connection
-//wParam=(WPARAM)(HANDLE)hConnection
-//lParam=(LPARAM)(NETLIBHTTPREQUEST*)&nlhr
+//wParam = (WPARAM)(HANDLE)hConnection
+//lParam = (LPARAM)(NETLIBHTTPREQUEST*)&nlhr
//Returns number of bytes sent on success, SOCKET_ERROR on failure
//hConnection must have been returned by MS_NETLIB_OPENCONNECTION
//Note that if you use NLHRF_SMARTAUTHHEADER and NTLM authentication is in use
@@ -525,13 +525,13 @@ struct NETLIBHTTPREQUEST_tag {
#define MS_NETLIB_SENDHTTPREQUEST "Netlib/SendHttpRequest"
//Receive HTTP headers
-//wParam=(WPARAM)(HANDLE)hConnection
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hConnection
+//lParam = 0
//Returns a pointer to a NETLIBHTTPREQUEST structure on success, NULL on
//failure.
//Call MS_NETLIB_FREEHTTPREQUESTSTRUCT to free this.
//hConnection must have been returned by MS_NETLIB_OPENCONNECTION
-//nlhr->pData=NULL and nlhr->dataLength=0 always. The requested data should
+//nlhr->pData = NULL and nlhr->dataLength = 0 always. The requested data should
//be retrieved using MS_NETLIB_RECV once the header has been parsed.
//If the headers haven't finished within 60 seconds the function returns NULL
//and ERROR_TIMEOUT.
@@ -544,8 +544,8 @@ struct NETLIBHTTPREQUEST_tag {
#define MS_NETLIB_RECVHTTPHEADERS "Netlib/RecvHttpHeaders"
//Free the memory used by a NETLIBHTTPREQUEST structure
-//wParam=0
-//lParam=(LPARAM)(NETLIBHTTPREQUEST*)pnlhr
+//wParam = 0
+//lParam = (LPARAM)(NETLIBHTTPREQUEST*)pnlhr
//Returns nonzero on success, 0 on failure ( !! this is different to most of the rest of Miranda, but consistent with netlib)
//This should only be called on structures returned by
//MS_NETLIB_RECVHTTPHEADERS or MS_NETLIB_HTTPTRANSACTION. Calling it on an
@@ -554,8 +554,8 @@ struct NETLIBHTTPREQUEST_tag {
#define MS_NETLIB_FREEHTTPREQUESTSTRUCT "Netlib/FreeHttpRequestStruct"
//Do an entire HTTP transaction
-//wParam=(WPARAM)(HANDLE)hUser
-//lParam=(LPARAM)(NETLIBHTTPREQUEST*)&nlhr
+//wParam = (WPARAM)(HANDLE)hUser
+//lParam = (LPARAM)(NETLIBHTTPREQUEST*)&nlhr
//Returns a pointer to another NETLIBHTTPREQUEST structure on success, NULL on
//failure.
//Call MS_NETLIB_FREEHTTPREQUESTSTRUCT to free this.
@@ -572,7 +572,7 @@ struct NETLIBHTTPREQUEST_tag {
// "User-Agent" (of the form "Miranda/0.1.2.2 (alpha)" or "Miranda/0.1.2.2")
// "Content-Length" (for POSTs only. Set to nlhr.dataLength)
//If you do not want to send one of these headers, create a nlhr.headers with
-//szValue=NULL.
+//szValue = NULL.
//In the return value headers, headerCount, pData, dataLength, resultCode and
//szResultDescr are all valid.
//In the return value pData[dataLength] == 0 always, as an extra safeguard
@@ -584,8 +584,8 @@ struct NETLIBHTTPREQUEST_tag {
#define MS_NETLIB_HTTPTRANSACTION "Netlib/HttpTransaction"
//Send data over a connection
-//wParam=(WPARAM)(HANDLE)hConnection
-//lParam=(LPARAM)(NETLIBBUFFER*)&nlb
+//wParam = (WPARAM)(HANDLE)hConnection
+//lParam = (LPARAM)(NETLIBBUFFER*)&nlb
//Returns the number of bytes sent on success, SOCKET_ERROR on failure
//Errors: ERROR_INVALID_PARAMETER
// anything from send(), nlu.pfnHttpGatewayWrapSend()
@@ -606,13 +606,13 @@ typedef struct {
} NETLIBBUFFER;
#define MS_NETLIB_SEND "Netlib/Send"
static __inline INT_PTR Netlib_Send(HANDLE hConn, const char *buf, int len, int flags) {
- NETLIBBUFFER nlb={(char*)buf, len, flags};
+ NETLIBBUFFER nlb = {(char*)buf, len, flags};
return CallService(MS_NETLIB_SEND, (WPARAM)hConn, (LPARAM)&nlb);
}
//Receive data over a connection
-//wParam=(WPARAM)(HANDLE)hConnection
-//lParam=(LPARAM)(NETLIBBUFFER*)&nlb
+//wParam = (WPARAM)(HANDLE)hConnection
+//lParam = (LPARAM)(NETLIBBUFFER*)&nlb
//Returns the number of bytes read on success, SOCKET_ERROR on failure,
//0 if the connection has been closed
//Flags supported: MSG_PEEK, MSG_NODUMP, MSG_DUMPPROXY, MSG_NOHTTPGATEWAYWRAP,
@@ -633,13 +633,13 @@ static __inline INT_PTR Netlib_Send(HANDLE hConn, const char *buf, int len, int
// MS_NETLIB_SENDHTTPREQUEST
#define MS_NETLIB_RECV "Netlib/Recv"
static __inline INT_PTR Netlib_Recv(HANDLE hConn, char *buf, int len, int flags) {
- NETLIBBUFFER nlb={buf, len, flags};
+ NETLIBBUFFER nlb = {buf, len, flags};
return CallService(MS_NETLIB_RECV, (WPARAM)hConn, (LPARAM)&nlb);
}
//Determine the status of one or more connections
-//wParam=0
-//lParam=(LPARAM)(NETLIBSELECT*)&nls
+//wParam = 0
+//lParam = (LPARAM)(NETLIBSELECT*)&nls
//Returns the number of ready connections, SOCKET_ERROR on failure,
//0 if the timeout expired.
//All handles passed to this function must have been returned by either
@@ -672,15 +672,15 @@ typedef struct {
#define MS_NETLIB_SELECTEX "Netlib/SelectEx"
//Shutdown connection
-//wParam=(WPARAM)(HANDLE)hConnection
-//lParam=(LPARAM)0
+//wParam = (WPARAM)(HANDLE)hConnection
+//lParam = (LPARAM)0
//Returns 0
#define MS_NETLIB_SHUTDOWN "Netlib/Shutdown"
__inline static void Netlib_Shutdown(HANDLE h) {CallService(MS_NETLIB_SHUTDOWN, (WPARAM)h, 0);}
//Create a packet receiver
-//wParam=(WPARAM)(HANDLE)hConnection
-//lParam=(LPARAM)(int)maxPacketSize
+//wParam = (WPARAM)(HANDLE)hConnection
+//lParam = (LPARAM)(int)maxPacketSize
//Returns a HANDLE on success, NULL on failure
//The packet receiver implements the common situation where you have variable
//length packets coming in over a connection and you want to split them up
@@ -691,8 +691,8 @@ __inline static void Netlib_Shutdown(HANDLE h) {CallService(MS_NETLIB_SHUTDOWN,
#define MS_NETLIB_CREATEPACKETRECVER "Netlib/CreatePacketRecver"
//Get the next set of packets from a packet receiver
-//wParam=(WPARAM)(HANDLE)hPacketRecver
-//lParam=(LPARAM)(NETLIBPACKETRECVER*)&nlpr
+//wParam = (WPARAM)(HANDLE)hPacketRecver
+//lParam = (LPARAM)(NETLIBPACKETRECVER*)&nlpr
//Returns the total number of bytes available in the buffer, 0 if the
//connection was closed, SOCKET_ERROR on error.
//hPacketRecver must have been returned by MS_NETLIB_CREATEPACKETRECVER
@@ -719,8 +719,8 @@ typedef struct {
#define MS_NETLIB_GETMOREPACKETS "Netlib/GetMorePackets"
//Add a message to the log (if it's running)
-//wParam=(WPARAM)(HANDLE)hUser
-//lParam=(LPARAM)(const char *)szMessage
+//wParam = (WPARAM)(HANDLE)hUser
+//lParam = (LPARAM)(const char *)szMessage
//Returns nonzero on success, 0 on failure ( !! this is different to most of the rest of Miranda, but consistent with netlib)
//Do not include a final line ending in szMessage.
//Errors: ERROR_INVALID_PARAMETER
@@ -728,15 +728,15 @@ typedef struct {
#define MS_NETLIB_LOGW "Netlib/LogW"
//Sets a gateway polling timeout interval
-//wParam=(WPARAM)(HANDLE)hConn
-//lParam=(LPARAM)timeout
+//wParam = (WPARAM)(HANDLE)hConn
+//lParam = (LPARAM)timeout
//Returns previous timeout value
//Errors: -1
#define MS_NETLIB_SETPOLLINGTIMEOUT "Netlib/SetPollingTimeout"
//Makes connection SSL
-//wParam=(WPARAM)(HANDLE)hConn
-//lParam=(LPARAM)(NETLIBSSL*)&nlssl or null if no certficate validation required
+//wParam = (WPARAM)(HANDLE)hConn
+//lParam = (LPARAM)(NETLIBSSL*)&nlssl or null if no certficate validation required
//Returns 0 on failure 1 on success
#define MS_NETLIB_STARTSSL "Netlib/StartSsl"
diff --git a/include/m_options.h b/include/m_options.h
index 5da817a71a..bc3469998a 100644
--- a/include/m_options.h
+++ b/include/m_options.h
@@ -30,8 +30,8 @@ extern int hLangpack;
The user opened the options dialog. Modules should do whatever initialisation
they need and call opt/addpage one or more times if they want pages displayed
in the options dialog
-wParam=addInfo
-lParam=0
+wParam = addInfo
+lParam = 0
addInfo should be passed straight to the wParam of opt/addpage
*/
#define ME_OPT_INITIALISE "Opt/Initialise"
@@ -39,8 +39,8 @@ addInfo should be passed straight to the wParam of opt/addpage
/* Opt/AddPage
Must only be called during an opt/initialise hook
Adds a page to the options dialog
-wParam=addInfo
-lParam=(LPARAM)(OPTIONSDIALOGPAGE*)odp
+wParam = addInfo
+lParam = (LPARAM)(OPTIONSDIALOGPAGE*)odp
addInfo must have come straight from the wParam of opt/initialise
Pages in the options dialog operate just like pages in property sheets. See the
Microsoft documentation for details on how they operate.
@@ -101,7 +101,7 @@ typedef struct {
#define ODPF_TCHAR 0
#endif
-#define PSN_EXPERTCHANGED 2 //sent to pages via WM_NOTIFY when the expert checkbox is clicked. lParam=new state
+#define PSN_EXPERTCHANGED 2 //sent to pages via WM_NOTIFY when the expert checkbox is clicked. lParam = new state
#define PSM_ISEXPERT (WM_USER+101) //returns true/false
#define PSM_GETBOLDFONT (WM_USER+102) //returns HFONT used for group box titles
@@ -111,8 +111,8 @@ __inline static INT_PTR Options_AddPage(WPARAM wParam, OPTIONSDIALOGPAGE* odp)
}
//Opens the options dialog, optionally at the specified page v0.1.2.1+
-//wParam=0
-//lParam=(LPARAM)(OPENOPTIONSDIALOG*)&ood;
+//wParam = 0
+//lParam = (LPARAM)(OPENOPTIONSDIALOG*)&ood;
//Returns 0 on success, nonzero on failure
//The behaviour if the options dialog is already open is that it will just be
//activated, the page won't be changed. This may change in the future.
diff --git a/include/m_popup.h b/include/m_popup.h
index 54ce2cd09a..835cdff9e0 100644
--- a/include/m_popup.h
+++ b/include/m_popup.h
@@ -1,10 +1,10 @@
/*
- ===============================================================================
+ ============================================================================== =
PopUp plugin
Plugin Name: PopUp
Plugin authors: Luca Santarelli aka hrk (hrk@users.sourceforge.net)
Victor Pavlychko aka zazoo (nullbie@gmail.com)
- ===============================================================================
+ ============================================================================== =
The purpose of this plugin is to give developers a common "platform/interface"
to show PopUps. It is born from the source code of NewStatusNotify, another
plugin I've made.
@@ -12,7 +12,7 @@ plugin I've made.
Remember that users *must* have this plugin enabled, or they won't get any
popup. Write this in the requirements, do whatever you wish ;-)... but tell
them!
- ===============================================================================
+ ============================================================================== =
*/
#ifndef M_POPUP_H
diff --git a/include/m_protocols.h b/include/m_protocols.h
index 88553d6ae0..b659e078a3 100644
--- a/include/m_protocols.h
+++ b/include/m_protocols.h
@@ -29,8 +29,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "statusmodes.h"
//send a general request through the protocol chain for a contact
-//wParam=0
-//lParam=(LPARAM)(CCSDATA*)&ccs
+//wParam = 0
+//lParam = (LPARAM)(CCSDATA*)&ccs
//returns the value as documented in the PS_ definition (m_protosvc.h)
typedef struct {
@@ -43,8 +43,8 @@ typedef struct {
#define MS_PROTO_CALLCONTACTSERVICE "Proto/CallContactService"
//a general network 'ack'
-//wParam=0
-//lParam=(LPARAM)(ACKDATA*)&ack
+//wParam = 0
+//lParam = (LPARAM)(ACKDATA*)&ack
//Note that just because definitions are here doesn't mean they will be sent.
//Read the documentation for the function you are calling to see what replies
//you will receive.
@@ -150,8 +150,8 @@ typedef struct tagPROTOFILETRANSFERSTATUS
PROTOFILETRANSFERSTATUS;
//Enumerate the currently running protocols
-//wParam=(WPARAM)(int*)&numberOfProtocols
-//lParam=(LPARAM)(PROTOCOLDESCRIPTOR***)&ppProtocolDescriptors
+//wParam = (WPARAM)(int*)&numberOfProtocols
+//lParam = (LPARAM)(PROTOCOLDESCRIPTOR***)&ppProtocolDescriptors
//Returns 0 on success, nonzero on failure
//Neither wParam nor lParam may be NULL
//The list returned by this service is the protocol modules currently installed
@@ -215,15 +215,15 @@ typedef struct {
#define MS_PROTO_ENUMPROTOCOLS "Proto/EnumAccounts"
//determines if a protocol module is loaded or not
-//wParam=0
-//lParam=(LPARAM)(const char*)szName
+//wParam = 0
+//lParam = (LPARAM)(const char*)szName
//Returns a pointer to the PROTOCOLDESCRIPTOR if the protocol is loaded, or
//NULL if it isn't.
#define MS_PROTO_ISPROTOCOLLOADED "Proto/IsProtocolLoaded"
//gets the network-level protocol associated with a contact
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//Returns a char* pointing to the asciiz name of the protocol or NULL if the
//contact has no protocol. There is no need to free() it or anything.
//This is the name of the module that actually accesses the network for that
@@ -231,8 +231,8 @@ typedef struct {
#define MS_PROTO_GETCONTACTBASEPROTO "Proto/GetContactBaseProto"
//determines whether the specified contact has the given protocol in its chain
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(const char*)szName
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(const char*)szName
//Returns -1 if it is base protocol, positive number if it is filter and 0 if it doesn't
#define MS_PROTO_ISPROTOONCONTACT "Proto/IsProtoOnContact"
@@ -241,8 +241,8 @@ typedef struct {
//This service is for notifying protocols that the user is typing a message v0.3.3+
//in a message dialog.
//This is typically sent by a message dialog when a user in the clist is typing.
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(int)typing state
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(int)typing state
//NOTE: Only protocols should generally call this service
#define MS_PROTO_SELFISTYPING "Proto/SelfIsTyping"
@@ -250,8 +250,8 @@ typedef struct {
#define PROTOTYPE_CONTACTTYPING_INFINITE 2147483647
//This service is for notifying message dialogs/other plugins of a user typing. v0.3.3+
//This is typically sent by a protocol when a user in the clist is typing.
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(int)time (secs)
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(int)time (secs)
//NOTE: The time in seconds is used to tell a message dialog (or other plugin)
//how long to display its notification. If time is 0, then notification
//of typing ends.
@@ -263,8 +263,8 @@ typedef struct {
//ProtoService PSS_USERISTYPING to the contacts protocol *after* verifying
//that the hContact is not NULL and the the user wishes to send notifications
//to this user (checked visibility, individual typing blocking, etc).
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(int)typing state
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(int)typing state
#define ME_PROTO_CONTACTISTYPING "Proto/ContactIsTypingEvent"
// -------------- accounts support --------------------- 0.8.0+
@@ -289,8 +289,8 @@ typedef struct tagACCOUNT
PROTOACCOUNT;
//account enumeration service
-//wParam=(WPARAM)(int*)piNumAccounts
-//lParam=(LPARAM)(PROTOACCOUNT**)paAccounts
+//wParam = (WPARAM)(int*)piNumAccounts
+//lParam = (LPARAM)(PROTOACCOUNT**)paAccounts
#define MS_PROTO_ENUMACCOUNTS "Proto/EnumAccounts"
__inline static INT_PTR ProtoEnumAccounts(int* accNumber, PROTOACCOUNT*** accArray)
@@ -298,8 +298,8 @@ __inline static INT_PTR ProtoEnumAccounts(int* accNumber, PROTOACCOUNT*** accArr
}
//retrieves an account's interface by its physical name (database module)
-//wParam=0
-//lParam=(LPARAM)(char*)szAccountName
+//wParam = 0
+//lParam = (LPARAM)(char*)szAccountName
//return value = PROTOACCOUNT* or NULL
#define MS_PROTO_GETACCOUNT "Proto/GetAccount"
@@ -321,8 +321,8 @@ __inline static PROTOACCOUNT* ProtoGetAccount(const char* accName)
#define ME_PROTO_ACCLISTCHANGED "Proto/AccListChanged"
//displays the Account Manager
-//wParam=0
-//lParam=0
+//wParam = 0
+//lParam = 0
#define MS_PROTO_SHOWACCMGR "Protos/ShowAccountManager"
//determines if an account is enabled or not
@@ -344,8 +344,8 @@ __inline static int IsAccountEnabled(const PROTOACCOUNT* pa)
//gets the account associated with a contact
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//Returns a char* pointing to the asciiz name of the protocol or NULL if the
//contact has no protocol. There is no need to mir_free() it or anything.
//This is the name of the module that actually accesses the network for that
diff --git a/include/m_protomod.h b/include/m_protomod.h
index 887e673625..98928c0832 100644
--- a/include/m_protomod.h
+++ b/include/m_protomod.h
@@ -33,29 +33,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "m_protocols.h"
//notify the protocol manager that you're around
-//wParam=0
-//lParam=(PROTOCOLDESCRIPTOR*)&descriptor
+//wParam = 0
+//lParam = (PROTOCOLDESCRIPTOR*)&descriptor
//returns 0 on success, nonzero on failure
//This service must be called in your module's Load(void) routine.
//descriptor.type can be a value other than the PROTOTYPE_ constants specified
//above to provide more precise positioning information for the contact
//protocol lists. It is strongly recommended that you give values relative to
-//the constants, however, by adding or subtracting small integers (<=100).
+//the constants, however, by adding or subtracting small integers ( <= 100).
//PROTOTYPE_PROTOCOL modules must not do this. The value must be exact.
//See MS_PROTO_ENUMPROTOCOLS for more notes.
#define MS_PROTO_REGISTERMODULE "Proto/RegisterModule"
//adds the specified protocol module to the chain for a contact
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(const char*)szName
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(const char*)szName
//returns 0 on success, nonzero on failure
//The module is added in the correct position according to the type given when
//it was registered.
#define MS_PROTO_ADDTOCONTACT "Proto/AddToContact"
//removes the specified protocol module from the chain for a contact
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(const char*)szName
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(const char*)szName
//returns 0 on success, nonzero on failure
#define MS_PROTO_REMOVEFROMCONTACT "Proto/RemoveFromContact"
@@ -63,7 +63,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//Protocol services are called with wParam and lParam as standard if they are
//to be called with CallProtoServiceInt(NULL,) (as PS_ services are)
//If they are called with CallContactService() (PSS_ and PSR_ services) then
-//they are called with lParam=(CCSDATA*)&ccs and wParam an opaque internal
+//they are called with lParam = (CCSDATA*)&ccs and wParam an opaque internal
//reference that should be passed unchanged to MS_PROTO_CHAIN*.
__inline static HANDLE CreateProtoServiceFunction(const char *szModule, const char *szService, MIRANDASERVICE serviceProc)
{
@@ -74,8 +74,8 @@ __inline static HANDLE CreateProtoServiceFunction(const char *szModule, const ch
}
//Call the next service in the chain for this send operation
-//wParam=wParam
-//lParam=lParam
+//wParam = wParam
+//lParam = lParam
//The return value should be returned immediately
//wParam and lParam should be passed as the parameters that your service was
//called with. wParam must remain untouched but lParam is a CCSDATA structure
@@ -85,8 +85,8 @@ __inline static HANDLE CreateProtoServiceFunction(const char *szModule, const ch
#define MS_PROTO_CHAINSEND "Proto/ChainSend"
//Call the next service in the chain for this receive operation
-//wParam=wParam
-//lParam=lParam
+//wParam = wParam
+//lParam = lParam
//The return value should be returned immediately
//wParam and lParam should be passed as the parameters that your service was
//called with. wParam must remain untouched but lParam is a CCSDATA structure
@@ -100,19 +100,19 @@ __inline static HANDLE CreateProtoServiceFunction(const char *szModule, const ch
#define MS_PROTO_CHAINRECV "Proto/ChainRecv"
//Broadcast a ME_PROTO_ACK event
-//wParam=0
-//lParam=(LPARAM)(ACKDATA*)&ack
+//wParam = 0
+//lParam = (LPARAM)(ACKDATA*)&ack
//returns the return value of the notifyeventhooks() call
//Thread safety: me_proto_ack is completely thread safe since 0.1.2.0
//See the notes in core/modules.h under NotifyEventHooks()
#define MS_PROTO_BROADCASTACK "Proto/BroadcastAck"
__inline static INT_PTR ProtoBroadcastAck(const char *szModule, HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
- ACKDATA ack={0};
- ack.cbSize=sizeof(ACKDATA);
- ack.szModule=szModule; ack.hContact=hContact;
- ack.type=type; ack.result=result;
- ack.hProcess=hProcess; ack.lParam=lParam;
+ ACKDATA ack = {0};
+ ack.cbSize = sizeof(ACKDATA);
+ ack.szModule = szModule; ack.hContact = hContact;
+ ack.type = type; ack.result = result;
+ ack.hProcess = hProcess; ack.lParam = lParam;
return CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)&ack);
}
diff --git a/include/m_protosvc.h b/include/m_protosvc.h
index f7ce4f26e9..1c6d04bb39 100644
--- a/include/m_protosvc.h
+++ b/include/m_protosvc.h
@@ -46,8 +46,8 @@ convert Unicode to ANSI and call the appropriate service.
//these should be called with CallProtoServiceInt(NULL,)
//Get the capability flags of the module.
-//wParam=flagNum
-//lParam=0
+//wParam = flagNum
+//lParam = 0
//Returns a bitfield corresponding to wParam. See the #defines below
//Should return 0 for unknown values of flagNum
//Non-network-access modules should return flags to represent the things they
@@ -145,11 +145,11 @@ static __inline unsigned long Proto_Status2Flag(int status)
#define PFLAG_UNIQUEIDTEXT 100 //returns a static buffer of text describing the unique field by which this protocol identifies users (already translated), or NULL
-#define PFLAG_MAXCONTACTSPERPACKET 200 //v0.1.2.2+: returns the maximum number of contacts which can be sent in a single PSS_CONTACTS, lParam=(LPARAM)hContact.
+#define PFLAG_MAXCONTACTSPERPACKET 200 //v0.1.2.2+: returns the maximum number of contacts which can be sent in a single PSS_CONTACTS, lParam = (LPARAM)hContact.
#define PFLAG_UNIQUEIDSETTING 300 // returns the setting name of where the unique id is stored
-#define PFLAG_MAXLENOFMESSAGE 400 // v0.3.2+: return the maximum length of an instant message, lParam=(LPARAM)hContact
+#define PFLAG_MAXLENOFMESSAGE 400 // v0.3.2+: return the maximum length of an instant message, lParam = (LPARAM)hContact
/*
@@ -188,8 +188,8 @@ will pick this up and everything will be good.
#define PS_GETCAPS "/GetCaps"
//Get a human-readable name for the protocol
-//wParam=cchName
-//lParam=(LPARAM)(char*)szName
+//wParam = cchName
+//lParam = (LPARAM)(char*)szName
//Returns 0 on success, nonzero on failure
//cchName is the number of characters in the buffer szName
//This should be translated before being returned
@@ -198,8 +198,8 @@ will pick this up and everything will be good.
#define PS_GETNAME "/GetName"
//Loads one of the protocol-specific icons
-//wParam=whichIcon
-//lParam=0
+//wParam = whichIcon
+//lParam = 0
//Returns the HICON, or NULL on failure
//The returned HICON must be DestroyIcon()ed.
//The UI should overlay the online icon with a further UI-specified icon to
@@ -214,14 +214,14 @@ will pick this up and everything will be good.
#define PS_LOADICON "/LoadIcon"
//Change the protocol's status mode
-//wParam=newMode, from ui/contactlist/statusmodes.h
-//lParam=0
+//wParam = newMode, from ui/contactlist/statusmodes.h
+//lParam = 0
//returns 0 on success, nonzero on failure
//Will send an ack with:
-//type=ACKTYPE_STATUS, result=ACKRESULT_SUCCESS, hProcess=(HANDLE)previousMode, lParam=newMode
+//type = ACKTYPE_STATUS, result = ACKRESULT_SUCCESS, hProcess = (HANDLE)previousMode, lParam = newMode
//when the change completes. This ack is sent for all changes, not just ones
//caused by calling this function.
-//Note that newMode can be ID_STATUS_CONNECTING<=newMode<ID_STATUS_CONNECTING+
+//Note that newMode can be ID_STATUS_CONNECTING <= newMode<ID_STATUS_CONNECTING+
//MAX_CONNECT_RETRIES to signify that it's connecting and it's the nth retry.
//Protocols are initially always in offline mode.
//Non-network-level protocol modules do not have the concept of a status and
@@ -230,7 +230,7 @@ will pick this up and everything will be good.
//closest one that it does support, and change to that.
//If the new mode requires that the protocol switch from offline to online then
//it will do so, but errors will be reported in the form of an additional ack:
-//type=ACKTYPE_LOGIN, result=ACKRESULT_FAILURE, hProcess=NULL, lParam=LOGINERR_
+//type = ACKTYPE_LOGIN, result = ACKRESULT_FAILURE, hProcess = NULL, lParam = LOGINERR_
// (added during 0.3.4.3) the protocol will send LOGINERR_OTHERLOCATION if the login
// was disconnected because of a login at another location
#define LOGINERR_WRONGPASSWORD 1
@@ -245,28 +245,28 @@ will pick this up and everything will be good.
#define PS_SETSTATUS "/SetStatus"
//Sets the status-mode specific message for yourself
-//wParam=status mode
-//lParam=(LPARAM)(const char*)szMessage
+//wParam = status mode
+//lParam = (LPARAM)(const char*)szMessage
//Returns 0 on success, nonzero on failure
//Note that this service will not be available unless PF1_MODEMSGSEND is set
//and PF1_INDIVMODEMSG is *not* set.
//If PF1_INDIVMODEMSG is set, then see PSS_AWAYMSG for details of
//the operation of away messages
-//Protocol modules must support szMessage=NULL. It may either mean to use an
+//Protocol modules must support szMessage = NULL. It may either mean to use an
//empty message, or (preferably) to not reply at all to any requests
#define PS_SETAWAYMSG "/SetAwayMsg"
#define PS_SETAWAYMSGW "/SetAwayMsgW"
//Get the status mode that a protocol is currently in
-//wParam=lParam=0
+//wParam = lParam = 0
//Returns the status mode
//Non-network-level protocol modules do not have the concept of a status and
//should leave this service unimplemented
#define PS_GETSTATUS "/GetStatus"
//Allow somebody to add us to their contact list
-//wParam=(WPARAM)(HANDLE)hDbEvent
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hDbEvent
+//lParam = 0
//Returns 0 on success, nonzero on failure
//Auth requests come in the form of an event added to the database for the NULL
//user. The form is:
@@ -277,21 +277,21 @@ will pick this up and everything will be good.
#define PS_AUTHALLOW "/Authorize"
//Deny an authorisation request
-//wParam=(WPARAM)(HANDLE)hDbEvent
-//lParam=(LPARAM)(const TCHAR*)szReason
+//wParam = (WPARAM)(HANDLE)hDbEvent
+//lParam = (LPARAM)(const TCHAR*)szReason
//Returns 0 on success, nonzero on failure
-//Protocol modules must be able to cope with szReason=NULL
+//Protocol modules must be able to cope with szReason = NULL
#define PS_AUTHDENY "/AuthDeny"
#define PS_AUTHDENYW "/AuthDenyW"
// Send a "You were added" event
-// wParam=lParam=0
+// wParam = lParam = 0
// Returns 0 on success, nonzero on failure
#define PSS_ADDED "/YouWereAdded"
//Create account manager UI form
-//wParam=0
-//lParam=(LPARAM)(HWND)hwndAccMgr
+//wParam = 0
+//lParam = (LPARAM)(HWND)hwndAccMgr
//Returns handle on newly created form.
//Size for best fit is 186x134 DLUs, please avoid groupboxes
//paddind and advanced options. This should provide minimal setup
@@ -299,8 +299,8 @@ will pick this up and everything will be good.
#define PS_CREATEACCMGRUI "/CreateAccMgrUI"
//Send a basic search request
-//wParam=0
-//lParam=(LPARAM)(const TCHAR*)szId
+//wParam = 0
+//lParam = (LPARAM)(const TCHAR*)szId
//Returns a handle for the search, or zero on failure
//All protocols identify users uniquely by a single field. This service will
//search by that field.
@@ -309,9 +309,9 @@ will pick this up and everything will be good.
//All search replies (even protocol-specific extended searches) are replied by
//means of a series of acks:
//result acks, one of more of:
-//type=ACKTYPE_SEARCH, result=ACKRESULT_DATA, lParam=(LPARAM)(PROTOSEARCHRESULT*)&psr
+//type = ACKTYPE_SEARCH, result = ACKRESULT_DATA, lParam = (LPARAM)(PROTOSEARCHRESULT*)&psr
//ending ack:
-//type=ACKTYPE_SEARCH, result=ACKRESULT_SUCCESS, lParam=0
+//type = ACKTYPE_SEARCH, result = ACKRESULT_SUCCESS, lParam = 0
//Note that the pointers in the structure are not guaranteed to be valid after
//the ack is complete.
@@ -344,8 +344,8 @@ typedef struct {
#define PS_BASICSEARCHW "/BasicSearchW"
//Search for users by e-mail address v0.1.2.1+
-//wParam=0
-//lParam=(LPARAM)(TCHAR*)szEmail
+//wParam = 0
+//lParam = (LPARAM)(TCHAR*)szEmail
//Returns a HANDLE to the search, or NULL on failure
//Results are returned as for PS_BASICSEARCH.
//This function is only available if the PF1_SEARCHBYEMAIL capability is set
@@ -356,8 +356,8 @@ typedef struct {
#define PS_SEARCHBYEMAILW "/SearchByEmailW"
//Search for users by name v0.1.2.1+
-//wParam=0
-//lParam=(LPARAM)(PROTOSEARCHBYNAME*)&psbn
+//wParam = 0
+//lParam = (LPARAM)(PROTOSEARCHBYNAME*)&psbn
//Returns a HANDLE to the search, or NULL on failure
//Results are returned as for PS_BASICSEARCH.
//This function is only available if the PF1_SEARCHBYNAME capability is set
@@ -370,8 +370,8 @@ typedef struct {
#define PS_SEARCHBYNAMEW "/SearchByNameW"
//Create the advanced search dialog box v0.1.2.1+
-//wParam=0
-//lParam=(HWND)hwndOwner
+//wParam = 0
+//lParam = (HWND)hwndOwner
//Returns a HWND, or NULL on failure
//This function is only available if the PF1_EXTSEARCHUI capability is set
//Advanced search is very protocol-specific so it is left to the protocol
@@ -384,8 +384,8 @@ typedef struct {
#define PS_CREATEADVSEARCHUI "/CreateAdvSearchUI"
//Search using the advanced search dialog v0.1.2.1+
-//wParam=0
-//lParam=(LPARAM)(HWND)hwndAdvancedSearchDlg
+//wParam = 0
+//lParam = (LPARAM)(HWND)hwndAdvancedSearchDlg
//Returns a HANDLE to the search, or NULL on failure
//Results are returned as for PS_BASICSEARCH.
//This function is only available if the PF1_EXTSEARCHUI capability is set
@@ -399,21 +399,21 @@ typedef struct {
} CUSTOMSEARCHRESULTS;
//Adds a search result to the contact list
-//wParam=flags
-//lParam=(LPARAM)(PROTOSEARCHRESULT*)&psr
+//wParam = flags
+//lParam = (LPARAM)(PROTOSEARCHRESULT*)&psr
//Returns a HANDLE to the new contact, or NULL on failure
//psr must be a result returned by a search function, since the extended
//information past the end of the official structure may contain important
//data required by the protocol.
//The protocol library should not allow duplicate contacts to be added, but if
//such a request is received it should return the original hContact, and do the
-//appropriate thing with the temporary flag (ie newflag=(oldflag&thisflag))
+//appropriate thing with the temporary flag (ie newflag = (oldflag&thisflag))
#define PALF_TEMPORARY 1 //add the contact temporarily and invisibly, just to get user info or something
#define PS_ADDTOLIST "/AddToList"
//Adds a contact to the contact list given an auth, added or contacts event
-//wParam=MAKEWPARAM(flags, iContact)
-//lParam=(LPARAM)(HANDLE)hDbEvent
+//wParam = MAKEWPARAM(flags, iContact)
+//lParam = (LPARAM)(HANDLE)hDbEvent
//Returns a HANDLE to the new contact, or NULL on failure
//hDbEvent must be either EVENTTYPE_AUTHREQ or EVENTTYPE_ADDED
//flags are the same as for PS_ADDTOLIST.
@@ -423,25 +423,25 @@ typedef struct {
#define PS_ADDTOLISTBYEVENT "/AddToListByEvent"
//Changes our user details as stored on the server v0.1.2.0+
-//wParam=infoType
-//lParam=(LPARAM)(void*)pInfoData
+//wParam = infoType
+//lParam = (LPARAM)(void*)pInfoData
//Returns a HANDLE to the change request, or NULL on failure
//The details information that is stored on the server is very protocol-
//specific, so this service just supplies an outline for protocols to use.
//See protocol-specific documentation for what infoTypes are available and
//what pInfoData should be for each infoType.
-//Sends an ack type=ACKTYPE_SETINFO, result=ACKRESULT_SUCCESS/FAILURE,
-//lParam=0 on completion.
+//Sends an ack type = ACKTYPE_SETINFO, result = ACKRESULT_SUCCESS/FAILURE,
+//lParam = 0 on completion.
#define PS_CHANGEINFO "/ChangeInfo"
//Informs the protocol of the users chosen resume behaviour v0.1.2.2+
-//wParam=(WPARAM)(HANDLE)hFileTransfer
-//lParam=(LPARAM)(PROTOFILERESUME*)&pfr
+//wParam = (WPARAM)(HANDLE)hFileTransfer
+//lParam = (LPARAM)(PROTOFILERESUME*)&pfr
//Returns 0 on success, nonzero on failure
//If the protocol supports file resume (PF1_FILERESUME) then before each
//individual file receive begins (note: not just each file that already exists)
-//it will broadcast an ack with type=ACKTYPE_FILE, result=ACKRESULT_RESUME,
-//hProcess=hFileTransfer, lParam=(LPARAM)(PROTOFILETRANSFERSTATUS*)&fts. If the
+//it will broadcast an ack with type = ACKTYPE_FILE, result = ACKRESULT_RESUME,
+//hProcess = hFileTransfer, lParam = (LPARAM)(PROTOFILETRANSFERSTATUS*)&fts. If the
//UI processes this ack it must return nonzero from its hook. If all the hooks
//complete without returning nonzero then the protocol will assume that no
//resume UI was available and will continue the file receive with a default
@@ -463,20 +463,20 @@ typedef struct {
#define PS_FILERESUMEW "/FileResumeW"
//Asks a protocol to join the chatroom from contact v0.8.0+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)0
//Returns 0 on success, nonzero on failure
#define PS_JOINCHAT "/JoinChat"
//Asks a protocol to leave the chatroom from contact v0.8.0+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)0
//Returns 0 on success, nonzero on failure
#define PS_LEAVECHAT "/LeaveChat"
//Asks a protocol to read contact information and translate them (for a lookup fields) v0.8.0+
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=(LPARAM)(DBCONTACTGETSETTING*)&dbcgs
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = (LPARAM)(DBCONTACTGETSETTING*)&dbcgs
//The flag PF4_INFOSETTINGSVC indicates that a protocol supports this. Basically it should
//do the same as MS_DB_CONTACT_GETSETTING_STR, except that for a lookup settings (e.g. Language)
//it returns string instead of an ID stored in the database.
@@ -488,8 +488,8 @@ typedef struct {
#define PS_GETINFOSETTING "/GetInfoSetting"
// Asks protocol for the status message for a status
-// wParam=(WORD) 0 for current status or a status id
-// lParam=SGMA_xxx
+// wParam = (WORD) 0 for current status or a status id
+// lParam = SGMA_xxx
// Returns status msg or NULL if there is none. The protocol have to handle only the current
// status. Handling messages for other statuses is optional.
// Remember to mir_free the return value
@@ -504,9 +504,9 @@ typedef struct {
#define PS_GETMYAWAYMSG "/GetMyAwayMsg"
// Set nickname for the user
-// wParam=(WPARAM)SMNN_xxx
-// lParam=(LPARAM)(char *) The new nickname for the user
-// return=0 for success
+// wParam = (WPARAM)SMNN_xxx
+// lParam = (LPARAM)(char *) The new nickname for the user
+// return = 0 for success
#define SMNN_UNICODE 1 // return Unicode status
#if defined(_UNICODE)
@@ -519,9 +519,9 @@ typedef struct {
// Get the max allowed length for the user nickname
// Optional, default value is 1024
-// wParam=(WPARAM)0
-// lParam=(LPARAM)0
-// return= <=0 for error, >0 the max length of the nick
+// wParam = (WPARAM)0
+// lParam = (LPARAM)0
+// return = <= 0 for error, >0 the max length of the nick
#define PS_GETMYNICKNAMEMAXLENGTH "/GetMyNicknameMaxLength"
// WAYD = What are you doing
@@ -533,21 +533,21 @@ typedef struct {
#endif
// Get the WAYD message for the user
-// wParam=(WPARAM)WAYD_xxx
-// lParam=(LPARAM)0
+// wParam = (WPARAM)WAYD_xxx
+// lParam = (LPARAM)0
// Returns the text or NULL if there is none. Remember to mir_free the return value.
#define PS_GETMYWAYD "/GetMyWAYD"
// Sets the WAYD message for the user
-// wParam=(WPARAM)WAYD_xxx
-// lParam=(LPARAM)(WCHAR * or char *)The message
+// wParam = (WPARAM)WAYD_xxx
+// lParam = (LPARAM)(WCHAR * or char *)The message
// Returns 0 on success, nonzero on failure
#define PS_SETMYWAYD "/SetMyWAYD"
// Get the max allowed length that a WAYD message can have
// Optional, default value is 1024
-// wParam=(WPARAM)0
-// lParam=(LPARAM)0
+// wParam = (WPARAM)0
+// lParam = (LPARAM)0
// Returns the max length
#define PS_GETMYWAYDMAXLENGTH "/GetMyWAYDMaxLength"
@@ -555,16 +555,16 @@ typedef struct {
//these should be called with CallContactService()
//Updates a contact's details from the server
-//wParam=flags
-//lParam=0
+//wParam = flags
+//lParam = 0
//returns 0 on success, nonzero on failure
//Will update all the information in the database, and then send acks with
-//type=ACKTYPE_GETINFO, result=ACKRESULT_SUCCESS, hProcess=(HANDLE)(int)nReplies, lParam=thisReply
+//type = ACKTYPE_GETINFO, result = ACKRESULT_SUCCESS, hProcess = (HANDLE)(int)nReplies, lParam = thisReply
//Since some protocols do not allow the library to tell when it has got all
//the information so it can send a final ack, one ack will be sent after each
//chunk of data has been received. nReplies contains the number of distinct
//acks that will be sent to get all the information, thisReply is the zero-
-//based index of this ack. When thisReply=0 the 'minimal' information has just
+//based index of this ack. When thisReply = 0 the 'minimal' information has just
//been received. All other numbering is arbitrary.
#define SGIF_MINIMAL 1 //get only the most basic information. This should
//contain at least a Nick and e-mail.
@@ -572,65 +572,65 @@ typedef struct {
#define PSS_GETINFO "/GetInfo"
//Send an instant message
-//wParam=flags
-//lParam=(LPARAM)(const char*)szMessage
+//wParam = flags
+//lParam = (LPARAM)(const char*)szMessage
//returns a hProcess corresponding to the one in the ack event.
//Will send an ack when the message actually gets sent
-//type=ACKTYPE_MESSAGE, result=success/failure, (char*)lParam=error message or NULL.
+//type = ACKTYPE_MESSAGE, result = success/failure, (char*)lParam = error message or NULL.
//Protocols modules are free to define flags starting at 0x10000
//The event will *not* be added to the database automatically.
#define PSS_MESSAGE "/SendMsg"
//Send an URL message
-//wParam=flags
-//lParam=(LPARAM)(const char*)szMessage
+//wParam = flags
+//lParam = (LPARAM)(const char*)szMessage
//returns a hProcess corresponding to the one in the ack event.
//szMessage should be encoded as the URL followed by the description, the
//separator being a single nul (\0). If there is no description, do not forget
//to end the URL with two nuls.
//Will send an ack when the message actually gets sent
-//type=ACKTYPE_URL, result=success/failure, (char*)lParam=error message or NULL.
+//type = ACKTYPE_URL, result = success/failure, (char*)lParam = error message or NULL.
//Protocols modules are free to define flags starting at 0x10000
//The event will *not* be added to the database automatically.
#define PSS_URL "/SendUrl"
//Send a set of contacts
-//wParam=MAKEWPARAM(flags, nContacts)
-//lParam=(LPARAM)(HANDLE*)hContactsList
+//wParam = MAKEWPARAM(flags, nContacts)
+//lParam = (LPARAM)(HANDLE*)hContactsList
//returns a hProcess corresponding to the one in the ack event, NULL on
//failure.
//hContactsList is an array of nContacts handles to contacts. If this array
//includes one or more contacts that cannot be transferred using this protocol
//the function will fail.
//Will send an ack when the contacts actually get sent
-//type=ACKTYPE_CONTACTS, result=success/failure, (char*)lParam=error message or NULL.
+//type = ACKTYPE_CONTACTS, result = success/failure, (char*)lParam = error message or NULL.
//No flags have yet been defined.
//The event will *not* be added to the database automatically.
#define PSS_CONTACTS "/SendContacts"
//Send a request to retrieve somebody's mode message.
-//wParam=lParam=0
+//wParam = lParam = 0
//returns an hProcess identifying the request, or 0 on failure
//This function will fail if the contact's current status mode doesn't have an
//associated message
//The reply will be in the form of an ack:
-//type=ACKTYPE_AWAYMSG, result=success/failure, lParam=(const char*)szMessage
+//type = ACKTYPE_AWAYMSG, result = success/failure, lParam = (const char*)szMessage
#define PSS_GETAWAYMSG "/GetAwayMsg"
//Sends an away message reply to a user
-//wParam=(WPARAM)(HANDLE)hProcess (of ack)
-//lParam=(LPARAM)(const char*)szMessage
+//wParam = (WPARAM)(HANDLE)hProcess (of ack)
+//lParam = (LPARAM)(const char*)szMessage
//Returns 0 on success, nonzero on failure
//This function must only be used if the protocol has PF1_MODEMSGSEND and
//PF1_INDIVMODEMSG set. Otherwise, PS_SETAWAYMESSAGE should be used.
//This function must only be called in response to an ack that a user has
//requested our away message. The ack is sent as:
-//type=ACKTYPE_AWAYMSG, result=ACKRESULT_SENTREQUEST, lParam=0
+//type = ACKTYPE_AWAYMSG, result = ACKRESULT_SENTREQUEST, lParam = 0
#define PSS_AWAYMSG "/SendAwayMsg"
//Allows a file transfer to begin
-//wParam=(WPARAM)(HANDLE)hTransfer
-//lParam=(LPARAM)(const TCHAR*)szPath
+//wParam = (WPARAM)(HANDLE)hTransfer
+//lParam = (LPARAM)(const TCHAR*)szPath
//Returns a new handle to the transfer, to be used from now on
//If szPath does not point to a directory then:
// if a single file is being transferred and the protocol supports file
@@ -645,47 +645,47 @@ typedef struct {
#define PSS_FILEALLOWW "/FileAllowW"
//Refuses a file transfer request
-//wParam=(WPARAM)(HANDLE)hTransfer
-//lParam=(LPARAM)(const TCHAR*)szReason
+//wParam = (WPARAM)(HANDLE)hTransfer
+//lParam = (LPARAM)(const TCHAR*)szReason
//Returns 0 on success, nonzero on failure
#define PSS_FILEDENY "/FileDeny"
#define PSS_FILEDENYW "/FileDenyW"
//Cancel an in-progress file transfer
-//wParam=(WPARAM)(HANDLE)hTransfer
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hTransfer
+//lParam = 0
//Returns 0 on success, nonzero on failure
#define PSS_FILECANCEL "/FileCancel"
//Initiate a file send
-//wParam=(WPARAM)(const TCHAR*)szDescription
-//lParam=(LPARAM)(TCHAR **)ppszFiles
+//wParam = (WPARAM)(const TCHAR*)szDescription
+//lParam = (LPARAM)(TCHAR **)ppszFiles
//Returns a transfer handle on success, NULL on failure
-//All notification is done through acks, with type=ACKTYPE_FILE
-//If result=ACKRESULT_FAILED then lParam=(LPARAM)(const char*)szReason
+//All notification is done through acks, with type = ACKTYPE_FILE
+//If result = ACKRESULT_FAILED then lParam = (LPARAM)(const char*)szReason
#define PSS_FILE "/SendFile"
#define PSS_FILEW "/SendFileW"
//Set the status mode you will appear in to a user
-//wParam=statusMode
-//lParam=0
+//wParam = statusMode
+//lParam = 0
//Returns 0 on success, nonzero on failure
-//Set statusMode=0 to revert to normal behaviour for the contact
+//Set statusMode = 0 to revert to normal behaviour for the contact
//ID_STATUS_ONLINE is possible iff PF1_VISLIST
//ID_STATUS_OFFLINE is possible iff PF1_INVISLIST
//Other modes are possible iff PF1_INDIVSTATUS
#define PSS_SETAPPARENTMODE "/SetApparentMode"
// Send an auth request
-// wParam=0
-// lParam=(const TCHAR *)szMessage
+// wParam = 0
+// lParam = (const TCHAR *)szMessage
// Returns 0 on success, nonzero on failure
#define PSS_AUTHREQUEST "/AuthRequest"
#define PSS_AUTHREQUESTW "/AuthRequestW"
// Send "User is Typing" (user is typing a message to the user) v0.3.3+
-// wParam=(WPARAM)(HANDLE)hContact
-// lParam=(LPARAM)(int)typing type - see PROTOTYPE_SELFTYPING_X defines in m_protocols.h
+// wParam = (WPARAM)(HANDLE)hContact
+// lParam = (LPARAM)(int)typing type - see PROTOTYPE_SELFTYPING_X defines in m_protocols.h
#define PSS_USERISTYPING "/UserIsTyping"
/**************************** RECEIVING SERVICES *************************/
@@ -708,8 +708,8 @@ typedef struct {
//In all cases, the database should store what the user read/wrote.
//An instant message has been received
-//wParam=0
-//lParam=(LPARAM)(PROTORECVEVENT*)&pre
+//wParam = 0
+//lParam = (LPARAM)(PROTORECVEVENT*)&pre
//DB event: EVENTTYPE_MESSAGE, blob contains szMessage without 0 terminator
//Return 0 - success, other failure
typedef struct {
@@ -737,15 +737,15 @@ typedef struct {
#define MS_PROTO_RECVMSG "Proto/RecvMessage"
//An URL has been received
-//wParam=0
-//lParam=(LPARAM)(PROTORECVEVENT*)&pre
+//wParam = 0
+//lParam = (LPARAM)(PROTORECVEVENT*)&pre
//szMessage is encoded the same as for PSS_URL
//DB event: EVENTTYPE_URL, blob contains szMessage without 0 terminator
#define PSR_URL "/RecvUrl"
//Contacts have been received
-//wParam=0
-//lParam=(LPARAM)(PROTORECVEVENT*)&pre
+//wParam = 0
+//lParam = (LPARAM)(PROTORECVEVENT*)&pre
//pre.szMessage is actually a (PROTOSEARCHRESULT**) list.
//pre.lParam is the number of contacts in that list.
//pre.flags can contain PREF_UTF defining the strings as utf-8 encoded (0.7.0+)
@@ -768,8 +768,8 @@ Use PS_ADDTOLISTBYEVENT to add the contacts from one of these to the list.
*/
//File(s) have been received (0.9.x)
-//wParam=0
-//lParam=(LPARAM)(PROTORECVFILE*)&prf
+//wParam = 0
+//lParam = (LPARAM)(PROTORECVFILE*)&prf
typedef struct {
DWORD flags;
DWORD timestamp; //unix time
@@ -795,13 +795,13 @@ typedef struct {
#define MS_PROTO_RECVFILE "Proto/RecvFile"
//An away message reply has been received
-//wParam=statusMode
-//lParam=(LPARAM)(PROTORECVEVENT*)&pre
+//wParam = statusMode
+//lParam = (LPARAM)(PROTORECVEVENT*)&pre
#define PSR_AWAYMSG "/RecvAwayMsg"
//An authorization request has been received
-//wParam=0
-//lParam=(LPARAM)(PROTORECVEVENT*)&pre
+//wParam = 0
+//lParam = (LPARAM)(PROTORECVEVENT*)&pre
//pre.szMessage is same format as blob
//pre.lParam is the size of the blob
#define PSR_AUTH "/RecvAuth"
diff --git a/include/m_skin.h b/include/m_skin.h
index aa36735ab0..6f49171901 100644
--- a/include/m_skin.h
+++ b/include/m_skin.h
@@ -27,8 +27,8 @@ extern int hLangpack;
//loads an icon from the user's custom skin library, or from the exe if there
//isn't one of them
-//wParam=id of icon to load - see below
-//lParam=0
+//wParam = id of icon to load - see below
+//lParam = 0
//returns an hIcon for the new icon. Do *not* DestroyIcon() the return value
//returns NULL if id is invalid, but will always succeed for a valid id
#define MS_SKIN_LOADICON "Skin/Icons/Load"
@@ -104,8 +104,8 @@ __inline static HICON LoadSkinnedIconBig(int id) {return (HICON)CallService(MS_S
#define SKINICON_STATUS_OUTTOLUNCH 9
//Loads an icon representing the status mode for a particular protocol.
-//wParam=(WPARAM)(const char*)szProto
-//lParam=status
+//wParam = (WPARAM)(const char*)szProto
+//lParam = status
//returns an hIcon for the new icon. Do *not* DestroyIcon() the return value
//returns NULL on failure
//if szProto is NULL the function will load the user's selected 'all protocols'
@@ -117,8 +117,8 @@ __inline static HICON LoadSkinnedProtoIcon(const char *szProto, int status) {ret
__inline static HICON LoadSkinnedProtoIconBig(const char *szProto, int status) {return (HICON)CallService(MS_SKIN_LOADPROTOICONBIG, (WPARAM)szProto, status);}
//add a new sound so it has a default and can be changed in the options dialog
-//wParam=hLangpack
-//lParam=(LPARAM)(SKINSOUNDDESC*)ssd;
+//wParam = hLangpack
+//lParam = (LPARAM)(SKINSOUNDDESC*)ssd;
//returns 0 on success, nonzero otherwise
#define SSDF_UNICODE 0x0001
@@ -161,7 +161,7 @@ __inline static INT_PTR SkinAddNewSoundEx(const char *name, const char *section,
__inline static INT_PTR SkinAddNewSound(const char *name, const char *description, const char *defaultFile)
{
SKINSOUNDDESCEX ssd = { 0 };
- ssd.cbSize=sizeof(ssd);
+ ssd.cbSize = sizeof(ssd);
ssd.pszName = name;
ssd.pszDescription = description;
ssd.pszDefaultFile = defaultFile;
@@ -185,8 +185,8 @@ __inline static INT_PTR Skin_AddSound(SKINSOUNDDESCEX *ssd)
}
//play a named sound event
-//wParam=0
-//lParam=(LPARAM)(const char*)pszName
+//wParam = 0
+//lParam = (LPARAM)(const char*)pszName
//pszName should have been added with Skin/Sounds/AddNew, but if not the
//function will not fail, it will play the Windows default sound instead.
#define MS_SKIN_PLAYSOUND "Skin/Sounds/Play"
@@ -198,7 +198,7 @@ __inline static INT_PTR SkinPlaySound(const char *name)
//sent when the icons DLL has been changed in the options dialog, and everyone
//should re-make their image lists
-//wParam=lParam=0
+//wParam = lParam = 0
#define ME_SKIN_ICONSCHANGED "Skin/IconsChanged"
diff --git a/include/m_system.h b/include/m_system.h
index db912fd32c..7d9e508f55 100644
--- a/include/m_system.h
+++ b/include/m_system.h
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <tchar.h>
-
+
#ifndef MIRANDANAME
#define MIRANDANAME "Miranda IM"
#endif
@@ -45,58 +45,59 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define __forceinline static FORCEINLINE
#else
#pragma warning(disable:4244 4245)
-#endif
+#endif
+
#include <m_core.h>
-
+
//miranda/system/modulesloaded
//called after all modules have been successfully initialised
-//wParam=lParam=0
+//wParam = lParam = 0
//used to resolve double-dependencies in the module load order
#define ME_SYSTEM_MODULESLOADED "Miranda/System/ModulesLoaded"
//miranda/system/shutdown event
//called just before the application terminates
//the database is still guaranteed to be running during this hook.
-//wParam=lParam=0
+//wParam = lParam = 0
#define ME_SYSTEM_SHUTDOWN "Miranda/System/Shutdown"
//restarts miranda (0.8+)
-//wParam=lParam=0
+//wParam = lParam = 0
#define MS_SYSTEM_RESTART "Miranda/System/Restart"
//miranda/system/oktoexit event
//called before the app goes into shutdown routine to make sure everyone is
//happy to exit
-//wParam=lParam=0
+//wParam = lParam = 0
//return nonzero to stop the exit cycle
#define ME_SYSTEM_OKTOEXIT "Miranda/System/OkToExitEvent"
//miranda/system/oktoexit service
//Check if everyone is happy to exit
-//wParam=lParam=0
+//wParam = lParam = 0
//if everyone acknowleges OK to exit then returns true, otherwise false
#define MS_SYSTEM_OKTOEXIT "Miranda/System/OkToExit"
//gets the version number of Miranda encoded as a DWORD v0.1.0.1+
-//wParam=lParam=0
+//wParam = lParam = 0
//returns the version number, encoded as one version per byte, therefore
//version 1.2.3.10 is 0x0102030a
#define MS_SYSTEM_GETVERSION "Miranda/System/GetVersion"
//gets the version of Miranda encoded as text v0.1.0.1+
-//wParam=cch
-//lParam=(LPARAM)(char*)pszVersion
+//wParam = cch
+//lParam = (LPARAM)(char*)pszVersion
//cch is the size of the buffer pointed to by pszVersion, in bytes
//may return a build qualifier, such as "0.1.0.1 alpha"
//returns 0 on success, nonzero on failure
#define MS_SYSTEM_GETVERSIONTEXT "Miranda/System/GetVersionText"
//Adds a HANDLE to the list to be checked in the main message loop v0.1.2.0+
-//wParam=(WPARAM)(HANDLE)hObject
-//lParam=(LPARAM)(const char*)pszService
+//wParam = (WPARAM)(HANDLE)hObject
+//lParam = (LPARAM)(const char*)pszService
//returns 0 on success or nonzero on failure
-//Causes pszService to be CallService()d (wParam=hObject, lParam=0) from the
+//Causes pszService to be CallService()d (wParam = hObject, lParam = 0) from the
//main thread whenever hObject is signalled.
//The Miranda message loop has a MsgWaitForMultipleObjects() call in it to
//implement this feature. See the documentation for that function for
@@ -128,14 +129,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_SYSTEM_WAITONHANDLE "Miranda/System/WaitOnHandle"
//Removes a HANDLE from the wait list v0.1.2.0+
-//wParam=(WPARAM)(HANDLE)hObject
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hObject
+//lParam = 0
//returns 0 on success or nonzero on failure.
#define MS_SYSTEM_REMOVEWAIT "Miranda/System/RemoveWait"
/*
-wParam=0
-lParam=0
+wParam = 0
+lParam = 0
This hook is fired just before the thread unwind stack is used,
it allows MT plugins to shutdown threads if they have any special
@@ -145,8 +146,8 @@ processing to do, etc.
#define ME_SYSTEM_PRESHUTDOWN "Miranda/System/PShutdown"
/*
-wParam=0
-lParam=0
+wParam = 0
+lParam = 0
Returns TRUE when Miranda has got WM_QUIT and is in the process
of shutting down
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h
index 0b79d4d552..c42bd68272 100644
--- a/include/m_system_cpp.h
+++ b/include/m_system_cpp.h
@@ -44,7 +44,7 @@ public:
__inline mir_ptr() : data((T*)mir_calloc(sizeof(T))) {}
__inline mir_ptr(T* _p) : data(_p) {}
__inline ~mir_ptr() { mir_free(data); }
- __inline T* operator= (T* _p) { if (data) mir_free(data); data = _p; return data; }
+ __inline T* operator = (T* _p) { if (data) mir_free(data); data = _p; return data; }
__inline T* operator->() const { return data; }
__inline operator T*() const { return data; }
__inline operator INT_PTR() const { return (INT_PTR)data; }
@@ -94,7 +94,7 @@ template<class T> struct LIST
List_Copy((SortedList*)&x, (SortedList*)this, sizeof(T));
}
- __inline LIST& operator=(const LIST& x)
+ __inline LIST& operator = (const LIST& x)
{ destroy();
List_Copy((SortedList*)&x, (SortedList*)this, sizeof(T));
return *this;
@@ -139,7 +139,7 @@ template<class T> struct OBJLIST : public LIST<T>
List_ObjCopy((SortedList*)&x, (SortedList*)this, sizeof(T));
}
- __inline OBJLIST& operator=(const OBJLIST& x)
+ __inline OBJLIST& operator = (const OBJLIST& x)
{ destroy();
List_ObjCopy((SortedList*)&x, (SortedList*)this, sizeof(T));
return *this;
diff --git a/include/m_url.h b/include/m_url.h
index 1ca41eac5b..d544839c8a 100644
--- a/include/m_url.h
+++ b/include/m_url.h
@@ -25,8 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define M_URL_H__ 1
//bring up the send URL dialog for a user
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
//returns 0 on success or nonzero on failure
//returns immediately, before the url is sent
#define MS_URL_SENDURL "SRUrl/SendCommand"
diff --git a/include/m_userinfo.h b/include/m_userinfo.h
index e19b08211c..79a64b6c07 100644
--- a/include/m_userinfo.h
+++ b/include/m_userinfo.h
@@ -27,16 +27,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "m_options.h"
//show the User Details dialog box
-//wParam=(WPARAM)(HANDLE)hContact
-//lParam=0
+//wParam = (WPARAM)(HANDLE)hContact
+//lParam = 0
#define MS_USERINFO_SHOWDIALOG "UserInfo/ShowDialog"
/* UserInfo/Initialise v0.1.2.0+
The user opened a details dialog. Modules should do whatever initialisation
they need and call userinfo/addpage one or more times if they want pages
displayed in the options dialog
-wParam=addInfo
-lParam=(LPARAM)hContact
+wParam = addInfo
+lParam = (LPARAM)hContact
addInfo should be passed straight to the wParam of userinfo/addpage
NB: The built-in userinfo module is loaded after all plugins, so calling
HookEvent() in your plugin's Load(void) function will fail if you specify this
@@ -47,12 +47,12 @@ hook. Look up core/m_system.h:me_system_modulesloaded.
/* UserInfo/AddPage v0.1.2.0+
Must only be called during an userinfo/initialise hook
Adds a page to the details dialog
-wParam=addInfo
-lParam=(LPARAM)(OPTIONSDIALOGPAGE*)odp
+wParam = addInfo
+lParam = (LPARAM)(OPTIONSDIALOGPAGE*)odp
addInfo must have come straight from the wParam of userinfo/initialise
Pages in the details dialog operate just like pages in property sheets. See the
Microsoft documentation for info on how they operate.
-When the pages receive WM_INITDIALOG, lParam=(LPARAM)hContact
+When the pages receive WM_INITDIALOG, lParam = (LPARAM)hContact
Strings in the structure can be released as soon as the service returns, but
icons must be kept around. This is not a problem if you're loading them from a
resource
@@ -61,11 +61,11 @@ Unlike the options dialog, the details dialog does not resize to fit its
largest page. Details dialog pages should be 222x132 dlus.
The details dialog (currently) has no Cancel button. I'm waiting to see if it's
sensible to have one.
-Pages will be sent PSN_INFOCHANGED through WM_NOTIFY (idFrom=0) when a protocol
-ack is broadcast for the correct contact and with type=ACKTYPE_GETINFO.
+Pages will be sent PSN_INFOCHANGED through WM_NOTIFY (idFrom = 0) when a protocol
+ack is broadcast for the correct contact and with type = ACKTYPE_GETINFO.
To help you out, PSN_INFOCHANGED will also be sent to each page just after it's
created.
-All PSN_ WM_NOTIFY messages have PSHNOTIFY.lParam=(LPARAM)hContact
+All PSN_ WM_NOTIFY messages have PSHNOTIFY.lParam = (LPARAM)hContact
*/
#define PSN_INFOCHANGED 1
#define PSN_PARAMCHANGED 2
diff --git a/include/m_utils.h b/include/m_utils.h
index 57cde573e4..ddeb1d2b15 100644
--- a/include/m_utils.h
+++ b/include/m_utils.h
@@ -62,8 +62,8 @@ running, one will be opened to show the URL.
/* Resizes a dialog by calling a custom routine to move the individual
controls v0.1.0.1+
-wParam=0
-lParam=(LPARAM)(UTILRESIZEDIALOG*)&urd
+wParam = 0
+lParam = (LPARAM)(UTILRESIZEDIALOG*)&urd
Returns 0 on success, or nonzero on failure
Does not support dialogtemplateex dialog boxes, and will return failure if you
try to resize one
@@ -102,16 +102,16 @@ typedef struct {
#define MS_UTILS_RESIZEDIALOG "Utils/ResizeDialog"
/* Gets the name of a country given its number v0.1.2.0+
-wParam=countryId
-lParam=0
+wParam = countryId
+lParam = 0
Returns a pointer to the string containing the country name on success,
or NULL on failure
*/
#define MS_UTILS_GETCOUNTRYBYNUMBER "Utils/GetCountryByNumber"
/* Gets the full list of country IDs v0.1.2.0+
-wParam=(WPARAM)(int*)piCount
-lParam=(LPARAM)(struct CountryListEntry**)ppList
+wParam = (WPARAM)(int*)piCount
+lParam = (LPARAM)(struct CountryListEntry**)ppList
Returns 0 always
Neither wParam nor lParam can be NULL.
The list is sorted alphabetically by country name, on the assumption that it's
@@ -126,13 +126,13 @@ struct CountryListEntry {
/******************************* Window lists *******************************/
//allocate a window list v0.1.0.1+
-//wParam=lParam=0
+//wParam = lParam = 0
//returns a handle to the new window list
#define MS_UTILS_ALLOCWINDOWLIST "Utils/AllocWindowList"
//adds a window to the specified window list v0.1.0.1+
-//wParam=0
-//lParam=(LPARAM)(WINDOWLISTENTRY*)&wle
+//wParam = 0
+//lParam = (LPARAM)(WINDOWLISTENTRY*)&wle
//returns 0 on success, nonzero on failure
typedef struct {
HANDLE hList;
@@ -142,12 +142,12 @@ typedef struct {
#define MS_UTILS_ADDTOWINDOWLIST "Utils/AddToWindowList"
__inline static INT_PTR WindowList_Add(HANDLE hList, HWND hwnd, HANDLE hContact) {
WINDOWLISTENTRY wle;
- wle.hList=hList; wle.hwnd=hwnd; wle.hContact=hContact;
+ wle.hList = hList; wle.hwnd = hwnd; wle.hContact = hContact;
return CallService(MS_UTILS_ADDTOWINDOWLIST, 0, (LPARAM)&wle);
}
//removes a window from the specified window list v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hList
-//lParam=(LPARAM)(HWND)hwnd
+//wParam = (WPARAM)(HANDLE)hList
+//lParam = (LPARAM)(HWND)hwnd
//returns 0 on success, nonzero on failure
#define MS_UTILS_REMOVEFROMWINDOWLIST "Utils/RemoveFromWindowList"
__inline static INT_PTR WindowList_Remove(HANDLE hList, HWND hwnd) {
@@ -155,8 +155,8 @@ __inline static INT_PTR WindowList_Remove(HANDLE hList, HWND hwnd) {
}
//finds a window given the hContact v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hList
-//lParam=(WPARAM)(HANDLE)hContact
+//wParam = (WPARAM)(HANDLE)hList
+//lParam = (WPARAM)(HANDLE)hContact
//returns the window handle on success, or NULL on failure
#define MS_UTILS_FINDWINDOWINLIST "Utils/FindWindowInList"
__inline static HWND WindowList_Find(HANDLE hList, HANDLE hContact) {
@@ -164,14 +164,14 @@ __inline static HWND WindowList_Find(HANDLE hList, HANDLE hContact) {
}
//broadcasts a message to all windows in a list v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hList
-//lParam=(LPARAM)(MSG*)&msg
+//wParam = (WPARAM)(HANDLE)hList
+//lParam = (LPARAM)(MSG*)&msg
//returns 0 on success, nonzero on failure
//Only msg.message, msg.wParam and msg.lParam are used
#define MS_UTILS_BROADCASTTOWINDOWLIST "Utils/BroadcastToWindowList"
__inline static INT_PTR WindowList_Broadcast(HANDLE hList, UINT message, WPARAM wParam, LPARAM lParam) {
MSG msg;
- msg.message=message; msg.wParam=wParam; msg.lParam=lParam;
+ msg.message = message; msg.wParam = wParam; msg.lParam = lParam;
return CallService(MS_UTILS_BROADCASTTOWINDOWLIST, (WPARAM)hList, (LPARAM)&msg);
}
@@ -180,8 +180,8 @@ __inline static INT_PTR WindowList_Broadcast(HANDLE hList, UINT message, WPARAM
Version: 0.3.0.0+
Inline helper: WindowList_BroadcastAsync
- wParam=(WPARAM)(HANDLE)hList
- lParam=(LPARAM)(MSG*)&msg
+ wParam = (WPARAM)(HANDLE)hList
+ lParam = (LPARAM)(MSG*)&msg
Returns 0 on success, nonzero on failure, this service does not fail, even if PostMessage() fails for whatever reason
@@ -190,7 +190,7 @@ __inline static INT_PTR WindowList_Broadcast(HANDLE hList, UINT message, WPARAM
__inline static INT_PTR WindowList_BroadcastAsync(HANDLE hList, UINT message, WPARAM wParam, LPARAM lParam) {
MSG msg;
- msg.message=message; msg.wParam=wParam; msg.lParam=lParam;
+ msg.message = message; msg.wParam = wParam; msg.lParam = lParam;
return CallService(MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC, (WPARAM)hList, (LPARAM)&msg);
}
@@ -202,19 +202,19 @@ __inline static INT_PTR WindowList_BroadcastAsync(HANDLE hList, UINT message, WP
//the control will send STN_CLICKED via WM_COMMAND when the link itself is clicked
// Use this in a SendMessage to set the color of the url when control is enabled
-// wParam=DWORD color
-// lParam=not used
+// wParam = DWORD color
+// lParam = not used
#define HLK_SETENABLECOLOUR (WM_USER+101) // added in 0.3.1
// Use this in a SendMessage to set the color of the url when control is disabled
-// wParam=DWORD color
-// lParam=not used
+// wParam = DWORD color
+// lParam = not used
#define HLK_SETDISABLECOLOUR (WM_USER+102) // added in 0.3.1
/***************************** Window Position Saving ***************************/
//saves the position of a window in the database v0.1.1.0+
-//wParam=0
-//lParam=(LPARAM)(SAVEWINDOWPOS*)&swp
+//wParam = 0
+//lParam = (LPARAM)(SAVEWINDOWPOS*)&swp
//returns 0 on success, nonzero on failure
typedef struct {
HWND hwnd;
@@ -225,13 +225,13 @@ typedef struct {
#define MS_UTILS_SAVEWINDOWPOSITION "Utils/SaveWindowPos"
__inline static INT_PTR Utils_SaveWindowPosition(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
SAVEWINDOWPOS swp;
- swp.hwnd=hwnd; swp.hContact=hContact; swp.szModule=szModule; swp.szNamePrefix=szNamePrefix;
+ swp.hwnd = hwnd; swp.hContact = hContact; swp.szModule = szModule; swp.szNamePrefix = szNamePrefix;
return CallService(MS_UTILS_SAVEWINDOWPOSITION, 0, (LPARAM)&swp);
}
//restores the position of a window from the database v0.1.1.0+
-//wParam=flags
-//lParam=(LPARAM)(SAVEWINDOWPOS*)&swp
+//wParam = flags
+//lParam = (LPARAM)(SAVEWINDOWPOS*)&swp
//returns 0 on success, nonzero on failure
//if no position was found in the database, the function returns 1 and does
//nothing
@@ -244,7 +244,7 @@ __inline static INT_PTR Utils_SaveWindowPosition(HWND hwnd, HANDLE hContact, con
#define MS_UTILS_RESTOREWINDOWPOSITION "Utils/RestoreWindowPos"
__inline static INT_PTR Utils_RestoreWindowPositionEx(HWND hwnd, int flags, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
SAVEWINDOWPOS swp;
- swp.hwnd=hwnd; swp.hContact=hContact; swp.szModule=szModule; swp.szNamePrefix=szNamePrefix;
+ swp.hwnd = hwnd; swp.hContact = hContact; swp.szModule = szModule; swp.szNamePrefix = szNamePrefix;
return CallService(MS_UTILS_RESTOREWINDOWPOSITION, flags, (LPARAM)&swp);
}
__inline static INT_PTR Utils_RestoreWindowPosition(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
@@ -258,8 +258,8 @@ __inline static INT_PTR Utils_RestoreWindowPositionNoMove(HWND hwnd, HANDLE hCon
}
//Moves a RECT inside screen if it is outside.It works with multiple monitors v0.9.0.4+
-//wParam=RECT *
-//lParam=0
+//wParam = RECT *
+//lParam = 0
//returns <0 on error, 0 if not changed the rect, 1 if changed the rect
#define MS_UTILS_ASSERTINSIDESCREEN "Utils/AssertInsideScreen"
__inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
@@ -270,17 +270,17 @@ __inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
#define WNDCLASS_COLOURPICKER _T("ColourPicker")
-#define CPM_SETCOLOUR 0x1000 //lParam=new colour
+#define CPM_SETCOLOUR 0x1000 //lParam = new colour
#define CPM_GETCOLOUR 0x1001 //returns colour
-#define CPM_SETDEFAULTCOLOUR 0x1002 //lParam=default, used as first custom colour
+#define CPM_SETDEFAULTCOLOUR 0x1002 //lParam = default, used as first custom colour
#define CPM_GETDEFAULTCOLOUR 0x1003 //returns colour
#define CPN_COLOURCHANGED 1 //sent through WM_COMMAND
/***************************** Bitmap Filter (0.1.2.1+) *************************/
//Loads a bitmap v0.1.2.1+
-//wParam=0
-//lParam=(LPARAM)(const char*)filename
+//wParam = 0
+//lParam = (LPARAM)(const char*)filename
//returns HBITMAP on success, NULL on failure
//This function uses OleLoadPicturePath() so supports BMP, JPEG and GIF. It may
//support PNG on future versions of Windows (or XP for that matter)
@@ -297,8 +297,8 @@ __inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
#endif
//Gets the filter strings for use in the open file dialog v0.1.2.1+
-//wParam=cbLengthOfBuffer
-//lParam=(LPARAM)(char*)pszBuffer
+//wParam = cbLengthOfBuffer
+//lParam = (LPARAM)(char*)pszBuffer
//Returns 0 on success, nonzero on failure
//See the MSDN under OPENFILENAME.lpstrFilter for the formatting
//An 'All Bitmaps' item is always first and 'All Files' is last.
@@ -308,8 +308,8 @@ __inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
//Saves a path to a relative path (from the miranda directory)
//Only saves as a relative path if the file is in the miranda directory (or
//sub directory)
-//wParam=(WPARAM)(char*)pszPath
-//lParam=(LPARAM)(char*)pszNewPath
+//wParam = (WPARAM)(char*)pszPath
+//lParam = (LPARAM)(char*)pszNewPath
//pszPath is the path to convert and pszNewPath is the buffer that
//the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
//Returns numbers of chars copied.
@@ -317,8 +317,8 @@ __inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
#define MS_UTILS_PATHTORELATIVE "Utils/PathToRelative"
//Saves a path to a absolute path (from the miranda directory)
-//wParam=(WPARAM)(char*)pszPath
-//lParam=(LPARAM)(char*)pszNewPath
+//wParam = (WPARAM)(char*)pszPath
+//lParam = (LPARAM)(char*)pszNewPath
//pszPath is the path to convert and pszNewPath is the buffer that
//the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
//Returns numbers of chars copied.
@@ -326,21 +326,21 @@ __inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
#define MS_UTILS_PATHTOABSOLUTE "Utils/PathToAbsolute"
//Creates a directory tree (even more than one directories levels are missing) 0.7.0+
-//wParam=0 (unused)
-//lParam=(LPARAM)(char*)pszPath - directory to be created
+//wParam = 0 (unused)
+//lParam = (LPARAM)(char*)pszPath - directory to be created
//Returns 0 on success error code otherwise
//Unicode version is available since 0.7.0
#define MS_UTILS_CREATEDIRTREE "Utils/CreateDirTree"
// Generates Random number of any length
-//wParam=size - length of the random number to generate
-//lParam=(LPARAM)(char*)pszArray - pointer to array to fill with random number
+//wParam = size - length of the random number to generate
+//lParam = (LPARAM)(char*)pszArray - pointer to array to fill with random number
//Always returns 0
#define MS_UTILS_GETRANDOM "Utils/GetRandom"
//Replace variables in text
-//wParam=(char*/TCHAR*/WCHAR*)string (depends on RVF_UNICODE/RVF_TCHAR flag)
-//lParam=(REPLACEVARSDATA *) data about variables, item with key=0 terminates the list
+//wParam = (char*/TCHAR*/WCHAR*)string (depends on RVF_UNICODE/RVF_TCHAR flag)
+//lParam = (REPLACEVARSDATA *) data about variables, item with key = 0 terminates the list
//returns new string, use mir_free to destroy
// variables known by the core:
diff --git a/include/m_xml.h b/include/m_xml.h
index fe6932a41c..24cb21bf4f 100644
--- a/include/m_xml.h
+++ b/include/m_xml.h
@@ -32,10 +32,10 @@ typedef int XML_ELEMENT_POS; // XML_ELEMENT_POS is not interchangeable with simp
typedef enum
{
- XML_ELEM_TYPE_CHILD = 0,
+ XML_ELEM_TYPE_CHILD = 0,
XML_ELEM_TYPE_ATTRIBUTE = 1,
- XML_ELEM_TYPE_TEXT = 2,
- XML_ELEM_TYPE_CLEAR = 3,
+ XML_ELEM_TYPE_TEXT = 2,
+ XML_ELEM_TYPE_CLEAR = 3,
}
XML_ELEMENT_TYPE;
@@ -62,8 +62,8 @@ typedef struct
HXML (*getNextNode)(HXML node);
LPCTSTR (*getName)(HXML);
HXML (*getParent)(HXML);
- LPCTSTR (*getText)(HXML); // = getTextByIndex(HXML, 0)
- void (*setText)(HXML, LPCTSTR); // = setTextByIndex(HXML, LPCTSTR, 0)
+ LPCTSTR (*getText)(HXML); //=getTextByIndex(HXML, 0)
+ void (*setText)(HXML, LPCTSTR); //=setTextByIndex(HXML, LPCTSTR, 0)
LPCTSTR (*getAttr)(HXML, int i);
LPCTSTR (*getAttrName)(HXML, int i);
diff --git a/include/newpluginapi.h b/include/newpluginapi.h
index 1f66cdc090..0629d292a8 100644
--- a/include/newpluginapi.h
+++ b/include/newpluginapi.h
@@ -117,14 +117,14 @@ typedef struct PLUGININFOEX_tag
//Miranda/System/LoadModule event
//called when a plugin is being loaded dynamically
-//wParam=PLUGININFOEX*
-//lParam=HINSTANCE of the loaded plugin
+//wParam = PLUGININFOEX*
+//lParam = HINSTANCE of the loaded plugin
#define ME_SYSTEM_MODULELOAD "Miranda/System/LoadModule"
//Miranda/System/UnloadModule event
//called when a plugin is being unloaded dynamically
-//wParam=PLUGININFOEX*
-//lParam=HINSTANCE of the plugin to be unloaded
+//wParam = PLUGININFOEX*
+//lParam = HINSTANCE of the plugin to be unloaded
#define ME_SYSTEM_MODULEUNLOAD "Miranda/System/UnloadModule"
//see modules.h for what all this stuff is
diff --git a/include/win2k.h b/include/win2k.h
index 9ff57530b0..3565a967d2 100644
--- a/include/win2k.h
+++ b/include/win2k.h
@@ -97,7 +97,7 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/
#define DTBG_COMPUTINGREGION 0x00000010 // TRUE if calling to compute region
#define DTBG_MIRRORDC 0x00000020 // assume the hdc is mirrorred and
// flip images as appropriate (currently
- // only supported for bgtype=imagefile)
+ // only supported for bgtype = imagefile)
#define DTBG_NOMIRROR 0x00000040 // don't mirror the output, overrides everything else
typedef struct _DTBGOPTS
@@ -500,11 +500,11 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/
typedef
enum TBPFLAG
{
- TBPF_NOPROGRESS = 0,
- TBPF_INDETERMINATE = 0x1,
- TBPF_NORMAL = 0x2,
- TBPF_ERROR = 0x4,
- TBPF_PAUSED = 0x8
+ TBPF_NOPROGRESS = 0,
+ TBPF_INDETERMINATE = 0x1,
+ TBPF_NORMAL = 0x2,
+ TBPF_ERROR = 0x4,
+ TBPF_PAUSED = 0x8
} TBPFLAG;
typedef struct THUMBBUTTON *LPTHUMBBUTTON;
diff --git a/plugins/Clist_nicer/SRC/clc.cpp b/plugins/Clist_nicer/SRC/clc.cpp
index 17af82664b..9a7d81a66b 100644
--- a/plugins/Clist_nicer/SRC/clc.cpp
+++ b/plugins/Clist_nicer/SRC/clc.cpp
@@ -186,11 +186,6 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int ClcModulesLoaded(WPARAM wParam, LPARAM lParam)
-{
- return 0;
-}
-
static int ClcPreshutdown(WPARAM wParam, LPARAM lParam)
{
SFL_Destroy();
@@ -218,13 +213,11 @@ int ClcShutdown(WPARAM wParam, LPARAM lParam)
DeleteObject(cfg::dat.hBrushColorKey);
DeleteObject(cfg::dat.hBrushCLCBk);
DeleteObject(cfg::dat.hBrushAvatarBorder);
- DestroyMenu(cfg::dat.hMenuNotify);
+ DestroyMenu(cfg::dat.hMenuNotify);
ClearIcons(1);
SFL_UnregisterWindowClass();
if (cfg::eCache) {
- int i;
-
- for (i = 0; i < cfg::nextCacheEntry; i++) {
+ for (int i = 0; i < cfg::nextCacheEntry; i++) {
if (cfg::eCache[i].statusMsg)
free(cfg::eCache[i].statusMsg);
if (cfg::eCache[i].status_item) {
@@ -255,7 +248,6 @@ int LoadCLCModule(void)
hCListImages = (HIMAGELIST) CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
- HookEvent(ME_SYSTEM_MODULESLOADED, ClcModulesLoaded);
hClcSettingsChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ClcSettingChanged);
hClcDBEvent = HookEvent(ME_DB_EVENT_ADDED, ClcEventAdded);
HookEvent(ME_OPT_INITIALISE, ClcOptInit);
diff --git a/plugins/Clist_nicer/SRC/clcpaint.cpp b/plugins/Clist_nicer/SRC/clcpaint.cpp
index 8844972745..c9b11d07b3 100644
--- a/plugins/Clist_nicer/SRC/clcpaint.cpp
+++ b/plugins/Clist_nicer/SRC/clcpaint.cpp
@@ -1387,22 +1387,22 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint)
my_status = GetGeneralisedStatus();
g_HDC = hdc;
- /*
- * temporary DC for avatar drawing
- */
+ /*
+ * temporary DC for avatar drawing
+ */
- g_padding_y = 0;
+ g_padding_y = 0;
- hdcTempAV = CreateCompatibleDC(g_HDC);
- hdcAV = CreateCompatibleDC(g_HDC);
- hbmTempAV = CreateCompatibleBitmap(g_HDC, g_maxAV_X, g_maxAV_Y);
- hbmTempOldAV = reinterpret_cast<HBITMAP>(SelectObject(hdcTempAV, hbmTempAV));
+ hdcTempAV = CreateCompatibleDC(g_HDC);
+ hdcAV = CreateCompatibleDC(g_HDC);
+ hbmTempAV = CreateCompatibleBitmap(g_HDC, g_maxAV_X, g_maxAV_Y);
+ hbmTempOldAV = reinterpret_cast<HBITMAP>(SelectObject(hdcTempAV, hbmTempAV));
- cfg::dat.t_now = time(NULL);
+ cfg::dat.t_now = time(NULL);
GetSystemTime(&cfg::dat.st);
SystemTimeToFileTime(&cfg::dat.st, &cfg::dat.ft);
- cfg::dat.bUseFastGradients = cfg::dat.bWantFastGradients && (API::pfnGradientFill != 0);
+ cfg::dat.bUseFastGradients = cfg::dat.bWantFastGradients && (API::pfnGradientFill != 0);
av_left = (cfg::dat.dwFlags & CLUI_FRAME_AVATARSLEFT);
av_right = (cfg::dat.dwFlags & CLUI_FRAME_AVATARSRIGHT);
@@ -1581,8 +1581,8 @@ bgdone:
}
line_num++;
- if(cfg::dat.bForceRefetchOnPaint)
- group->cl.items[group->scanIndex]->ace = (struct avatarCacheEntry*)-1;
+ if(cfg::dat.bForceRefetchOnPaint)
+ group->cl.items[group->scanIndex]->ace = (struct avatarCacheEntry*)-1;
if (y > rcPaint->top - dat->row_heights[line_num] && y <= rcPaint->bottom) {
if (group->cl.items[group->scanIndex]->ace == (struct avatarCacheEntry*)-1 )
diff --git a/plugins/Clist_nicer/SRC/clui.cpp b/plugins/Clist_nicer/SRC/clui.cpp
index e4009d6feb..366e503c76 100644
--- a/plugins/Clist_nicer/SRC/clui.cpp
+++ b/plugins/Clist_nicer/SRC/clui.cpp
@@ -2066,6 +2066,7 @@ void LoadCLUIModule(void)
HookEvent(ME_MC_SUBCONTACTSCHANGED, MetaChanged);
InitGroupMenus();
+ LoadExtBkSettingsFromDB();
wndclass.style = 0;
wndclass.lpfnWndProc = EventAreaWndProc;
diff --git a/plugins/Clist_nicer/SRC/init.cpp b/plugins/Clist_nicer/SRC/init.cpp
index 0454d0d36a..16a33bfc66 100644
--- a/plugins/Clist_nicer/SRC/init.cpp
+++ b/plugins/Clist_nicer/SRC/init.cpp
@@ -205,7 +205,6 @@ static int systemModulesLoaded(WPARAM wParam, LPARAM lParam)
ZeroMemory((void *)overlayicons, sizeof(HICON) * 10);
CLN_LoadAllIcons(1);
- LoadExtBkSettingsFromDB();
return 0;
}
@@ -240,38 +239,38 @@ extern "C" int __declspec(dllexport) CListInitialise()
cfg::maxCacheEntry = iCount;
cfg::init();
- cfg::dat.hMenuNotify = CreatePopupMenu();
- cfg::dat.wNextMenuID = 1;
- cfg::dat.sortTimer = cfg::getDword("CLC", "SortTimer", 150);
- cfg::dat.szNoEvents = TranslateTS(szNoevents);
- cfg::dat.avatarBorder = (COLORREF)cfg::getDword("CLC", "avatarborder", 0);
- cfg::dat.avatarRadius = (COLORREF)cfg::getDword("CLC", "avatarradius", 4);
- cfg::dat.hBrushAvatarBorder = CreateSolidBrush(cfg::dat.avatarBorder);
- cfg::dat.avatarSize = cfg::getWord("CList", "AvatarSize", 24);
- cfg::dat.dualRowMode = cfg::getByte("CLC", "DualRowMode", 0);
- cfg::dat.avatarPadding = cfg::getByte("CList", "AvatarPadding", 0);
- cfg::dat.isTransparent = cfg::getByte("CList", "Transparent", 0);
- cfg::dat.alpha = cfg::getByte("CList", "Alpha", SETTING_ALPHA_DEFAULT);
- cfg::dat.autoalpha = cfg::getByte("CList", "AutoAlpha", SETTING_ALPHA_DEFAULT);
- cfg::dat.fadeinout = cfg::getByte("CLUI", "FadeInOut", 0);
- cfg::dat.autosize = cfg::getByte("CLUI", "AutoSize", 0);
- cfg::dat.dwExtraImageMask = cfg::getDword("CLUI", "ximgmask", 0);
- cfg::dat.bNoOfflineAvatars = cfg::getByte("CList", "NoOfflineAV", 1);
- cfg::dat.bFullTransparent = cfg::getByte("CLUI", "fulltransparent", 0);
- cfg::dat.bDblClkAvatars = cfg::getByte("CLC", "dblclkav", 0);
- cfg::dat.bEqualSections = cfg::getByte("CLUI", "EqualSections", 0);
- cfg::dat.bCenterStatusIcons = cfg::getByte("CLC", "si_centered", 1);
- cfg::dat.boldHideOffline = -1;
- cfg::dat.bSecIMAvail = ServiceExists("SecureIM/IsContactSecured") ? 1 : 0;
- cfg::dat.bNoTrayTips = cfg::getByte("CList", "NoTrayTips", 0);
- cfg::dat.bShowLocalTime = cfg::getByte("CLC", "ShowLocalTime", 1);
- cfg::dat.bShowLocalTimeSelective = cfg::getByte("CLC", "SelectiveLocalTime", 1);
- cfg::dat.bDontSeparateOffline = cfg::getByte("CList", "DontSeparateOffline", 0);
- cfg::dat.bShowXStatusOnSbar = cfg::getByte("CLUI", "xstatus_sbar", 0);
- cfg::dat.bLayeredHack = cfg::getByte("CLUI", "layeredhack", 1);
- cfg::dat.bFirstRun = cfg::getByte("CLUI", "firstrun", 1);
- cfg::dat.langPackCP = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
- cfg::dat.realTimeSaving = cfg::getByte("CLUI", "save_pos_always", 0);
+ cfg::dat.hMenuNotify = CreatePopupMenu();
+ cfg::dat.wNextMenuID = 1;
+ cfg::dat.sortTimer = cfg::getDword("CLC", "SortTimer", 150);
+ cfg::dat.szNoEvents = TranslateTS(szNoevents);
+ cfg::dat.avatarBorder = (COLORREF)cfg::getDword("CLC", "avatarborder", 0);
+ cfg::dat.avatarRadius = (COLORREF)cfg::getDword("CLC", "avatarradius", 4);
+ cfg::dat.hBrushAvatarBorder = CreateSolidBrush(cfg::dat.avatarBorder);
+ cfg::dat.avatarSize = cfg::getWord("CList", "AvatarSize", 24);
+ cfg::dat.dualRowMode = cfg::getByte("CLC", "DualRowMode", 0);
+ cfg::dat.avatarPadding = cfg::getByte("CList", "AvatarPadding", 0);
+ cfg::dat.isTransparent = cfg::getByte("CList", "Transparent", 0);
+ cfg::dat.alpha = cfg::getByte("CList", "Alpha", SETTING_ALPHA_DEFAULT);
+ cfg::dat.autoalpha = cfg::getByte("CList", "AutoAlpha", SETTING_ALPHA_DEFAULT);
+ cfg::dat.fadeinout = cfg::getByte("CLUI", "FadeInOut", 0);
+ cfg::dat.autosize = cfg::getByte("CLUI", "AutoSize", 0);
+ cfg::dat.dwExtraImageMask = cfg::getDword("CLUI", "ximgmask", 0);
+ cfg::dat.bNoOfflineAvatars = cfg::getByte("CList", "NoOfflineAV", 1);
+ cfg::dat.bFullTransparent = cfg::getByte("CLUI", "fulltransparent", 0);
+ cfg::dat.bDblClkAvatars = cfg::getByte("CLC", "dblclkav", 0);
+ cfg::dat.bEqualSections = cfg::getByte("CLUI", "EqualSections", 0);
+ cfg::dat.bCenterStatusIcons = cfg::getByte("CLC", "si_centered", 1);
+ cfg::dat.boldHideOffline = -1;
+ cfg::dat.bSecIMAvail = ServiceExists("SecureIM/IsContactSecured") ? 1 : 0;
+ cfg::dat.bNoTrayTips = cfg::getByte("CList", "NoTrayTips", 0);
+ cfg::dat.bShowLocalTime = cfg::getByte("CLC", "ShowLocalTime", 1);
+ cfg::dat.bShowLocalTimeSelective = cfg::getByte("CLC", "SelectiveLocalTime", 1);
+ cfg::dat.bDontSeparateOffline = cfg::getByte("CList", "DontSeparateOffline", 0);
+ cfg::dat.bShowXStatusOnSbar = cfg::getByte("CLUI", "xstatus_sbar", 0);
+ cfg::dat.bLayeredHack = cfg::getByte("CLUI", "layeredhack", 1);
+ cfg::dat.bFirstRun = cfg::getByte("CLUI", "firstrun", 1);
+ cfg::dat.langPackCP = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+ cfg::dat.realTimeSaving = cfg::getByte("CLUI", "save_pos_always", 0);
DWORD sortOrder = cfg::getDword("CList", "SortOrder", SORTBY_NAME);
cfg::dat.sortOrder[0] = LOBYTE(LOWORD(sortOrder));
diff --git a/plugins/Clist_nicer/SRC/statusbar.cpp b/plugins/Clist_nicer/SRC/statusbar.cpp
index 8d130cd866..09036b2ed7 100644
--- a/plugins/Clist_nicer/SRC/statusbar.cpp
+++ b/plugins/Clist_nicer/SRC/statusbar.cpp
@@ -83,7 +83,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case WM_PAINT:
- if(cfg::shutDown)
+ if(cfg::shutDown || !StatusItems)
return 0;
if(cfg::dat.bSkinnedStatusBar) {
diff --git a/plugins/Mir_core/Miranda32.lib b/plugins/Mir_core/Miranda32.lib
deleted file mode 100644
index 966aff352a..0000000000
--- a/plugins/Mir_core/Miranda32.lib
+++ /dev/null
Binary files differ
diff --git a/plugins/Mir_core/Miranda64.lib b/plugins/Mir_core/Miranda64.lib
deleted file mode 100644
index b3feb4c445..0000000000
--- a/plugins/Mir_core/Miranda64.lib
+++ /dev/null
Binary files differ
diff --git a/plugins/Mir_core/mir_core_10.vcxproj b/plugins/Mir_core/mir_core_10.vcxproj
index 52717bfdd2..03ea9c52e1 100644
--- a/plugins/Mir_core/mir_core_10.vcxproj
+++ b/plugins/Mir_core/mir_core_10.vcxproj
@@ -121,8 +121,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>miranda32.lib;ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>
- </AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
<CustomBuildStep>
@@ -158,8 +157,7 @@
<ImportLibrary>$(IntDir)$(TargetName)64.lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>miranda64.lib;ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>
- </AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/ignore:4197 %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
@@ -190,8 +188,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>miranda32.lib;ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>
- </AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
<CustomBuildStep>
@@ -231,8 +228,7 @@
<ImportLibrary>$(IntDir)$(TargetName)64.lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>miranda64.lib;ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>
- </AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/ignore:4197 %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
diff --git a/plugins/TabSRMM/include/themes.h b/plugins/TabSRMM/include/themes.h
index 38c46e07e3..fcd4d03927 100644
--- a/plugins/TabSRMM/include/themes.h
+++ b/plugins/TabSRMM/include/themes.h
@@ -252,6 +252,7 @@ public:
CSkin()
{
+ ZeroMemory(this, sizeof(CSkin));
m_default_bf.SourceConstantAlpha = 255;
m_default_bf.AlphaFormat = AC_SRC_ALPHA;
m_default_bf.BlendOp = AC_SRC_OVER;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index 031eec0328..5bf22158dc 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -1084,7 +1084,6 @@ void CSkin::setFileName()
void CSkin::Init(bool fStartup)
{
m_ImageItems = 0;
- ZeroMemory(this, sizeof(CSkin));
m_SkinItems = ::SkinItems;
m_fLoadOnStartup = false;
m_skinEnabled = m_frameSkins = false;
@@ -1204,11 +1203,13 @@ void CSkin::Unload()
::DeleteObject(m_SkinDarkShadowPen);
m_SkinDarkShadowPen = 0;
- for(i = 0; i < ID_EXTBK_LAST; i++) {
- m_SkinItems[i].IGNORED = 1;
- m_SkinItems[i].imageItem = 0;
+ if (m_SkinItems) {
+ for(i = 0; i < ID_EXTBK_LAST; i++) {
+ m_SkinItems[i].IGNORED = 1;
+ m_SkinItems[i].imageItem = 0;
+ }
+ m_SkinItems[ID_EXTBKINFOPANELBG] = _defInfoPanel;
}
- m_SkinItems[ID_EXTBKINFOPANELBG] = _defInfoPanel;
ZeroMemory(this, sizeof(CSkin));
diff --git a/src/core/commonheaders.h b/src/core/commonheaders.h
index 5e6c25da62..ca35d2ae4b 100644
--- a/src/core/commonheaders.h
+++ b/src/core/commonheaders.h
@@ -93,6 +93,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_timezones.h>
#include "miranda.h"
+#include "stdplug.h"
#include <m_ssl.h>
#include <m_netlib.h>
diff --git a/src/core/miranda.cpp b/src/core/miranda.cpp
index a04846b217..4ee236537f 100644
--- a/src/core/miranda.cpp
+++ b/src/core/miranda.cpp
@@ -118,27 +118,27 @@ static void __cdecl compactHeapsThread(void*)
HANDLE hHeaps[256];
DWORD hc;
SleepEx((1000*60)*5, TRUE); // every 5 minutes
- hc=GetProcessHeaps(255, (PHANDLE)&hHeaps);
+ hc = GetProcessHeaps(255, (PHANDLE)&hHeaps);
if (hc != 0 && hc < 256) {
DWORD j;
- for (j=0; j < hc; j++)
+ for (j = 0; j < hc; j++)
HeapCompact(hHeaps[j], 0);
}
} //while
}
-void (*SetIdleCallback) (void)=NULL;
+void (*SetIdleCallback) (void) = NULL;
static INT_PTR SystemSetIdleCallback(WPARAM, LPARAM lParam)
{
if (lParam && SetIdleCallback == NULL) {
- SetIdleCallback=(void (*)(void))lParam;
+ SetIdleCallback = (void (*)(void))lParam;
return 1;
}
return 0;
}
-static DWORD dwEventTime=0;
+static DWORD dwEventTime = 0;
void checkIdle(MSG * msg)
{
switch(msg->message) {
@@ -209,9 +209,8 @@ void ParseCommandLine()
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
{
- DWORD myPid=0;
- int messageloop=1;
- HMODULE hUser32, hThemeAPI, hDwmApi, hShFolder = NULL;
+ DWORD myPid = 0;
+ int messageloop = 1;
int result = 0;
hInst = hInstance;
@@ -222,23 +221,23 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
- hUser32 = GetModuleHandleA("user32");
+ HINSTANCE hUser32 = GetModuleHandleA("user32");
openInputDesktop = (pfnOpenInputDesktop)GetProcAddress (hUser32, "OpenInputDesktop");
closeDesktop = (pfnCloseDesktop)GetProcAddress (hUser32, "CloseDesktop");
msgWaitForMultipleObjectsEx = (pfnMsgWaitForMultipleObjectsEx)GetProcAddress(hUser32, "MsgWaitForMultipleObjectsEx");
- animateWindow =(pfnAnimateWindow)GetProcAddress(hUser32, "AnimateWindow");
- setLayeredWindowAttributes =(pfnSetLayeredWindowAttributes)GetProcAddress(hUser32, "SetLayeredWindowAttributes");
+ animateWindow = (pfnAnimateWindow)GetProcAddress(hUser32, "AnimateWindow");
+ setLayeredWindowAttributes = (pfnSetLayeredWindowAttributes)GetProcAddress(hUser32, "SetLayeredWindowAttributes");
MyMonitorFromPoint = (pfnMyMonitorFromPoint)GetProcAddress(hUser32, "MonitorFromPoint");
MyMonitorFromRect = (pfnMyMonitorFromRect)GetProcAddress(hUser32, "MonitorFromRect");
MyMonitorFromWindow = (pfnMyMonitorFromWindow)GetProcAddress(hUser32, "MonitorFromWindow");
MyGetMonitorInfo = (pfnMyGetMonitorInfo)GetProcAddress(hUser32, "GetMonitorInfoW");
- hShFolder = GetModuleHandleA("shell32");
+ HINSTANCE hShFolder = GetModuleHandleA("shell32");
shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder, "SHGetSpecialFolderPathA");
shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder, "SHGetSpecialFolderPathW");
if (shGetSpecialFolderPathA == NULL) {
- hShFolder = LoadLibraryA("ShFolder.dll");
+ HINSTANCE hShFolder = LoadLibraryA("ShFolder.dll");
shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder, "SHGetSpecialFolderPathA");
shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder, "SHGetSpecialFolderPathW");
}
@@ -246,17 +245,17 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
shAutoComplete = (pfnSHAutoComplete)GetProcAddress(GetModuleHandleA("shlwapi"), "SHAutoComplete");
if ( IsWinVerXPPlus()) {
- hThemeAPI = LoadLibraryA("uxtheme.dll");
+ HINSTANCE hThemeAPI = LoadLibraryA("uxtheme.dll");
if (hThemeAPI) {
openThemeData = (pfnOpenThemeData)GetProcAddress(hThemeAPI, "OpenThemeData");
isThemeBackgroundPartiallyTransparent = (pfnIsThemeBackgroundPartiallyTransparent)GetProcAddress(hThemeAPI, "IsThemeBackgroundPartiallyTransparent");
- drawThemeParentBackground = (pfnDrawThemeParentBackground)GetProcAddress(hThemeAPI, "DrawThemeParentBackground");
+ drawThemeParentBackground = (pfnDrawThemeParentBackground)GetProcAddress(hThemeAPI, "DrawThemeParentBackground");
drawThemeBackground = (pfnDrawThemeBackground)GetProcAddress(hThemeAPI, "DrawThemeBackground");
drawThemeText = (pfnDrawThemeText)GetProcAddress(hThemeAPI, "DrawThemeText");
drawThemeTextEx = (pfnDrawThemeTextEx)GetProcAddress(hThemeAPI, "DrawThemeTextEx");
getThemeBackgroundContentRect = (pfnGetThemeBackgroundContentRect)GetProcAddress(hThemeAPI , "GetThemeBackgroundContentRect");
getThemeFont = (pfnGetThemeFont)GetProcAddress(hThemeAPI, "GetThemeFont");
- closeThemeData = (pfnCloseThemeData)GetProcAddress(hThemeAPI, "CloseThemeData");
+ closeThemeData = (pfnCloseThemeData)GetProcAddress(hThemeAPI, "CloseThemeData");
enableThemeDialogTexture = (pfnEnableThemeDialogTexture)GetProcAddress(hThemeAPI, "EnableThemeDialogTexture");
setWindowTheme = (pfnSetWindowTheme)GetProcAddress(hThemeAPI, "SetWindowTheme");
setWindowThemeAttribute = (pfnSetWindowThemeAttribute)GetProcAddress(hThemeAPI, "SetWindowThemeAttribute");
@@ -270,7 +269,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
}
if ( IsWinVerVistaPlus()) {
- hDwmApi = LoadLibraryA("dwmapi.dll");
+ HINSTANCE hDwmApi = LoadLibraryA("dwmapi.dll");
if (hDwmApi) {
dwmExtendFrameIntoClientArea = (pfnDwmExtendFrameIntoClientArea)GetProcAddress(hDwmApi, "DwmExtendFrameIntoClientArea");
dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi, "DwmIsCompositionEnabled");
@@ -306,12 +305,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
forkthread(compactHeapsThread, 0, NULL);
CreateServiceFunction(MS_SYSTEM_SETIDLECALLBACK, SystemSetIdleCallback);
CreateServiceFunction(MS_SYSTEM_GETIDLE, SystemGetIdle);
- dwEventTime=GetTickCount();
- myPid=GetCurrentProcessId();
+ dwEventTime = GetTickCount();
+ myPid = GetCurrentProcessId();
while (messageloop) {
MSG msg;
DWORD rc;
- BOOL dying=FALSE;
+ BOOL dying = FALSE;
rc = MsgWaitForMultipleObjectsEx(waitObjectCount, hWaitObjects, INFINITE, QS_ALLINPUT, MWMO_ALERTABLE);
if (rc >= WAIT_OBJECT_0 && rc < WAIT_OBJECT_0 + waitObjectCount) {
rc -= WAIT_OBJECT_0;
@@ -320,7 +319,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
//
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
if (msg.message != WM_QUIT) {
- HWND h=GetForegroundWindow();
+ HWND h = GetForegroundWindow();
DWORD pid = 0;
checkIdle(&msg);
if (h != NULL && GetWindowThreadProcessId(h, &pid) && pid == myPid && GetClassLongPtr(h, GCW_ATOM) == 32770)
@@ -344,7 +343,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
PostQuitMessage(0);
}
else if (dying)
- messageloop=0;
+ messageloop = 0;
}
}
@@ -358,12 +357,8 @@ exit:
OleUninitialize();
- if (bufferedPaintUninit) bufferedPaintUninit();
-
- if (hDwmApi) FreeLibrary(hDwmApi);
- if (hThemeAPI) FreeLibrary(hThemeAPI);
- if (hShFolder) FreeLibrary(hShFolder);
-
+ if (bufferedPaintUninit)
+ bufferedPaintUninit();
return result;
}
@@ -401,8 +396,8 @@ static INT_PTR GetMirandaVersionText(WPARAM wParam, LPARAM lParam)
PVOID pVerInfo;
GetModuleFileName(NULL, filename, SIZEOF(filename));
- verInfoSize=GetFileVersionInfoSize(filename, &unused);
- pVerInfo=mir_alloc(verInfoSize);
+ verInfoSize = GetFileVersionInfoSize(filename, &unused);
+ pVerInfo = mir_alloc(verInfoSize);
GetFileVersionInfo(filename, 0, verInfoSize, pVerInfo);
VerQueryValue(pVerInfo, _T("\\StringFileInfo\\000004b0\\ProductVersion"), (LPVOID*)&productVersion, &blockSize);
#if defined(_WIN64)
diff --git a/src/core/miranda.h b/src/core/miranda.h
index 3446fc0a72..3b08c636ba 100644
--- a/src/core/miranda.h
+++ b/src/core/miranda.h
@@ -126,7 +126,7 @@ void KillModuleSounds(int hLangpack);
/**** miranda.cpp **********************************************************************/
extern HINSTANCE hInst;
-extern HANDLE hOkToExitEvent, hModulesLoadedEvent;
+extern HANDLE hOkToExitEvent, hModulesLoadedEvent, hevLoadModule, hevUnloadModule;
/**** utf.cpp **************************************************************************/
@@ -145,20 +145,10 @@ HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const TCHAR* name);
/**** skin2icons.cpp *******************************************************************/
-HANDLE IcoLib_AddNewIcon(int hLangpack, SKINICONDESC* sid);
-HICON IcoLib_GetIcon(const char* pszIconName, bool big);
-HICON IcoLib_GetIconByHandle(HANDLE hItem, bool big);
-HANDLE IcoLib_IsManaged(HICON hIcon);
-int IcoLib_ReleaseIcon(HICON hIcon, char* szIconName, bool big);
-
void KillModuleIcons(int hLangpack);
/**** skinicons.cpp ********************************************************************/
-HICON LoadSkinProtoIcon(const char* szProto, int status, bool big = false);
-HICON LoadSkinIcon(int idx, bool big = false);
-HANDLE GetSkinIconHandle(int idx);
-
HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared);
int ImageList_AddIcon_NotShared(HIMAGELIST hIml, LPCTSTR szResource);
int ImageList_ReplaceIcon_NotShared(HIMAGELIST hIml, int iIndex, HINSTANCE hInstance, LPCTSTR szResource);
@@ -167,20 +157,13 @@ int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId);
int ImageList_AddIcon_ProtoIconLibLoaded(HIMAGELIST hIml, const char* szProto, int iconId);
int ImageList_ReplaceIcon_IconLibLoaded(HIMAGELIST hIml, int nIndex, HICON hIcon);
-void Button_SetIcon_IcoLib(HWND hDlg, int itemId, int iconId, const char* tooltip);
-void Button_FreeIcon_IcoLib(HWND hDlg, int itemId);
-
-void Window_SetIcon_IcoLib(HWND hWnd, int iconId);
-void Window_SetProtoIcon_IcoLib(HWND hWnd, const char* szProto, int iconId);
-void Window_FreeIcon_IcoLib(HWND hWnd);
-
-#define IconLib_ReleaseIcon(hIcon, szName) IcoLib_ReleaseIcon(hIcon, szName, false);
#define Safe_DestroyIcon(hIcon) if (hIcon) DestroyIcon(hIcon)
/**** clistmenus.cpp ********************************************************************/
extern HANDLE hMainMenuObject, hContactMenuObject, hStatusMenuObject;
extern HANDLE hPreBuildMainMenuEvent, hPreBuildContactMenuEvent;
+extern HANDLE hShutdownEvent, hPreShutdownEvent;
extern const int statusModeList[ MAX_STATUS_COUNT ];
extern const int skinIconStatusList[ MAX_STATUS_COUNT ];
diff --git a/src/core/modules.cpp b/src/core/modules.cpp
index d1636a09a0..d33fc47a84 100644
--- a/src/core/modules.cpp
+++ b/src/core/modules.cpp
@@ -146,7 +146,14 @@ int LoadDefaultModules(void)
if ( LoadIgnoreModule()) return 1;
if ( LoadVisibilityModule()) return 1;
- if ( !pluginDefault[ 0].pImpl) if ( LoadUserInfoModule()) return 1;
+ for (int i=0; i < 1; i++) {
+ if ( pluginDefault[i].pImpl )
+ continue;
+
+ if ( !LoadCorePlugin(pluginDefault[i]))
+ return 1;
+ }
+
if ( !pluginDefault[ 1].pImpl) if ( LoadSendRecvUrlModule()) return 1;
if ( !pluginDefault[ 2].pImpl) if ( LoadSendRecvEMailModule()) return 1;
if ( !pluginDefault[ 3].pImpl) if ( LoadSendRecvAuthModule()) return 1;
@@ -157,6 +164,7 @@ int LoadDefaultModules(void)
if ( !pluginDefault[ 8].pImpl) if ( LoadAutoAwayModule()) return 1;
if ( !pluginDefault[ 9].pImpl) if ( LoadUserOnlineModule()) return 1;
if ( !pluginDefault[10].pImpl) if ( LoadUpdateNotifyModule()) return 1;
+
return 0;
}
diff --git a/src/core/stdplug.h b/src/core/stdplug.h
new file mode 100644
index 0000000000..269eeeba3d
--- /dev/null
+++ b/src/core/stdplug.h
@@ -0,0 +1,23 @@
+
+#ifdef _STATIC
+ #define MIRANDA_EXE_FUNC(T) extern "C" T __declspec(dllexport)
+#else
+ #define MIRANDA_EXE_FUNC(T) extern "C" T __declspec(dllimport)
+#endif
+
+MIRANDA_EXE_FUNC(HICON) LoadSkinProtoIcon(const char* szProto, int status, bool big = false);
+MIRANDA_EXE_FUNC(HICON) LoadSkinIcon(int idx, bool big = false);
+MIRANDA_EXE_FUNC(HANDLE) GetSkinIconHandle(int idx);
+
+MIRANDA_EXE_FUNC(HANDLE) IcoLib_AddNewIcon(int hLangpack, SKINICONDESC* sid);
+MIRANDA_EXE_FUNC(HICON) IcoLib_GetIcon(const char* pszIconName, bool big);
+MIRANDA_EXE_FUNC(HICON) IcoLib_GetIconByHandle(HANDLE hItem, bool big);
+MIRANDA_EXE_FUNC(HANDLE) IcoLib_IsManaged(HICON hIcon);
+MIRANDA_EXE_FUNC(int) IcoLib_ReleaseIcon(HICON hIcon, char* szIconName, bool big=false);
+
+MIRANDA_EXE_FUNC(void) Button_SetIcon_IcoLib(HWND hDlg, int itemId, int iconId, const char* tooltip);
+MIRANDA_EXE_FUNC(void) Button_FreeIcon_IcoLib(HWND hDlg, int itemId);
+
+MIRANDA_EXE_FUNC(void) Window_SetIcon_IcoLib(HWND hWnd, int iconId);
+MIRANDA_EXE_FUNC(void) Window_SetProtoIcon_IcoLib(HWND hWnd, const char* szProto, int iconId);
+MIRANDA_EXE_FUNC(void) Window_FreeIcon_IcoLib(HWND hWnd);
diff --git a/src/core/stduserinfo/commonheaders.cpp b/src/core/stduserinfo/commonheaders.cpp
new file mode 100644
index 0000000000..95b2201163
--- /dev/null
+++ b/src/core/stduserinfo/commonheaders.cpp
@@ -0,0 +1,2 @@
+#include "commonheaders.h"
+
diff --git a/src/core/stduserinfo/commonheaders.h b/src/core/stduserinfo/commonheaders.h
new file mode 100644
index 0000000000..b3fdcb29f3
--- /dev/null
+++ b/src/core/stduserinfo/commonheaders.h
@@ -0,0 +1,96 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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; either version 2
+of the License, or (at your option) any later version.
+
+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, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+// to enable all 0.9.0 core functions
+#define MIRANDA_VER 0x0A00
+
+#define WINVER 0x0700
+#define _WIN32_WINNT 0x0700
+#define _WIN32_IE 0x0601
+
+#include <tchar.h>
+#include <winsock2.h>
+#include <shlobj.h>
+#include <uxtheme.h>
+#include <commctrl.h>
+#include <vssym32.h>
+
+#include <stdio.h>
+#include <time.h>
+#include <stddef.h>
+#include <process.h>
+#include <io.h>
+#include <limits.h>
+#include <string.h>
+#include <locale.h>
+#include <direct.h>
+#include <malloc.h>
+
+#include <win2k.h>
+
+#include <m_system.h>
+#include <m_system_cpp.h>
+#include <m_core.h>
+#include <newpluginapi.h>
+#include <m_database.h>
+#include <m_netlib.h>
+#include <m_clc.h>
+#include <m_clui.h>
+#include <m_crypto.h>
+#include <m_langpack.h>
+#include <m_clist.h>
+#include <m_clistint.h>
+#include <m_avatars.h>
+#include <m_button.h>
+#include <m_protosvc.h>
+#include <m_protomod.h>
+#include <m_protocols.h>
+#include <m_protoint.h>
+#include <m_plugins.h>
+#include <m_options.h>
+#include <m_skin.h>
+#include <m_contacts.h>
+#include <m_message.h>
+#include <m_userinfo.h>
+#include <m_history.h>
+#include <m_addcontact.h>
+#include <m_findadd.h>
+#include <m_file.h>
+#include <m_email.h>
+#include <m_awaymsg.h>
+#include <m_idle.h>
+#include <m_ignore.h>
+#include <m_icolib.h>
+#include <m_modernopt.h>
+#include <m_help.h>
+#include <m_timezones.h>
+
+#include "version.h"
+
+#include "../../resource.h"
+#include "../stdplug.h"
+
+extern HINSTANCE hInst;
+
+typedef HRESULT (STDAPICALLTYPE *pfnEnableThemeDialogTexture)(HWND hwnd, DWORD dwFlags);
+extern pfnEnableThemeDialogTexture enableThemeDialogTexture;
diff --git a/src/core/stduserinfo/contactinfo.cpp b/src/core/stduserinfo/contactinfo.cpp
new file mode 100644
index 0000000000..031a9e40ab
--- /dev/null
+++ b/src/core/stduserinfo/contactinfo.cpp
@@ -0,0 +1,528 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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; either version 2
+of the License, or (at your option) any later version.
+
+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, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "commonheaders.h"
+
+static HFONT hEmailFont = NULL;
+static HCURSOR hHandCursor = NULL;
+
+static INT_PTR CALLBACK EditUserEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg) {
+ case WM_INITDIALOG:
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
+ if (*(char*)lParam) SetWindowText(hwndDlg, TranslateT("Edit E-Mail Address"));
+ TranslateDialogDefault(hwndDlg);
+ SetDlgItemTextA(hwndDlg, IDC_EMAIL, (char*)lParam);
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), *(char*)lParam);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDOK:
+ GetDlgItemTextA(hwndDlg, IDC_EMAIL, (char*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA), 256);
+ //fall through
+ case IDCANCEL:
+ EndDialog(hwndDlg, wParam);
+ case IDC_EMAIL:
+ if (HIWORD(wParam) == EN_CHANGE)
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), GetWindowTextLength(GetDlgItem(hwndDlg, IDC_EMAIL)));
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ static int noRecursion = 0;
+
+ switch(msg) {
+ case WM_INITDIALOG:
+ {
+ char *szText = (char*)lParam;
+ int i, item, countryCount;
+ struct CountryListEntry *countries;
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
+ if (szText[0]) SetWindowText(hwndDlg, TranslateT("Edit Phone Number"));
+ TranslateDialogDefault(hwndDlg);
+ if (lstrlenA(szText)>4 && !lstrcmpA(szText+lstrlenA(szText)-4, " SMS")) {
+ CheckDlgButton(hwndDlg, IDC_SMS, BST_CHECKED);
+ szText[lstrlenA(szText)-4] = '\0';
+ }
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), szText[0]);
+ SendDlgItemMessage(hwndDlg, IDC_AREA, EM_LIMITTEXT, 31, 0);
+ SendDlgItemMessage(hwndDlg, IDC_NUMBER, EM_LIMITTEXT, 63, 0);
+ CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&countryCount, (LPARAM)&countries);
+ for (i=0;i<countryCount;i++) {
+ if (countries[i].id == 0 || countries[i].id == 0xFFFF) continue;
+ item = SendDlgItemMessageA(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)Translate(countries[i].szName));
+ SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_SETITEMDATA, item, countries[i].id);
+ }
+ SetDlgItemTextA(hwndDlg, IDC_PHONE, szText);
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDOK:
+ { char *szText = (char*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ int isValid = 1;
+ GetDlgItemTextA(hwndDlg, IDC_PHONE, szText, 252);
+ if (lstrlenA(szText)<7 || szText[0] != '+') isValid = 0;
+ if (isValid) isValid = (lstrlenA(szText+1) == (int)strspn(szText+1, "0123456789 ()-"));
+ if ( !isValid) {
+ MessageBox(hwndDlg, TranslateT("The phone number should start with a + and consist of numbers, spaces, brackets and hyphens only."), TranslateT("Invalid Phone Number"), MB_OK);
+ break;
+ }
+ if (IsDlgButtonChecked(hwndDlg, IDC_SMS)) lstrcatA(szText, " SMS");
+ }
+ //fall through
+ case IDCANCEL:
+ EndDialog(hwndDlg, wParam);
+ case IDC_COUNTRY:
+ if (HIWORD(wParam) != CBN_SELCHANGE) break;
+ case IDC_AREA:
+ case IDC_NUMBER:
+ if (LOWORD(wParam) != IDC_COUNTRY && HIWORD(wParam) != EN_CHANGE) break;
+ if (noRecursion) break;
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
+ { char szPhone[96], szArea[32], szNumber[64];
+ GetDlgItemTextA(hwndDlg, IDC_AREA, szArea, SIZEOF(szArea));
+ GetDlgItemTextA(hwndDlg, IDC_NUMBER, szNumber, SIZEOF(szNumber));
+ mir_snprintf(szPhone, SIZEOF(szPhone), "+%u (%s) %s", SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0), 0), szArea, szNumber);
+ noRecursion = 1;
+ SetDlgItemTextA(hwndDlg, IDC_PHONE, szPhone);
+ noRecursion = 0;
+ }
+ break;
+ case IDC_PHONE:
+ if (HIWORD(wParam) != EN_UPDATE) break;
+ if (noRecursion) break;
+ noRecursion = 1;
+ {
+ char szText[256], *pText = NULL, *pArea, *pNumber;
+ int isValid = 1;
+ GetDlgItemTextA(hwndDlg, IDC_PHONE, szText, SIZEOF(szText));
+ if (szText[0] != '+')
+ isValid = 0;
+
+ if (isValid) {
+ int i, country = strtol(szText+1, &pText, 10);
+ if (pText - szText > 4)
+ isValid = 0;
+ else {
+ for (i = SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETCOUNT, 0, 0)-1; i >= 0; i--)
+ if (country == SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, i, 0)) {
+ SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_SETCURSEL, i, 0);
+ break;
+ }
+ if (i < 0)
+ isValid = 0;
+ }
+ }
+ if (isValid) {
+ pArea = pText+strcspn(pText, "0123456789");
+ pText = pArea+strspn(pArea, "0123456789");
+ if (*pText) {
+ *pText = '\0';
+ pNumber = pText+1+strcspn(pText+1, "0123456789");
+ SetDlgItemTextA(hwndDlg, IDC_NUMBER, pNumber);
+ }
+ SetDlgItemTextA(hwndDlg, IDC_AREA, pArea);
+ }
+ if ( !isValid) {
+ SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_SETCURSEL, -1, 0);
+ SetDlgItemTextA(hwndDlg, IDC_AREA, "");
+ SetDlgItemTextA(hwndDlg, IDC_NUMBER, "");
+ }
+ }
+ noRecursion = 0;
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), GetWindowTextLength(GetDlgItem(hwndDlg, IDC_PHONE)));
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail)
+{
+ RECT rc;
+ HWND hwndEmails;
+ TCHAR szText[256];
+ HDC hdc;
+ SIZE textSize;
+ LVHITTESTINFO hti;
+
+ hwndEmails = GetDlgItem(hwndDlg, IDC_EMAILS);
+ GetCursorPos(&hti.pt);
+ ScreenToClient(hwndEmails, &hti.pt);
+ GetClientRect(hwndEmails, &rc);
+ if ( !PtInRect(&rc, hti.pt)) return 0;
+ if (ListView_SubItemHitTest(hwndEmails, &hti) == -1) return 0;
+ if (hti.iSubItem != 1) return 0;
+ if ( !(hti.flags&LVHT_ONITEMLABEL)) return 0;
+ ListView_GetSubItemRect(hwndEmails, hti.iItem, 1, LVIR_LABEL, &rc);
+ szText[0] = 0;
+ ListView_GetItemText(hwndEmails, hti.iItem, 1, szText, SIZEOF(szText));
+ hdc = GetDC(hwndEmails);
+ SelectObject(hdc, hEmailFont);
+ GetTextExtentPoint32(hdc, szText, lstrlen(szText), &textSize);
+ ReleaseDC(hwndEmails, hdc);
+ if (hti.pt.x<rc.left+textSize.cx) {
+ if (szEmail && cchEmail) lstrcpyn(szEmail, szText, cchEmail);
+ return 1;
+ }
+ return 0;
+}
+
+#define M_REMAKELISTS (WM_USER+1)
+INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg) {
+ case WM_INITDIALOG:
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
+ if (hEmailFont) DeleteObject(hEmailFont);
+ {
+ LOGFONT lf;
+ hEmailFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_EMAILS, WM_GETFONT, 0, 0);
+ GetObject(hEmailFont, sizeof(lf), &lf);
+ lf.lfUnderline = 1;
+ hEmailFont = CreateFontIndirect(&lf);
+ }
+ if (hHandCursor == NULL) {
+ if ( IsWinVer2000Plus()) hHandCursor = LoadCursor(NULL, IDC_HAND);
+ else hHandCursor = LoadCursor(hInst, MAKEINTRESOURCE(IDC_HYPERLINKHAND));
+ }
+ TranslateDialogDefault(hwndDlg);
+ {
+ LVCOLUMN lvc;
+ RECT rc;
+ GetClientRect(GetDlgItem(hwndDlg, IDC_EMAILS), &rc);
+ rc.right-=GetSystemMetrics(SM_CXVSCROLL);
+ lvc.mask = LVCF_WIDTH;
+ ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg, IDC_EMAILS), LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
+ ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg, IDC_PHONES), LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
+ lvc.cx = rc.right/4;
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 0, &lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 0, &lvc);
+ lvc.cx = rc.right-rc.right/4-40;
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 1, &lvc);
+ lvc.cx = rc.right-rc.right/4-90;
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 1, &lvc);
+ lvc.cx = 50;
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 2, &lvc);
+ lvc.cx = 20;
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 2, &lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 3, &lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 3, &lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 4, &lvc);
+ }
+ break;
+
+ case M_REMAKELISTS:
+ {
+ int i;
+ HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ if (hContact != NULL) {
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (szProto == NULL)
+ break;
+
+ //e-mails
+ ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_EMAILS));
+
+ char idstr[33];
+ TCHAR idstr2[33];
+ DBVARIANT dbv;
+
+ LVITEM lvi;
+ lvi.mask = LVIF_TEXT|LVIF_PARAM;
+ lvi.lParam = (LPARAM)(-1);
+ lvi.iSubItem = 0;
+ lvi.iItem = 0;
+ for (i = -1;;i++) {
+ if (i == -1) {
+ if (DBGetContactSettingTString(hContact, szProto, "e-mail", &dbv))
+ continue;
+ lvi.pszText = TranslateT("Primary");
+ }
+ else {
+ mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i);
+ if (DBGetContactSettingTString(hContact, szProto, idstr, &dbv))
+ break;
+
+ lvi.pszText = idstr2;
+ mir_sntprintf(idstr2, SIZEOF(idstr2), _T("%d"), i+2);
+ }
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ lvi.iItem++;
+ }
+ lvi.iSubItem = 0;
+ for (i=0;;i++) {
+ lvi.lParam = i;
+ mir_snprintf(idstr, SIZEOF(idstr), "Mye-mail%d", i);
+ if (DBGetContactSettingTString(hContact, "UserInfo", idstr, &dbv))
+ break;
+ lvi.pszText = idstr2;
+ mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"), i+1);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ lvi.iItem++;
+ }
+ lvi.mask = LVIF_PARAM;
+ lvi.lParam = (LPARAM)(-2);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
+ //phones
+ ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_PHONES));
+ lvi.mask = LVIF_TEXT|LVIF_PARAM;
+ lvi.lParam = (LPARAM)(-1);
+ lvi.iSubItem = 0;
+ lvi.iItem = 0;
+ if ( !DBGetContactSettingTString(hContact, szProto, "Phone", &dbv)) {
+ lvi.pszText = TranslateT("Primary");
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ lvi.iItem++;
+ }
+ if ( !DBGetContactSettingTString(hContact, szProto, "Fax", &dbv)) {
+ lvi.pszText = TranslateT("Fax");
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ lvi.iItem++;
+ }
+ if ( !DBGetContactSettingTString(hContact, szProto, "Cellular", &dbv)) {
+ lvi.pszText = TranslateT("Mobile");
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ if (lstrlenA(dbv.pszVal)>4 && !lstrcmpA(dbv.pszVal+lstrlenA(dbv.pszVal)-4, " SMS")) {
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y"));
+ dbv.ptszVal[lstrlen(dbv.ptszVal)-4] = '\0';
+ }
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ lvi.iItem++;
+ }
+ if ( !DBGetContactSettingTString(hContact, szProto, "CompanyPhone", &dbv)) {
+ lvi.pszText = TranslateT("Work Phone");
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ lvi.iItem++;
+ }
+ if ( !DBGetContactSettingTString(hContact, szProto, "CompanyFax", &dbv)) {
+ lvi.pszText = TranslateT("Work Fax");
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ lvi.iItem++;
+ }
+ lvi.iSubItem = 0;
+ for (i=0;; i++) {
+ lvi.lParam = i;
+ mir_snprintf(idstr, SIZEOF(idstr), "MyPhone%d", i);
+ if (DBGetContactSettingTString(hContact, "UserInfo", idstr, &dbv))
+ break;
+ lvi.pszText = idstr2;
+ mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"), i+1);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ if (lstrlen(dbv.ptszVal)>4 && !lstrcmp(dbv.ptszVal+lstrlen(dbv.ptszVal)-4, _T(" SMS"))) {
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y"));
+ dbv.ptszVal[lstrlen(dbv.ptszVal)-4] = '\0';
+ }
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ lvi.iItem++;
+ }
+ lvi.mask = LVIF_PARAM;
+ lvi.lParam = (LPARAM)(-2);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ }
+ }
+ break;
+
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED)
+ SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
+ break;
+
+ case IDC_EMAILS:
+ case IDC_PHONES:
+ switch (((LPNMHDR)lParam)->code) {
+ case NM_CUSTOMDRAW:
+ {
+ NMLVCUSTOMDRAW *nm = (NMLVCUSTOMDRAW*)lParam;
+ switch(nm->nmcd.dwDrawStage) {
+ case CDDS_PREPAINT:
+ case CDDS_ITEMPREPAINT:
+ SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_NOTIFYSUBITEMDRAW);
+ return TRUE;
+ case CDDS_SUBITEM|CDDS_ITEMPREPAINT:
+ {
+ RECT rc;
+ ListView_GetSubItemRect(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc);
+ if (nm->iSubItem == 1 && nm->nmcd.hdr.idFrom == IDC_EMAILS) {
+ HFONT hoFont;
+ TCHAR szText[256] = {0};
+ ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, SIZEOF(szText));
+ hoFont = (HFONT)SelectObject(nm->nmcd.hdc, hEmailFont);
+ SetTextColor(nm->nmcd.hdc, RGB(0, 0, 255));
+ DrawText(nm->nmcd.hdc, szText, -1, &rc, DT_END_ELLIPSIS|DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_TOP);
+ SelectObject(nm->nmcd.hdc, hoFont);
+ SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT);
+ return TRUE;
+ }
+
+ HICON hIcon = NULL;
+ if (nm->nmcd.lItemlParam == (LPARAM)(-2) && nm->iSubItem-3 == (nm->nmcd.hdr.idFrom == IDC_PHONES))
+ hIcon = LoadSkinIcon(SKINICON_OTHER_ADDCONTACT);
+ else if (nm->iSubItem>1 && nm->nmcd.lItemlParam != (LPARAM)(-1) && nm->nmcd.lItemlParam != (LPARAM)(-2)) {
+ static int iconResources[3] = {SKINICON_OTHER_RENAME, SKINICON_OTHER_DELETE};
+ if (nm->iSubItem == 2 && nm->nmcd.hdr.idFrom == IDC_PHONES) {
+ TCHAR szText[2];
+ ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, SIZEOF(szText));
+ if (szText[0]) hIcon = LoadSkinIcon(SKINICON_OTHER_SMS);
+ }
+ else hIcon = LoadSkinIcon(iconResources[nm->iSubItem-3+(nm->nmcd.hdr.idFrom == IDC_EMAILS)]);
+ }
+ else break;
+ DrawIconEx(nm->nmcd.hdc, (rc.left+rc.right-GetSystemMetrics(SM_CXSMICON))/2, (rc.top+rc.bottom-GetSystemMetrics(SM_CYSMICON))/2, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
+ IcoLib_ReleaseIcon(hIcon, 0);
+ SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT);
+ return TRUE;
+ }
+ }
+ }
+ break;
+
+ case NM_CLICK:
+ {
+ NMLISTVIEW *nm = (NMLISTVIEW*)lParam;
+ LVITEM lvi;
+ TCHAR szEmail[256];
+ HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ char *szIdTemplate = nm->hdr.idFrom == IDC_PHONES?"MyPhone%d":"Mye-mail%d";
+ LVHITTESTINFO hti;
+
+ if (IsOverEmail(hwndDlg, szEmail, SIZEOF(szEmail))) {
+ TCHAR szExec[264];
+ mir_sntprintf(szExec, SIZEOF(szExec), _T("mailto:%s"), szEmail);
+ ShellExecute(hwndDlg, _T("open"), szExec, NULL, NULL, SW_SHOW);
+ break;
+ }
+ if (nm->iSubItem<2) break;
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(nm->hdr.hwndFrom, &hti.pt);
+ if (ListView_SubItemHitTest(nm->hdr.hwndFrom, &hti) == -1) break;
+ lvi.mask = LVIF_PARAM;
+ lvi.iItem = hti.iItem;
+ lvi.iSubItem = 0;
+ ListView_GetItem(nm->hdr.hwndFrom, &lvi);
+ if (lvi.lParam == (LPARAM)(-1)) break;
+ if (lvi.lParam == (LPARAM)(-2)) {
+ if (hti.iSubItem-3 == (nm->hdr.idFrom == IDC_PHONES)) {
+ //add
+ char szNewData[256] = "", idstr[33];
+ DBVARIANT dbv;
+ if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szNewData))
+ break;
+ for (int i=0;; i++) {
+ mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
+ DBFreeVariant(&dbv);
+ }
+ DBWriteContactSettingString(hContact, "UserInfo", idstr, szNewData);
+ SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
+ }
+ }
+ else {
+ if (hti.iSubItem-3 == (nm->hdr.idFrom == IDC_PHONES)) {
+ //delete
+ int i;
+ char idstr[33];
+ DBVARIANT dbv;
+ for (i = lvi.lParam;;i++) {
+ mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i+1);
+ if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
+ mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ DBWriteContactSettingString(hContact, "UserInfo", idstr, dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ DBDeleteContactSetting(hContact, "UserInfo", idstr);
+ SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
+ }
+ else if (hti.iSubItem-2 == (nm->hdr.idFrom == IDC_PHONES)) {
+ //edit
+ char szText[256], idstr[33];
+ DBVARIANT dbv;
+ mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, lvi.lParam);
+ if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
+ lstrcpynA(szText, dbv.pszVal, SIZEOF(szText));
+ DBFreeVariant(&dbv);
+ if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szText))
+ break;
+ DBWriteContactSettingString(hContact, "UserInfo", idstr, szText);
+ SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+ break;
+
+ case WM_SETCURSOR:
+ if (LOWORD(lParam) != HTCLIENT) break;
+ if (GetForegroundWindow() == GetParent(hwndDlg)) {
+ POINT pt;
+ GetCursorPos(&pt);
+ ScreenToClient(hwndDlg, &pt);
+ }
+ if (IsOverEmail(hwndDlg, NULL, 0)) {
+ SetCursor(hHandCursor);
+ SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, TRUE);
+ return TRUE;
+ }
+ break;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDCANCEL:
+ SendMessage(GetParent(hwndDlg), msg, wParam, lParam);
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
diff --git a/src/core/stduserinfo/main.cpp b/src/core/stduserinfo/main.cpp
new file mode 100644
index 0000000000..22420f0fa3
--- /dev/null
+++ b/src/core/stduserinfo/main.cpp
@@ -0,0 +1,90 @@
+/*
+
+Standard User Info plugin for Myranda IM
+
+Copyright (C) 2012 George Hazan
+
+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; either version 2 of the License, or
+(at your option) any later version.
+
+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, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "commonheaders.h"
+
+int LoadUserInfoModule(void);
+
+CLIST_INTERFACE* pcli;
+TIME_API tmi;
+HINSTANCE hInst;
+int hLangpack;
+
+pfnEnableThemeDialogTexture enableThemeDialogTexture;
+
+PLUGININFOEX pluginInfo = {
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ MIRANDA_VERSION_DWORD,
+ __DESCRIPTION,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ // {8198DC94-0BC4-448A-8495-8FE832C1D333}
+ {0x8198dc94, 0xbc4, 0x448a, {0x84, 0x95, 0x8f, 0xe8, 0x32, 0xc1, 0xd3, 0x33 }}
+};
+
+static const MUUID interfaces[] = {MIID_UIUSERINFO, MIID_LAST};
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ hInst = hinstDLL;
+ return TRUE;
+}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ return &pluginInfo;
+}
+
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+{
+ return interfaces;
+}
+
+static int OnModulesLoaded(WPARAM, LPARAM)
+{
+ return 0;
+}
+
+extern "C" int __declspec(dllexport) Load(void)
+{
+ mir_getLP(&pluginInfo);
+ mir_getTMI(&tmi);
+
+ pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)hInst);
+
+ if ( IsWinVerXPPlus()) {
+ HINSTANCE hThemeAPI = LoadLibraryA("uxtheme.dll");
+ if (hThemeAPI)
+ enableThemeDialogTexture = (pfnEnableThemeDialogTexture)GetProcAddress(hThemeAPI, "EnableThemeDialogTexture");
+ }
+
+ LoadUserInfoModule();
+ return 0;
+}
+
+extern "C" int __declspec(dllexport) Unload(void)
+{
+ return 0;
+}
diff --git a/src/core/stduserinfo/res/cursor_hyperlink.cur b/src/core/stduserinfo/res/cursor_hyperlink.cur
new file mode 100644
index 0000000000..f0f548c828
--- /dev/null
+++ b/src/core/stduserinfo/res/cursor_hyperlink.cur
Binary files differ
diff --git a/src/core/stduserinfo/resource.rc b/src/core/stduserinfo/resource.rc
new file mode 100644
index 0000000000..4b2a37b640
--- /dev/null
+++ b/src/core/stduserinfo/resource.rc
@@ -0,0 +1,303 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "..\..\resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include <windows.h>
+#include <winres.h>
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (United States) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Cursor
+//
+
+IDC_HYPERLINKHAND CURSOR "res/cursor_hyperlink.cur"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ADDPHONE DIALOGEX 0, 0, 210, 91
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CONTROLPARENT
+CAPTION "Add Phone Number"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "Enter country, area code and phone number:",IDC_STATIC,5,5,200,8
+ COMBOBOX IDC_COUNTRY,21,15,66,120,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_AREA,91,15,36,12,ES_AUTOHSCROLL | ES_NUMBER
+ EDITTEXT IDC_NUMBER,131,15,74,12,ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "Or enter a full international number:",IDC_STATIC,5,30,200,8
+ EDITTEXT IDC_PHONE,21,40,184,12,ES_AUTOHSCROLL
+ CONTROL "Phone can receive SMS text messages",IDC_SMS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,56,200,10
+ DEFPUSHBUTTON "OK",IDOK,47,72,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,113,72,50,14
+END
+
+IDD_ADDEMAIL DIALOGEX 0, 0, 187, 42
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CONTROLPARENT
+CAPTION "Add E-Mail Address"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ EDITTEXT IDC_EMAIL,5,5,177,12,ES_AUTOHSCROLL
+ DEFPUSHBUTTON "OK",IDOK,36,23,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,102,23,50,14
+END
+
+IDD_DETAILS DIALOGEX 0, 0, 318, 210
+STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CONTROLPARENT
+CAPTION "%s: User Details"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ CONTROL "%s\nView personal user details and more",IDC_HEADERBAR,
+ "MHeaderbarCtrl",0x0,0,0,318,25
+ CONTROL "",IDC_PAGETREE,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_NOTOOLTIPS | TVS_TRACKSELECT | TVS_FULLROWSELECT | TVS_NONEVENHEIGHT | WS_HSCROLL | WS_TABSTOP,3,30,76,176,WS_EX_STATICEDGE
+ CONTROL "Tab1",IDC_TABS,"SysTabControl32",TCS_HOTTRACK | TCS_MULTILINE | WS_TABSTOP,85,29,228,158
+ PUSHBUTTON "Update Now",IDC_UPDATE,85,191,55,14,WS_DISABLED
+ CTEXT "Updating",IDC_UPDATING,145,194,113,8,SS_NOPREFIX | SS_CENTERIMAGE
+ DEFPUSHBUTTON "OK",IDOK,263,191,50,14
+END
+
+IDD_INFO_SUMMARY DIALOGEX 0, 0, 222, 132
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "Nickname:",IDC_STATIC,5,5,46,8
+ EDITTEXT IDC_NICK,51,5,166,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "First name:",IDC_STATIC,5,18,46,8
+ EDITTEXT IDC_FIRSTNAME,51,18,74,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Gender:",IDC_STATIC,126,18,44,8
+ EDITTEXT IDC_GENDER,170,18,47,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Last name:",IDC_STATIC,5,31,46,8
+ EDITTEXT IDC_LASTNAME,51,31,74,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Age:",IDC_STATIC,126,31,44,8
+ EDITTEXT IDC_AGE,170,31,47,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "E-mail:",IDC_STATIC,5,44,46,8
+ CONTROL "",IDC_EMAIL,"Hyperlink",WS_TABSTOP,51,44,166,8
+ LTEXT "Date of birth:",IDC_STATIC,5,58,59,8
+ EDITTEXT IDC_DOBDAY,66,58,8,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ EDITTEXT IDC_DOBMONTH,76,58,16,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ EDITTEXT IDC_DOBYEAR,94,58,20,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Marital status:",IDC_STATIC,5,71,76,8
+ EDITTEXT IDC_MARITAL,83,71,87,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+END
+
+IDD_INFO_CONTACT DIALOGEX 0, 0, 222, 132
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "E-mail:",IDC_STATIC,5,5,212,8
+ CONTROL "List1",IDC_EMAILS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,14,212,50
+ LTEXT "Phone:",IDC_STATIC,5,68,212,8
+ CONTROL "List1",IDC_PHONES,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,77,212,50
+END
+
+IDD_INFO_BACKGROUND DIALOGEX 0, 0, 222, 132
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "Web page:",IDC_STATIC,5,5,44,8
+ CONTROL "",IDC_WEBPAGE,"Hyperlink",WS_TABSTOP,49,5,168,8
+ LTEXT "Past background:",IDC_STATIC,5,18,212,8
+ CONTROL "List1",IDC_PAST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,27,212,44
+ LTEXT "Interests:",IDC_STATIC,5,74,212,8
+ CONTROL "List1",IDC_INTERESTS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,83,212,44
+END
+
+IDD_INFO_NOTES DIALOGEX 0, 0, 222, 132
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "About:",IDC_STATIC,5,5,212,8
+ EDITTEXT IDC_ABOUT,5,13,212,45,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
+ LTEXT "My notes:",IDC_STATIC,5,61,212,8
+ EDITTEXT IDC_MYNOTES,5,69,212,58,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
+END
+
+IDD_INFO_LOCATION DIALOGEX 0, 0, 222, 147
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "Street:",IDC_STATIC,5,5,51,8
+ EDITTEXT IDC_STREET,56,5,161,16,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "City:",IDC_STATIC,5,22,51,8
+ EDITTEXT IDC_CITY,56,22,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "State:",IDC_STATIC,5,33,51,8
+ EDITTEXT IDC_STATE,56,33,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Postal code:",IDC_STATIC,5,44,51,8
+ EDITTEXT IDC_ZIP,56,44,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Country:",IDC_STATIC,5,55,51,8
+ EDITTEXT IDC_COUNTRY,56,55,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Spoken languages:",IDC_STATIC,5,70,51,16
+ EDITTEXT IDC_LANGUAGE1,56,70,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ EDITTEXT IDC_LANGUAGE2,56,78,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ EDITTEXT IDC_LANGUAGE3,56,86,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Timezone:",IDC_STATIC,5,97,51,8
+ EDITTEXT IDC_TIMEZONE,56,97,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Local time:",IDC_STATIC,5,108,51,8
+ EDITTEXT IDC_LOCALTIME,56,108,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ COMBOBOX IDC_TIMEZONESELECT,4,132,214,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Set custom time zone",IDC_STATIC,5,121,212,8
+END
+
+IDD_INFO_WORK DIALOGEX 0, 0, 222, 132
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "Company:",IDC_STATIC,5,5,51,8
+ EDITTEXT IDC_COMPANY,56,5,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Department:",IDC_STATIC,5,17,51,8
+ EDITTEXT IDC_DEPARTMENT,56,17,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Position:",IDC_STATIC,5,28,51,8
+ EDITTEXT IDC_POSITION,56,28,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Street:",IDC_STATIC,5,48,51,8
+ EDITTEXT IDC_STREET,56,48,161,16,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "City:",IDC_STATIC,5,65,51,8
+ EDITTEXT IDC_CITY,56,65,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "State:",IDC_STATIC,5,76,51,8
+ EDITTEXT IDC_STATE,56,76,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Postal code:",IDC_STATIC,5,87,51,8
+ EDITTEXT IDC_ZIP,56,87,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Country:",IDC_STATIC,5,98,51,8
+ EDITTEXT IDC_COUNTRY,56,98,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Website:",IDC_STATIC,5,109,51,8
+ CONTROL "",IDC_WEBPAGE,"Hyperlink",WS_TABSTOP,57,109,160,8
+END
+
+#endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_INFO_CONTACT, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 217
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 127
+ END
+
+ IDD_INFO_BACKGROUND, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 217
+ VERTGUIDE, 49
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 127
+ END
+
+ IDD_INFO_NOTES, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 217
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 127
+ END
+
+ IDD_INFO_LOCATION, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 217
+ VERTGUIDE, 56
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 142
+ HORZGUIDE, 22
+ HORZGUIDE, 33
+ HORZGUIDE, 45
+ HORZGUIDE, 56
+ HORZGUIDE, 70
+ HORZGUIDE, 95
+ HORZGUIDE, 106
+ END
+
+ IDD_INFO_WORK, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 217
+ VERTGUIDE, 56
+ VERTGUIDE, 126
+ VERTGUIDE, 170
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 127
+ HORZGUIDE, 16
+ HORZGUIDE, 27
+ HORZGUIDE, 44
+ HORZGUIDE, 61
+ HORZGUIDE, 72
+ HORZGUIDE, 83
+ HORZGUIDE, 94
+ HORZGUIDE, 105
+ END
+
+ IDD_ADDEMAIL, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 182
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 37
+ END
+
+ IDD_ADDPHONE, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 205
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 86
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "..\..\resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include <windows.h>\r\n"
+ "#include <winres.h>\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
diff --git a/src/modules/userinfo/stdinfo.cpp b/src/core/stduserinfo/stdinfo.cpp
index 42f2b3241d..008f2d0b74 100644
--- a/src/modules/userinfo/stdinfo.cpp
+++ b/src/core/stduserinfo/stdinfo.cpp
@@ -20,7 +20,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "..\..\core\commonheaders.h"
+
+#include "commonheaders.h"
INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -35,10 +36,10 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
static int Proto_GetContactInfoSetting(HANDLE hContact, const char *szProto, const char *szModule, const char *szSetting, DBVARIANT *dbv, const int nType)
{
- DBCONTACTGETSETTING cgs={szModule, szSetting, dbv};
- dbv->type=(BYTE)nType;
+ DBCONTACTGETSETTING cgs = {szModule, szSetting, dbv};
+ dbv->type = (BYTE)nType;
- return CallProtoServiceInt(NULL,szProto, PS_GETINFOSETTING, (WPARAM)hContact, (LPARAM)&cgs);
+ return CallProtoService(szProto, PS_GETINFOSETTING, (WPARAM)hContact, (LPARAM)&cgs);
}
static void Proto_FreeInfoVariant(DBVARIANT *dbv)
@@ -49,17 +50,17 @@ static void Proto_FreeInfoVariant(DBVARIANT *dbv)
case DBVT_WCHAR:
{
mir_free(dbv->pszVal);
- dbv->pszVal=0;
+ dbv->pszVal = 0;
break;
}
case DBVT_BLOB:
{
mir_free(dbv->pbVal);
- dbv->pbVal=0;
+ dbv->pbVal = 0;
break;
}
}
- dbv->type=0;
+ dbv->type = 0;
}
static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule, char *szSetting, int special)
@@ -67,39 +68,39 @@ static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule,
DBVARIANT dbv = { 0 };
char str[80], *pstr = NULL;
TCHAR* ptstr = NULL;
- int unspecified=0;
+ int unspecified = 0;
char* szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- bool proto_service = szProto && (CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC);
+ bool proto_service = szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC);
- dbv.type=DBVT_DELETED;
- if (szModule == NULL) unspecified=1;
- else if (proto_service) unspecified=Proto_GetContactInfoSetting(hContact, szProto, szModule, szSetting, &dbv, 0);
- else unspecified=DBGetContactSettingW(hContact, szModule, szSetting, &dbv);
+ dbv.type = DBVT_DELETED;
+ if (szModule == NULL) unspecified = 1;
+ else if (proto_service) unspecified = Proto_GetContactInfoSetting(hContact, szProto, szModule, szSetting, &dbv, 0);
+ else unspecified = DBGetContactSettingW(hContact, szModule, szSetting, &dbv);
if ( !unspecified) {
switch(dbv.type) {
case DBVT_BYTE:
if (special == SVS_GENDER) {
- if (dbv.cVal == 'M') ptstr=TranslateT("Male");
- else if (dbv.cVal == 'F') ptstr=TranslateT("Female");
- else unspecified=1;
+ if (dbv.cVal == 'M') ptstr = TranslateT("Male");
+ else if (dbv.cVal == 'F') ptstr = TranslateT("Female");
+ else unspecified = 1;
}
else if (special == SVS_MONTH) {
- if (dbv.bVal>0 && dbv.bVal<=12) {
- pstr=str;
+ if (dbv.bVal>0 && dbv.bVal <= 12) {
+ pstr = str;
GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SABBREVMONTHNAME1-1+dbv.bVal, str, SIZEOF(str));
}
- else unspecified=1;
+ else unspecified = 1;
}
else if (special == SVS_TIMEZONE) {
- if (dbv.cVal == -100) unspecified=1;
+ if (dbv.cVal == -100) unspecified = 1;
else {
- pstr=str;
+ pstr = str;
mir_snprintf(str, SIZEOF(str), dbv.cVal?"UTC%+d:%02d":"UTC", -dbv.cVal/2, (dbv.cVal&1)*30);
}
}
else {
- unspecified=(special == SVS_ZEROISUNSPEC && dbv.bVal == 0);
- pstr=_itoa(special == SVS_SIGNED?dbv.cVal:dbv.bVal, str, 10);
+ unspecified = (special == SVS_ZEROISUNSPEC && dbv.bVal == 0);
+ pstr = _itoa(special == SVS_SIGNED?dbv.cVal:dbv.bVal, str, 10);
}
break;
case DBVT_WORD:
@@ -116,29 +117,29 @@ static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule,
}
pstr = Translate((char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, wSave, 0));
- unspecified=pstr == NULL;
+ unspecified = pstr == NULL;
}
else {
- unspecified=(special == SVS_ZEROISUNSPEC && dbv.wVal == 0);
- pstr=_itoa(special == SVS_SIGNED?dbv.sVal:dbv.wVal, str, 10);
+ unspecified = (special == SVS_ZEROISUNSPEC && dbv.wVal == 0);
+ pstr = _itoa(special == SVS_SIGNED?dbv.sVal:dbv.wVal, str, 10);
}
break;
case DBVT_DWORD:
- unspecified=(special == SVS_ZEROISUNSPEC && dbv.dVal == 0);
+ unspecified = (special == SVS_ZEROISUNSPEC && dbv.dVal == 0);
if (special == SVS_IP) {
struct in_addr ia;
- ia.S_un.S_addr=htonl(dbv.dVal);
- pstr=inet_ntoa(ia);
- if (dbv.dVal == 0) unspecified=1;
+ ia.S_un.S_addr = htonl(dbv.dVal);
+ pstr = inet_ntoa(ia);
+ if (dbv.dVal == 0) unspecified = 1;
}
- else pstr=_itoa(special == SVS_SIGNED?dbv.lVal:dbv.dVal, str, 10);
+ else pstr = _itoa(special == SVS_SIGNED?dbv.lVal:dbv.dVal, str, 10);
break;
case DBVT_ASCIIZ:
- unspecified=(special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
- pstr=dbv.pszVal;
+ unspecified = (special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
+ pstr = dbv.pszVal;
break;
case DBVT_UTF8:
- unspecified=(special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
+ unspecified = (special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
if ( !unspecified)
{ WCHAR* wszStr;
Utf8Decode(dbv.pszVal, &wszStr);
@@ -147,10 +148,10 @@ static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule,
goto LBL_Exit;
}
- pstr=dbv.pszVal;
+ pstr = dbv.pszVal;
Utf8Decode(dbv.pszVal, NULL);
break;
- default: pstr=str; lstrcpyA(str, "???"); break;
+ default: pstr = str; lstrcpyA(str, "???"); break;
} }
if (unspecified)
@@ -182,9 +183,9 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case 0:
if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED)
{ char *szProto;
- HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) break;
SetValue(hwndDlg, IDC_NICK, hContact, szProto, "Nick", 0);
SetValue(hwndDlg, IDC_FIRSTNAME, hContact, szProto, "FirstName", 0);
@@ -258,9 +259,9 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
case 0:
if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED)
{ char *szProto;
- HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) break;
SetValue(hwndDlg, IDC_STREET, hContact, szProto, "Street", SVS_ZEROISUNSPEC);
SetValue(hwndDlg, IDC_CITY, hContact, szProto, "City", SVS_ZEROISUNSPEC);
@@ -306,9 +307,9 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case 0:
if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED)
{ char *szProto;
- HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) break;
SetValue(hwndDlg, IDC_COMPANY, hContact, szProto, "Company", SVS_ZEROISUNSPEC);
SetValue(hwndDlg, IDC_DEPARTMENT, hContact, szProto, "CompanyDepartment", SVS_ZEROISUNSPEC);
@@ -360,11 +361,11 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
RECT rc;
GetClientRect(GetDlgItem(hwndDlg, IDC_PAST), &rc);
rc.right-=GetSystemMetrics(SM_CXVSCROLL);
- lvc.mask=LVCF_WIDTH;
- lvc.cx=rc.right/3;
+ lvc.mask = LVCF_WIDTH;
+ lvc.cx = rc.right/3;
ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PAST), 0, &lvc);
ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_INTERESTS), 0, &lvc);
- lvc.cx=rc.right-rc.right/3;
+ lvc.cx = rc.right-rc.right/3;
ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PAST), 1, &lvc);
ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_INTERESTS), 1, &lvc);
}
@@ -380,19 +381,19 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
int i;
char idstr[33];
DBVARIANT dbv, dbvText;
- HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) break;
- bool proto_service = (CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC) == PF4_INFOSETTINGSVC;
+ bool proto_service = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC) == PF4_INFOSETTINGSVC;
SetValue(hwndDlg, IDC_WEBPAGE, hContact, szProto, "Homepage", SVS_ZEROISUNSPEC);
//past
ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_PAST));
- lvi.mask=LVIF_TEXT;
- lvi.iSubItem=0;
- lvi.iItem=0;
+ lvi.mask = LVIF_TEXT;
+ lvi.iSubItem = 0;
+ lvi.iItem = 0;
for (i=0;;i++) {
mir_snprintf(idstr, SIZEOF(idstr), "Past%d", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
@@ -401,7 +402,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
mir_snprintf(idstr, SIZEOF(idstr), "Past%dText", i);
if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else DBFreeVariant(&dbv); break;}
- lvi.pszText=dbv.ptszVal;
+ lvi.pszText = dbv.ptszVal;
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PAST), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PAST), lvi.iItem, 1, dbvText.ptszVal);
DBFreeVariant(&dbvText);
@@ -420,7 +421,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%dText", i);
if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else DBFreeVariant(&dbv); break;}
- lvi.pszText=dbv.ptszVal;
+ lvi.pszText = dbv.ptszVal;
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PAST), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PAST), lvi.iItem, 1, dbvText.ptszVal);
DBFreeVariant(&dbvText);
@@ -435,9 +436,9 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
//interests
ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_INTERESTS));
- lvi.mask=LVIF_TEXT;
- lvi.iSubItem=0;
- lvi.iItem=0;
+ lvi.mask = LVIF_TEXT;
+ lvi.iSubItem = 0;
+ lvi.iItem = 0;
for (i=0;;i++) {
mir_snprintf(idstr, SIZEOF(idstr), "Interest%dCat", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
@@ -446,7 +447,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
mir_snprintf(idstr, SIZEOF(idstr), "Interest%dText", i);
if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else DBFreeVariant(&dbv); break;}
- lvi.pszText=dbv.ptszVal;
+ lvi.pszText = dbv.ptszVal;
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_INTERESTS), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_INTERESTS), lvi.iItem, 1, dbvText.ptszVal);
DBFreeVariant(&dbvText);
@@ -520,16 +521,16 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
{ char *szProto;
- HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) break;
SetValue(hwndDlg, IDC_ABOUT, hContact, szProto, "About", 0);
}
break;
}
case PSN_APPLY:
- { HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ { HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MYNOTES))) {
char text[2048];
GetDlgItemTextA(hwndDlg, IDC_MYNOTES, text, SIZEOF(text));
@@ -560,14 +561,13 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
int DetailsInit(WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE odp;
-
- if ((HANDLE)lParam == NULL)
+ if (lParam == NULL)
return 0;
if (CallService(MS_PROTO_GETCONTACTBASEPROTO, lParam, 0) == 0)
return 0;
+ OPTIONSDIALOGPAGE odp;
odp.cbSize = sizeof(odp);
odp.hIcon = NULL;
odp.hInstance = hInst;
diff --git a/src/core/stduserinfo/stduserinfo_10.vcxproj b/src/core/stduserinfo/stduserinfo_10.vcxproj
new file mode 100644
index 0000000000..af6d086e6d
--- /dev/null
+++ b/src/core/stduserinfo/stduserinfo_10.vcxproj
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>stduserinfo</ProjectName>
+ <ProjectGuid>{1C856B14-54CD-4D07-B18B-5F7DB073AB51}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Core\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Core\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Core\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Core\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>..\..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ADDCONTACTPLUS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <WarningLevel>Level3</WarningLevel>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\..\include\msapi;..\..\..\include</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <BaseAddress>0x3ae00000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <SubSystem>Windows</SubSystem>
+ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ADDCONTACTPLUS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>false</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\..\include\msapi;..\..\..\include</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <BaseAddress>0x3ae00000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <SubSystem>Windows</SubSystem>
+ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>..\..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;ADDCONTACTPLUS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <WarningLevel>Level3</WarningLevel>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\..\include\msapi;..\..\..\include</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <BaseAddress>0x3ae00000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <SubSystem>Windows</SubSystem>
+ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;ADDCONTACTPLUS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>false</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <WarningLevel>Level3</WarningLevel>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\..\include\msapi;..\..\..\include</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <BaseAddress>0x3ae00000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <SubSystem>Windows</SubSystem>
+ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="commonheaders.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="contactinfo.cpp" />
+ <ClCompile Include="main.cpp" />
+ <ClCompile Include="stdinfo.cpp" />
+ <ClCompile Include="userinfo.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\stdplug.h" />
+ <ClInclude Include="commonheaders.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="resource.rc" />
+ <ResourceCompile Include="version.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/core/stduserinfo/stduserinfo_10.vcxproj.filters b/src/core/stduserinfo/stduserinfo_10.vcxproj.filters
new file mode 100644
index 0000000000..ac101b1384
--- /dev/null
+++ b/src/core/stduserinfo/stduserinfo_10.vcxproj.filters
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{5c074c9e-6c66-4233-bbd3-a50170fccf47}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{e30af2c4-42d4-4342-8eb9-2dbca157c6bb}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{9208a050-ffae-47fa-bc98-4ca4f79d37d7}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="commonheaders.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="contactinfo.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="main.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="stdinfo.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="userinfo.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\stdplug.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="commonheaders.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="version.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="resource.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/src/modules/userinfo/userinfo.cpp b/src/core/stduserinfo/userinfo.cpp
index 237c1bdee5..a36c134106 100644
--- a/src/modules/userinfo/userinfo.cpp
+++ b/src/core/stduserinfo/userinfo.cpp
@@ -20,12 +20,14 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "..\..\core\commonheaders.h"
+
+#include "commonheaders.h"
+
#define UPDATEANIMFRAMES 20
int DetailsInit(WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-static HANDLE hWindowList=NULL;
+static HANDLE hWindowList = NULL;
static HANDLE hDetailsInitEvent;
struct DetailsPageInit {
@@ -79,14 +81,14 @@ static INT_PTR ShowDetailsDialogCommand(WPARAM wParam, LPARAM)
struct DetailsPageInit opi;
int i;
- if (hwnd=WindowList_Find(hWindowList, (HANDLE)wParam)) {
+ if (hwnd = WindowList_Find(hWindowList, (HANDLE)wParam)) {
SetForegroundWindow(hwnd);
SetFocus(hwnd);
return 0;
}
- opi.pageCount=0;
- opi.odp=NULL;
+ opi.pageCount = 0;
+ opi.odp = NULL;
NotifyEventHooks(hDetailsInitEvent, (WPARAM)&opi, wParam);
if (opi.pageCount == 0) return 0;
qsort(opi.odp, opi.pageCount, sizeof(OPTIONSDIALOGPAGE), (int (*)(const void*, const void*))PageSortProc);
@@ -114,14 +116,14 @@ static INT_PTR ShowDetailsDialogCommand(WPARAM wParam, LPARAM)
static INT_PTR AddDetailsPage(WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE *odp=(OPTIONSDIALOGPAGE*)lParam, *dst;
- struct DetailsPageInit *opi=(struct DetailsPageInit*)wParam;
+ OPTIONSDIALOGPAGE *odp = (OPTIONSDIALOGPAGE*)lParam, *dst;
+ struct DetailsPageInit *opi = (struct DetailsPageInit*)wParam;
if (odp == NULL || opi == NULL) return 1;
- if (odp->cbSize != sizeof(OPTIONSDIALOGPAGE) && odp->cbSize != OPTIONPAGE_OLD_SIZE)
+ if (odp->cbSize != sizeof(OPTIONSDIALOGPAGE))
return 1;
- opi->odp=(OPTIONSDIALOGPAGE*)mir_realloc(opi->odp, sizeof(OPTIONSDIALOGPAGE)*(opi->pageCount+1));
+ opi->odp = (OPTIONSDIALOGPAGE*)mir_realloc(opi->odp, sizeof(OPTIONSDIALOGPAGE)*(opi->pageCount+1));
dst = opi->odp + opi->pageCount;
dst->cbSize = sizeof(OPTIONSDIALOGPAGE);
dst->hInstance = odp->hInstance;
@@ -165,7 +167,7 @@ static void ThemeDialogBackground(HWND hwnd)
static void CreateDetailsTabs(HWND hwndDlg, struct DetailsData* dat, struct DetailsPageData* ppg)
{
HWND hwndTab = GetDlgItem(hwndDlg, IDC_TABS);
- int i, sel=0, pages=0;
+ int i, sel = 0, pages = 0;
TCITEM tie;
tie.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
tie.iImage = -1;
@@ -189,7 +191,7 @@ static void CreateDetailsTabs(HWND hwndDlg, struct DetailsData* dat, struct Deta
static void CreateDetailsPageWindow(HWND hwndDlg, struct DetailsData* dat, struct DetailsPageData* ppg)
{
RECT *rc = ppg->ptszTab ? &dat->rcDisplayTab : &dat->rcDisplay;
- ppg->hwnd=CreateDialogIndirectParam(ppg->hInst, ppg->pTemplate, hwndDlg, ppg->dlgProc, (LPARAM)dat->hContact);
+ ppg->hwnd = CreateDialogIndirectParam(ppg->hInst, ppg->pTemplate, hwndDlg, ppg->dlgProc, (LPARAM)dat->hContact);
ThemeDialogBackground(ppg->hwnd);
SetWindowPos(ppg->hwnd, HWND_TOP, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, 0);
SetWindowPos(ppg->hwnd, HWND_TOP, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, 0);
@@ -201,10 +203,10 @@ static void CreateDetailsPageWindow(HWND hwndDlg, struct DetailsData* dat, struc
pshn.lParam = (LPARAM)ppg->dlgParam;
SendMessage(ppg->hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
- pshn.hdr.code=PSN_INFOCHANGED;
- pshn.hdr.hwndFrom=ppg->hwnd;
- pshn.hdr.idFrom=0;
- pshn.lParam=(LPARAM)dat->hContact;
+ pshn.hdr.code = PSN_INFOCHANGED;
+ pshn.hdr.hwndFrom = ppg->hwnd;
+ pshn.hdr.idFrom = 0;
+ pshn.lParam = (LPARAM)dat->hContact;
SendMessage(ppg->hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
}
}
@@ -212,7 +214,7 @@ static void CreateDetailsPageWindow(HWND hwndDlg, struct DetailsData* dat, struc
static int UserInfoContactDelete(WPARAM wParam, LPARAM)
{
HWND hwnd;
- hwnd=WindowList_Find(hWindowList, (HANDLE)wParam);
+ hwnd = WindowList_Find(hWindowList, (HANDLE)wParam);
if (hwnd != NULL) DestroyWindow(hwnd);
return 0;
}
@@ -221,7 +223,7 @@ static int UserInfoContactDelete(WPARAM wParam, LPARAM)
#define M_CHECKONLINE (WM_USER+11)
static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct DetailsData *dat =(struct DetailsData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ struct DetailsData *dat = (struct DetailsData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
@@ -239,7 +241,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (dat->hContact == NULL)
name = TranslateT("Owner");
else
- name = cli.pfnGetContactDisplayName(dat->hContact, 0);
+ name = pcli->pfnGetContactDisplayName(dat->hContact, 0);
GetWindowText(hwndDlg, oldTitle, SIZEOF(oldTitle));
mir_sntprintf(newTitle, SIZEOF(newTitle), oldTitle, name);
@@ -250,10 +252,10 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SetDlgItemText(hwndDlg, IDC_HEADERBAR, newTitle);
}
{ LOGFONT lf;
- HFONT hNormalFont=(HFONT)SendDlgItemMessage(hwndDlg, IDC_NAME, WM_GETFONT, 0, 0);
+ HFONT hNormalFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_NAME, WM_GETFONT, 0, 0);
GetObject(hNormalFont, sizeof(lf), &lf);
- lf.lfWeight=FW_BOLD;
- dat->hBoldFont=CreateFontIndirect(&lf);
+ lf.lfWeight = FW_BOLD;
+ dat->hBoldFont = CreateFontIndirect(&lf);
SendDlgItemMessage(hwndDlg, IDC_NAME, WM_SETFONT, (WPARAM)dat->hBoldFont, 0);
}
{ OPTIONSDIALOGPAGE *odp;
@@ -311,7 +313,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
GetWindowRect(hwndTab, &dat->rcDisplayTab);
TabCtrl_AdjustRect(hwndTab, FALSE, &dat->rcDisplayTab);
- { POINT pt={0, 0};
+ { POINT pt = {0, 0};
ClientToScreen(hwndDlg, &pt);
OffsetRect(&dat->rcDisplayTab, -pt.x, -pt.y);
}
@@ -320,7 +322,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
GetWindowRect(hwndTab, &dat->rcDisplay);
TabCtrl_AdjustRect(hwndTab, FALSE, &dat->rcDisplay);
- { POINT pt={0, 0};
+ { POINT pt = {0, 0};
ClientToScreen(hwndDlg, &pt);
OffsetRect(&dat->rcDisplay, -pt.x, -pt.y);
} }
@@ -345,7 +347,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TCHAR str[128];
mir_sntprintf(str, SIZEOF(str), _T("%.*s%s%.*s"), dat->updateAnimFrame%10, _T("........."), dat->szUpdating, dat->updateAnimFrame%10, _T("........."));
SetDlgItemText(hwndDlg, IDC_UPDATING, str);
- if (++dat->updateAnimFrame == UPDATEANIMFRAMES) dat->updateAnimFrame=0;
+ if (++dat->updateAnimFrame == UPDATEANIMFRAMES) dat->updateAnimFrame = 0;
break;
}
case WM_CTLCOLORSTATIC:
@@ -357,10 +359,10 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
COLORREF textCol, bgCol, newCol;
int ratio;
- textCol=GetSysColor(COLOR_BTNTEXT);
- bgCol=GetSysColor(COLOR_3DFACE);
- ratio=abs(UPDATEANIMFRAMES/2-dat->updateAnimFrame)*510/UPDATEANIMFRAMES;
- newCol=RGB(GetRValue(bgCol)+(GetRValue(textCol)-GetRValue(bgCol))*ratio/256,
+ textCol = GetSysColor(COLOR_BTNTEXT);
+ bgCol = GetSysColor(COLOR_3DFACE);
+ ratio = abs(UPDATEANIMFRAMES/2-dat->updateAnimFrame)*510/UPDATEANIMFRAMES;
+ newCol = RGB(GetRValue(bgCol)+(GetRValue(textCol)-GetRValue(bgCol))*ratio/256,
GetGValue(bgCol)+(GetGValue(textCol)-GetGValue(bgCol))*ratio/256,
GetBValue(bgCol)+(GetBValue(textCol)-GetBValue(bgCol))*ratio/256);
SetTextColor((HDC)wParam, newCol);
@@ -374,18 +376,18 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case PSM_CHANGED:
- dat->opd[dat->currentPage].changed=1;
+ dat->opd[dat->currentPage].changed = 1;
return TRUE;
case PSM_FORCECHANGED:
{
int i;
PSHNOTIFY pshn;
- pshn.hdr.code=PSN_INFOCHANGED;
- pshn.hdr.idFrom=0;
- pshn.lParam=(LPARAM)dat->hContact;
+ pshn.hdr.code = PSN_INFOCHANGED;
+ pshn.hdr.idFrom = 0;
+ pshn.lParam = (LPARAM)dat->hContact;
for (i=0;i<dat->pageCount;i++) {
- pshn.hdr.hwndFrom=dat->opd[i].hwnd;
+ pshn.hdr.hwndFrom = dat->opd[i].hwnd;
if (dat->opd[i].hwnd != NULL)
SendMessage(dat->opd[i].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
}
@@ -395,16 +397,16 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
char *szProto;
if (dat->hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
if (szProto == NULL) {EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE); break;}
- if (CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0)<ID_STATUS_ONLINE) EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE);
+ if (CallProtoService(szProto, PS_GETSTATUS, 0, 0)<ID_STATUS_ONLINE) EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE);
else EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), !IsWindowVisible(GetDlgItem(hwndDlg, IDC_UPDATING)));
}
break;
}
case HM_PROTOACK:
{
- ACKDATA *ack=(ACKDATA*)lParam;
+ ACKDATA *ack = (ACKDATA*)lParam;
int i;
if (ack->hContact == NULL && ack->type == ACKTYPE_STATUS) {
@@ -421,8 +423,8 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendMessage(hwndDlg, M_CHECKONLINE, 0, 0);
break;
} //if
- if (dat->infosUpdated == NULL) dat->infosUpdated=(int*)mir_calloc(sizeof(int)*(INT_PTR)ack->hProcess);
- if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED) dat->infosUpdated[ack->lParam]=1;
+ if (dat->infosUpdated == NULL) dat->infosUpdated = (int*)mir_calloc(sizeof(int)*(INT_PTR)ack->hProcess);
+ if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED) dat->infosUpdated[ack->lParam] = 1;
for (i=0;i<(int)ack->hProcess;i++)
if (dat->infosUpdated[i] == 0) break;
if (i == (int)ack->hProcess) {
@@ -436,19 +438,16 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
switch(wParam) {
case IDC_TABS:
case IDC_PAGETREE:
- switch(((LPNMHDR)lParam)->code)
- {
+ switch(((LPNMHDR)lParam)->code) {
case TCN_SELCHANGING:
case TVN_SELCHANGING:
- if (dat->currentPage != -1 && dat->opd[dat->currentPage].hwnd != NULL)
- {
+ if (dat->currentPage != -1 && dat->opd[dat->currentPage].hwnd != NULL) {
PSHNOTIFY pshn;
pshn.hdr.code = PSN_KILLACTIVE;
pshn.hdr.hwndFrom = dat->opd[dat->currentPage].hwnd;
pshn.hdr.idFrom = 0;
pshn.lParam = (LPARAM)dat->hContact;
- if (SendMessage(dat->opd[dat->currentPage].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn))
- {
+ if (SendMessage(dat->opd[dat->currentPage].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn)) {
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, TRUE);
return TRUE;
}
@@ -456,8 +455,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case TCN_SELCHANGE:
- if (dat->currentPage != -1 && dat->opd[dat->currentPage].hwnd != NULL)
- {
+ if (dat->currentPage != -1 && dat->opd[dat->currentPage].hwnd != NULL) {
HWND hwndTab = GetDlgItem(hwndDlg, IDC_TABS);
ShowWindow(dat->opd[dat->currentPage].hwnd, SW_HIDE);
@@ -473,8 +471,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
tvi.lParam = dat->currentPage;
TreeView_SetItem(GetDlgItem(hwndDlg, IDC_PAGETREE), &tvi);
- if (dat->currentPage != -1)
- {
+ if (dat->currentPage != -1) {
if (dat->opd[dat->currentPage].hwnd == NULL)
CreateDetailsPageWindow(hwndDlg, dat, &dat->opd[dat->currentPage]);
ShowWindow(dat->opd[dat->currentPage].hwnd, SW_SHOWNA);
@@ -485,14 +482,12 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case TVN_SELCHANGED:
if (dat->currentPage != -1 && dat->opd[dat->currentPage].hwnd != NULL)
ShowWindow(dat->opd[dat->currentPage].hwnd, SW_HIDE);
-
{
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW) lParam;
TVITEM tvi = pnmtv->itemNew;
dat->currentPage = tvi.lParam;
- if (dat->currentPage != -1)
- {
+ if (dat->currentPage != -1) {
CreateDetailsTabs(hwndDlg, dat, &dat->opd[dat->currentPage]);
if (dat->opd[dat->currentPage].hwnd == NULL)
CreateDetailsPageWindow(hwndDlg, dat, &dat->opd[dat->currentPage]);
@@ -509,50 +504,50 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDCANCEL:
- {
- int i;
- PSHNOTIFY pshn;
- pshn.hdr.idFrom=0;
- pshn.lParam=(LPARAM)dat->hContact;
- pshn.hdr.code=PSN_RESET;
- for (i=0;i<dat->pageCount;i++) {
- if (dat->opd[i].hwnd == NULL || !dat->opd[i].changed) continue;
- pshn.hdr.hwndFrom=dat->opd[i].hwnd;
- SendMessage(dat->opd[i].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
+ {
+ PSHNOTIFY pshn;
+ pshn.hdr.idFrom = 0;
+ pshn.lParam = (LPARAM)dat->hContact;
+ pshn.hdr.code = PSN_RESET;
+ for (int i=0; i < dat->pageCount; i++) {
+ if (dat->opd[i].hwnd == NULL || !dat->opd[i].changed) continue;
+ pshn.hdr.hwndFrom = dat->opd[i].hwnd;
+ SendMessage(dat->opd[i].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
+ }
+ DestroyWindow(hwndDlg);
}
- DestroyWindow(hwndDlg);
break;
- }
+
case IDOK:
- {
- int i;
- PSHNOTIFY pshn;
- pshn.hdr.idFrom=0;
- pshn.lParam=(LPARAM)dat->hContact;
- if (dat->currentPage != -1) {
- pshn.hdr.code=PSN_KILLACTIVE;
- pshn.hdr.hwndFrom=dat->opd[dat->currentPage].hwnd;
- if (SendMessage(dat->opd[dat->currentPage].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn))
- break;
- }
+ {
+ PSHNOTIFY pshn;
+ pshn.hdr.idFrom = 0;
+ pshn.lParam = (LPARAM)dat->hContact;
+ if (dat->currentPage != -1) {
+ pshn.hdr.code = PSN_KILLACTIVE;
+ pshn.hdr.hwndFrom = dat->opd[dat->currentPage].hwnd;
+ if (SendMessage(dat->opd[dat->currentPage].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn))
+ break;
+ }
- pshn.hdr.code=PSN_APPLY;
- for (i=0;i<dat->pageCount;i++) {
- if (dat->opd[i].hwnd == NULL || !dat->opd[i].changed) continue;
- pshn.hdr.hwndFrom=dat->opd[i].hwnd;
- if (SendMessage(dat->opd[i].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn) == PSNRET_INVALID_NOCHANGEPAGE) {
- TreeView_Select(GetDlgItem(hwndDlg, IDC_PAGETREE), dat->opd[i].hItem, TVGN_CARET);
- if (dat->currentPage != -1) ShowWindow(dat->opd[dat->currentPage].hwnd, SW_HIDE);
- dat->currentPage=i;
- ShowWindow(dat->opd[dat->currentPage].hwnd, SW_SHOW);
- return 0;
+ pshn.hdr.code = PSN_APPLY;
+ for (int i=0; i < dat->pageCount;i++) {
+ if (dat->opd[i].hwnd == NULL || !dat->opd[i].changed) continue;
+ pshn.hdr.hwndFrom = dat->opd[i].hwnd;
+ if (SendMessage(dat->opd[i].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn) == PSNRET_INVALID_NOCHANGEPAGE) {
+ TreeView_Select(GetDlgItem(hwndDlg, IDC_PAGETREE), dat->opd[i].hItem, TVGN_CARET);
+ if (dat->currentPage != -1) ShowWindow(dat->opd[dat->currentPage].hwnd, SW_HIDE);
+ dat->currentPage = i;
+ ShowWindow(dat->opd[dat->currentPage].hwnd, SW_SHOW);
+ return 0;
+ }
}
+ DestroyWindow(hwndDlg);
}
- DestroyWindow(hwndDlg);
break;
- }
+
case IDC_UPDATE:
- if (dat->infosUpdated != NULL) {mir_free(dat->infosUpdated); dat->infosUpdated=NULL;}
+ if (dat->infosUpdated != NULL) {mir_free(dat->infosUpdated); dat->infosUpdated = NULL;}
if (dat->hContact != NULL) {
if ( !CallContactService(dat->hContact, PSS_GETINFO, 0, 0)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE);
@@ -574,8 +569,8 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TVITEM tvi;
tvi.mask = TVIF_TEXT;
tvi.hItem = dat->opd[dat->currentPage].hItem;
- tvi.pszText=name;
- tvi.cchTextMax=SIZEOF(name);
+ tvi.pszText = name;
+ tvi.cchTextMax = SIZEOF(name);
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_PAGETREE), &tvi);
DBWriteContactSettingTString(NULL, "UserInfo", "LastTab", name);
}
@@ -584,9 +579,8 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
DeleteObject(dat->hBoldFont);
WindowList_Remove(hWindowList, hwndDlg);
UnhookEvent(dat->hProtoAckEvent);
- { int i;
- for (i=0;i<dat->pageCount;i++)
- {
+ {
+ for (int i=0; i < dat->pageCount; i++) {
if (dat->opd[i].hwnd != NULL) DestroyWindow(dat->opd[i].hwnd);
mir_free(dat->opd[i].ptszTitle);
mir_free(dat->opd[i].ptszTab);
@@ -600,7 +594,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
return FALSE;
}
-int ShutdownUserInfo(WPARAM, LPARAM)
+static int ShutdownUserInfo(WPARAM, LPARAM)
{
WindowList_BroadcastAsync(hWindowList, WM_DESTROY, 0, 0);
return 0;
@@ -608,15 +602,16 @@ int ShutdownUserInfo(WPARAM, LPARAM)
int LoadUserInfoModule(void)
{
- CLISTMENUITEM mi = { 0 };
-
+ CreateServiceFunction("UserInfo/AddPage", AddDetailsPage);
CreateServiceFunction(MS_USERINFO_SHOWDIALOG, ShowDetailsDialogCommand);
- hDetailsInitEvent=CreateHookableEvent(ME_USERINFO_INITIALISE);
+
+ hDetailsInitEvent = CreateHookableEvent(ME_USERINFO_INITIALISE);
+
HookEvent(ME_USERINFO_INITIALISE, DetailsInit);
HookEvent(ME_DB_CONTACT_DELETED, UserInfoContactDelete);
HookEvent(ME_SYSTEM_PRESHUTDOWN, ShutdownUserInfo);
- CreateServiceFunction("UserInfo/AddPage", AddDetailsPage);
+ CLISTMENUITEM mi = { 0 };
mi.cbSize = sizeof(mi);
mi.flags = CMIF_ICONFROMICOLIB;
mi.position = 1000050000;
diff --git a/src/core/stduserinfo/version.h b/src/core/stduserinfo/version.h
new file mode 100644
index 0000000000..b9df9bad73
--- /dev/null
+++ b/src/core/stduserinfo/version.h
@@ -0,0 +1,14 @@
+
+#include <m_version.h>
+
+#define __FILEVERSION_STRING MIRANDA_VERSION_FILEVERSION
+#define __VERSION_STRING MIRANDA_VERSION_STRING
+
+#define __PLUGIN_NAME "stduserinfo"
+#define __INTERNAL_NAME "stduserinfo"
+#define __FILENAME "stduserinfo.dll"
+#define __DESCRIPTION "Core module for providing user information."
+#define __AUTHOR "Myranda team"
+#define __AUTHOREMAIL ""
+#define __AUTHORWEB "http://nightly.miranda.im"
+#define __COPYRIGHT "© 2012 Myranda team"
diff --git a/src/core/stduserinfo/version.rc b/src/core/stduserinfo/version.rc
new file mode 100644
index 0000000000..e637f0cb33
--- /dev/null
+++ b/src/core/stduserinfo/version.rc
@@ -0,0 +1,38 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "afxres.h"
+#include "version.h"
+
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#endif //_WIN32
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION __FILEVERSION_STRING
+ PRODUCTVERSION __FILEVERSION_STRING
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x0L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "FileDescription", __DESCRIPTION
+ VALUE "InternalName", __PLUGIN_NAME
+ VALUE "LegalCopyright", __COPYRIGHT
+ VALUE "OriginalFilename", __FILENAME
+ VALUE "ProductName", __PLUGIN_NAME
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
diff --git a/src/miranda32.def b/src/miranda32.def
index 667800545c..c36a1b6fc4 100644
--- a/src/miranda32.def
+++ b/src/miranda32.def
@@ -1,6 +1,18 @@
EXPORTS
-CallContactService @1
-CallProtoService @2
-RecalculateTime @3
-
+CallContactService @1
+CallProtoService @2
+RecalculateTime @3
+LoadSkinProtoIcon @4
+LoadSkinIcon @5
+Button_FreeIcon_IcoLib @6
+Button_SetIcon_IcoLib @7
+GetSkinIconHandle @8
+IcoLib_AddNewIcon @9
+IcoLib_GetIcon @10
+IcoLib_GetIconByHandle @11
+IcoLib_IsManaged @12
+IcoLib_ReleaseIcon @13
+Window_FreeIcon_IcoLib @14
+Window_SetIcon_IcoLib @15
+Window_SetProtoIcon_IcoLib @16
diff --git a/src/miranda32_10.vcxproj b/src/miranda32_10.vcxproj
index 31d08d7b3c..852acd97b5 100644
--- a/src/miranda32_10.vcxproj
+++ b/src/miranda32_10.vcxproj
@@ -250,6 +250,7 @@
<ClInclude Include="..\include\win2k.h" />
<ClInclude Include="core\commonheaders.h" />
<ClInclude Include="core\miranda.h" />
+ <ClInclude Include="core\stdplug.h" />
<ClInclude Include="modules\database\profilemanager.h" />
<ClInclude Include="modules\findadd\findadd.h" />
<ClInclude Include="modules\json\internalJSONNode.h" />
@@ -503,15 +504,6 @@
<ClCompile Include="modules\updatenotify\updatenotify.cpp">
<PrecompiledHeaderFile>..\..\core\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="modules\userinfo\contactinfo.cpp">
- <PrecompiledHeaderFile>..\..\core\commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="modules\userinfo\stdinfo.cpp">
- <PrecompiledHeaderFile>..\..\core\commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="modules\userinfo\userinfo.cpp">
- <PrecompiledHeaderFile>..\..\core\commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
<ClCompile Include="modules\useronline\useronline.cpp">
<PrecompiledHeaderFile>..\..\core\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
diff --git a/src/miranda32_10.vcxproj.filters b/src/miranda32_10.vcxproj.filters
index 1edbf008b5..7e4c8a431e 100644
--- a/src/miranda32_10.vcxproj.filters
+++ b/src/miranda32_10.vcxproj.filters
@@ -76,9 +76,6 @@
<Filter Include="Modules\updater">
<UniqueIdentifier>{9074e889-f17c-4c90-a3cf-1cfb2e513491}</UniqueIdentifier>
</Filter>
- <Filter Include="Modules\userinfo">
- <UniqueIdentifier>{34172b4f-5cec-4166-8610-1537127749d9}</UniqueIdentifier>
- </Filter>
<Filter Include="Modules\useronline">
<UniqueIdentifier>{daa4af16-7ada-4bd5-92bb-59f5ab815e9c}</UniqueIdentifier>
</Filter>
@@ -309,6 +306,9 @@
<ClInclude Include="..\include\m_json.h">
<Filter>SDK</Filter>
</ClInclude>
+ <ClInclude Include="core\stdplug.h">
+ <Filter>Core</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="core\commonheaders.cpp">
@@ -494,15 +494,6 @@
<ClCompile Include="modules\updatenotify\updatenotify.cpp">
<Filter>Modules\updater</Filter>
</ClCompile>
- <ClCompile Include="modules\userinfo\contactinfo.cpp">
- <Filter>Modules\userinfo</Filter>
- </ClCompile>
- <ClCompile Include="modules\userinfo\stdinfo.cpp">
- <Filter>Modules\userinfo</Filter>
- </ClCompile>
- <ClCompile Include="modules\userinfo\userinfo.cpp">
- <Filter>Modules\userinfo</Filter>
- </ClCompile>
<ClCompile Include="modules\useronline\useronline.cpp">
<Filter>Modules\useronline</Filter>
</ClCompile>
diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp
index ce03278281..30ed412bda 100644
--- a/src/modules/addcontact/addcontact.cpp
+++ b/src/modules/addcontact/addcontact.cpp
@@ -30,7 +30,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp
case WM_INITDIALOG:
{
char szUin[10];
- acs=(ADDCONTACTSTRUCT *)lparam;
+ acs = (ADDCONTACTSTRUCT *)lparam;
SetWindowLongPtr(hdlg, GWLP_USERDATA, (LONG_PTR)acs);
TranslateDialogDefault(hdlg);
@@ -38,9 +38,9 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp
if (acs->handleType == HANDLE_EVENT) {
DWORD dwUin;
DBEVENTINFO dbei = { 0 };
- dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=sizeof(DWORD);
- dbei.pBlob=(PBYTE)&dwUin;
+ dbei.cbSize = sizeof(dbei);
+ dbei.cbBlob = sizeof(DWORD);
+ dbei.pBlob = (PBYTE)&dwUin;
CallService(MS_DB_EVENT_GET, (WPARAM)acs->handle, (LPARAM)&dbei);
_ltoa(dwUin, szUin, 10);
acs->szProto = dbei.szModule;
@@ -57,11 +57,11 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp
HANDLE hcontact;
ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)acs->handle, 0);
- dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob);
+ dbei.cbSize = sizeof(dbei);
+ dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)acs->handle, 0);
+ dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
CallService(MS_DB_EVENT_GET, (WPARAM)acs->handle, (LPARAM)&dbei);
- hcontact=*((PHANDLE)(dbei.pBlob+sizeof(DWORD)));
+ hcontact = *((PHANDLE)(dbei.pBlob+sizeof(DWORD)));
mir_free(dbei.pBlob);
if (hcontact != INVALID_HANDLE_VALUE) {
szName = cli.pfnGetContactDisplayName(hcontact, 0);
diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp
index 75c4148980..f3384f3fcc 100644
--- a/src/modules/button/button.cpp
+++ b/src/modules/button/button.cpp
@@ -260,7 +260,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- MButtonCtrl* bct = (MButtonCtrl *)GetWindowLongPtr(hwndDlg, 0);
+ MButtonCtrl* bct = (MButtonCtrl *)GetWindowLongPtr(hwndDlg, 0);
if (bct && bct->fnWindowProc) {
LRESULT res = bct->fnWindowProc(hwndDlg, msg, wParam, lParam);
if (res)
@@ -315,7 +315,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
bct->hwndToolTips = NULL;
}
}
- if (bct->arrow) IconLib_ReleaseIcon(bct->arrow, 0);
+ if (bct->arrow) IcoLib_ReleaseIcon(bct->arrow, 0);
DestroyTheme(bct);
}
break; // DONT! fall thru
@@ -450,7 +450,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
}
else {
if (bct->arrow) {
- IconLib_ReleaseIcon(bct->arrow, 0);
+ IcoLib_ReleaseIcon(bct->arrow, 0);
bct->arrow = NULL;
SetHwndPropInt(bct, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_ROLE, ROLE_SYSTEM_PUSHBUTTON);
}
@@ -620,18 +620,18 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
int LoadButtonModule(void)
{
- WNDCLASSEX wc = {0};
-
- if (bModuleInitialized) return 0;
+ if (bModuleInitialized)
+ return 0;
bModuleInitialized = TRUE;
- wc.cbSize = sizeof(wc);
- wc.lpszClassName = MIRANDABUTTONCLASS;
- wc.lpfnWndProc = MButtonWndProc;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.cbWndExtra = sizeof(MButtonCtrl*);
- wc.hbrBackground = 0;
- wc.style = CS_GLOBALCLASS;
+ WNDCLASSEX wc = {0};
+ wc.cbSize = sizeof(wc);
+ wc.lpszClassName = MIRANDABUTTONCLASS;
+ wc.lpfnWndProc = MButtonWndProc;
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.cbWndExtra = sizeof(MButtonCtrl*);
+ wc.hbrBackground = 0;
+ wc.style = CS_GLOBALCLASS;
RegisterClassEx(&wc);
InitializeCriticalSection(&csTips);
diff --git a/src/modules/clist/Docking.cpp b/src/modules/clist/Docking.cpp
index b02a039f3f..382794b9d7 100644
--- a/src/modules/clist/Docking.cpp
+++ b/src/modules/clist/Docking.cpp
@@ -232,7 +232,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
wp->y = rc.top;
wp->cy = rc.bottom - rc.top;
wp->cx = rc.right - rc.left;
- wp->flags &= ~(SWP_NOSIZE | SWP_NOMOVE);
+ wp->flags &= ~(SWP_NOSIZE | SWP_NOMOVE);
}
}
}
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp
index 8a50469245..56a8b66c35 100644
--- a/src/modules/clist/clc.cpp
+++ b/src/modules/clist/clc.cpp
@@ -120,13 +120,13 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam)
static int ClcAccountsChanged(WPARAM, LPARAM)
{
int i, cnt;
- for (i = 0, cnt = 0; i < accounts.getCount(); ++i)
+ for (i=0, cnt=0; i < accounts.getCount(); ++i)
if (Proto_IsAccountEnabled(accounts[i])) ++cnt;
cli.hClcProtoCount = cnt;
cli.clcProto = (ClcProtoStatus *) mir_realloc(cli.clcProto, sizeof(ClcProtoStatus) * cli.hClcProtoCount);
- for (i = 0, cnt = 0; i < accounts.getCount(); ++i) {
+ for (i=0, cnt=0; i < accounts.getCount(); ++i) {
if (Proto_IsAccountEnabled(accounts[i])) {
cli.clcProto[cnt].szProto = accounts[i]->szModuleName;
cli.clcProto[cnt].dwStatus = CallProtoServiceInt(NULL,accounts[i]->szModuleName, PS_GETSTATUS, 0, 0);
@@ -151,7 +151,7 @@ static int ClcProtoAck(WPARAM, LPARAM lParam)
if (ack->type == ACKTYPE_STATUS) {
WindowList_BroadcastAsync(hClcWindowList, INTM_INVALIDATE, 0, 0);
if (ack->result == ACKRESULT_SUCCESS) {
- for (i = 0; i < cli.hClcProtoCount; i++) {
+ for (i=0; i < cli.hClcProtoCount; i++) {
if ( !lstrcmpA(cli.clcProto[i].szProto, ack->szModule)) {
cli.clcProto[i].dwStatus = (WORD) ack->lParam;
break;
@@ -268,7 +268,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
}
{
int i;
- for (i = 0; i <= FONTID_MAX; i++)
+ for (i=0; i <= FONTID_MAX; i++)
dat->fontInfo[i].changed = 1;
}
dat->selection = -1;
@@ -401,7 +401,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (cli.pfnFindItem(hwnd, dat, (HANDLE) (groupId | HCONTACT_ISGROUP), &contact, &group, NULL)) {
lstrcpy(szFullName, contact->szText);
while (group->parent) {
- for (i = 0; i < group->parent->cl.count; i++)
+ for (i=0; i < group->parent->cl.count; i++)
if (group->parent->cl.items[i]->group == group)
break;
if (i == group->parent->cl.count) {
@@ -1320,7 +1320,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
cli.pfnHideInfoTip(hwnd, dat);
{
int i;
- for (i = 0; i <= FONTID_MAX; i++)
+ for (i=0; i <= FONTID_MAX; i++)
if ( !dat->fontInfo[i].changed)
DeleteObject(dat->fontInfo[i].hFont);
}
diff --git a/src/modules/clist/clcfiledrop.cpp b/src/modules/clist/clcfiledrop.cpp
index 5c64082215..10d101e705 100644
--- a/src/modules/clist/clcfiledrop.cpp
+++ b/src/modules/clist/clcfiledrop.cpp
@@ -229,7 +229,7 @@ HRESULT CDropTarget::Drop(IDataObject * pDataObj, DWORD /*fKeyState*/, POINTL pt
fileCount = DragQueryFile(hDrop, -1, NULL, 0);
ppFiles = NULL;
- for (i = 0; i < fileCount; i++) {
+ for (i=0; i < fileCount; i++) {
DragQueryFile(hDrop, i, szFilename, SIZEOF(szFilename));
AddToFileList(&ppFiles, &totalCount, szFilename);
}
@@ -237,7 +237,7 @@ HRESULT CDropTarget::Drop(IDataObject * pDataObj, DWORD /*fKeyState*/, POINTL pt
if ( !CallService(MS_FILE_SENDSPECIFICFILEST, (WPARAM) hContact, (LPARAM) ppFiles))
*pdwEffect = DROPEFFECT_COPY;
- for (i = 0; ppFiles[i]; i++)
+ for (i=0; ppFiles[i]; i++)
mir_free(ppFiles[i]);
mir_free(ppFiles);
}
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp
index 74e951c276..37aa09bb46 100644
--- a/src/modules/clist/clcitems.cpp
+++ b/src/modules/clist/clcitems.cpp
@@ -59,7 +59,7 @@ struct ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName,
pNextField = pBackslash + 1;
}
compareResult = 1;
- for (i = 0; i < group->cl.count; i++) {
+ for (i=0; i < group->cl.count; i++) {
if (group->cl.items[i]->type == CLCIT_CONTACT)
break;
if (group->cl.items[i]->type != CLCIT_GROUP)
@@ -130,7 +130,7 @@ void fnFreeContact(struct ClcContact* p)
void fnFreeGroup(struct ClcGroup *group)
{
int i;
- for (i = 0; i < group->cl.count; i++) {
+ for (i=0; i < group->cl.count; i++) {
cli.pfnFreeContact(group->cl.items[i]);
mir_free(group->cl.items[i]);
}
@@ -143,7 +143,7 @@ void fnFreeGroup(struct ClcGroup *group)
static int iInfoItemUniqueHandle = 0;
int fnAddInfoItemToGroup(struct ClcGroup *group, int flags, const TCHAR *pszText)
{
- int i = 0;
+ int i=0;
if (flags & CLCIIF_BELOWCONTACTS)
i = group->cl.count;
@@ -309,7 +309,7 @@ struct ClcGroup* fnRemoveItemFromGroup(HWND hwnd, struct ClcGroup *group, struct
int i;
if (group->parent == NULL)
return group;
- for (i = 0; i < group->parent->cl.count; i++)
+ for (i=0; i < group->parent->cl.count; i++)
if (group->parent->cl.items[i]->type == CLCIT_GROUP && group->parent->cl.items[i]->groupId == group->groupId)
break;
if (i == group->parent->cl.count)
@@ -337,7 +337,7 @@ void fnDeleteItemFromTree(HWND hwnd, HANDLE hItem)
//decrease member counts of all parent groups too
group = &dat->list;
nameOffset = 0;
- for (i = 0;; i++) {
+ for (i=0;; i++) {
if (group->scanIndex == group->cl.count)
break;
if (group->cl.items[i]->type == CLCIT_GROUP) {
@@ -502,7 +502,7 @@ static void SortGroup(struct ClcData *dat, struct ClcGroup *group, int useInsert
List_Remove((SortedList*)&group->cl, i);
} }
- for (i = 0; i < group->cl.count; i++)
+ for (i=0; i < group->cl.count; i++)
if (group->cl.items[i]->type != CLCIT_INFO)
break;
if (i > group->cl.count - 2)
@@ -530,7 +530,7 @@ static void SortGroup(struct ClcData *dat, struct ClcGroup *group, int useInsert
qsort(group->cl.items + i, sortCount, sizeof(void*), ContactSortProc);
if (dat->exStyle & CLS_EX_DIVIDERONOFF) {
int prevContactOnline = 0;
- for (i = 0; i < group->cl.count; i++) {
+ for (i=0; i < group->cl.count; i++) {
if (group->cl.items[i]->type != CLCIT_CONTACT)
continue;
if (group->cl.items[i]->flags & CONTACTF_ONLINE)
@@ -685,7 +685,7 @@ void fnSaveStateAndRebuildList(HWND hwnd, struct ClcData *dat)
group->scanIndex++;
}
- for (i = 0; i < saveInfo.getCount(); i++) {
+ for (i=0; i < saveInfo.getCount(); i++) {
if (saveInfo[i].parentId == -1)
group = &dat->list;
else {
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index e49e9621b3..8617d82f9a 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -156,7 +156,7 @@ int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcCo
return hit;
}
- for (i = 0; i < dat->extraColumnsCount; i++) {
+ for (i=0; i < dat->extraColumnsCount; i++) {
if (hitcontact->iExtraImage[i] == 0xFF)
continue;
if (testx >= clRect.right - dat->extraColumnSpacing * (dat->extraColumnsCount - i) &&
@@ -723,7 +723,7 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat)
SIZE fontSize;
HDC hdc = GetDC(hwnd);
- for (i = 0; i <= FONTID_MAX; i++)
+ for (i=0; i <= FONTID_MAX; i++)
{
if ( !dat->fontInfo[i].changed)
DeleteObject(dat->fontInfo[i].hFont);
@@ -824,7 +824,7 @@ void fnSetGroupChildCheckboxes(struct ClcGroup *group, int checked)
{
int i;
- for (i = 0; i < group->cl.count; i++) {
+ for (i=0; i < group->cl.count; i++) {
if (group->cl.items[i]->type == CLCIT_GROUP) {
cli.pfnSetGroupChildCheckboxes(group->cl.items[i]->group, checked);
if (checked)
diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp
index 8177e233d4..96d5a95a9e 100644
--- a/src/modules/clist/clistevents.cpp
+++ b/src/modules/clist/clistevents.cpp
@@ -49,7 +49,7 @@ int fnGetImlIconIndex(HICON hIcon)
{
int i;
- for (i = 0; i < imlIconCount; i++) {
+ for (i=0; i < imlIconCount; i++) {
if (imlIcon[i].hIcon == hIcon)
return imlIcon[i].index;
}
@@ -89,7 +89,7 @@ static void ShowEventsInTray()
int i;
char ** pTrayProtos;
char nTrayProtoCnt;
- int nTrayCnt=cli.trayIconCount;
+ int nTrayCnt = cli.trayIconCount;
if ( !cli.events.count || !nTrayCnt) return;
if (cli.events.count == 1 || nTrayCnt == 1)
{
@@ -101,24 +101,24 @@ static void ShowEventsInTray()
// lets use several icon to show events from protocols in different icons
cli.pfnLockTray();
pTrayProtos = (char**)_alloca(sizeof(char*)*cli.trayIconCount);
- nTrayProtoCnt=0;
+ nTrayProtoCnt = 0;
for (i=0; i<cli.trayIconCount; i++)
{
if (cli.trayIcon[i].id == 0 || !cli.trayIcon[i].szProto) continue;
- pTrayProtos[nTrayProtoCnt++]=cli.trayIcon[i].szProto;
+ pTrayProtos[nTrayProtoCnt++] = cli.trayIcon[i].szProto;
}
for (i=0; i<cli.events.count; i++)
{
- char * iEventProto=GetEventProtocol(i);
+ char * iEventProto = GetEventProtocol(i);
{
int j;
- for (j=0; j<nTrayProtoCnt; j++)
+ for (j = 0; j<nTrayProtoCnt; j++)
if (iEventProto && pTrayProtos[j] && !lstrcmpA(pTrayProtos[j], iEventProto))
break;
- if (j>=nTrayProtoCnt) j=0; //event was not found so assume first icon
+ if (j>=nTrayProtoCnt) j = 0; //event was not found so assume first icon
if (pTrayProtos[j]) //if not already set
ShowOneEventInTray(i); //show it
- pTrayProtos[j]=NULL; //and clear slot
+ pTrayProtos[j] = NULL; //and clear slot
}
}
cli.pfnUnlockTray();
@@ -128,7 +128,7 @@ static VOID CALLBACK IconFlashTimer(HWND, UINT, UINT_PTR idEvent, DWORD)
{
int i, j;
ShowEventsInTray();
- for (i = 0; i < cli.events.count; i++) {
+ for (i=0; i < cli.events.count; i++) {
for (j = 0; j < i; j++)
if (cli.events.items[j]->cle.hContact == cli.events.items[i]->cle.hContact)
break;
@@ -157,7 +157,7 @@ struct CListEvent* fnAddEvent(CLISTEVENT *cle)
return NULL;
if (cle->flags & CLEF_URGENT) {
- for (i = 0; i < cli.events.count; i++)
+ for (i=0; i < cli.events.count; i++)
if ( !(cli.events.items[i]->cle.flags & CLEF_URGENT))
break;
}
@@ -182,7 +182,7 @@ struct CListEvent* fnAddEvent(CLISTEVENT *cle)
if (cle->flags&CLEF_PROTOCOLGLOBAL)
szProto = cle->lpszProtocol;
else
- szProto=NULL;
+ szProto = NULL;
}
else
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cle->hContact, 0);
@@ -201,10 +201,10 @@ int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent)
{
int i;
char *szProto;
- int nSameProto=0;
+ int nSameProto = 0;
// Find the event that should be removed
- for (i = 0; i < cli.events.count; i++)
+ for (i=0; i < cli.events.count; i++)
if ((cli.events.items[i]->cle.hContact == hContact) && (cli.events.items[i]->cle.hDbEvent == dbEvent))
break;
@@ -224,12 +224,12 @@ int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent)
{
//count same protocoled events
char * szEventProto;
- for (i = 0; i < cli.events.count; i++)
+ for (i=0; i < cli.events.count; i++)
{
if (cli.events.items[i]->cle.hContact)
- szEventProto=(char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)(cli.events.items[i]->cle.hContact), 0);
+ szEventProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)(cli.events.items[i]->cle.hContact), 0);
else if (cli.events.items[i]->cle.flags&CLEF_PROTOCOLGLOBAL)
- szEventProto=(char *) cli.events.items[i]->cle.lpszProtocol;
+ szEventProto = (char *) cli.events.items[i]->cle.lpszProtocol;
else
szEventProto = NULL;
if (szEventProto && szProto && !lstrcmpA(szEventProto, szProto))
@@ -262,7 +262,7 @@ CLISTEVENT* fnGetEvent(HANDLE hContact, int idx)
return &cli.events.items[idx]->cle;
}
- for (int i = 0; i < cli.events.count; i++)
+ for (int i=0; i < cli.events.count; i++)
if (cli.events.items[i]->cle.hContact == hContact)
if (idx-- == 0)
return &cli.events.items[i]->cle;
@@ -271,7 +271,7 @@ CLISTEVENT* fnGetEvent(HANDLE hContact, int idx)
int fnEventsProcessContactDoubleClick(HANDLE hContact)
{
- for (int i = 0; i < cli.events.count; i++) {
+ for (int i=0; i < cli.events.count; i++) {
if (cli.events.items[i]->cle.hContact == hContact) {
HANDLE hDbEvent = cli.events.items[i]->cle.hDbEvent;
CallService(cli.events.items[i]->cle.pszService, (WPARAM) (HWND) NULL, (LPARAM) & cli.events.items[i]->cle);
@@ -284,30 +284,30 @@ int fnEventsProcessContactDoubleClick(HANDLE hContact)
int fnEventsProcessTrayDoubleClick(int index)
{
- BOOL click_in_first_icon=FALSE;
+ BOOL click_in_first_icon = FALSE;
if (cli.events.count) {
HANDLE hContact, hDbEvent;
- int eventIndex=0;
+ int eventIndex = 0;
cli.pfnLockTray();
if (cli.trayIconCount>1 && index>0) {
int i;
- char * szProto=NULL;
+ char * szProto = NULL;
for (i=0; i<cli.trayIconCount; i++)
if (cli.trayIcon[i].id == index) {
- szProto=cli.trayIcon[i].szProto;
- if (i == 0) click_in_first_icon=TRUE;
+ szProto = cli.trayIcon[i].szProto;
+ if (i == 0) click_in_first_icon = TRUE;
break;
}
if (szProto) {
for (i=0; i<cli.events.count; i++) {
- char * eventProto=NULL;
+ char * eventProto = NULL;
if (cli.events.items[i]->cle.hContact)
- eventProto=(char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cli.events.items[i]->cle.hContact, 0);
+ eventProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cli.events.items[i]->cle.hContact, 0);
if ( !eventProto)
- eventProto=cli.events.items[i]->cle.lpszProtocol;
+ eventProto = cli.events.items[i]->cle.lpszProtocol;
if ( !eventProto || !_strcmpi(eventProto, szProto)) {
- eventIndex=i;
+ eventIndex = i;
break;
} }
@@ -316,18 +316,18 @@ int fnEventsProcessTrayDoubleClick(int index)
int j;
if (click_in_first_icon)
for (i=0; i<cli.events.count; i++) {
- char * eventProto=NULL;
+ char * eventProto = NULL;
if (cli.events.items[i]->cle.hContact)
- eventProto=(char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cli.events.items[i]->cle.hContact, 0);
+ eventProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cli.events.items[i]->cle.hContact, 0);
if ( !eventProto)
- eventProto=cli.events.items[i]->cle.lpszProtocol;
+ eventProto = cli.events.items[i]->cle.lpszProtocol;
if (eventProto) {
- for (j=0; j<cli.trayIconCount; j++)
+ for (j = 0; j<cli.trayIconCount; j++)
if (cli.trayIcon[j].szProto && !_strcmpi(eventProto, cli.trayIcon[j].szProto))
break;
if (j == cli.trayIconCount) {
- eventIndex=i;
+ eventIndex = i;
break;
} } }
if (i == cli.events.count) { //not found
@@ -428,7 +428,7 @@ void UninitCListEvents(void)
if (cli.events.count) KillTimer(NULL, flashTimerId);
- for (i = 0; i < cli.events.count; i++)
+ for (i=0; i < cli.events.count; i++)
cli.pfnFreeEvent((struct CListEvent*)cli.events.items[i]);
List_Destroy((SortedList*)&cli.events);
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index 677678d847..8abc2bd2da 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -321,7 +321,7 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam)
else
mir_snprintf(buf, SIZEOF(buf), "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", mi->ptszName);
}
- else buf[0]='\0';
+ else buf[0] = '\0';
if (buf[0]) MO_SetOptionsMenuItem(menuHandle, OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
return (INT_PTR)menuHandle;
}
@@ -331,7 +331,7 @@ static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM)
HANDLE hContact = (HANDLE)wParam;
NotifyEventHooks(hPreBuildContactMenuEvent, (WPARAM)hContact, 0);
- char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
BuildContactParam bcp;
bcp.szProto = szProto;
@@ -354,8 +354,8 @@ static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM)
INT_PTR ContactMenuExecService(WPARAM wParam, LPARAM lParam)
{
if (wParam != 0) {
- lpContactMenuExecParam cmep=(lpContactMenuExecParam)wParam;
- //call with wParam=(WPARAM)(HANDLE)hContact, lparam=popupposition
+ lpContactMenuExecParam cmep = (lpContactMenuExecParam)wParam;
+ //call with wParam = (WPARAM)(HANDLE)hContact, lparam = popupposition
CallService(cmep->szServiceName, lParam, cmep->param);
}
return 0;
@@ -474,7 +474,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
MenuItemData it = {0};
if (FindMenuHandleByGlobalID(hStatusMenu, timiParent, &it)) {
- MENUITEMINFO mi ={0};
+ MENUITEMINFO mi = {0};
TCHAR d[100];
GetMenuString(it.OwnerMenu, it.position, d, SIZEOF(d), MF_BYPOSITION);
@@ -517,14 +517,14 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
timi->mi.flags &= ~CMIF_CHECKED;
}
else if (( !smep || smep->proto) && timi->mi.pszName) {
- int curProtoStatus=0;
- BOOL IconNeedDestroy=FALSE;
+ int curProtoStatus = 0;
+ BOOL IconNeedDestroy = FALSE;
char* prot;
if (smep)
prot = smep->proto;
else
{
- char *prn=mir_u2a(timi->mi.ptszName);
+ char *prn = mir_u2a(timi->mi.ptszName);
prot = NEWSTR_ALLOCA(prn);
if (prn) mir_free(prn);
}
@@ -537,7 +537,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
if (curProtoStatus >= ID_STATUS_OFFLINE && curProtoStatus < ID_STATUS_IDLE)
timi->mi.hIcon = LoadSkinProtoIcon(prot, curProtoStatus);
else {
- timi->mi.hIcon=(HICON)CallProtoServiceInt(NULL,prot, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ timi->mi.hIcon = (HICON)CallProtoServiceInt(NULL,prot, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (timi->mi.hIcon == (HICON)CALLSERVICE_NOTFOUND)
timi->mi.hIcon = NULL;
else
@@ -551,7 +551,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
DestroyIcon(timi->mi.hIcon);
timi->mi.hIcon = NULL;
}
- else IconLib_ReleaseIcon(timi->mi.hIcon, 0);
+ else IcoLib_ReleaseIcon(timi->mi.hIcon, 0);
} }
return TRUE;
@@ -569,9 +569,9 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM)
if (smep->status == 0 && smep->protoindex != 0 && smep->proto != NULL) {
PMO_IntMenuItem pimi;
char *prot = smep->proto;
- char szHumanName[64]={0};
+ char szHumanName[64] = {0};
PROTOACCOUNT * acc = Proto_GetAccount(smep->proto);
- int i=(DBGetContactSettingByte(NULL, prot, "LockMainStatus", 0)?0:1);
+ int i = (DBGetContactSettingByte(NULL, prot, "LockMainStatus", 0)?0:1);
DBWriteContactSettingByte(NULL, prot, "LockMainStatus", (BYTE)i);
CallProtoServiceInt(NULL,smep->proto, PS_GETNAME, (WPARAM)SIZEOF(szHumanName), (LPARAM)szHumanName);
@@ -684,7 +684,7 @@ BOOL FindMenuHanleByGlobalID(HMENU hMenu, PMO_IntMenuItem id, MenuItemData* itda
int i;
PMO_IntMenuItem pimi;
MENUITEMINFO mii = {0};
- BOOL inSub=FALSE;
+ BOOL inSub = FALSE;
if ( !itdat)
return FALSE;
@@ -843,7 +843,7 @@ void RebuildMenuOrder(void)
tmp.CheckService = "StatusMenuCheckService";
tmp.name = "StatusMenu";
- hStatusMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
+ hStatusMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
MO_SetOptionsMenuObject(hStatusMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, (INT_PTR)"CLISTMENUS/FreeOwnerDataStatusMenu");
hStatusMainMenuHandles = (PMO_IntMenuItem*)mir_calloc(SIZEOF(statusModeList) * sizeof(PMO_IntMenuItem*));
@@ -854,7 +854,7 @@ void RebuildMenuOrder(void)
FreeMenuProtos();
- for (s=0; s < accounts.getCount(); s++) {
+ for (s = 0; s < accounts.getCount(); s++) {
i = cli.pfnGetAccountIndexByPos(s);
if (i == -1)
continue;
@@ -917,7 +917,7 @@ void RebuildMenuOrder(void)
((lpStatusMenuExecParam)tmi.ownerdata)->protoindex = (int)menuHandle;
MO_ModifyMenuItem(menuHandle, &tmi);
- cli.menuProtos=(MenuProto*)mir_realloc(cli.menuProtos, sizeof(MenuProto)*(cli.menuProtoCount+1));
+ cli.menuProtos = (MenuProto*)mir_realloc(cli.menuProtos, sizeof(MenuProto)*(cli.menuProtoCount+1));
memset(&(cli.menuProtos[cli.menuProtoCount]), 0, sizeof(MenuProto));
cli.menuProtos[cli.menuProtoCount].pMenu = rootmenu;
cli.menuProtos[cli.menuProtoCount].szProto = mir_strdup(pa->szModuleName);
@@ -931,7 +931,7 @@ void RebuildMenuOrder(void)
DestroyIcon(ic);
pos += 500000;
- for (j=0; j < SIZEOF(statusModeList); j++) {
+ for (j = 0; j < SIZEOF(statusModeList); j++) {
if ( !(flags & statusModePf2List[j]))
continue;
@@ -963,14 +963,14 @@ void RebuildMenuOrder(void)
mir_snprintf(buf, SIZEOF(buf), "ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMenuHandles[i].menuhandle[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
}
- IconLib_ReleaseIcon(tmi.hIcon, 0);
+ IcoLib_ReleaseIcon(tmi.hIcon, 0);
} }
NotifyEventHooks(cli.hPreBuildStatusMenuEvent, 0, 0);
int pos = 200000;
//add to root menu
- for (j=0; j < SIZEOF(statusModeList); j++) {
+ for (j = 0; j < SIZEOF(statusModeList); j++) {
for (i=0; i < accounts.getCount(); i++) {
PROTOACCOUNT* pa = accounts[i];
if ( !bHideStatusMenu && !cli.pfnGetProtocolVisibility(pa->szModuleName))
@@ -1012,7 +1012,7 @@ void RebuildMenuOrder(void)
mir_snprintf(buf, sizeof(buf), "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMainMenuHandles[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
}
- IconLib_ReleaseIcon(tmi.hIcon, 0);
+ IcoLib_ReleaseIcon(tmi.hIcon, 0);
break;
} }
@@ -1027,7 +1027,7 @@ static int sttRebuildHotkeys(WPARAM, LPARAM)
tmi.cbSize = sizeof(tmi);
tmi.flags = CMIM_HOTKEY | CMIM_NAME | CMIF_TCHAR;
- for (int j=0; j < SIZEOF(statusModeList); j++) {
+ for (int j = 0; j < SIZEOF(statusModeList); j++) {
TCHAR buf[ 256 ], hotkeyName[ 100 ];
WORD hotKey = GetHotkeyValue(statusHotkeys[j]);
HotkeyToName(hotkeyName, SIZEOF(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
@@ -1055,7 +1055,7 @@ int statustopos(int status)
static int MenuProtoAck(WPARAM, LPARAM lParam)
{
- ACKDATA* ack=(ACKDATA*)lParam;
+ ACKDATA* ack = (ACKDATA*)lParam;
if (ack->type != ACKTYPE_STATUS) return 0;
if (ack->result != ACKRESULT_SUCCESS) return 0;
if (hStatusMainMenuHandles == NULL) return 0;
@@ -1068,7 +1068,7 @@ static int MenuProtoAck(WPARAM, LPARAM lParam)
if (overallStatus >= ID_STATUS_OFFLINE) {
int pos = statustopos(cli.currentStatusMenuItem);
if (pos == -1)
- pos=0;
+ pos = 0;
// reset all current possible checked statuses
for (int pos2 = 0; pos2<hStatusMainMenuHandlesCnt; pos2++) {
@@ -1077,7 +1077,7 @@ static int MenuProtoAck(WPARAM, LPARAM lParam)
MO_ModifyMenuItem(hStatusMainMenuHandles[pos2], &tmi);
} }
- cli.currentStatusMenuItem=overallStatus;
+ cli.currentStatusMenuItem = overallStatus;
pos = statustopos(cli.currentStatusMenuItem);
if (pos>=0 && pos < hStatusMainMenuHandlesCnt) {
tmi.flags = CMIM_FLAGS | CMIF_ROOTHANDLE | CMIF_CHECKED;
@@ -1087,13 +1087,13 @@ static int MenuProtoAck(WPARAM, LPARAM lParam)
}
else {
int pos = statustopos(cli.currentStatusMenuItem);
- if (pos == -1) pos=0;
+ if (pos == -1) pos = 0;
if (pos >= 0 && pos < hStatusMainMenuHandlesCnt) {
tmi.flags = CMIM_FLAGS | CMIF_ROOTHANDLE;
MO_ModifyMenuItem(hStatusMainMenuHandles[pos], &tmi);
}
- cli.currentStatusMenuItem=0;
+ cli.currentStatusMenuItem = 0;
}
for (int i=0; i < accounts.getCount(); i++) {
@@ -1208,7 +1208,7 @@ static INT_PTR AddStatusMenuItem(WPARAM wParam, LPARAM lParam)
} }
if (wParam) {
- int * res=(int*)wParam;
+ int * res = (int*)wParam;
*res = (int)pRoot;
}
@@ -1217,13 +1217,13 @@ static INT_PTR AddStatusMenuItem(WPARAM wParam, LPARAM lParam)
if (mi->pszService) {
smep = (lpStatusMenuExecParam)mir_calloc(sizeof(StatusMenuExecParam));
smep->custom = TRUE;
- smep->svc=mir_strdup(mi->pszService);
+ smep->svc = mir_strdup(mi->pszService);
{
- char *buf=mir_strdup(mi->pszService);
+ char *buf = mir_strdup(mi->pszService);
int i=0;
while (buf[i] != '\0' && buf[i] != '/') i++;
- buf[i]='\0';
- smep->proto=mir_strdup(buf);
+ buf[i] = '\0';
+ smep->proto = mir_strdup(buf);
mir_free(buf);
}
tmi.ownerdata = smep;
@@ -1299,21 +1299,21 @@ void InitCustomMenus(void)
CreateServiceFunction("CList/AddProtoMenuItem", AddProtoMenuItem);
- hPreBuildContactMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDCONTACTMENU);
- hPreBuildMainMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDMAINMENU);
- cli.hPreBuildStatusMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDSTATUSMENU);
+ hPreBuildContactMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDCONTACTMENU);
+ hPreBuildMainMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDMAINMENU);
+ cli.hPreBuildStatusMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDSTATUSMENU);
hStatusModeChangeEvent = CreateHookableEvent(ME_CLIST_STATUSMODECHANGE);
- hAckHook=(HANDLE)HookEvent(ME_PROTO_ACK, MenuProtoAck);
+ hAckHook = (HANDLE)HookEvent(ME_PROTO_ACK, MenuProtoAck);
hMainMenu = CreatePopupMenu();
hStatusMenu = CreatePopupMenu();
- hStatusMainMenuHandles=NULL;
- hStatusMainMenuHandlesCnt=0;
+ hStatusMainMenuHandles = NULL;
+ hStatusMainMenuHandlesCnt = 0;
- hStatusMenuHandles=NULL;
- hStatusMenuHandlesCnt=0;
+ hStatusMenuHandles = NULL;
+ hStatusMenuHandlesCnt = 0;
//new menu sys
InitGenMenu();
@@ -1321,11 +1321,11 @@ void InitCustomMenus(void)
//main menu
{
TMenuParam tmp = { 0 };
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService=NULL;
- tmp.ExecService="MainMenuExecService";
- tmp.name="MainMenu";
- hMainMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
+ tmp.cbSize = sizeof(tmp);
+ tmp.CheckService = NULL;
+ tmp.ExecService = "MainMenuExecService";
+ tmp.name = "MainMenu";
+ hMainMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
}
MO_SetOptionsMenuObject(hMainMenuObject, OPT_USERDEFINEDITEMS, TRUE);
@@ -1334,11 +1334,11 @@ void InitCustomMenus(void)
//contact menu
{
TMenuParam tmp = { 0 };
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService="ContactMenuCheckService";
- tmp.ExecService="ContactMenuExecService";
- tmp.name="ContactMenu";
- hContactMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
+ tmp.cbSize = sizeof(tmp);
+ tmp.CheckService = "ContactMenuCheckService";
+ tmp.ExecService = "ContactMenuExecService";
+ tmp.name = "ContactMenu";
+ hContactMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
}
MO_SetOptionsMenuObject(hContactMenuObject, OPT_USERDEFINEDITEMS, TRUE);
@@ -1351,7 +1351,7 @@ void InitCustomMenus(void)
hkd.cbSize = sizeof(hkd);
hkd.ptszSection = _T("Status");
hkd.dwFlags = HKD_TCHAR;
- for (int i = 0; i < SIZEOF(statusHotkeys); i++) {
+ for (int i=0; i < SIZEOF(statusHotkeys); i++) {
char szName[30];
mir_snprintf(szName, SIZEOF(szName), "StatusHotKey_%d", i);
hkd.pszName = szName;
@@ -1376,8 +1376,8 @@ void InitCustomMenus(void)
AddMainMenuItem(0, (LPARAM)&mi);
}
- cli.currentStatusMenuItem=ID_STATUS_OFFLINE;
- cli.currentDesiredStatusMode=ID_STATUS_OFFLINE;
+ cli.currentStatusMenuItem = ID_STATUS_OFFLINE;
+ cli.currentDesiredStatusMode = ID_STATUS_OFFLINE;
if (IsWinVer98Plus())
HookEvent(ME_SKIN_ICONSCHANGED, MenuIconsChanged);
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp
index 39047d9331..7c8d7527d7 100644
--- a/src/modules/clist/clistmod.cpp
+++ b/src/modules/clist/clistmod.cpp
@@ -177,7 +177,7 @@ int fnIconFromStatusMode(const char *szProto, int status, HANDLE)
index = 0;
if (szProto == NULL)
return index + 1;
- for (i = 0; i < protoIconIndex.getCount(); i++) {
+ for (i=0; i < protoIconIndex.getCount(); i++) {
if (strcmp(szProto, protoIconIndex[i].szProto) == 0)
return protoIconIndex[i].iIconBase + index;
}
@@ -197,7 +197,7 @@ static void AddProtoIconIndex(PROTOACCOUNT* pa)
{
ProtoIconIndex *pii = new ProtoIconIndex;
pii->szProto = pa->szModuleName;
- for (int i = 0; i < SIZEOF(statusModeList); i++) {
+ for (int i=0; i < SIZEOF(statusModeList); i++) {
int iImg = ImageList_AddIcon_ProtoIconLibLoaded(hCListImages, pa->szModuleName, statusModeList[i]);
if (i == 0)
pii->iIconBase = iImg;
@@ -207,7 +207,7 @@ static void AddProtoIconIndex(PROTOACCOUNT* pa)
static void RemoveProtoIconIndex(PROTOACCOUNT* pa)
{
- for (int i = 0; i < protoIconIndex.getCount(); i++)
+ for (int i=0; i < protoIconIndex.getCount(); i++)
if (strcmp(protoIconIndex[i].szProto, pa->szModuleName) == 0) {
protoIconIndex.remove(i);
break;
@@ -222,7 +222,7 @@ static int ContactListModulesLoaded(WPARAM, LPARAM)
}
RebuildMenuOrder();
- for (int i = 0; i < accounts.getCount(); i++)
+ for (int i=0; i < accounts.getCount(); i++)
AddProtoIconIndex(accounts[i]);
cli.pfnLoadContactTree();
@@ -282,11 +282,11 @@ static int CListIconsChanged(WPARAM, LPARAM)
{
int i, j;
- for (i = 0; i < SIZEOF(statusModeList); i++)
+ for (i=0; i < SIZEOF(statusModeList); i++)
ImageList_ReplaceIcon_IconLibLoaded(hCListImages, i + 1, LoadSkinIcon(skinIconStatusList[i]));
ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPOPEN, LoadSkinIcon(SKINICON_OTHER_GROUPOPEN));
ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPSHUT, LoadSkinIcon(SKINICON_OTHER_GROUPSHUT));
- for (i = 0; i < protoIconIndex.getCount(); i++)
+ for (i=0; i < protoIconIndex.getCount(); i++)
for (j = 0; j < SIZEOF(statusModeList); j++)
ImageList_ReplaceIcon_IconLibLoaded(hCListImages, protoIconIndex[i].iIconBase + j, LoadSkinProtoIcon(protoIconIndex[i].szProto, statusModeList[j]));
cli.pfnTrayIconIconsChanged();
@@ -533,7 +533,7 @@ int LoadContactListModule2(void)
ImageList_AddIcon_NotShared(hCListImages, MAKEINTRESOURCE(IDI_BLANK));
//now all core skin icons are loaded via icon lib. so lets release them
- for (int i = 0; i < SIZEOF(statusModeList); i++)
+ for (int i=0; i < SIZEOF(statusModeList); i++)
ImageList_AddIcon_IconLibLoaded(hCListImages, skinIconStatusList[i]);
//see IMAGE_GROUP... in clist.h if you add more images above here
diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp
index 710bd6aaf0..2e6f065628 100644
--- a/src/modules/clist/clistsettings.cpp
+++ b/src/modules/clist/clistsettings.cpp
@@ -40,7 +40,7 @@ void FreeDisplayNameCache(void)
{
if (clistCache != NULL) {
int i;
- for (i = 0; i < clistCache->realCount; i++) {
+ for (i=0; i < clistCache->realCount; i++) {
cli.pfnFreeCacheItem((ClcCacheEntryBase*)clistCache->items[i]);
mir_free(clistCache->items[i]);
}
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp
index e8a3a12d3b..91af2f6b21 100644
--- a/src/modules/clist/clisttray.cpp
+++ b/src/modules/clist/clisttray.cpp
@@ -35,7 +35,7 @@ static UINT WM_TASKBARBUTTONCREATED;
static BOOL mToolTipTrayTips = FALSE;
static UINT_PTR cycleTimerId = 0;
static int cycleStep = 0;
-static UINT_PTR RefreshTimerId=0; /////by FYR
+static UINT_PTR RefreshTimerId = 0; /////by FYR
static CRITICAL_SECTION trayLockCS;
// don't move to win2k.h, need new and old versions to work on 9x/2000/XP
@@ -47,7 +47,7 @@ static CRITICAL_SECTION trayLockCS;
#define initcheck if ( !fTrayInited) return
-static BOOL fTrayInited=FALSE;
+static BOOL fTrayInited = FALSE;
static TCHAR* sttGetXStatus(const char* szProto)
{
@@ -61,7 +61,7 @@ static TCHAR* sttGetXStatus(const char* szProto)
char* dbTitle2 = NULL;
int xstatus = CallProtoServiceInt(NULL,szProto, "/GetXStatus", (WPARAM)&dbTitle, (LPARAM)&dbTitle2);
if (dbTitle && xstatus) {
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
if ( !DBGetContactSettingTString(NULL, szProto, dbTitle, &dbv)) {
if (dbv.ptszVal[0] != 0)
result = mir_tstrdup(dbv.ptszVal);
@@ -86,7 +86,7 @@ static void SetTaskBarIcon(const HICON hIcon, const TCHAR *szNewTip)
TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto)
{
TCHAR *szStatus, *szSeparator;
- TCHAR *ProtoXStatus=NULL;
+ TCHAR *ProtoXStatus = NULL;
int t;
PROTOACCOUNT* pa;
initcheck NULL;
@@ -191,7 +191,7 @@ int fnTrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int s
int i;
initcheck 0;
lock;
- for (i = 0; i < cli.trayIconCount; i++)
+ for (i=0; i < cli.trayIconCount; i++)
if (cli.trayIcon[i].id == 0)
break;
@@ -228,7 +228,7 @@ void fnTrayIconRemove(HWND hwnd, const char *szProto)
int i;
initcheck;
lock;
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
struct trayIconInfo_t* pii = &cli.trayIcon[i];
if (pii->id != 0 && !lstrcmpA(szProto, pii->szProto)) {
NOTIFYICONDATA nid = { 0 };
@@ -288,7 +288,7 @@ int fnTrayIconInit(HWND hwnd)
(averageMode < 0 || DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
{
cli.trayIconCount = netProtoCount;
- for (int i = 0; i < accounts.getCount(); ++i)
+ for (int i=0; i < accounts.getCount(); ++i)
{
int j = cli.pfnGetAccountIndexByPos(i);
if (j >= 0)
@@ -329,7 +329,7 @@ int fnTrayIconDestroy(HWND hwnd)
nid.cbSize = (cli.shellVersion >= 5) ? sizeof(nid) : NOTIFYICONDATA_V1_SIZE;
nid.hWnd = hwnd;
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
nid.uID = cli.trayIcon[i].id;
@@ -358,7 +358,7 @@ static VOID CALLBACK RefreshTimerProc(HWND, UINT, UINT_PTR, DWORD)
int i;
if (RefreshTimerId) {
KillTimer(NULL, RefreshTimerId);
- RefreshTimerId=0;
+ RefreshTimerId = 0;
}
for (i=0; i < accounts.getCount(); i++) {
cli.pfnTrayIconUpdateBase(accounts[i]->szModuleName);
@@ -379,7 +379,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer
if ( !hNewIcon)
{ ulock; return -1; }
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
if (lstrcmpA(cli.trayIcon[i].szProto, szPreferredProto))
@@ -404,7 +404,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer
//if there wasn't a suitable icon, change all the icons
{
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
nid.uID = cli.trayIcon[i].id;
@@ -424,11 +424,11 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer
cli.trayIcon[i].isBase = isBase;
if (DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
{
- DWORD time1=DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT)*200;
- DWORD time2=DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550)+1000;
- DWORD time=max(max(2000, time1), time2);
- if (RefreshTimerId) {KillTimer(NULL, RefreshTimerId); RefreshTimerId=0;}
- RefreshTimerId=SetTimer(NULL, 0, time, RefreshTimerProc); // if unknown base was changed - than show preffered proto icon for 2 sec and reset it to original one after timeout
+ DWORD time1 = DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT)*200;
+ DWORD time2 = DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550)+1000;
+ DWORD time = max(max(2000, time1), time2);
+ if (RefreshTimerId) {KillTimer(NULL, RefreshTimerId); RefreshTimerId = 0;}
+ RefreshTimerId = SetTimer(NULL, 0, time, RefreshTimerProc); // if unknown base was changed - than show preffered proto icon for 2 sec and reset it to original one after timeout
}
{ ulock; return i; }
}
@@ -443,7 +443,7 @@ int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto)
lock;
if (szPreferredProto)
{
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
if (lstrcmpA(cli.trayIcon[i].szProto, szPreferredProto))
@@ -461,7 +461,7 @@ int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto)
}
//if there wasn't a specific icon, there will only be one suitable
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
@@ -521,7 +521,7 @@ void fnTrayIconUpdateBase(const char *szChangedProto)
cli.cycleTimerId = 0;
}
- for (i = 0; i < accounts.getCount(); i++) {
+ for (i=0; i < accounts.getCount(); i++) {
if ( !lstrcmpA(szChangedProto, accounts[i]->szModuleName))
cycleStep = i - 1;
}
@@ -560,9 +560,9 @@ void fnTrayIconUpdateBase(const char *szChangedProto)
break;
}
case SETTING_TRAYICON_CYCLE:
- cli.cycleTimerId =
+ cli.cycleTimerId =
SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cli.pfnTrayCycleTimerProc);
- changed =
+ changed =
cli.pfnTrayIconSetBaseInfo(ImageList_GetIcon
(hCListImages, cli.pfnIconFromStatusMode(szChangedProto, CallProtoServiceInt(NULL,szChangedProto, PS_GETSTATUS, 0, 0), NULL),
ILD_NORMAL), NULL);
@@ -595,7 +595,7 @@ void fnTrayIconSetToBase(char *szPreferredProto)
initcheck;
lock;
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
if (lstrcmpA(cli.trayIcon[i].szProto, szPreferredProto))
@@ -605,7 +605,7 @@ void fnTrayIconSetToBase(char *szPreferredProto)
}
//if there wasn't a specific icon, there will only be one suitable
- for (i = 0; i < cli.trayIconCount; i++) {
+ for (i=0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
cli.pfnTrayIconUpdate(cli.trayIcon[i].hBaseIcon, NULL, szPreferredProto, 1);
@@ -686,9 +686,9 @@ static void CALLBACK TrayToolTipTimerProc(HWND hwnd, UINT, UINT_PTR id, DWORD)
if (n >= 0 && n < cli.trayIconCount)
szTipCur = cli.trayIcon[n].ptszToolTip;
}
- ti.rcItem.left = pt.x - 10;
- ti.rcItem.right = pt.x + 10;
- ti.rcItem.top = pt.y - 10;
+ ti.rcItem.left = pt.x - 10;
+ ti.rcItem.right = pt.x + 10;
+ ti.rcItem.top = pt.y - 10;
ti.rcItem.bottom = pt.y + 10;
ti.cbSize = sizeof(ti);
ti.isTreeFocused = GetFocus() == cli.hwndContactList ? 1 : 0;
@@ -748,7 +748,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
POINT pt;
HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
- for (int i = 0; i < cli.trayIconCount; ++i)
+ for (int i=0; i < cli.trayIconCount; ++i)
{
if ((unsigned)cli.trayIcon[i].id == msg->wParam)
{
@@ -945,12 +945,12 @@ void fnInitTray(void)
InitializeCriticalSection(&trayLockCS);
if (cli.shellVersion >= 5)
CreateServiceFunction(MS_CLIST_SYSTRAY_NOTIFY, pfnCListTrayNotifyStub);
- fTrayInited=TRUE;
+ fTrayInited = TRUE;
}
void fnUninitTray(void)
{
- fTrayInited=FALSE;
+ fTrayInited = FALSE;
DeleteCriticalSection(&trayLockCS);
}
void fnLockTray(void)
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp
index 8524a4cf3a..bdb0fe356c 100644
--- a/src/modules/clist/clui.cpp
+++ b/src/modules/clist/clui.cpp
@@ -247,10 +247,10 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
{
LRESULT result;
MSG m;
- m.hwnd=hwnd;
- m.message=msg;
- m.wParam=wParam;
- m.lParam=lParam;
+ m.hwnd = hwnd;
+ m.message = msg;
+ m.wParam = wParam;
+ m.lParam = lParam;
if (cli.pfnDocking_ProcessWindowMessage((WPARAM)&m, (LPARAM)&result))
return result;
if (cli.pfnTrayIconProcessMessage((WPARAM)&m, (LPARAM)&result))
@@ -485,7 +485,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
{
HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MAINMENU);
HBITMAP hBmp = ConvertIconToBitmap(hIcon, NULL, 0);
- IconLib_ReleaseIcon(hIcon, NULL);
+ IcoLib_ReleaseIcon(hIcon, NULL);
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_BITMAP | MIIM_STRING | MIIM_DATA;
@@ -638,7 +638,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (cluiopt.transparent) {
if ( !transparentFocus && GetForegroundWindow() != hwnd && setLayeredWindowAttributes) {
setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)cluiopt.alpha, LWA_ALPHA);
- transparentFocus=1;
+ transparentFocus = 1;
SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
}
}
@@ -1049,13 +1049,13 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
HICON hIcon = LoadSkinProtoIcon(szProto, status);
DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
if (Proto_IsAccountLocked(Proto_GetAccount(szProto))) {
hIcon = LoadSkinnedIcon(SKINICON_OTHER_STATUS_LOCKED);
if (hIcon != NULL) {
DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
}
}
@@ -1087,7 +1087,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (dis->itemData == MENU_MIRANDAMENU) {
HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MAINMENU);
fnDrawMenuItem(dis, CopyIcon(hIcon), NULL);
- IconLib_ReleaseIcon(hIcon, NULL);
+ IcoLib_ReleaseIcon(hIcon, NULL);
return TRUE;
}
return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp
index 30f1a55322..ea3c153d36 100644
--- a/src/modules/clist/cluiservices.cpp
+++ b/src/modules/clist/cluiservices.cpp
@@ -170,7 +170,7 @@ void fnCluiProtocolStatusChanged(int, const char*)
RECT rc;
GetClientRect(cli.hwndStatus, &rc);
rc.right -= borders[0] * 2 + (DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? GetSystemMetrics(SM_CXVSCROLL) : 0);
- for (i = 0; i < cli.menuProtoCount; i++)
+ for (i=0; i < cli.menuProtoCount; i++)
partWidths[ i ] = (i+1) * rc.right / cli.menuProtoCount - (borders[2] >> 1);
}
else {
@@ -180,7 +180,7 @@ void fnCluiProtocolStatusChanged(int, const char*)
hdc = GetDC(NULL);
SelectObject(hdc, (HFONT) SendMessage(cli.hwndStatus, WM_GETFONT, 0, 0));
- for (i = 0; i < cli.menuProtoCount; i++) { //count down since built in ones tend to go at the end
+ for (i=0; i < cli.menuProtoCount; i++) { //count down since built in ones tend to go at the end
int x = 2;
if (showOpts & 1)
x += g_IconWidth;
@@ -215,7 +215,7 @@ void fnCluiProtocolStatusChanged(int, const char*)
flags = SBT_OWNERDRAW;
if (DBGetContactSettingByte(NULL, "CLUI", "SBarBevel", 1) == 0)
flags |= SBT_NOBORDERS;
- for (i = 0; i < cli.menuProtoCount; i++) {
+ for (i=0; i < cli.menuProtoCount; i++) {
SendMessage(cli.hwndStatus, SB_SETTEXT, i | flags, (LPARAM)cli.menuProtos[i].szProto);
}
}
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp
index 5fce5cb1f4..9404446db5 100644
--- a/src/modules/clist/contact.cpp
+++ b/src/modules/clist/contact.cpp
@@ -31,7 +31,7 @@ int sortByProto;
static const struct {
int status, order;
-} statusModeOrder[]={
+} statusModeOrder[] = {
{ID_STATUS_OFFLINE, 500},
{ID_STATUS_ONLINE, 10},
{ID_STATUS_AWAY, 200},
@@ -60,7 +60,7 @@ void fnChangeContactIcon(HANDLE hContact, int iIcon, int add)
int GetStatusModeOrdering(int statusMode)
{
int i;
- for (i = 0; i < SIZEOF(statusModeOrder); i++)
+ for (i=0; i < SIZEOF(statusModeOrder); i++)
if (statusModeOrder[i].status == statusMode)
return statusModeOrder[i].order;
return 1000;
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp
index deb5de8227..33b94d6cf8 100644
--- a/src/modules/clist/genmenu.cpp
+++ b/src/modules/clist/genmenu.cpp
@@ -105,8 +105,8 @@ PMO_IntMenuItem MO_RecursiveWalkMenu(PMO_IntMenuItem parent, pfnWalkFunc func, v
}
///////////////////////////////////////////////////////////////////////////////
-//wparam=0
-//lparam=LPMEASUREITEMSTRUCT
+//wparam = 0
+//lparam = LPMEASUREITEMSTRUCT
int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis)
{
// prevent win9x from ugly menus displaying when there is no icon
@@ -132,8 +132,8 @@ int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis)
}
///////////////////////////////////////////////////////////////////////////////
-//wparam=0
-//lparam=LPDRAWITEMSTRUCT
+//wparam = 0
+//lparam = LPDRAWITEMSTRUCT
int MO_DrawMenuItem(LPDRAWITEMSTRUCT dis)
{
if ( !bIsGenMenuInited)
@@ -188,7 +188,7 @@ int MO_RemoveAllObjects()
return 0;
}
-//wparam=MenuObjectHandle
+//wparam = MenuObjectHandle
INT_PTR MO_RemoveMenuObject(WPARAM wParam, LPARAM)
{
if ( !bIsGenMenuInited)
@@ -204,8 +204,8 @@ INT_PTR MO_RemoveMenuObject(WPARAM wParam, LPARAM)
return 0;
}
-//wparam=MenuObjectHandle
-//lparam=vKey
+//wparam = MenuObjectHandle
+//lparam = vKey
INT_PTR MO_ProcessHotKeys(HANDLE menuHandle, INT_PTR vKey)
{
if ( !bIsGenMenuInited)
@@ -253,8 +253,8 @@ INT_PTR MO_GetProtoRootMenu(WPARAM wParam, LPARAM lParam)
return NULL;
}
-//wparam=MenuItemHandle
-//lparam=PMO_MenuItem
+//wparam = MenuItemHandle
+//lparam = PMO_MenuItem
INT_PTR MO_GetMenuItem(WPARAM wParam, LPARAM lParam)
{
PMO_MenuItem mi = (PMO_MenuItem)lParam;
@@ -323,7 +323,7 @@ int MO_ModifyMenuItem(PMO_IntMenuItem menuHandle, PMO_MenuItem pmi)
if (hIcon != NULL) {
pimi->hIcolibItem = pmi->hIcolibItem;
pimi->iconId = ImageList_ReplaceIcon(pimi->parent->m_hMenuIcons, pimi->iconId, hIcon);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
}
else pimi->iconId = -1, pimi->hIcolibItem = NULL;
}
@@ -492,9 +492,9 @@ int MO_SetOptionsMenuObject(HANDLE handle, int setting, INT_PTR value)
return res;
}
-//wparam=0;
-//lparam=PMenuParam;
-//result=MenuObjectHandle
+//wparam = 0;
+//lparam = PMenuParam;
+//result = MenuObjectHandle
INT_PTR MO_CreateNewMenuObject(WPARAM, LPARAM lParam)
{
PMenuParam pmp = (PMenuParam)lParam;
@@ -514,8 +514,8 @@ INT_PTR MO_CreateNewMenuObject(WPARAM, LPARAM lParam)
return p->id;
}
-//wparam=MenuItemHandle
-//lparam=0
+//wparam = MenuItemHandle
+//lparam = 0
static int FreeMenuItem(TMO_IntMenuItem* pimi, void*)
{
@@ -593,8 +593,8 @@ static int GetNextObjectMenuItemId()
return NextObjectMenuItemId++;
}
-//wparam=MenuObjectHandle
-//lparam=PMO_MenuItem
+//wparam = MenuObjectHandle
+//lparam = PMO_MenuItem
//return MenuItemHandle
PMO_IntMenuItem MO_AddNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi)
{
@@ -632,7 +632,7 @@ PMO_IntMenuItem MO_AddNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi)
HICON hIcon = IcoLib_GetIconByHandle(pmi->hIcolibItem, false);
p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, hIcon);
p->hIcolibItem = pmi->hIcolibItem;
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
}
else {
HANDLE hIcolibItem = IcoLib_IsManaged(pmi->hIcon);
@@ -660,8 +660,8 @@ PMO_IntMenuItem MO_AddNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi)
return p;
}
-//wparam=MenuObjectHandle
-//lparam=PMO_MenuItem
+//wparam = MenuObjectHandle
+//lparam = PMO_MenuItem
int FindRoot(PMO_IntMenuItem pimi, void* param)
{
@@ -728,7 +728,7 @@ static int WhereToPlace(HMENU hMenu, PMO_MenuItem mi)
MENUITEMINFO mii = { 0 };
mii.cbSize = MENUITEMINFO_V4_SIZE;
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
- for (int i=GetMenuItemCount(hMenu)-1; i >= 0; i--) {
+ for (int i = GetMenuItemCount(hMenu)-1; i >= 0; i--) {
GetMenuItemInfo(hMenu, i, TRUE, &mii);
if (mii.fType != MFT_SEPARATOR) {
PMO_IntMenuItem pimi = MO_GetIntMenuItem((HGENMENU)mii.dwItemData);
@@ -1007,7 +1007,7 @@ static int MO_ReloadIcon(PMO_IntMenuItem pmi, void*)
if (newIcon)
ImageList_ReplaceIcon(pmi->parent->m_hMenuIcons, pmi->iconId, newIcon);
- IconLib_ReleaseIcon(newIcon, 0);
+ IcoLib_ReleaseIcon(newIcon, 0);
}
return FALSE;
@@ -1074,7 +1074,7 @@ static int MO_RegisterIcon(PMO_IntMenuItem pmi, void*)
Safe_DestroyIcon(hIcon);
if (hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)iconame)) {
ImageList_ReplaceIcon(pmi->parent->m_hMenuIcons, pmi->iconId, hIcon);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
}
}
@@ -1183,7 +1183,7 @@ int UnitGenMenu()
if (bIsGenMenuInited) {
{ mir_cslock lck(csMenuHook);
MO_RemoveAllObjects();
- bIsGenMenuInited=false;
+ bIsGenMenuInited = false;
}
DeleteCriticalSection(&csMenuHook);
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp
index 4ec48d0e20..0e45e8efa0 100644
--- a/src/modules/clist/genmenuopt.cpp
+++ b/src/modules/clist/genmenuopt.cpp
@@ -144,9 +144,9 @@ static int BuildMenuObjectsTree(HWND hwndDlg)
if (g_menus[i]->id == (int)hStatusMenuObject || !g_menus[i]->m_bUseUserDefinedItems)
continue;
- tvis.item.lParam = (LPARAM)g_menus[i]->id;
+ tvis.item.lParam = (LPARAM)g_menus[i]->id;
tvis.item.pszText = Langpack_PcharToTchar(g_menus[i]->Name);
- tvis.item.iImage = tvis.item.iSelectedImage = TRUE;
+ tvis.item.iImage = tvis.item.iSelectedImage = TRUE;
TreeView_InsertItem(hTree, &tvis);
mir_free(tvis.item.pszText);
}
@@ -156,8 +156,8 @@ static int BuildMenuObjectsTree(HWND hwndDlg)
static int sortfunc(const void *a, const void *b)
{
lpMenuItemOptData *sd1, *sd2;
- sd1=(lpMenuItemOptData *)a;
- sd2=(lpMenuItemOptData *)b;
+ sd1 = (lpMenuItemOptData *)a;
+ sd2 = (lpMenuItemOptData *)b;
if ((*sd1)->pos > (*sd2)->pos)
return 1;
@@ -186,10 +186,10 @@ static int InsertSeparator(HWND hwndDlg)
PD = (MenuItemOptData*)mir_alloc(sizeof(MenuItemOptData));
ZeroMemory(PD, sizeof(MenuItemOptData));
- PD->id = -1;
+ PD->id = -1;
PD->name = mir_tstrdup(STR_SEPARATOR);
PD->show = TRUE;
- PD->pos = ((MenuItemOptData *)tvi.lParam)->pos-1;
+ PD->pos = ((MenuItemOptData *)tvi.lParam)->pos-1;
tvis.item.lParam = (LPARAM)(PD);
tvis.item.pszText = PD->name;
@@ -320,7 +320,7 @@ static int BuildTree(HWND hwndDlg, int MenuObjectId, BOOL bReread)
HTREEITEM hti = (HTREEITEM)SendDlgItemMessage(hwndDlg, IDC_MENUITEMS, TVM_INSERTITEM, 0, (LPARAM)&tvis);
if (first) {
TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), hti);
- first=FALSE;
+ first = FALSE;
}
lastpos = PDar[i]->pos;
@@ -371,51 +371,51 @@ static HTREEITEM MoveItemAbove(HWND hTreeWnd, HTREEITEM hItem, HTREEITEM hInsert
return NULL;
if ( !TreeView_DeleteItem(hTreeWnd, hItem))
return NULL;
- tvis.hParent=NULL;
- tvis.hInsertAfter=hInsertAfter;
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = hInsertAfter;
return TreeView_InsertItem(hTreeWnd, &tvis);
}
return NULL;
}
-WNDPROC MyOldWindowProc=NULL;
+WNDPROC MyOldWindowProc = NULL;
LRESULT CALLBACK LBTNDOWNProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_LBUTTONDOWN && !(GetKeyState(VK_CONTROL)&0x8000)) {
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
// ClientToScreen(hwndDlg, &hti.pt);
// ScreenToClient(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt);
TreeView_HitTest(hwnd, &hti);
if (hti.flags&TVHT_ONITEMLABEL) {
/// LabelClicked Set/unset selection
TVITEM tvi;
- HWND tvw=hwnd;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hti.hItem;
+ HWND tvw = hwnd;
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = hti.hItem;
TreeView_GetItem(tvw, &tvi);
if ( !((MenuItemOptData *)tvi.lParam)->isSelected) { /* is not Selected*/
// reset all selection except current
HTREEITEM hit;
- hit=TreeView_GetRoot(tvw);
+ hit = TreeView_GetRoot(tvw);
if (hit)
do {
- TVITEM tvi={0};
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hit;
+ TVITEM tvi = {0};
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = hit;
TreeView_GetItem(tvw, &tvi);
if (hti.hItem != hit)
- ((MenuItemOptData *)tvi.lParam)->isSelected=0;
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 0;
else
- ((MenuItemOptData *)tvi.lParam)->isSelected=1;
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 1;
TreeView_SetItem(tvw, &tvi);
}
- while (hit=TreeView_GetNextSibling(tvw, hit));
+ while (hit = TreeView_GetNextSibling(tvw, hit));
} } }
return CallWindowProc(MyOldWindowProc, hwnd, uMsg, wParam, lParam);
@@ -429,7 +429,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- dat=(struct OrderData*)mir_alloc(sizeof(struct OrderData));
+ dat = (struct OrderData*)mir_alloc(sizeof(struct OrderData));
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_USERDATA, (LONG_PTR)dat);
dat->dragging = 0;
dat->iInitMenuValue = DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE);
@@ -437,7 +437,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_WNDPROC, (LONG_PTR)&LBTNDOWNProc);
{
HIMAGELIST himlCheckBoxes;
- himlCheckBoxes=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
+ himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
(IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 2, 2);
ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_NOTICK);
@@ -476,12 +476,12 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
HTREEITEM hti;
MenuItemOptData *iod;
- hti=TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS));
+ hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS));
if (hti == NULL)
break;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
- tvi.hItem=hti;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
+ tvi.hItem = hti;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), &tvi);
iod = (MenuItemOptData *)tvi.lParam;
@@ -557,33 +557,33 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
switch (hdr->code) {
case NM_CUSTOMDRAW:
{
- int i= handleCustomDraw(GetDlgItem(hwndDlg, IDC_MENUITEMS), (LPNMTVCUSTOMDRAW) lParam);
+ int i = handleCustomDraw(GetDlgItem(hwndDlg, IDC_MENUITEMS), (LPNMTVCUSTOMDRAW) lParam);
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, i);
return TRUE;
}
case TVN_BEGINDRAGA:
SetCapture(hwndDlg);
- dat->dragging=1;
- dat->hDragItem=((LPNMTREEVIEW)lParam)->itemNew.hItem;
+ dat->dragging = 1;
+ dat->hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem;
TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), dat->hDragItem);
break;
case NM_CLICK:
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(hdr->hwndFrom, &hti.pt);
if (TreeView_HitTest(hdr->hwndFrom, &hti)) {
if (hti.flags&TVHT_ONITEMICON) {
TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
- tvi.hItem=hti.hItem;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
+ tvi.hItem = hti.hItem;
TreeView_GetItem(hdr->hwndFrom, &tvi);
- tvi.iImage=tvi.iSelectedImage=!tvi.iImage;
- ((MenuItemOptData *)tvi.lParam)->show=tvi.iImage;
+ tvi.iImage = tvi.iSelectedImage = !tvi.iImage;
+ ((MenuItemOptData *)tvi.lParam)->show = tvi.iImage;
TreeView_SetItem(hdr->hwndFrom, &tvi);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -594,15 +594,15 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (hti.flags&TVHT_ONITEMLABEL) {
/// LabelClicked Set/unset selection
TVITEM tvi;
- HWND tvw=hdr->hwndFrom;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hti.hItem;
+ HWND tvw = hdr->hwndFrom;
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = hti.hItem;
TreeView_GetItem(tvw, &tvi);
if (GetKeyState(VK_CONTROL)&0x8000) {
if (((MenuItemOptData *)tvi.lParam)->isSelected)
- ((MenuItemOptData *)tvi.lParam)->isSelected=0;
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 0;
else
- ((MenuItemOptData *)tvi.lParam)->isSelected=1; //current selection order++.
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 1; //current selection order++.
TreeView_SetItem(tvw, &tvi);
}
else if (GetKeyState(VK_SHIFT)&0x8000) {
@@ -611,21 +611,21 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
else {
// reset all selection except current
HTREEITEM hit;
- hit=TreeView_GetRoot(tvw);
+ hit = TreeView_GetRoot(tvw);
if (hit)
do {
- TVITEM tvi={0};
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hit;
+ TVITEM tvi = {0};
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = hit;
TreeView_GetItem(tvw, &tvi);
if (hti.hItem != hit)
- ((MenuItemOptData *)tvi.lParam)->isSelected=0;
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 0;
else
- ((MenuItemOptData *)tvi.lParam)->isSelected=1;
+ ((MenuItemOptData *)tvi.lParam)->isSelected = 1;
TreeView_SetItem(tvw, &tvi);
}
- while (hit=TreeView_GetNextSibling(tvw, hit));
+ while (hit = TreeView_GetNextSibling(tvw, hit));
} } }
break;
}
@@ -633,7 +633,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
LPNMTREEVIEW pn;
pn = (LPNMTREEVIEW) lParam;
- //((MenuItemOptData *)(pn->itemNew.lParam))->isSelected=1;
+ //((MenuItemOptData *)(pn->itemNew.lParam))->isSelected = 1;
/*if (pn->action == NotKeyPressed)
{
remove all selection
@@ -653,12 +653,12 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_DEFAULT), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_SET), FALSE);
- hti=TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS));
+ hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS));
if (hti == NULL)
break;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
- tvi.hItem=hti;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
+ tvi.hItem = hti;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), &tvi);
if (tvi.lParam == 0)
@@ -688,8 +688,8 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg, &hti.pt);
ScreenToClient(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt);
TreeView_HitTest(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti);
@@ -714,53 +714,53 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
break;
TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_MENUITEMS), NULL, 0);
- dat->dragging=0;
+ dat->dragging = 0;
ReleaseCapture();
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg, &hti.pt);
ScreenToClient(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt);
hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_MENUITEMS))/2;
TreeView_HitTest(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti);
- if (hti.flags&TVHT_ABOVE) hti.hItem=TVI_FIRST;
+ if (hti.flags&TVHT_ABOVE) hti.hItem = TVI_FIRST;
if (dat->hDragItem == hti.hItem) break;
- dat->hDragItem=NULL;
+ dat->hDragItem = NULL;
if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) {
HWND tvw;
HTREEITEM * pSIT;
- HTREEITEM FirstItem=NULL;
+ HTREEITEM FirstItem = NULL;
UINT uITCnt, uSic;
- tvw=GetDlgItem(hwndDlg, IDC_MENUITEMS);
- uITCnt=TreeView_GetCount(tvw);
- uSic=0;
+ tvw = GetDlgItem(hwndDlg, IDC_MENUITEMS);
+ uITCnt = TreeView_GetCount(tvw);
+ uSic = 0;
if (uITCnt) {
- pSIT=(HTREEITEM *)mir_alloc(sizeof(HTREEITEM)*uITCnt);
+ pSIT = (HTREEITEM *)mir_alloc(sizeof(HTREEITEM)*uITCnt);
if (pSIT) {
HTREEITEM hit;
- hit=TreeView_GetRoot(tvw);
+ hit = TreeView_GetRoot(tvw);
if (hit)
do {
- TVITEM tvi={0};
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hit;
+ TVITEM tvi = {0};
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = hit;
TreeView_GetItem(tvw, &tvi);
if (((MenuItemOptData *)tvi.lParam)->isSelected) {
- pSIT[uSic]=tvi.hItem;
+ pSIT[uSic] = tvi.hItem;
uSic++;
}
- }while (hit=TreeView_GetNextSibling(tvw, hit));
+ }while (hit = TreeView_GetNextSibling(tvw, hit));
// Proceed moving
{
UINT i;
HTREEITEM insertAfter;
- insertAfter=hti.hItem;
+ insertAfter = hti.hItem;
for (i=0; i<uSic; i++) {
- if (insertAfter) insertAfter=MoveItemAbove(tvw, pSIT[i], insertAfter);
+ if (insertAfter) insertAfter = MoveItemAbove(tvw, pSIT[i], insertAfter);
else break;
- if ( !i) FirstItem=insertAfter;
+ if ( !i) FirstItem = insertAfter;
} }
// free pointers...
mir_free(pSIT);
@@ -798,20 +798,20 @@ long handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD)
HTREEITEM hItem = (HTREEITEM) pNMTVCD->nmcd.dwItemSpec;
TCHAR buf[255];
TVITEM tvi = {0};
- int k=0;
+ int k = 0;
tvi.mask = TVIF_HANDLE |TVIF_PARAM|TVIS_SELECTED|TVIF_TEXT|TVIF_IMAGE;
- tvi.stateMask=TVIS_SELECTED;
+ tvi.stateMask = TVIS_SELECTED;
tvi.hItem = hItem;
- tvi.pszText=(LPTSTR)(&buf);
- tvi.cchTextMax=254;
+ tvi.pszText = (LPTSTR)(&buf);
+ tvi.cchTextMax = 254;
TreeView_GetItem(hWndTreeView, &tvi);
if (((MenuItemOptData *)tvi.lParam)->isSelected) {
pNMTVCD->clrTextBk = GetSysColor(COLOR_HIGHLIGHT);
- pNMTVCD->clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
+ pNMTVCD->clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
}
else {
pNMTVCD->clrTextBk = GetSysColor(COLOR_WINDOW);
- pNMTVCD->clrText = GetSysColor(COLOR_WINDOWTEXT);
+ pNMTVCD->clrText = GetSysColor(COLOR_WINDOWTEXT);
}
/* At this point, you can change the background colors for the item
@@ -822,14 +822,14 @@ long handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD)
HBRUSH br;
SIZE sz;
RECT rc;
- k=1;
+ k = 1;
GetTextExtentPoint32(pNMTVCD->nmcd.hdc, tvi.pszText, lstrlen(tvi.pszText), &sz);
- if (sz.cx+3>pNMTVCD->nmcd.rc.right-pNMTVCD->nmcd.rc.left) rc=pNMTVCD->nmcd.rc;
+ if (sz.cx+3>pNMTVCD->nmcd.rc.right-pNMTVCD->nmcd.rc.left) rc = pNMTVCD->nmcd.rc;
else SetRect(&rc, pNMTVCD->nmcd.rc.left, pNMTVCD->nmcd.rc.top, pNMTVCD->nmcd.rc.left+sz.cx+3, pNMTVCD->nmcd.rc.bottom);
- br=CreateSolidBrush(pNMTVCD->clrTextBk);
+ br = CreateSolidBrush(pNMTVCD->clrTextBk);
SetTextColor(pNMTVCD->nmcd.hdc, pNMTVCD->clrText);
SetBkColor(pNMTVCD->nmcd.hdc, pNMTVCD->clrTextBk);
FillRect(pNMTVCD->nmcd.hdc, &rc, br);
@@ -848,7 +848,7 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
int GenMenuOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.cbSize=sizeof(odp);
+ odp.cbSize = sizeof(odp);
odp.hInstance = hInst;
odp.pszGroup = LPGEN("Customize");
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp
index 714ed0e223..c3a6403fe0 100644
--- a/src/modules/clist/groups.cpp
+++ b/src/modules/clist/groups.cpp
@@ -34,7 +34,7 @@ static int CountGroups(void)
int i;
char str[33];
- for (i = 0;; i++) {
+ for (i=0;; i++) {
_itoa(i, str, 10);
if (DBGetContactSetting(NULL, "CListGroups", str, &dbv))
break;
@@ -49,7 +49,7 @@ static int GroupNameExists(const TCHAR *name, int skipGroup)
DBVARIANT dbv;
int i;
- for (i = 0;; i++) {
+ for (i=0;; i++) {
if (i == skipGroup)
continue;
_itoa(i, idstr, 10);
@@ -226,7 +226,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM)
int len;
len = lstrlen(name);
- for (i = 0;; i++) {
+ for (i=0;; i++) {
_itoa(i, str, 10);
if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
break;
@@ -291,7 +291,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
int len, i;
len = lstrlen(oldName);
- for (i = 0;; i++) {
+ for (i=0;; i++) {
if (i == groupId)
continue;
_itoa(i, idstr, 10);
@@ -314,7 +314,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
pszLastBackslash = _tcsrchr(str, '\\');
if (pszLastBackslash != NULL) {
*pszLastBackslash = '\0';
- for (i = 0;; i++) {
+ for (i=0;; i++) {
_itoa(i, idstr, 10);
if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
break;
@@ -541,7 +541,7 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM)
int InitGroupServices(void)
{
- for (int i = 0;; i++)
+ for (int i=0;; i++)
{
char str[32];
_itoa(i, str, 10);
diff --git a/src/modules/clist/keyboard.cpp b/src/modules/clist/keyboard.cpp
index 2942f7137e..e580681e5c 100644
--- a/src/modules/clist/keyboard.cpp
+++ b/src/modules/clist/keyboard.cpp
@@ -32,7 +32,7 @@ static INT_PTR hkHideShow(WPARAM, LPARAM)
/*
INT_PTR hkSearch(WPARAM wParam, LPARAM lParam)
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
if ( !DBGetContactSettingString(NULL, "CList", "SearchUrl", &dbv)) {
CallService(MS_UTILS_OPENURL, DBGetContactSettingByte(NULL, "CList", "HKSearchNewWnd", 0), (LPARAM)dbv.pszVal);
DBFreeVariant(&dbv);
@@ -100,11 +100,11 @@ int InitClistHotKeys(void)
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'I');
Hotkey_Register(&shk);
/*
- shk.pszDescription="Search in site";
- shk.pszName="SearchInWeb";
- shk.pszSection="Main";
- shk.pszService="CLIST/HK/Search";
- shk.DefHotKey=846;
+ shk.pszDescription = "Search in site";
+ shk.pszName = "SearchInWeb";
+ shk.pszSection = "Main";
+ shk.pszService = "CLIST/HK/Search";
+ shk.DefHotKey = 846;
Hotkey_Register(&shk);
*/
shk.ptszDescription = _T("Open Options Page");
@@ -129,25 +129,25 @@ int InitClistHotKeys(void)
Hotkey_Register(&shk);
/*
- shk.pszDescription="Close Miranda";
- shk.pszName="CloseMiranda";
- shk.pszSection="Main";
- shk.pszService="CLIST/HK/CloseMiranda";
- shk.DefHotKey=0;
+ shk.pszDescription = "Close Miranda";
+ shk.pszName = "CloseMiranda";
+ shk.pszSection = "Main";
+ shk.pszService = "CLIST/HK/CloseMiranda";
+ shk.DefHotKey = 0;
Hotkey_Register(&shk);
- shk.pszDescription="Restore last status";
- shk.pszName="RestoreLastStatus";
- shk.pszSection="Status";
- shk.pszService="CLIST/HK/RestoreStatus";
- shk.DefHotKey=0;
+ shk.pszDescription = "Restore last status";
+ shk.pszName = "RestoreLastStatus";
+ shk.pszSection = "Status";
+ shk.pszService = "CLIST/HK/RestoreStatus";
+ shk.DefHotKey = 0;
Hotkey_Register(&shk);
- shk.pszDescription="Set All Offline";
- shk.pszName="AllOffline";
- shk.pszSection="Status";
- shk.pszService="CLIST/HK/AllOffline";
- shk.DefHotKey=0;
+ shk.pszDescription = "Set All Offline";
+ shk.pszName = "AllOffline";
+ shk.pszSection = "Status";
+ shk.pszService = "CLIST/HK/AllOffline";
+ shk.DefHotKey = 0;
Hotkey_Register(&shk);
*/
return 0;
diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp
index 2075fa3648..eaf4bc1906 100644
--- a/src/modules/clist/movetogroup.cpp
+++ b/src/modules/clist/movetogroup.cpp
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "..\..\core\commonheaders.h"
HANDLE hOnCntMenuBuild;
-HGENMENU hMoveToGroupItem=0, hPriorityItem = 0, hFloatingItem = 0;
+HGENMENU hMoveToGroupItem = 0, hPriorityItem = 0, hFloatingItem = 0;
LIST<HANDLE> lphGroupsItems(5);
@@ -56,23 +56,23 @@ static TCHAR* PrepareGroupName(TCHAR* str)
d = p = (TCHAR*)mir_alloc(sizeof(TCHAR)*(2*_tcslen(str)+1));
while (*str) {
if (*str == '&')
- *d++ = '&';
- *d++ = *str++;
+ *d++='&';
+ *d++=*str++;
}
- *d++ = 0;
+ *d++=0;
return p;
}
static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, bool checked)
{
CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
- mi.hParentMenu = hRoot;
+ mi.cbSize = sizeof(mi);
+ mi.hParentMenu = hRoot;
mi.popupPosition = param; // param to pszService - only with CMIF_CHILDPOPUP !!!!!!
- mi.position = pos;
- mi.ptszName = PrepareGroupName(name);
- mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.position = pos;
+ mi.ptszName = PrepareGroupName(name);
+ mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
if (checked)
mi.flags |= CMIF_CHECKED;
mi.pszService = MTG_MOVE;
@@ -100,7 +100,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM)
hMoveToGroupItem = Menu_AddContactMenuItem(&mi);
}
- for (i = 0; i < lphGroupsItems.getCount(); i++)
+ for (i=0; i < lphGroupsItems.getCount(); i++)
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)lphGroupsItems[i], 0);
lphGroupsItems.destroy();
@@ -112,7 +112,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM)
pos += 100000; // Separator
- for (i = 0; ; ++i)
+ for (i=0; ; ++i)
{
char intname[20];
_itoa(i, intname, 10);
@@ -127,7 +127,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM)
mir_free(dbv.ptszVal);
}
- for (i = 0; i < groups.getCount(); ++i)
+ for (i=0; i < groups.getCount(); ++i)
{
bool checked = szContactGroup && !_tcscmp(szContactGroup, groups[i].name);
AddGroupItem(hMoveToGroupItem, groups[i].name, ++pos, groups[i].position, checked);
@@ -147,7 +147,7 @@ static INT_PTR MTG_DOMOVE(WPARAM wParam, LPARAM lParam)
void MTG_OnmodulesLoad()
{
- hOnCntMenuBuild=HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnContactMenuBuild);
+ hOnCntMenuBuild = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnContactMenuBuild);
CreateServiceFunction(MTG_MOVE, MTG_DOMOVE);
}
diff --git a/src/modules/clist/protocolorder.cpp b/src/modules/clist/protocolorder.cpp
index 2eeb402f42..cebda085cb 100644
--- a/src/modules/clist/protocolorder.cpp
+++ b/src/modules/clist/protocolorder.cpp
@@ -64,7 +64,7 @@ bool CheckProtocolOrder(void)
for (;;)
{
// Find account with this id
- for (i = 0; i < accounts.getCount(); i++)
+ for (i=0; i < accounts.getCount(); i++)
if (accounts[i]->iOrder == id) break;
// Account with id not found
@@ -72,7 +72,7 @@ bool CheckProtocolOrder(void)
{
// Check if this is skipped id, if it is decrement all other ids
bool found = false;
- for (i = 0; i < accounts.getCount(); i++)
+ for (i=0; i < accounts.getCount(); i++)
{
if (accounts[i]->iOrder < 1000000 && accounts[i]->iOrder > id)
{
@@ -90,7 +90,7 @@ bool CheckProtocolOrder(void)
if (id < accounts.getCount())
{
// Remove huge ids
- for (i = 0; i < accounts.getCount(); i++)
+ for (i=0; i < accounts.getCount(); i++)
{
if (accounts[i]->iOrder >= 1000000)
accounts[i]->iOrder = id++;
@@ -101,7 +101,7 @@ bool CheckProtocolOrder(void)
if (id < accounts.getCount())
{
// Remove duplicate ids
- for (i = 0; i < accounts.getCount(); i++)
+ for (i=0; i < accounts.getCount(); i++)
{
bool found = false;
for (int j = 0; j < accounts.getCount(); j++)
@@ -135,7 +135,7 @@ int FillTree(HWND hwnd)
if (accounts.getCount() == 0)
return FALSE;
- for (i = 0; i < accounts.getCount(); i++) {
+ for (i=0; i < accounts.getCount(); i++) {
int idx = cli.pfnGetAccountIndexByPos(i);
if (idx == -1)
continue;
@@ -173,7 +173,7 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TranslateDialogDefault(hwndDlg);
dat = (ProtocolOrderData*)mir_calloc(sizeof(ProtocolOrderData));
SetWindowLongPtr(hwndProtoOrder, GWLP_USERDATA, (LONG_PTR)dat);
- dat->dragging=0;
+ dat->dragging = 0;
SetWindowLongPtr(hwndProtoOrder, GWL_STYLE, GetWindowLongPtr(hwndProtoOrder, GWL_STYLE) | TVS_NOHSCROLL);
{
@@ -189,7 +189,7 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case WM_COMMAND:
if (LOWORD(wParam) == IDC_RESETPROTOCOLDATA && HIWORD(wParam) == BN_CLICKED)
{
- for (int i = 0; i < accounts.getCount(); i++)
+ for (int i=0; i < accounts.getCount(); i++)
accounts[i]->iOrder = i;
FillTree(hwndProtoOrder);
@@ -244,16 +244,16 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case TVN_BEGINDRAGA:
SetCapture(hwndDlg);
- dat->dragging=1;
- dat->hDragItem=((LPNMTREEVIEW)lParam)->itemNew.hItem;
+ dat->dragging = 1;
+ dat->hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem;
TreeView_SelectItem(hwndProtoOrder, dat->hDragItem);
break;
case NM_CLICK:
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti)) {
if (hti.flags & TVHT_ONITEMICON) {
@@ -276,8 +276,8 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case WM_MOUSEMOVE:
if (dat->dragging) {
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg, &hti.pt);
ScreenToClient(hwndProtoOrder, &hti.pt);
TreeView_HitTest(hwndProtoOrder, &hti);
@@ -333,12 +333,12 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
//the pointed lParam will be freed inside TVN_DELETEITEM
//so lets substitute it with 0
- lpOldData=(ProtocolData *)tvis.item.lParam;
- tvis.item.lParam=0;
+ lpOldData = (ProtocolData *)tvis.item.lParam;
+ tvis.item.lParam = 0;
TreeView_SetItem(hwndProtoOrder, &tvis.item);
- tvis.item.lParam=(LPARAM)lpOldData;
+ tvis.item.lParam = (LPARAM)lpOldData;
- //now current item contain lParam=0 we can delete it. the memory will be kept.
+ //now current item contain lParam = 0 we can delete it. the memory will be kept.
TreeView_DeleteItem(hwndProtoOrder, dat->hDragItem);
tvis.hParent = NULL;
tvis.hInsertAfter = hti.hItem;
diff --git a/src/modules/contacts/contacts.cpp b/src/modules/contacts/contacts.cpp
index 096725972a..dbdd874fbb 100644
--- a/src/modules/contacts/contacts.cpp
+++ b/src/modules/contacts/contacts.cpp
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "..\..\core\commonheaders.h"
#define NAMEORDERCOUNT 8
-static TCHAR* nameOrderDescr[ NAMEORDERCOUNT ] =
+static TCHAR* nameOrderDescr[ NAMEORDERCOUNT ] =
{
_T("My custom name (not moveable)"),
_T("Nick"),
@@ -357,14 +357,14 @@ struct ContactOptionsData {
static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
{ struct ContactOptionsData *dat;
- dat=(struct ContactOptionsData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ dat = (struct ContactOptionsData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg)
{
case WM_INITDIALOG:
{ TranslateDialogDefault(hwndDlg);
- dat=(struct ContactOptionsData*)mir_alloc(sizeof(struct ContactOptionsData));
+ dat = (struct ContactOptionsData*)mir_alloc(sizeof(struct ContactOptionsData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- dat->dragging=0;
+ dat->dragging = 0;
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NAMEORDER), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NAMEORDER), GWL_STYLE)|TVS_NOHSCROLL);
{ TVINSERTSTRUCT tvis;
int i;
@@ -408,8 +408,8 @@ static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPara
if (notify->itemNew.lParam == 0 || notify->itemNew.lParam == SIZEOF(nameOrderDescr)-1)
break;
SetCapture(hwndDlg);
- dat->dragging=1;
- dat->hDragItem=((LPNMTREEVIEW)lParam)->itemNew.hItem;
+ dat->dragging = 1;
+ dat->hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem;
TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), dat->hDragItem);
}
break;
@@ -418,8 +418,8 @@ static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPara
case WM_MOUSEMOVE:
if ( !dat->dragging) break;
{ TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg, &hti.pt);
ScreenToClient(GetDlgItem(hwndDlg, IDC_NAMEORDER), &hti.pt);
TreeView_HitTest(GetDlgItem(hwndDlg, IDC_NAMEORDER), &hti);
@@ -438,33 +438,33 @@ static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPara
case WM_LBUTTONUP:
if ( !dat->dragging) break;
TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_NAMEORDER), NULL, 0);
- dat->dragging=0;
+ dat->dragging = 0;
ReleaseCapture();
{ TVHITTESTINFO hti;
TVITEM tvi;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg, &hti.pt);
ScreenToClient(GetDlgItem(hwndDlg, IDC_NAMEORDER), &hti.pt);
hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_NAMEORDER))/2;
TreeView_HitTest(GetDlgItem(hwndDlg, IDC_NAMEORDER), &hti);
if (dat->hDragItem == hti.hItem) break;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hti.hItem;
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = hti.hItem;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), &tvi);
if (tvi.lParam == SIZEOF(nameOrderDescr)-1) break;
if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)) {
TVINSERTSTRUCT tvis;
TCHAR name[128];
- tvis.item.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT|TVIF_PARAM;
- tvis.item.stateMask=0xFFFFFFFF;
- tvis.item.pszText=name;
- tvis.item.cchTextMax=SIZEOF(name);
- tvis.item.hItem=dat->hDragItem;
+ tvis.item.mask = TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT|TVIF_PARAM;
+ tvis.item.stateMask = 0xFFFFFFFF;
+ tvis.item.pszText = name;
+ tvis.item.cchTextMax = SIZEOF(name);
+ tvis.item.hItem = dat->hDragItem;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), &tvis.item);
TreeView_DeleteItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), dat->hDragItem);
- tvis.hParent=NULL;
- tvis.hInsertAfter=hti.hItem;
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = hti.hItem;
TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), &tvis));
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
@@ -495,7 +495,7 @@ static int ContactOptInit(WPARAM wParam, LPARAM)
int LoadContactsModule(void)
{
for (BYTE i=0; i < NAMEORDERCOUNT; i++)
- nameOrder[i]=i;
+ nameOrder[i] = i;
DBVARIANT dbv;
if ( !DBGetContactSetting(NULL, "Contact", "NameOrder", &dbv)) {
diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp
index ec97fcaa9f..d9299c6c5d 100644
--- a/src/modules/database/database.cpp
+++ b/src/modules/database/database.cpp
@@ -66,7 +66,7 @@ bool IsInsideRootDir(TCHAR* profiledir, bool exact)
}
// returns 1 if the profile path was returned, without trailing slash
-int getProfilePath(TCHAR * buf, size_t cch)
+int getProfilePath(TCHAR *buf, size_t cch)
{
TCHAR profiledir[MAX_PATH];
GetPrivateProfileString(_T("Database"), _T("ProfileDir"), _T(""), profiledir, SIZEOF(profiledir), mirandabootini);
@@ -114,7 +114,7 @@ bool shouldAutoCreate(TCHAR *szProfile)
return _tcsicmp(ac, _T("yes")) == 0;
}
-static void getDefaultProfile(TCHAR * szProfile, size_t cch, TCHAR * profiledir)
+static void getDefaultProfile(TCHAR *szProfile, size_t cch, TCHAR *profiledir)
{
TCHAR defaultProfile[MAX_PATH];
GetPrivateProfileString(_T("Database"), _T("DefaultProfile"), _T(""), defaultProfile, SIZEOF(defaultProfile), mirandabootini);
@@ -131,12 +131,12 @@ static void getDefaultProfile(TCHAR * szProfile, size_t cch, TCHAR * profiledir)
}
// returns 1 if something that looks like a profile is there
-static int getProfileCmdLineArgs(TCHAR * szProfile, size_t cch)
+static int getProfileCmdLineArgs(TCHAR *szProfile, size_t cch)
{
TCHAR *szCmdLine = GetCommandLine();
TCHAR *szEndOfParam;
TCHAR szThisParam[1024];
- int firstParam=1;
+ int firstParam = 1;
while (szCmdLine[0])
{
@@ -153,8 +153,8 @@ static int getProfileCmdLineArgs(TCHAR * szProfile, size_t cch)
lstrcpyn(szThisParam, szCmdLine, min(SIZEOF(szThisParam), szEndOfParam - szCmdLine+1));
szCmdLine = szEndOfParam;
}
- while (*szCmdLine && *szCmdLine<=' ') szCmdLine++;
- if (firstParam) { firstParam=0; continue; } //first param is executable name
+ while (*szCmdLine && *szCmdLine <= ' ') szCmdLine++;
+ if (firstParam) { firstParam = 0; continue; } //first param is executable name
if (szThisParam[0] == '/' || szThisParam[0] == '-') continue; //no switches supported
TCHAR* res = Utils_ReplaceVarsT(szThisParam);
@@ -166,7 +166,7 @@ static int getProfileCmdLineArgs(TCHAR * szProfile, size_t cch)
return 0;
}
-void getProfileCmdLine(TCHAR * szProfile, size_t cch, TCHAR * profiledir)
+void getProfileCmdLine(TCHAR *szProfile, size_t cch, TCHAR *profiledir)
{
TCHAR buf[MAX_PATH];
if (getProfileCmdLineArgs(buf, SIZEOF(buf)))
@@ -202,7 +202,7 @@ void getProfileCmdLine(TCHAR * szProfile, size_t cch, TCHAR * profiledir)
}
// move profile from profile subdir
-static void moveProfileDirProfiles(TCHAR * profiledir, BOOL isRootDir = TRUE)
+static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE)
{
TCHAR pfd[MAX_PATH];
if (isRootDir) {
@@ -217,19 +217,19 @@ static void moveProfileDirProfiles(TCHAR * profiledir, BOOL isRootDir = TRUE)
HANDLE hFind = FindFirstFile(pfd, &ffd);
if (hFind != INVALID_HANDLE_VALUE)
{
- TCHAR *c =_tcsrchr(pfd, '\\'); if (c) *c = 0;
+ TCHAR *c = _tcsrchr(pfd, '\\'); if (c) *c = 0;
do
{
TCHAR path[MAX_PATH], path2[MAX_PATH];
TCHAR* profile = mir_tstrdup(ffd.cFileName);
- TCHAR *c =_tcsrchr(profile, '.'); if (c) *c = 0;
+ TCHAR *c = _tcsrchr(profile, '.'); if (c) *c = 0;
mir_sntprintf(path, SIZEOF(path), _T("%s\\%s"), pfd, ffd.cFileName);
mir_sntprintf(path2, SIZEOF(path2), _T("%s\\%s"), profiledir, profile);
CreateDirectoryTreeT(path2);
mir_sntprintf(path2, SIZEOF(path2), _T("%s\\%s\\%s"), profiledir, profile, ffd.cFileName);
if (_taccess(path2, 0) == 0)
{
- const TCHAR tszMoveMsg[] =
+ const TCHAR tszMoveMsg[] =
_T("Miranda is trying upgrade your profile structure.\n")
_T("It cannot move profile %s to the new location %s\n")
_T("Because profile with this name already exist. Please resolve the issue manually.");
@@ -240,7 +240,7 @@ static void moveProfileDirProfiles(TCHAR * profiledir, BOOL isRootDir = TRUE)
}
else if (MoveFile(path, path2) == 0)
{
- const TCHAR tszMoveMsg[] =
+ const TCHAR tszMoveMsg[] =
_T("Miranda is trying upgrade your profile structure.\n")
_T("It cannot move profile %s to the new location %s automatically\n")
_T("Most likely due to insufficient privileges. Please move profile manually.");
@@ -258,7 +258,7 @@ static void moveProfileDirProfiles(TCHAR * profiledir, BOOL isRootDir = TRUE)
}
// returns 1 if a single profile (full path) is found within the profile dir
-static int getProfile1(TCHAR * szProfile, size_t cch, TCHAR * profiledir, BOOL * noProfiles)
+static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * noProfiles)
{
unsigned int found = 0;
@@ -307,7 +307,7 @@ static int getProfile1(TCHAR * szProfile, size_t cch, TCHAR * profiledir, BOOL *
}
// returns 1 if a default profile should be selected instead of showing the manager.
-static int getProfileAutoRun(TCHAR * szProfile)
+static int getProfileAutoRun(TCHAR *szProfile)
{
TCHAR Mgr[32];
GetPrivateProfileString(_T("Database"), _T("ShowProfileMgr"), _T(""), Mgr, SIZEOF(Mgr), mirandabootini);
@@ -318,7 +318,7 @@ static int getProfileAutoRun(TCHAR * szProfile)
}
// returns 1 if a profile was selected
-static int getProfile(TCHAR * szProfile, size_t cch)
+static int getProfile(TCHAR *szProfile, size_t cch)
{
getProfilePath(g_profileDir, SIZEOF(g_profileDir));
if (IsInsideRootDir(g_profileDir, true))
@@ -371,12 +371,12 @@ char* makeFileName(const TCHAR* tszOriginalName)
}
// called by the UI, return 1 on success, use link to create profile, set error if any
-int makeDatabase(TCHAR * profile, DATABASELINK * link, HWND hwndDlg)
+int makeDatabase(TCHAR *profile, DATABASELINK * link, HWND hwndDlg)
{
TCHAR buf[256];
- int err=0;
+ int err = 0;
// check if the file already exists
- TCHAR * file = _tcsrchr(profile, '\\');
+ TCHAR *file = _tcsrchr(profile, '\\');
if (file) file++;
if (_taccess(profile, 0) == 0) {
// file already exists!
@@ -475,7 +475,7 @@ static int FindDbPluginAutoCreate(const char*, DATABASELINK * dblink, LPARAM lPa
}
typedef struct {
- TCHAR * profile;
+ TCHAR *profile;
UINT msg;
ATOM aPath;
int found;
@@ -485,7 +485,7 @@ static BOOL CALLBACK EnumMirandaWindows(HWND hwnd, LPARAM lParam)
{
TCHAR classname[256];
ENUMMIRANDAWINDOW * x = (ENUMMIRANDAWINDOW *)lParam;
- DWORD_PTR res=0;
+ DWORD_PTR res = 0;
if (GetClassName(hwnd, classname, SIZEOF(classname)) && lstrcmp(_T("Miranda"), classname) == 0) {
if (SendMessageTimeout(hwnd, x->msg, (WPARAM)x->aPath, 0, SMTO_ABORTIFHUNG, 100, &res) && res) {
x->found++;
@@ -495,12 +495,12 @@ static BOOL CALLBACK EnumMirandaWindows(HWND hwnd, LPARAM lParam)
return TRUE;
}
-static int FindMirandaForProfile(TCHAR * szProfile)
+static int FindMirandaForProfile(TCHAR *szProfile)
{
- ENUMMIRANDAWINDOW x={0};
- x.profile=szProfile;
- x.msg=RegisterWindowMessage(_T("Miranda::ProcessProfile"));
- x.aPath=GlobalAddAtom(szProfile);
+ ENUMMIRANDAWINDOW x = {0};
+ x.profile = szProfile;
+ x.msg = RegisterWindowMessage(_T("Miranda::ProcessProfile"));
+ x.aPath = GlobalAddAtom(szProfile);
EnumWindows(EnumMirandaWindows, (LPARAM)&x);
GlobalDeleteAtom(x.aPath);
return x.found;
@@ -525,9 +525,9 @@ int LoadDatabaseModule(void)
dbe.lParam = (LPARAM)szProfile;
if (_taccess(szProfile, 0) && shouldAutoCreate(szProfile))
- dbe.pfnEnumCallback=(int(*) (const char*, void*, LPARAM))FindDbPluginAutoCreate;
+ dbe.pfnEnumCallback = (int(*) (const char*, void*, LPARAM))FindDbPluginAutoCreate;
else
- dbe.pfnEnumCallback=(int(*) (const char*, void*, LPARAM))FindDbPluginForProfile;
+ dbe.pfnEnumCallback = (int(*) (const char*, void*, LPARAM))FindDbPluginForProfile;
// find a driver to support the given profile
bool retry;
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp
index 70c1f965af..d8da15eac6 100644
--- a/src/modules/database/dbini.cpp
+++ b/src/modules/database/dbini.cpp
@@ -113,21 +113,21 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM
SetDlgItemTextA(hwndDlg, IDC_SETTINGNAME, szSettingName);
SetDlgItemTextA(hwndDlg, IDC_NEWVALUE, warnInfo->szValue);
if (IsInSpaceSeparatedList(warnInfo->szSection, warnInfo->szSafeSections))
- pszSecurityInfo=LPGENT("This change is known to be safe.");
+ pszSecurityInfo = LPGENT("This change is known to be safe.");
else if (IsInSpaceSeparatedList(warnInfo->szSection, warnInfo->szUnsafeSections))
- pszSecurityInfo=LPGENT("This change is known to be potentially hazardous.");
+ pszSecurityInfo = LPGENT("This change is known to be potentially hazardous.");
else
- pszSecurityInfo=LPGENT("This change is not known to be safe.");
+ pszSecurityInfo = LPGENT("This change is not known to be safe.");
SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
return TRUE;
}
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDCANCEL:
- warnInfo->cancel=1;
+ warnInfo->cancel = 1;
case IDYES:
case IDNO:
- warnInfo->warnNoMore=IsDlgButtonChecked(hwndDlg, IDC_WARNNOMORE);
+ warnInfo->warnNoMore = IsDlgButtonChecked(hwndDlg, IDC_WARNNOMORE);
EndDialog(hwndDlg, LOWORD(wParam));
break;
}
@@ -154,10 +154,10 @@ static INT_PTR CALLBACK IniImportDoneDlgProc(HWND hwndDlg, UINT message, WPARAM
EndDialog(hwndDlg, LOWORD(wParam));
break;
case IDC_RECYCLE:
- { SHFILEOPSTRUCT shfo={0};
- shfo.wFunc=FO_DELETE;
- shfo.pFrom=szIniPath;
- szIniPath[lstrlen(szIniPath)+1]='\0';
+ { SHFILEOPSTRUCT shfo = {0};
+ shfo.wFunc = FO_DELETE;
+ shfo.pFrom = szIniPath;
+ szIniPath[lstrlen(szIniPath)+1] = '\0';
shfo.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO;
SHFileOperation(&shfo);
}
@@ -186,7 +186,7 @@ struct SettingsList
int SettingsEnumProc(const char *szSetting, LPARAM lParam)
{
- SettingsList *newItem = (SettingsList *)mir_alloc(sizeof(SettingsList));
+ SettingsList *newItem = (SettingsList *)mir_alloc(sizeof(SettingsList));
newItem->name = mir_strdup(szSetting);
newItem->next = setting_items;
setting_items = newItem;
@@ -222,10 +222,10 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf
break;
int lineLength = lstrlenA(szLine);
- while (lineLength && (BYTE)(szLine[lineLength-1])<=' ')
- szLine[--lineLength]='\0';
+ while (lineLength && (BYTE)(szLine[lineLength-1]) <= ' ')
+ szLine[--lineLength] = '\0';
- if (szLine[0] == ';' || szLine[0]<=' ')
+ if (szLine[0] == ';' || szLine[0] <= ' ')
continue;
if (szLine[0] == '[') {
@@ -254,14 +254,14 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf
warnThisSection = true;
break;
}
- if (secFN) warnThisSection=0;
+ if (secFN) warnThisSection = 0;
}
if (szLine[1] == '?') {
DBCONTACTENUMSETTINGS dbces;
- dbces.pfnEnumProc=SettingsEnumProc;
+ dbces.pfnEnumProc = SettingsEnumProc;
lstrcpynA(szSection, szLine+2, min(sizeof(szSection), (int)(szEnd-szLine-1)));
- dbces.szModule=szSection;
- dbces.ofsSettings=0;
+ dbces.szModule = szSection;
+ dbces.ofsSettings = 0;
CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&dbces);
while (setting_items) {
SettingsList *next = setting_items->next;
@@ -282,7 +282,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf
if (szSection[0] == '\0')
continue;
- char *szValue=strchr(szLine, '=');
+ char *szValue = strchr(szLine, '=');
if (szValue == NULL)
continue;
@@ -291,20 +291,20 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf
szValue++;
{
warnSettingChangeInfo_t warnInfo;
- warnInfo.szIniPath=szIniPath;
- warnInfo.szName=szName;
- warnInfo.szSafeSections=szSafeSections;
- warnInfo.szSection=szSection;
- warnInfo.szUnsafeSections=szUnsafeSections;
- warnInfo.szValue=szValue;
- warnInfo.warnNoMore=0;
- warnInfo.cancel=0;
+ warnInfo.szIniPath = szIniPath;
+ warnInfo.szName = szName;
+ warnInfo.szSafeSections = szSafeSections;
+ warnInfo.szSection = szSection;
+ warnInfo.szUnsafeSections = szUnsafeSections;
+ warnInfo.szValue = szValue;
+ warnInfo.warnNoMore = 0;
+ warnInfo.cancel = 0;
if (warnThisSection && IDNO == DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_WARNINICHANGE), NULL, WarnIniChangeDlgProc, (LPARAM)&warnInfo))
continue;
if (warnInfo.cancel)
break;
if (warnInfo.warnNoMore)
- warnThisSection=0;
+ warnThisSection = 0;
}
switch(szValue[0]) {
@@ -334,13 +334,13 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf
case 'g':
case 'G':
{ char *pstr;
- for (pstr=szValue+1;*pstr;pstr++) {
+ for (pstr = szValue+1;*pstr;pstr++) {
if (*pstr == '\\') {
switch(pstr[1]) {
- case 'n': *pstr='\n'; break;
- case 't': *pstr='\t'; break;
- case 'r': *pstr='\r'; break;
- default: *pstr=pstr[1]; break;
+ case 'n': *pstr = '\n'; break;
+ case 't': *pstr = '\t'; break;
+ case 'r': *pstr = '\r'; break;
+ default: *pstr = pstr[1]; break;
}
MoveMemory(pstr+1, pstr+2, lstrlenA(pstr+2)+1);
} } }
@@ -357,17 +357,17 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf
char *pszValue, *pszEnd;
DBCONTACTWRITESETTING cws;
- buf=(PBYTE)mir_alloc(lstrlenA(szValue+1));
- for (len=0, pszValue=szValue+1;;len++) {
- buf[len]=(BYTE)strtol(pszValue, &pszEnd, 0x10);
+ buf = (PBYTE)mir_alloc(lstrlenA(szValue+1));
+ for (len = 0, pszValue = szValue+1;;len++) {
+ buf[len] = (BYTE)strtol(pszValue, &pszEnd, 0x10);
if (pszValue == pszEnd) break;
- pszValue=pszEnd;
+ pszValue = pszEnd;
}
- cws.szModule=szSection;
- cws.szSetting=szName;
- cws.value.type=DBVT_BLOB;
- cws.value.pbVal=buf;
- cws.value.cpbVal=len;
+ cws.szModule = szSection;
+ cws.szSetting = szName;
+ cws.value.type = DBVT_BLOB;
+ cws.value.pbVal = buf;
+ cws.value.cpbVal = len;
CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)(HANDLE)NULL, (LPARAM)&cws);
mir_free(buf);
}
@@ -432,7 +432,7 @@ static void DoAutoExec(void)
mir_sntprintf(szIniPath, SIZEOF(szIniPath), _T("%s%s"), szFindPath, fd.cFileName);
if ( !lstrcmpi(szUse, _T("prompt")) && !secFN) {
- int result=DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INSTALLINI), NULL, InstallIniDlgProc, (LPARAM)szIniPath);
+ int result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INSTALLINI), NULL, InstallIniDlgProc, (LPARAM)szIniPath);
if (result == IDC_NOTOALL) break;
if (result == IDCANCEL) continue;
}
@@ -447,11 +447,11 @@ static void DoAutoExec(void)
if ( !lstrcmpi(szOnCompletion, _T("delete")))
DeleteFile(szIniPath);
else if ( !lstrcmpi(szOnCompletion, _T("recycle"))) {
- SHFILEOPSTRUCT shfo={0};
- shfo.wFunc=FO_DELETE;
- shfo.pFrom=szIniPath;
- szIniPath[lstrlen(szIniPath)+1]=0;
- shfo.fFlags=FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO;
+ SHFILEOPSTRUCT shfo = {0};
+ shfo.wFunc = FO_DELETE;
+ shfo.pFrom = szIniPath;
+ szIniPath[lstrlen(szIniPath)+1] = 0;
+ shfo.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO;
SHFileOperation(&shfo);
}
else if ( !lstrcmpi(szOnCompletion, _T("rename"))) {
@@ -487,7 +487,7 @@ int InitIni(void)
DoAutoExec();
PathToAbsoluteT(_T("."), szMirandaDir, NULL);
- hIniChangeNotification=FindFirstChangeNotification(szMirandaDir, 0, FILE_NOTIFY_CHANGE_FILE_NAME);
+ hIniChangeNotification = FindFirstChangeNotification(szMirandaDir, 0, FILE_NOTIFY_CHANGE_FILE_NAME);
if (hIniChangeNotification != INVALID_HANDLE_VALUE) {
CreateServiceFunction("DB/Ini/CheckImportNow", CheckIniImportNow);
CallService(MS_SYSTEM_WAITONHANDLE, (WPARAM)hIniChangeNotification, (LPARAM)"DB/Ini/CheckImportNow");
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp
index 54b352bb4d..1e62b160b4 100644
--- a/src/modules/database/dbutils.cpp
+++ b/src/modules/database/dbutils.cpp
@@ -45,7 +45,7 @@ static INT_PTR DbEventTypeRegister(WPARAM, LPARAM lParam)
p->cbSize = DBEVENTTYPEDESCR_SIZE;
p->module = mir_strdup(et->module);
p->eventType = et->eventType;
- p->descr = mir_strdup(et->descr);
+ p->descr = mir_strdup(et->descr);
p->textService = NULL;
p->iconService = NULL;
p->eventIcon = NULL;
@@ -132,7 +132,7 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam)
}
else {
size_t msglen = strlen((char*)dbei->pBlob) + 1, msglenW = 0;
- if (msglen != dbei->cbBlob) {
+ if (msglen != dbei->cbBlob) {
size_t i, count = ((dbei->cbBlob - msglen) / sizeof(WCHAR));
WCHAR* p = (WCHAR*)&dbei->pBlob[ msglen ];
for (i=0; i < count; i++) {
@@ -231,7 +231,7 @@ static INT_PTR DbDeleteModule(WPARAM, LPARAM lParam)
dbces.szModule = (char*)lParam;
CallService(MS_DB_CONTACT_ENUMSETTINGS, NULL, (LPARAM)&dbces);
- for (int i=vars.getCount()-1; i >= 0; i--) {
+ for (int i = vars.getCount()-1; i >= 0; i--) {
DBDeleteContactSetting(NULL, (char*)lParam, vars[i]);
mir_free(vars[i]);
}
diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp
index 32e515efbe..558646e510 100644
--- a/src/modules/database/profilemanager.cpp
+++ b/src/modules/database/profilemanager.cpp
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define WM_INPUTCHANGED (WM_USER + 0x3000)
#define WM_FOCUSTEXTBOX (WM_USER + 0x3001)
-typedef BOOL (__cdecl *ENUMPROFILECALLBACK) (TCHAR * fullpath, TCHAR * profile, LPARAM lParam);
+typedef BOOL (__cdecl *ENUMPROFILECALLBACK) (TCHAR *fullpath, TCHAR *profile, LPARAM lParam);
struct DetailsPageInit {
int pageCount;
@@ -76,7 +76,7 @@ static void ThemeDialogBackground(HWND hwnd)
enableThemeDialogTexture(hwnd, ETDT_ENABLETAB);
}
-static int findProfiles(TCHAR * szProfileDir, ENUMPROFILECALLBACK callback, LPARAM lParam)
+static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARAM lParam)
{
// find in Miranda IM profile subfolders
HANDLE hFind = INVALID_HANDLE_VALUE;
@@ -242,19 +242,19 @@ char* fullpath = makeFileName((TCHAR*)lParam);
return DBPE_CONT;
}
-BOOL EnumProfilesForList(TCHAR * fullpath, TCHAR * profile, LPARAM lParam)
+BOOL EnumProfilesForList(TCHAR *fullpath, TCHAR *profile, LPARAM lParam)
{
ProfileEnumData *ped = (ProfileEnumData*)lParam;
HWND hwndList = GetDlgItem(ped->hwnd, IDC_PROFILELIST);
TCHAR sizeBuf[64];
- int iItem=0;
+ int iItem = 0;
struct _stat statbuf;
bool bFileExists = false, bFileLocked = true;
TCHAR* p = _tcsrchr(profile, '.');
_tcscpy(sizeBuf, _T("0 KB"));
- if (p != NULL) *p=0;
+ if (p != NULL) *p = 0;
LVITEM item = { 0 };
item.mask = LVIF_TEXT | LVIF_IMAGE;
@@ -371,23 +371,23 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam,
// set columns
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.pszText = TranslateT("Profile");
- col.cx=122;
+ col.cx = 122;
ListView_InsertColumn(hwndList, 0, &col);
col.pszText = TranslateT("Driver");
- col.cx=100;
+ col.cx = 100;
ListView_InsertColumn(hwndList, 1, &col);
col.pszText = TranslateT("Size");
- col.cx=60;
+ col.cx = 60;
ListView_InsertColumn(hwndList, 2, &col);
col.pszText = TranslateT("Created");
- col.cx=145;
+ col.cx = 145;
ListView_InsertColumn(hwndList, 3, &col);
col.pszText = TranslateT("Modified");
- col.cx=145;
+ col.cx = 145;
ListView_InsertColumn(hwndList, 4, &col);
// icons
@@ -445,13 +445,13 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_CONTEXTMENU:
{
LVHITTESTINFO lvht = {0};
- lvht.pt.x = GET_X_LPARAM(lParam);
- lvht.pt.y = GET_Y_LPARAM(lParam);
+ lvht.pt.x = GET_X_LPARAM(lParam);
+ lvht.pt.y = GET_Y_LPARAM(lParam);
ScreenToClient(hwndList, &lvht.pt);
if (ListView_HitTest(hwndList, &lvht) < 0) break;
- lvht.pt.x = GET_X_LPARAM(lParam);
- lvht.pt.y = GET_Y_LPARAM(lParam);
+ lvht.pt.x = GET_X_LPARAM(lParam);
+ lvht.pt.y = GET_Y_LPARAM(lParam);
HMENU hMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_STRING, 1, TranslateT("Run"));
@@ -600,7 +600,7 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam,
ShowWindow(GetDlgItem(hwndDlg, IDC_SM_LABEL), FALSE);
ShowWindow(GetDlgItem(hwndDlg, IDC_SM_COMBO), FALSE);
} else {
- int i = 0;
+ int i=0;
LRESULT index;
HWND hwndCombo = GetDlgItem(hwndDlg, IDC_SM_COMBO);
index = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)_T(""));
@@ -628,7 +628,7 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case PSM_CHANGED:
- dat->opd[dat->currentPage].changed=1;
+ dat->opd[dat->currentPage].changed = 1;
return TRUE;
case PSM_FORCECHANGED:
@@ -671,13 +671,13 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam,
if (dat->currentPage != -1) {
if (dat->opd[dat->currentPage].hwnd == NULL) {
PSHNOTIFY pshn;
- dat->opd[dat->currentPage].hwnd=CreateDialogIndirectParam(dat->opd[dat->currentPage].hInst, dat->opd[dat->currentPage].pTemplate, hwndDlg, dat->opd[dat->currentPage].dlgProc, (LPARAM)dat->prof);
+ dat->opd[dat->currentPage].hwnd = CreateDialogIndirectParam(dat->opd[dat->currentPage].hInst, dat->opd[dat->currentPage].pTemplate, hwndDlg, dat->opd[dat->currentPage].dlgProc, (LPARAM)dat->prof);
ThemeDialogBackground(dat->opd[dat->currentPage].hwnd);
SetWindowPos(dat->opd[dat->currentPage].hwnd, HWND_TOP, dat->rcDisplay.left, dat->rcDisplay.top, 0, 0, SWP_NOSIZE);
- pshn.hdr.code=PSN_INFOCHANGED;
- pshn.hdr.hwndFrom=dat->opd[dat->currentPage].hwnd;
- pshn.hdr.idFrom=0;
- pshn.lParam=(LPARAM)0;
+ pshn.hdr.code = PSN_INFOCHANGED;
+ pshn.hdr.hwndFrom = dat->opd[dat->currentPage].hwnd;
+ pshn.hdr.idFrom = 0;
+ pshn.lParam = (LPARAM)0;
SendMessage(dat->opd[dat->currentPage].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
}
ShowWindow(dat->opd[dat->currentPage].hwnd, SW_SHOW);
@@ -693,12 +693,12 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam,
case IDCANCEL:
{ int i;
PSHNOTIFY pshn;
- pshn.hdr.idFrom=0;
- pshn.lParam=0;
- pshn.hdr.code=PSN_RESET;
+ pshn.hdr.idFrom = 0;
+ pshn.lParam = 0;
+ pshn.hdr.code = PSN_RESET;
for (i=0;i<dat->pageCount;i++) {
if (dat->opd[i].hwnd == NULL || !dat->opd[i].changed) continue;
- pshn.hdr.hwndFrom=dat->opd[i].hwnd;
+ pshn.hdr.hwndFrom = dat->opd[i].hwnd;
SendMessage(dat->opd[i].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
}
EndDialog(hwndDlg, 0);
@@ -716,8 +716,8 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam,
{
int i;
PSHNOTIFY pshn;
- pshn.hdr.idFrom=0;
- pshn.lParam=(LPARAM)0;
+ pshn.hdr.idFrom = 0;
+ pshn.lParam = (LPARAM)0;
if (dat->currentPage != -1) {
pshn.hdr.code = PSN_KILLACTIVE;
pshn.hdr.hwndFrom = dat->opd[dat->currentPage].hwnd;
@@ -725,7 +725,7 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
}
- pshn.hdr.code=PSN_APPLY;
+ pshn.hdr.code = PSN_APPLY;
for (i=0; i < dat->pageCount; i++) {
if (dat->opd[i].hwnd == NULL || !dat->opd[i].changed)
continue;
@@ -776,15 +776,15 @@ static int AddProfileManagerPage(struct DetailsPageInit * opi, OPTIONSDIALOGPAGE
opi->odp = (OPTIONSDIALOGPAGE*)mir_realloc(opi->odp, sizeof(OPTIONSDIALOGPAGE)*(opi->pageCount+1));
{
OPTIONSDIALOGPAGE* p = opi->odp + opi->pageCount++;
- p->cbSize = sizeof(OPTIONSDIALOGPAGE);
- p->hInstance = odp->hInstance;
- p->pfnDlgProc = odp->pfnDlgProc;
- p->position = odp->position;
- p->ptszTitle = Langpack_PcharToTchar(odp->pszTitle);
- p->pszGroup = NULL;
+ p->cbSize = sizeof(OPTIONSDIALOGPAGE);
+ p->hInstance = odp->hInstance;
+ p->pfnDlgProc = odp->pfnDlgProc;
+ p->position = odp->position;
+ p->ptszTitle = Langpack_PcharToTchar(odp->pszTitle);
+ p->pszGroup = NULL;
p->groupPosition = odp->groupPosition;
- p->hGroupIcon = odp->hGroupIcon;
- p->hIcon = odp->hIcon;
+ p->hGroupIcon = odp->hGroupIcon;
+ p->hIcon = odp->hIcon;
if ((DWORD_PTR)odp->pszTemplate & 0xFFFF0000)
p->pszTemplate = mir_strdup(odp->pszTemplate);
else
@@ -796,34 +796,34 @@ static int AddProfileManagerPage(struct DetailsPageInit * opi, OPTIONSDIALOGPAGE
int getProfileManager(PROFILEMANAGERDATA * pd)
{
DetailsPageInit opi;
- opi.pageCount=0;
- opi.odp=NULL;
+ opi.pageCount = 0;
+ opi.odp = NULL;
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.cbSize = sizeof(odp);
- odp.pszTitle = LPGEN("My Profiles");
- odp.pfnDlgProc = DlgProfileSelect;
+ odp.cbSize = sizeof(odp);
+ odp.pszTitle = LPGEN("My Profiles");
+ odp.pfnDlgProc = DlgProfileSelect;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_PROFILE_SELECTION);
- odp.hInstance = hInst;
+ odp.hInstance = hInst;
AddProfileManagerPage(&opi, &odp);
- odp.pszTitle = LPGEN("New Profile");
+ odp.pszTitle = LPGEN("New Profile");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_PROFILE_NEW);
- odp.pfnDlgProc = DlgProfileNew;
+ odp.pfnDlgProc = DlgProfileNew;
AddProfileManagerPage(&opi, &odp);
}
PROPSHEETHEADER psh = { 0 };
- psh.dwSize = sizeof(psh);
- psh.dwFlags = PSH_PROPSHEETPAGE|PSH_NOAPPLYNOW;
+ psh.dwSize = sizeof(psh);
+ psh.dwFlags = PSH_PROPSHEETPAGE|PSH_NOAPPLYNOW;
psh.hwndParent = NULL;
- psh.nPages = opi.pageCount;
+ psh.nPages = opi.pageCount;
psh.pStartPage = 0;
- psh.ppsp = (PROPSHEETPAGE*)opi.odp;
+ psh.ppsp = (PROPSHEETPAGE*)opi.odp;
DlgProfData prof;
- prof.pd = pd;
+ prof.pd = pd;
prof.psh = &psh;
int rc = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_PROFILEMANAGER), NULL, DlgProfileManager, (LPARAM)&prof);
diff --git a/src/modules/database/profilemanager.h b/src/modules/database/profilemanager.h
index 9d4e7821e1..416403f057 100644
--- a/src/modules/database/profilemanager.h
+++ b/src/modules/database/profilemanager.h
@@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
typedef struct {
- TCHAR * szProfile; // in/out
- TCHAR * szProfileDir; // in/out
+ TCHAR *szProfile; // in/out
+ TCHAR *szProfileDir; // in/out
BOOL noProfiles; // in
BOOL newProfile; // out
DATABASELINK * dblink; // out
@@ -32,10 +32,10 @@ typedef struct {
int InitUtils(void);
char* makeFileName(const TCHAR* tszOriginalName);
-int makeDatabase(TCHAR * profile, DATABASELINK * link, HWND hwndDlg);
+int makeDatabase(TCHAR *profile, DATABASELINK * link, HWND hwndDlg);
int getProfileManager(PROFILEMANAGERDATA * pd);
-int getProfilePath(TCHAR * buf, size_t cch);
-int isValidProfileName(const TCHAR * name);
+int getProfilePath(TCHAR *buf, size_t cch);
+int isValidProfileName(const TCHAR *name);
bool fileExist(TCHAR* fname);
bool shouldAutoCreate(TCHAR *szProfile);
diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp
index 297b418067..da55c76cff 100644
--- a/src/modules/findadd/findadd.cpp
+++ b/src/modules/findadd/findadd.cpp
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define HM_SEARCHACK (WM_USER+10)
#define M_SETGROUPVISIBILITIES (WM_USER+11)
-static HWND hwndFindAdd=NULL;
+static HWND hwndFindAdd = NULL;
static HANDLE hHookModulesLoaded = 0;
static HANDLE hMainMenuItem = NULL;
static int OnSystemModulesLoaded(WPARAM wParam, LPARAM lParam);
@@ -38,12 +38,12 @@ static int FindAddDlgResizer(HWND, LPARAM lParam, UTILRESIZECONTROL *urc)
static int y, nextY, oldTop;
struct FindAddDlgData *dat;
- dat=(struct FindAddDlgData*)lParam;
+ dat = (struct FindAddDlgData*)lParam;
switch(urc->wId) {
case IDC_RESULTS:
return RD_ANCHORX_WIDTH|RD_ANCHORY_HEIGHT;
case IDOK:
- dat->minDlgHeight=nextY+urc->rcItem.bottom-urc->rcItem.top;
+ dat->minDlgHeight = nextY+urc->rcItem.bottom-urc->rcItem.top;
return RD_ANCHORX_LEFT|RD_ANCHORY_BOTTOM;
case IDC_ADD:
case IDC_MOREOPTIONS:
@@ -51,35 +51,35 @@ static int FindAddDlgResizer(HWND, LPARAM lParam, UTILRESIZECONTROL *urc)
case IDC_STATUSBAR:
return RD_ANCHORX_WIDTH|RD_ANCHORY_BOTTOM;
case IDC_PROTOIDGROUP: //the resize is always processed in template order
- nextY=y=urc->rcItem.top;
- if (dat->showProtoId) nextY=y+urc->rcItem.bottom-urc->rcItem.top+7;
+ nextY = y = urc->rcItem.top;
+ if (dat->showProtoId) nextY = y+urc->rcItem.bottom-urc->rcItem.top+7;
break;
case IDC_EMAILGROUP:
- oldTop=urc->rcItem.top;
- y=nextY;
- if (dat->showEmail) nextY=y+urc->rcItem.bottom-urc->rcItem.top+7;
+ oldTop = urc->rcItem.top;
+ y = nextY;
+ if (dat->showEmail) nextY = y+urc->rcItem.bottom-urc->rcItem.top+7;
OffsetRect(&urc->rcItem, 0, y-oldTop);
return RD_ANCHORX_LEFT|RD_ANCHORY_CUSTOM;
case IDC_NAMEGROUP:
- oldTop=urc->rcItem.top;
- y=nextY;
- if (dat->showName) nextY=y+urc->rcItem.bottom-urc->rcItem.top+7;
+ oldTop = urc->rcItem.top;
+ y = nextY;
+ if (dat->showName) nextY = y+urc->rcItem.bottom-urc->rcItem.top+7;
OffsetRect(&urc->rcItem, 0, y-oldTop);
return RD_ANCHORX_LEFT|RD_ANCHORY_CUSTOM;
case IDC_ADVANCEDGROUP:
- oldTop=urc->rcItem.top;
- y=nextY;
- if (dat->showAdvanced) nextY=y+urc->rcItem.bottom-urc->rcItem.top+7;
+ oldTop = urc->rcItem.top;
+ y = nextY;
+ if (dat->showAdvanced) nextY = y+urc->rcItem.bottom-urc->rcItem.top+7;
OffsetRect(&urc->rcItem, 0, y-oldTop);
return RD_ANCHORX_LEFT|RD_ANCHORY_CUSTOM;
case IDC_TINYEXTENDEDGROUP:
- oldTop=urc->rcItem.top;
- y=nextY;
+ oldTop = urc->rcItem.top;
+ y = nextY;
if (dat->showTiny)
{
- int height= urc->dlgNewSize.cy-y-(urc->dlgOriginalSize.cy-urc->rcItem.bottom);
- nextY=y+200; //min height for custom dialog
- urc->rcItem.top=urc->rcItem.bottom-height;
+ int height = urc->dlgNewSize.cy-y-(urc->dlgOriginalSize.cy-urc->rcItem.bottom);
+ nextY = y+200; //min height for custom dialog
+ urc->rcItem.top = urc->rcItem.bottom-height;
}
return RD_ANCHORX_LEFT|RD_ANCHORY_BOTTOM;
case IDC_BYEMAIL:
@@ -112,25 +112,25 @@ static void RenderThrobber(HDC hdc, RECT *rcItem, int *throbbing, int *pivot)
int x, width, height, height2;
InflateRect(rcItem, -1, 0);
- width=rcItem->right-rcItem->left;
- height=rcItem->bottom-rcItem->top;
- height2=height/2;
+ width = rcItem->right-rcItem->left;
+ height = rcItem->bottom-rcItem->top;
+ height2 = height/2;
if (*throbbing) {
/* create memdc */
- hMemDC=CreateCompatibleDC(0);
- hBitmap=(HBITMAP)SelectObject(hMemDC, CreateCompatibleBitmap(hdc, width, height));
+ hMemDC = CreateCompatibleDC(0);
+ hBitmap = (HBITMAP)SelectObject(hMemDC, CreateCompatibleBitmap(hdc, width, height));
/* flush it */
- rc.left=rc.top=0;
- rc.right=width;
- rc.bottom=height;
- hBr=GetSysColorBrush(COLOR_BTNFACE);
+ rc.left = rc.top = 0;
+ rc.right = width;
+ rc.bottom = height;
+ hBr = GetSysColorBrush(COLOR_BTNFACE);
FillRect(hMemDC, &rc, hBr);
DeleteObject(hBr);
/* set up the pen */
- hPen=(HPEN)SelectObject(hMemDC, CreatePen(PS_SOLID, 4, GetSysColor(COLOR_BTNSHADOW)));
+ hPen = (HPEN)SelectObject(hMemDC, CreatePen(PS_SOLID, 4, GetSysColor(COLOR_BTNSHADOW)));
/* draw everything before the pivot */
- x=*pivot;
+ x = *pivot;
while (x>(-height)) {
MoveToEx(hMemDC, x+height2, 0, NULL);
LineTo(hMemDC, x-height2, height);
@@ -148,11 +148,11 @@ static void RenderThrobber(HDC hdc, RECT *rcItem, int *throbbing, int *pivot)
/* move the pivot */
*pivot+=2;
/* reset the pivot point if it gets past the rect */
- if (*pivot>width) *pivot=0;
+ if (*pivot>width) *pivot = 0;
/* put back the old pen and delete the new one */
DeleteObject(SelectObject(hMemDC, hPen));
/* cap the top and bottom */
- hPen=(HPEN)SelectObject(hMemDC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNFACE)));
+ hPen = (HPEN)SelectObject(hMemDC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNFACE)));
MoveToEx(hMemDC, 0, 0, NULL);
LineTo(hMemDC, width, 0);
MoveToEx(hMemDC, 0, height-1, NULL);
@@ -162,39 +162,39 @@ static void RenderThrobber(HDC hdc, RECT *rcItem, int *throbbing, int *pivot)
/* paint to screen */
BitBlt(hdc, rcItem->left, rcItem->top, width, height, hMemDC, 0, 0, SRCCOPY);
/* select back in the old bitmap and delete the created one, as well as freeing the mem dc. */
- hBitmap=(HBITMAP)SelectObject(hMemDC, hBitmap);
+ hBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);
DeleteObject(hBitmap);
DeleteDC(hMemDC);
}
else {
/* just flush the DC */
- hBr=GetSysColorBrush(COLOR_BTNFACE);
+ hBr = GetSysColorBrush(COLOR_BTNFACE);
FillRect(hdc, rcItem, hBr);
DeleteObject(hBr);
} }
static void StartThrobber(HWND hwndDlg, struct FindAddDlgData *dat)
{
- dat->throbbing=1;
+ dat->throbbing = 1;
SetTimer(hwndDlg, TIMERID_THROBBER, 25, NULL);
}
static void StopThrobber(HWND hwndDlg, struct FindAddDlgData *dat)
{
KillTimer(hwndDlg, TIMERID_THROBBER);
- dat->throbbing=0;
- dat->pivot=0;
+ dat->throbbing = 0;
+ dat->pivot = 0;
InvalidateRect(GetDlgItem(hwndDlg, IDC_STATUSBAR), NULL, FALSE);
}
static void ShowAdvancedSearchDlg(HWND hwndDlg, struct FindAddDlgData *dat)
{
- char *szProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
+ char *szProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
if (szProto == NULL) return;
if (dat->hwndAdvSearch == NULL) {
RECT rc;
- dat->hwndAdvSearch=(HWND)CallProtoServiceInt(NULL,szProto, PS_CREATEADVSEARCHUI, 0, (LPARAM)hwndDlg);
+ dat->hwndAdvSearch = (HWND)CallProtoServiceInt(NULL,szProto, PS_CREATEADVSEARCHUI, 0, (LPARAM)hwndDlg);
GetWindowRect(GetDlgItem(hwndDlg, IDC_RESULTS), &rc);
SetWindowPos(dat->hwndAdvSearch, 0, rc.left, rc.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
}
@@ -210,11 +210,11 @@ static void ReposTinySearchDlg(HWND hwndDlg, struct FindAddDlgData *dat)
if (dat->hwndTinySearch != NULL) {
RECT rc;
RECT clientRect;
- POINT pt={0, 0};
+ POINT pt = {0, 0};
GetWindowRect(GetDlgItem(hwndDlg, IDC_TINYEXTENDEDGROUP), &rc);
GetWindowRect(dat->hwndTinySearch, &clientRect);
- pt.x=rc.left;
- pt.y=rc.top;
+ pt.x = rc.left;
+ pt.y = rc.top;
ScreenToClient(hwndDlg, &pt);
SetWindowPos(dat->hwndTinySearch, 0, pt.x+5, pt.y+15, rc.right-rc.left-10, rc.bottom-rc.top-30, SWP_NOZORDER);
//SetWindowPos(GetDlgItem(hwndDlg, IDC_TINYEXTENDEDGROUP), 0, 0, 0, rc.right-rc.left, clientRect.bottom-clientRect.top+20, SWP_NOMOVE|SWP_NOZORDER);
@@ -222,10 +222,10 @@ static void ReposTinySearchDlg(HWND hwndDlg, struct FindAddDlgData *dat)
static void ShowTinySearchDlg(HWND hwndDlg, struct FindAddDlgData *dat)
{
- char *szProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
+ char *szProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
if (szProto == NULL) return;
if (dat->hwndTinySearch == NULL) {
- dat->hwndTinySearch=(HWND)CallProtoServiceInt(NULL,szProto, PS_CREATEADVSEARCHUI, 0, (LPARAM)/*GetDlgItem(*/hwndDlg/*, IDC_TINYEXTENDEDGROUP)*/);
+ dat->hwndTinySearch = (HWND)CallProtoServiceInt(NULL,szProto, PS_CREATEADVSEARCHUI, 0, (LPARAM)/*GetDlgItem(*/hwndDlg/*, IDC_TINYEXTENDEDGROUP)*/);
if (dat->hwndTinySearch)
ReposTinySearchDlg(hwndDlg, dat);
else
@@ -252,7 +252,7 @@ void EnableResultButtons(HWND hwndDlg, int enable)
static void CheckSearchTypeRadioButton(HWND hwndDlg, int idControl)
{
int i;
- static const int controls[]={IDC_BYPROTOID, IDC_BYEMAIL, IDC_BYNAME, IDC_BYADVANCED, IDC_BYCUSTOM};
+ static const int controls[] = {IDC_BYPROTOID, IDC_BYEMAIL, IDC_BYNAME, IDC_BYADVANCED, IDC_BYCUSTOM};
for (i=0; i < SIZEOF(controls); i++)
CheckDlgButton(hwndDlg, controls[i], idControl == controls[i]?BST_CHECKED:BST_UNCHECKED);
}
@@ -286,13 +286,13 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TranslateDialogDefault(hwndDlg);
Window_SetIcon_IcoLib(hwndDlg, SKINICON_OTHER_FINDUSER);
- dat=(struct FindAddDlgData*)mir_calloc(sizeof(struct FindAddDlgData));
+ dat = (struct FindAddDlgData*)mir_calloc(sizeof(struct FindAddDlgData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- dat->notSearchedYet=1;
- dat->iLastColumnSortIndex=1;
- dat->bSortAscending=1;
- dat->hBmpSortUp=(HBITMAP)LoadImage(hInst, MAKEINTRESOURCE(IDB_SORTCOLUP), IMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS);
- dat->hBmpSortDown=(HBITMAP)LoadImage(hInst, MAKEINTRESOURCE(IDB_SORTCOLDOWN), IMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS);
+ dat->notSearchedYet = 1;
+ dat->iLastColumnSortIndex = 1;
+ dat->bSortAscending = 1;
+ dat->hBmpSortUp = (HBITMAP)LoadImage(hInst, MAKEINTRESOURCE(IDB_SORTCOLUP), IMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS);
+ dat->hBmpSortDown = (HBITMAP)LoadImage(hInst, MAKEINTRESOURCE(IDB_SORTCOLDOWN), IMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS);
SendDlgItemMessage(hwndDlg, IDC_MOREOPTIONS, BUTTONSETARROW, 1, 0);
ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP);
@@ -305,10 +305,10 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
lvc.pszText = TranslateT("Results");
lvc.cx = rc.right-1;
ListView_InsertColumn(hwndList, 0, &lvc);
- lvi.mask=LVIF_TEXT;
- lvi.iItem=0;
- lvi.iSubItem=0;
- lvi.pszText=TranslateT("There are no results to display.");
+ lvi.mask = LVIF_TEXT;
+ lvi.iItem = 0;
+ lvi.iSubItem = 0;
+ lvi.pszText = TranslateT("There are no results to display.");
ListView_InsertItem(hwndList, &lvi);
}
@@ -317,15 +317,15 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SIZE textSize;
HDC hdc;
- hdc=GetDC(GetDlgItem(hwndDlg, IDC_STATUSBAR));
+ hdc = GetDC(GetDlgItem(hwndDlg, IDC_STATUSBAR));
SelectObject(hdc, (HFONT)SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, WM_GETFONT, 0, 0));
GetTextExtentPoint32(hdc, TranslateT("Searching"), lstrlen(TranslateT("Searching")), &textSize);
- partWidth[0]=textSize.cx;
+ partWidth[0] = textSize.cx;
GetTextExtentPoint32(hdc, _T("01234567890123456789"), 20, &textSize);
partWidth[0]+=textSize.cx;
ReleaseDC(GetDlgItem(hwndDlg, IDC_STATUSBAR), hdc);
- partWidth[1]=partWidth[0]+150;
- partWidth[2]=-1;
+ partWidth[1] = partWidth[0]+150;
+ partWidth[2] = -1;
SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, SB_SETPARTS, SIZEOF(partWidth), (LPARAM)partWidth);
SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, SB_SETTEXT, 1|SBT_OWNERDRAW, 0);
SetStatusBarSearchInfo(GetDlgItem(hwndDlg, IDC_STATUSBAR), dat);
@@ -333,7 +333,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
TCHAR *szProto = NULL;
int index = 0;
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
HDC hdc;
SIZE textSize;
RECT rect;
@@ -342,41 +342,41 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if ( !DBGetContactSettingTString(NULL, "FindAdd", "LastSearched", &dbv))
szProto = dbv.ptszVal;
- for (i=0, netProtoCount=0; i < accounts.getCount(); i++) {
+ for (i=0, netProtoCount = 0; i < accounts.getCount(); i++) {
if ( !Proto_IsAccountEnabled(accounts[i])) continue;
DWORD caps = (DWORD)CallProtoServiceInt(NULL,accounts[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if (caps & PF1_BASICSEARCH || caps & PF1_EXTSEARCH || caps & PF1_SEARCHBYEMAIL || caps & PF1_SEARCHBYNAME)
netProtoCount++;
}
- dat->himlComboIcons=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, netProtoCount+1, netProtoCount+1);
+ dat->himlComboIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, netProtoCount+1, netProtoCount+1);
SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CBEM_SETIMAGELIST, 0, (LPARAM)dat->himlComboIcons);
- cbei.mask=CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_TEXT|CBEIF_LPARAM;
- cbei.iItem=0;
- hdc=GetDC(hwndDlg);
+ cbei.mask = CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_TEXT|CBEIF_LPARAM;
+ cbei.iItem = 0;
+ hdc = GetDC(hwndDlg);
SelectObject(hdc, (HFONT)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, WM_GETFONT, 0, 0));
if (netProtoCount>1) {
- cbei.pszText=TranslateT("All Networks");
+ cbei.pszText = TranslateT("All Networks");
GetTextExtentPoint32(hdc, cbei.pszText, lstrlen(cbei.pszText), &textSize);
if (textSize.cx>cbwidth) cbwidth = textSize.cx;
- cbei.iImage=cbei.iSelectedImage=ImageList_AddIcon_IconLibLoaded(dat->himlComboIcons, SKINICON_OTHER_SEARCHALL);
- cbei.lParam=0;
+ cbei.iImage = cbei.iSelectedImage = ImageList_AddIcon_IconLibLoaded(dat->himlComboIcons, SKINICON_OTHER_SEARCHALL);
+ cbei.lParam = 0;
SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CBEM_INSERTITEM, 0, (LPARAM)&cbei);
cbei.iItem++;
}
for (i=0; i < accounts.getCount(); i++) {
PROTOACCOUNT* pa = accounts[i];
if ( !Proto_IsAccountEnabled(pa)) continue;
- DWORD caps=(DWORD)CallProtoServiceInt(NULL,pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
+ DWORD caps = (DWORD)CallProtoServiceInt(NULL,pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if ( !(caps&PF1_BASICSEARCH) && !(caps&PF1_EXTSEARCH) && !(caps&PF1_SEARCHBYEMAIL) && !(caps&PF1_SEARCHBYNAME))
continue;
cbei.pszText = pa->tszAccountName;
GetTextExtentPoint32(hdc, cbei.pszText, lstrlen(cbei.pszText), &textSize);
if (textSize.cx>cbwidth) cbwidth = textSize.cx;
- hIcon=(HICON)CallProtoServiceInt(NULL,pa->szModuleName, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
- cbei.iImage=cbei.iSelectedImage=ImageList_AddIcon(dat->himlComboIcons, hIcon);
+ hIcon = (HICON)CallProtoServiceInt(NULL,pa->szModuleName, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ cbei.iImage = cbei.iSelectedImage = ImageList_AddIcon(dat->himlComboIcons, hIcon);
DestroyIcon(hIcon);
- cbei.lParam=(LPARAM)pa->szModuleName;
+ cbei.lParam = (LPARAM)pa->szModuleName;
SendDlgItemMessageA(hwndDlg, IDC_PROTOLIST, CBEM_INSERTITEM, 0, (LPARAM)&cbei);
if (szProto && cbei.pszText && !lstrcmp(szProto, pa->tszAccountName))
index = cbei.iItem;
@@ -395,13 +395,13 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
return TRUE;
}
case WM_SIZE:
- { UTILRESIZEDIALOG urd={0};
- urd.cbSize=sizeof(urd);
- urd.hwndDlg=hwndDlg;
- urd.hInstance=hInst;
- urd.lpTemplate=MAKEINTRESOURCEA(IDD_FINDADD);
- urd.lParam=(LPARAM)dat;
- urd.pfnResizer=FindAddDlgResizer;
+ { UTILRESIZEDIALOG urd = {0};
+ urd.cbSize = sizeof(urd);
+ urd.hwndDlg = hwndDlg;
+ urd.hInstance = hInst;
+ urd.lpTemplate = MAKEINTRESOURCEA(IDD_FINDADD);
+ urd.lParam = (LPARAM)dat;
+ urd.pfnResizer = FindAddDlgResizer;
CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd);
ReposTinySearchDlg(hwndDlg, dat);
SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, WM_SIZE, 0, 0);
@@ -421,17 +421,17 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
break;
case WM_GETMINMAXINFO:
- { MINMAXINFO *mmi=(MINMAXINFO*)lParam;
+ { MINMAXINFO *mmi = (MINMAXINFO*)lParam;
RECT rc, rc2;
GetWindowRect(hwndList, &rc);
GetWindowRect(hwndDlg, &rc2);
- mmi->ptMinTrackSize.x=rc.left-rc2.left+10+GetSystemMetrics(SM_CXFRAME);
+ mmi->ptMinTrackSize.x = rc.left-rc2.left+10+GetSystemMetrics(SM_CXFRAME);
GetClientRect(GetDlgItem(hwndDlg, IDC_MOREOPTIONS), &rc);
mmi->ptMinTrackSize.x+=rc.right+5;
GetClientRect(GetDlgItem(hwndDlg, IDC_ADD), &rc);
mmi->ptMinTrackSize.x+=rc.right+5;
GetClientRect(GetDlgItem(hwndDlg, IDC_STATUSBAR), &rc);
- mmi->ptMinTrackSize.y=dat->minDlgHeight+20+GetSystemMetrics(SM_CYCAPTION)+2*GetSystemMetrics(SM_CYFRAME);
+ mmi->ptMinTrackSize.y = dat->minDlgHeight+20+GetSystemMetrics(SM_CYCAPTION)+2*GetSystemMetrics(SM_CYFRAME);
GetClientRect(GetDlgItem(hwndDlg, IDC_STATUSBAR), &rc);
mmi->ptMinTrackSize.y+=rc.bottom;
return 0;
@@ -445,29 +445,29 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
int checkmarkVisible;
dat->showAdvanced = dat->showEmail = dat->showName = dat->showProtoId = dat->showTiny = 0;
- szProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
+ szProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
if (szProto == (char *)CB_ERR)
break;
if (szProto == NULL) {
for (i=0; i < accounts.getCount(); i++) {
PROTOACCOUNT* pa = accounts[i];
if ( !Proto_IsAccountEnabled(pa)) continue;
- protoCaps=(DWORD)CallProtoServiceInt(NULL,pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
- if (protoCaps&PF1_SEARCHBYEMAIL) dat->showEmail=1;
- if (protoCaps&PF1_SEARCHBYNAME) dat->showName=1;
+ protoCaps = (DWORD)CallProtoServiceInt(NULL,pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
+ if (protoCaps&PF1_SEARCHBYEMAIL) dat->showEmail = 1;
+ if (protoCaps&PF1_SEARCHBYNAME) dat->showName = 1;
}
}
else {
- protoCaps=(DWORD)CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
- if (protoCaps&PF1_BASICSEARCH) dat->showProtoId=1;
- if (protoCaps&PF1_SEARCHBYEMAIL) dat->showEmail=1;
- if (protoCaps&PF1_SEARCHBYNAME) dat->showName=1;
- if (protoCaps&PF1_EXTSEARCH && !(protoCaps&PF1_EXTSEARCHUI)) dat->showTiny=1;
- if (protoCaps&PF1_EXTSEARCHUI) dat->showAdvanced=1;
- if (protoCaps&PF1_USERIDISEMAIL && dat->showProtoId) {dat->showProtoId=0; dat->showEmail=1;}
+ protoCaps = (DWORD)CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
+ if (protoCaps&PF1_BASICSEARCH) dat->showProtoId = 1;
+ if (protoCaps&PF1_SEARCHBYEMAIL) dat->showEmail = 1;
+ if (protoCaps&PF1_SEARCHBYNAME) dat->showName = 1;
+ if (protoCaps&PF1_EXTSEARCH && !(protoCaps&PF1_EXTSEARCHUI)) dat->showTiny = 1;
+ if (protoCaps&PF1_EXTSEARCHUI) dat->showAdvanced = 1;
+ if (protoCaps&PF1_USERIDISEMAIL && dat->showProtoId) {dat->showProtoId = 0; dat->showEmail = 1;}
if (dat->showProtoId) {
char *szUniqueId;
- szUniqueId=(char*)CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0);
+ szUniqueId = (char*)CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0);
if (szUniqueId) {
#if defined(_UNICODE)
TCHAR* p = mir_a2u(szUniqueId);
@@ -488,7 +488,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
else {
if (dat->hwndTinySearch) {
DestroyWindow(dat->hwndTinySearch);
- dat->hwndTinySearch=NULL;
+ dat->hwndTinySearch = NULL;
} }
#define en(id, t) ShowWindow(GetDlgItem(hwndDlg, IDC_##id), dat->show##t?SW_SHOW:SW_HIDE)
@@ -502,7 +502,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
en(BYCUSTOM, Tiny); en(TINYEXTENDEDGROUP, Tiny);
#undef en
- checkmarkVisible=(dat->showAdvanced && IsDlgButtonChecked(hwndDlg, IDC_BYADVANCED)) ||
+ checkmarkVisible = (dat->showAdvanced && IsDlgButtonChecked(hwndDlg, IDC_BYADVANCED)) ||
(dat->showEmail && IsDlgButtonChecked(hwndDlg, IDC_BYEMAIL)) ||
(dat->showTiny && IsDlgButtonChecked(hwndDlg, IDC_BYCUSTOM)) ||
(dat->showName && IsDlgButtonChecked(hwndDlg, IDC_BYNAME)) ||
@@ -530,13 +530,13 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, SB_GETBORDERS, 0, (LPARAM)borders);
SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, SB_GETRECT, 1, (LPARAM)&rc);
InflateRect(&rc, -borders[2]/2, -borders[1]/2);
- hdc=GetDC(GetDlgItem(hwndDlg, IDC_STATUSBAR));
+ hdc = GetDC(GetDlgItem(hwndDlg, IDC_STATUSBAR));
RenderThrobber(hdc, &rc, &dat->throbbing, &dat->pivot);
ReleaseDC(GetDlgItem(hwndDlg, IDC_STATUSBAR), hdc);
}
break;
case WM_DRAWITEM:
- { DRAWITEMSTRUCT *dis=(DRAWITEMSTRUCT*)lParam;
+ { DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT*)lParam;
if (dis->CtlID == IDC_STATUSBAR && dis->itemID == 1) {
RenderThrobber(dis->hDC, &dis->rcItem, &dat->throbbing, &dat->pivot);
return TRUE;
@@ -547,29 +547,29 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (wParam == IDC_RESULTS) {
switch(((LPNMHDR)lParam)->code) {
case LVN_ITEMCHANGED:
- { int count=ListView_GetSelectedCount(hwndList);
- if (dat->notSearchedYet) count=0;
+ { int count = ListView_GetSelectedCount(hwndList);
+ if (dat->notSearchedYet) count = 0;
EnableResultButtons(hwndDlg, count);
break;
}
case LVN_COLUMNCLICK:
{
- LPNMLISTVIEW nmlv=(LPNMLISTVIEW)lParam;
+ LPNMLISTVIEW nmlv = (LPNMLISTVIEW)lParam;
HDITEM hdi;
- hdi.mask=HDI_BITMAP|HDI_FORMAT;
- hdi.fmt=HDF_LEFT|HDF_STRING;
+ hdi.mask = HDI_BITMAP|HDI_FORMAT;
+ hdi.fmt = HDF_LEFT|HDF_STRING;
Header_SetItem(ListView_GetHeader(hwndList), dat->iLastColumnSortIndex, &hdi);
if (nmlv->iSubItem != dat->iLastColumnSortIndex)
{
- dat->bSortAscending=TRUE;
- dat->iLastColumnSortIndex=nmlv->iSubItem;
+ dat->bSortAscending = TRUE;
+ dat->iLastColumnSortIndex = nmlv->iSubItem;
}
- else dat->bSortAscending=!dat->bSortAscending;
+ else dat->bSortAscending = !dat->bSortAscending;
- hdi.fmt=HDF_LEFT|HDF_BITMAP|HDF_STRING|HDF_BITMAP_ON_RIGHT;
- hdi.hbm=dat->bSortAscending?dat->hBmpSortDown:dat->hBmpSortUp;
+ hdi.fmt = HDF_LEFT|HDF_BITMAP|HDF_STRING|HDF_BITMAP_ON_RIGHT;
+ hdi.hbm = dat->bSortAscending?dat->hBmpSortDown:dat->hBmpSortUp;
Header_SetItem(ListView_GetHeader(hwndList), dat->iLastColumnSortIndex, &hdi);
ListView_SortItemsEx(hwndList, SearchResultsCompareFunc, (LPARAM)hwndDlg);
@@ -585,11 +585,11 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
HideAdvancedSearchDlg(hwndDlg, dat);
if (dat->hwndAdvSearch) {
DestroyWindow(dat->hwndAdvSearch);
- dat->hwndAdvSearch=NULL;
+ dat->hwndAdvSearch = NULL;
}
if (dat->hwndTinySearch) {
DestroyWindow(dat->hwndTinySearch);
- dat->hwndTinySearch=NULL;
+ dat->hwndTinySearch = NULL;
}
SendMessage(hwndDlg, M_SETGROUPVISIBILITIES, 0, 0);
}
@@ -640,17 +640,17 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
HideAdvancedSearchDlg(hwndDlg, dat);
if (dat->searchCount) { //cancel search
SetDlgItemText(hwndDlg, IDOK, TranslateT("&Search"));
- if (dat->hResultHook) {UnhookEvent(dat->hResultHook); dat->hResultHook=NULL;}
- if (dat->search) {mir_free(dat->search); dat->search=NULL;}
- dat->searchCount=0;
+ if (dat->hResultHook) {UnhookEvent(dat->hResultHook); dat->hResultHook = NULL;}
+ if (dat->search) {mir_free(dat->search); dat->search = NULL;}
+ dat->searchCount = 0;
StopThrobber(hwndDlg, dat);
SetStatusBarSearchInfo(GetDlgItem(hwndDlg, IDC_STATUSBAR), dat);
break;
}
- char *szProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
- if (dat->search) {mir_free(dat->search); dat->search=NULL;}
- dat->searchCount=0;
- dat->hResultHook=HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_SEARCHACK);
+ char *szProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
+ if (dat->search) {mir_free(dat->search); dat->search = NULL;}
+ dat->searchCount = 0;
+ dat->hResultHook = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_SEARCHACK);
if (IsDlgButtonChecked(hwndDlg, IDC_BYCUSTOM))
{
BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYADVANCED, PF1_EXTSEARCHUI, dat->hwndTinySearch);
@@ -695,11 +695,11 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
if (dat->searchCount == 0) {
- if (dat->hResultHook) {UnhookEvent(dat->hResultHook); dat->hResultHook=NULL;}
+ if (dat->hResultHook) {UnhookEvent(dat->hResultHook); dat->hResultHook = NULL;}
break;
}
- dat->notSearchedYet=0;
+ dat->notSearchedYet = 0;
FreeSearchResults(hwndList);
CreateResultsColumns(hwndList, dat, szProto);
@@ -761,8 +761,8 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{ POINT pt;
LVHITTESTINFO lvhti;
- pt.x=(short)LOWORD(lParam); pt.y=(short)HIWORD(lParam);
- lvhti.pt=pt;
+ pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam);
+ lvhti.pt = pt;
ScreenToClient(hwndDlg, &pt);
switch(GetDlgCtrlID(ChildWindowFromPoint(hwndDlg, pt))) {
case IDC_RESULTS:
@@ -775,7 +775,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
}
case HM_SEARCHACK:
- { ACKDATA *ack=(ACKDATA*)lParam;
+ { ACKDATA *ack = (ACKDATA*)lParam;
int i;
if (ack->type != ACKTYPE_SEARCH) break;
@@ -787,9 +787,9 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
memmove(dat->search+i, dat->search+i+1, sizeof(struct ProtoSearchInfo)*(dat->searchCount-i));
if (dat->searchCount == 0) {
mir_free(dat->search);
- dat->search=NULL;
+ dat->search = NULL;
UnhookEvent(dat->hResultHook);
- dat->hResultHook=NULL;
+ dat->hResultHook = NULL;
SetDlgItemText(hwndDlg, IDOK, TranslateT("&Search"));
StopThrobber(hwndDlg, dat);
}
@@ -799,14 +799,14 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
else if (ack->result == ACKRESULT_SEARCHRESULT && ack->lParam) {
PROTOSEARCHRESULT *psr;
- CUSTOMSEARCHRESULTS * csr=(CUSTOMSEARCHRESULTS*)ack->lParam;
- dat->bFlexSearchResult=TRUE;
- psr=&(csr->psr);
+ CUSTOMSEARCHRESULTS * csr = (CUSTOMSEARCHRESULTS*)ack->lParam;
+ dat->bFlexSearchResult = TRUE;
+ psr = &(csr->psr);
// check if this is column names data (psr->cbSize == 0)
if (psr->cbSize == 0) { // blob contain info about columns
int iColumn;
- LVCOLUMN lvc={0};
+ LVCOLUMN lvc = {0};
//firstly remove all exist items
FreeSearchResults(hwndList);
@@ -814,10 +814,10 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
//secondly remove all columns
while (ListView_DeleteColumn(hwndList, 1)); //will delete fist column till it possible
//now will add columns and captions;
- lvc.mask=LVCF_TEXT;
- for (iColumn=0; iColumn<csr->nFieldCount; iColumn++)
+ lvc.mask = LVCF_TEXT;
+ for (iColumn = 0; iColumn<csr->nFieldCount; iColumn++)
{
- lvc.pszText=TranslateTS(csr->pszFields[iColumn]);
+ lvc.pszText = TranslateTS(csr->pszFields[iColumn]);
ListView_InsertColumn (hwndList, iColumn+1, &lvc);
}
// Column inserting Done
@@ -857,7 +857,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
lvi.lParam = (LPARAM)lsr;
for (i = SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCOUNT, 0, 0); i--;)
{
- szComboProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, i, 0);
+ szComboProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, i, 0);
if (szComboProto == NULL) continue;
if ( !lstrcmpA(szComboProto, ack->szModule))
{
@@ -868,7 +868,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
}
i = ListView_InsertItem(hwndList, &lvi);
- for (col=0; col<csr->nFieldCount; col++) {
+ for (col = 0; col<csr->nFieldCount; col++) {
SetListItemText(hwndList, i, col+1 , csr->pszFields[col]);
}
ListView_SortItemsEx(hwndList, SearchResultsCompareFunc, (LPARAM)hwndDlg);
@@ -879,15 +879,15 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
}
else if (ack->result == ACKRESULT_DATA) {
- LVITEM lvi={0};
+ LVITEM lvi = {0};
int i, col;
- PROTOSEARCHRESULT *psr=(PROTOSEARCHRESULT*)ack->lParam;
+ PROTOSEARCHRESULT *psr = (PROTOSEARCHRESULT*)ack->lParam;
struct ListSearchResult *lsr;
char *szComboProto;
- COMBOBOXEXITEM cbei={0};
- dat->bFlexSearchResult=FALSE;
- lsr=(struct ListSearchResult*)mir_alloc(offsetof(struct ListSearchResult, psr)+psr->cbSize);
- lsr->szProto=ack->szModule;
+ COMBOBOXEXITEM cbei = {0};
+ dat->bFlexSearchResult = FALSE;
+ lsr = (struct ListSearchResult*)mir_alloc(offsetof(struct ListSearchResult, psr)+psr->cbSize);
+ lsr->szProto = ack->szModule;
CopyMemory(&lsr->psr, psr, psr->cbSize);
lsr->psr.nick = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)psr->nick) : mir_a2t((char*)psr->nick);
@@ -898,21 +898,21 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_TCHAR;
lvi.mask = LVIF_PARAM|LVIF_IMAGE;
- lvi.lParam=(LPARAM)lsr;
+ lvi.lParam = (LPARAM)lsr;
for (i = SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCOUNT, 0, 0); i--;)
{
- szComboProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, i, 0);
+ szComboProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, i, 0);
if (szComboProto == NULL) continue;
if ( !lstrcmpA(szComboProto, ack->szModule)) {
- cbei.mask=CBEIF_IMAGE;
- cbei.iItem=i;
+ cbei.mask = CBEIF_IMAGE;
+ cbei.iItem = i;
SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CBEM_GETITEM, 0, (LPARAM)&cbei);
- lvi.iImage=cbei.iImage;
+ lvi.iImage = cbei.iImage;
break;
}
}
- i=ListView_InsertItem(hwndList, &lvi);
- col=1;
+ i = ListView_InsertItem(hwndList, &lvi);
+ col = 1;
SetListItemText(hwndList, i, col++, lsr->psr.id);
SetListItemText(hwndList, i, col++, lsr->psr.nick);
SetListItemText(hwndList, i, col++, lsr->psr.firstName);
@@ -930,7 +930,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TCHAR *szProto;
int len = SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETLBTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
szProto = (TCHAR*)alloca(sizeof(TCHAR)*(len+1));
- *szProto='\0';
+ *szProto = '\0';
SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETLBTEXT, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), (LPARAM)szProto);
DBWriteContactSettingTString(NULL, "FindAdd", "LastSearched", szProto?szProto:_T(""));
}
@@ -941,11 +941,11 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
mir_free(dat->search);
if (dat->hwndAdvSearch) {
DestroyWindow(dat->hwndAdvSearch);
- dat->hwndAdvSearch=NULL;
+ dat->hwndAdvSearch = NULL;
}
if (dat->hwndTinySearch) {
DestroyWindow(dat->hwndTinySearch);
- dat->hwndTinySearch=NULL;
+ dat->hwndTinySearch = NULL;
}
DeleteObject(dat->hBmpSortDown);
DeleteObject(dat->hBmpSortUp);
@@ -974,15 +974,15 @@ static INT_PTR FindAddCommand(WPARAM, LPARAM)
// One alternative would be to only create the service if we have network
// protocols loaded but that would delay the creation until MODULE_LOADED and
// that is not good either...
- for (i=0, netProtoCount=0; i < accounts.getCount(); i++) {
+ for (i=0, netProtoCount = 0; i < accounts.getCount(); i++) {
PROTOACCOUNT* pa = accounts[i];
if ( !Proto_IsAccountEnabled(pa)) continue;
- int protoCaps=CallProtoServiceInt(NULL,pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
+ int protoCaps = CallProtoServiceInt(NULL,pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if (protoCaps&PF1_BASICSEARCH || protoCaps&PF1_SEARCHBYEMAIL || protoCaps&PF1_SEARCHBYNAME
|| protoCaps&PF1_EXTSEARCHUI) netProtoCount++;
}
if (netProtoCount > 0)
- hwndFindAdd=CreateDialog(hInst, MAKEINTRESOURCE(IDD_FINDADD), NULL, DlgProcFindAdd);
+ hwndFindAdd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_FINDADD), NULL, DlgProcFindAdd);
}
return 0;
}
@@ -1003,11 +1003,11 @@ int LoadFindAddModule(void)
HookEvent(ME_SYSTEM_PRESHUTDOWN, FindAddPreShutdown);
CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
- mi.position = 500020000;
- mi.flags = CMIF_ICONFROMICOLIB;
+ mi.cbSize = sizeof(mi);
+ mi.position = 500020000;
+ mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_FINDUSER);
- mi.pszName = LPGEN("&Find/Add Contacts...");
+ mi.pszName = LPGEN("&Find/Add Contacts...");
mi.pszService = MS_FINDADD_FINDADD;
hMainMenuItem = Menu_AddMainMenuItem(&mi);
return 0;
@@ -1018,7 +1018,7 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM)
int netProtoCount, i;
// Make sure we have some networks to search on.
- for (i=0, netProtoCount=0; i < accounts.getCount(); i++) {
+ for (i=0, netProtoCount = 0; i < accounts.getCount(); i++) {
PROTOACCOUNT* pa = accounts[i];
int protoCaps = CallProtoServiceInt(NULL,pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if (protoCaps & (PF1_BASICSEARCH | PF1_SEARCHBYEMAIL | PF1_SEARCHBYNAME | PF1_EXTSEARCHUI))
diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp
index e579c9888b..6addad0725 100644
--- a/src/modules/findadd/searchresults.cpp
+++ b/src/modules/findadd/searchresults.cpp
@@ -41,8 +41,8 @@ void SaveColumnSizes(HWND hwndResults)
int i;
struct FindAddDlgData *dat;
- dat=(struct FindAddDlgData*)GetWindowLongPtr(GetParent(hwndResults), GWLP_USERDATA);
- columnCount=Header_GetItemCount(ListView_GetHeader(hwndResults));
+ dat = (struct FindAddDlgData*)GetWindowLongPtr(GetParent(hwndResults), GWLP_USERDATA);
+ columnCount = Header_GetItemCount(ListView_GetHeader(hwndResults));
if (columnCount != NUM_COLUMNID) return;
ListView_GetColumnOrderArray(hwndResults, columnCount, columnOrder);
for (i=0; i < NUM_COLUMNID; i++) {
@@ -57,7 +57,7 @@ void SaveColumnSizes(HWND hwndResults)
}
static const TCHAR *szColumnNames[] = { NULL, NULL, _T("Nick"), _T("First Name"), _T("Last Name"), _T("E-mail") };
-static int defaultColumnSizes[]={0, 90, 100, 100, 100, 2000};
+static int defaultColumnSizes[] = {0, 90, 100, 100, 100, 2000};
void LoadColumnSizes(HWND hwndResults, const char *szProto)
{
HDITEM hdi;
@@ -129,18 +129,18 @@ static LPARAM ListView_GetItemLParam(HWND hwndList, int idx)
int CALLBACK SearchResultsCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
- struct FindAddDlgData *dat=(struct FindAddDlgData*)GetWindowLongPtr((HWND) lParamSort, GWLP_USERDATA);
+ struct FindAddDlgData *dat = (struct FindAddDlgData*)GetWindowLongPtr((HWND) lParamSort, GWLP_USERDATA);
int sortMultiplier;
int sortCol;
struct ListSearchResult *lsr1, *lsr2;
- HWND hList=GetDlgItem((HWND) lParamSort, IDC_RESULTS);
+ HWND hList = GetDlgItem((HWND) lParamSort, IDC_RESULTS);
- sortMultiplier=dat->bSortAscending?1:-1;
- sortCol=dat->iLastColumnSortIndex;
+ sortMultiplier = dat->bSortAscending?1:-1;
+ sortCol = dat->iLastColumnSortIndex;
if ( !dat->bFlexSearchResult)
{
- lsr1=(struct ListSearchResult*)ListView_GetItemLParam(hList, (int)lParam1);
- lsr2=(struct ListSearchResult*)ListView_GetItemLParam(hList, (int)lParam2);
+ lsr1 = (struct ListSearchResult*)ListView_GetItemLParam(hList, (int)lParam1);
+ lsr2 = (struct ListSearchResult*)ListView_GetItemLParam(hList, (int)lParam2);
if (lsr1 == NULL || lsr2 == NULL) return 0;
switch(sortCol)
@@ -174,10 +174,10 @@ void FreeSearchResults(HWND hwndResults)
{
LV_ITEM lvi;
struct ListSearchResult *lsr;
- for (lvi.iItem=ListView_GetItemCount(hwndResults)-1;lvi.iItem>=0;lvi.iItem--) {
- lvi.mask=LVIF_PARAM;
+ for (lvi.iItem = ListView_GetItemCount(hwndResults)-1;lvi.iItem>=0;lvi.iItem--) {
+ lvi.mask = LVIF_PARAM;
ListView_GetItem(hwndResults, &lvi);
- lsr=(struct ListSearchResult*)lvi.lParam;
+ lsr = (struct ListSearchResult*)lvi.lParam;
if (lsr == NULL) continue;
mir_free(lsr->psr.id);
mir_free(lsr->psr.email);
@@ -214,7 +214,7 @@ int BeginSearch(HWND, struct FindAddDlgData *dat, const char *szProto, const cha
for (int i=0; i < accounts.getCount();i++) {
PROTOACCOUNT* pa = accounts[i];
if ( !Proto_IsAccountEnabled(pa)) continue;
- DWORD caps=(DWORD)CallProtoServiceInt(NULL,pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
+ DWORD caps = (DWORD)CallProtoServiceInt(NULL,pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if ( !(caps&requiredCapability)) continue;
dat->search[dat->searchCount].hProcess = (HANDLE)CallProtoServiceInt(NULL,pa->szModuleName, szSearchService, 0, (LPARAM)pvSearchParams);
dat->search[dat->searchCount].szProto = pa->szModuleName;
@@ -226,23 +226,23 @@ int BeginSearch(HWND, struct FindAddDlgData *dat, const char *szProto, const cha
if (dat->searchCount == 0) {
forkthread(BeginSearchFailed, 0, NULL);
mir_free(dat->search);
- dat->search=NULL;
+ dat->search = NULL;
return 1;
}
}
}
else {
- dat->search=(struct ProtoSearchInfo*)mir_alloc(sizeof(struct ProtoSearchInfo));
- dat->searchCount=1;
- dat->search[0].hProcess=(HANDLE)CallProtoServiceInt(NULL,szProto, szSearchService, 0, (LPARAM)pvSearchParams);
- dat->search[0].szProto=szProto;
+ dat->search = (struct ProtoSearchInfo*)mir_alloc(sizeof(struct ProtoSearchInfo));
+ dat->searchCount = 1;
+ dat->search[0].hProcess = (HANDLE)CallProtoServiceInt(NULL,szProto, szSearchService, 0, (LPARAM)pvSearchParams);
+ dat->search[0].szProto = szProto;
if (dat->search[0].hProcess == NULL) {
//infuriatingly vague error message. fixme.
PROTOACCOUNT* pa = Proto_GetAccount(szProto);
forkthread(BeginSearchFailed, 0, mir_tstrdup(pa->tszAccountName));
mir_free(dat->search);
- dat->search=NULL;
- dat->searchCount=0;
+ dat->search = NULL;
+ dat->searchCount = 0;
return 1;
}
}
@@ -277,20 +277,20 @@ struct ProtoResultsSummary {
};
void SetStatusBarResultInfo(HWND hwndDlg)
{
- HWND hwndStatus=GetDlgItem(hwndDlg, IDC_STATUSBAR);
- HWND hwndResults=GetDlgItem(hwndDlg, IDC_RESULTS);
+ HWND hwndStatus = GetDlgItem(hwndDlg, IDC_STATUSBAR);
+ HWND hwndResults = GetDlgItem(hwndDlg, IDC_RESULTS);
LV_ITEM lvi;
struct ListSearchResult *lsr;
- struct ProtoResultsSummary *subtotal=NULL;
- int subtotalCount=0;
+ struct ProtoResultsSummary *subtotal = NULL;
+ int subtotalCount = 0;
int i, total;
TCHAR str[256];
- total=ListView_GetItemCount(hwndResults);
- for (lvi.iItem=total-1;lvi.iItem>=0;lvi.iItem--) {
- lvi.mask=LVIF_PARAM;
+ total = ListView_GetItemCount(hwndResults);
+ for (lvi.iItem = total-1;lvi.iItem>=0;lvi.iItem--) {
+ lvi.mask = LVIF_PARAM;
ListView_GetItem(hwndResults, &lvi);
- lsr=(struct ListSearchResult*)lvi.lParam;
+ lsr = (struct ListSearchResult*)lvi.lParam;
if (lsr == NULL) continue;
for (i=0;i<subtotalCount;i++) {
if (subtotal[i].szProto == lsr->szProto) {
@@ -299,9 +299,9 @@ void SetStatusBarResultInfo(HWND hwndDlg)
}
}
if (i == subtotalCount) {
- subtotal=(struct ProtoResultsSummary*)mir_realloc(subtotal, sizeof(struct ProtoResultsSummary)*(subtotalCount+1));
- subtotal[subtotalCount].szProto=lsr->szProto;
- subtotal[subtotalCount++].count=1;
+ subtotal = (struct ProtoResultsSummary*)mir_realloc(subtotal, sizeof(struct ProtoResultsSummary)*(subtotalCount+1));
+ subtotal[subtotalCount].szProto = lsr->szProto;
+ subtotal[subtotalCount++].count = 1;
}
}
if (total != 0) {
@@ -348,40 +348,40 @@ void ShowMoreOptionsMenu(HWND hwndDlg, int x, int y)
int commandId;
struct ListSearchResult *lsr;
- dat=(struct FindAddDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ dat = (struct FindAddDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
{ LVITEM lvi;
if (ListView_GetSelectedCount(GetDlgItem(hwndDlg, IDC_RESULTS)) != 1) return;
- lvi.mask=LVIF_PARAM;
- lvi.iItem=ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_RESULTS), -1, LVNI_ALL|LVNI_SELECTED);
+ lvi.mask = LVIF_PARAM;
+ lvi.iItem = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_RESULTS), -1, LVNI_ALL|LVNI_SELECTED);
ListView_GetItem(GetDlgItem(hwndDlg, IDC_RESULTS), &lvi);
- lsr=(struct ListSearchResult*)lvi.lParam;
+ lsr = (struct ListSearchResult*)lvi.lParam;
}
- hMenu=LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
- hPopupMenu=GetSubMenu(hMenu, 4);
+ hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
+ hPopupMenu = GetSubMenu(hMenu, 4);
TranslateMenu(hPopupMenu);
- commandId=TrackPopupMenu(hPopupMenu, TPM_RIGHTBUTTON|TPM_RETURNCMD, x, y, 0, hwndDlg, NULL);
+ commandId = TrackPopupMenu(hPopupMenu, TPM_RIGHTBUTTON|TPM_RETURNCMD, x, y, 0, hwndDlg, NULL);
switch(commandId) {
case IDC_ADD:
{ ADDCONTACTSTRUCT acs;
- acs.handle=NULL;
- acs.handleType=HANDLE_SEARCHRESULT;
- acs.szProto=lsr->szProto;
- acs.psr=&lsr->psr;
+ acs.handle = NULL;
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = lsr->szProto;
+ acs.psr = &lsr->psr;
CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs);
break;
}
case IDC_DETAILS:
{ HANDLE hContact;
- hContact=(HANDLE)CallProtoServiceInt(NULL,lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr);
+ hContact = (HANDLE)CallProtoServiceInt(NULL,lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr);
CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
break;
}
case IDC_SENDMESSAGE:
{ HANDLE hContact;
- hContact=(HANDLE)CallProtoServiceInt(NULL,lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr);
+ hContact = (HANDLE)CallProtoServiceInt(NULL,lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr);
CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, (LPARAM)(const char*)NULL);
break;
}
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp
index bb3961369e..0ed3aa6911 100644
--- a/src/modules/fonts/FontOptions.cpp
+++ b/src/modules/fonts/FontOptions.cpp
@@ -102,13 +102,13 @@ int __inline DrawTextWithEffect(HDC hdc, LPCTSTR lpchText, int cchText, RECT * l
return DrawText (hdc, lpchText, cchText, lprc, dwDTFormat);
// else
- params.cbSize = sizeof(DrawTextWithEffectParam);
- params.hdc = hdc;
- params.lpchText = lpchText;
- params.cchText = cchText;
- params.lprc = lprc;
- params.dwDTFormat = dwDTFormat;
- params.pEffect = pEffect;
+ params.cbSize = sizeof(DrawTextWithEffectParam);
+ params.hdc = hdc;
+ params.lpchText = lpchText;
+ params.cchText = cchText;
+ params.lprc = lprc;
+ params.dwDTFormat = dwDTFormat;
+ params.pEffect = pEffect;
return CallService(MS_DRAW_TEXT_WITH_EFFECT, (WPARAM)&params, 0);
}
@@ -149,7 +149,7 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<FontInternal>& flist,
strcpy(buff, "SETTINGS:\r\n");
WriteLine(fhand, buff);
- for (i = 0; i < flist.getCount(); i++) {
+ for (i=0; i < flist.getCount(); i++) {
FontInternal& F = flist[i];
mir_snprintf(buff, SIZEOF(buff), "\r\n[%s]", F.dbSettingsGroup);
@@ -159,16 +159,16 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<FontInternal>& flist,
}
if (F.flags & FIDF_APPENDNAME)
- mir_snprintf(buff, SIZEOF(buff), "%sName=s", F.prefix);
+ mir_snprintf(buff, SIZEOF(buff), "%sName = s", F.prefix);
else
- mir_snprintf(buff, SIZEOF(buff), "%s=s", F.prefix);
+ mir_snprintf(buff, SIZEOF(buff), "%s = s", F.prefix);
WideCharToMultiByte(code_page, 0, F.value.szFace, -1, abuff, 1024, 0, 0);
- abuff[1023]=0;
+ abuff[1023] = 0;
strcat(buff, abuff);
WriteLine(fhand, buff);
- mir_snprintf(buff, SIZEOF(buff), "%sSize=b", F.prefix);
+ mir_snprintf(buff, SIZEOF(buff), "%sSize = b", F.prefix);
if (F.flags & FIDF_SAVEACTUALHEIGHT) {
HDC hdc;
SIZE size;
@@ -195,17 +195,17 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<FontInternal>& flist,
WriteLine(fhand, buff);
- mir_snprintf(buff, SIZEOF(buff), "%sSty=b%d", F.prefix, (BYTE)F.value.style);
+ mir_snprintf(buff, SIZEOF(buff), "%sSty = b%d", F.prefix, (BYTE)F.value.style);
WriteLine(fhand, buff);
- mir_snprintf(buff, SIZEOF(buff), "%sSet=b%d", F.prefix, (BYTE)F.value.charset);
+ mir_snprintf(buff, SIZEOF(buff), "%sSet = b%d", F.prefix, (BYTE)F.value.charset);
WriteLine(fhand, buff);
- mir_snprintf(buff, SIZEOF(buff), "%sCol=d%d", F.prefix, (DWORD)F.value.colour);
+ mir_snprintf(buff, SIZEOF(buff), "%sCol = d%d", F.prefix, (DWORD)F.value.colour);
WriteLine(fhand, buff);
if (F.flags & FIDF_NOAS) {
- mir_snprintf(buff, SIZEOF(buff), "%sAs=w%d", F.prefix, (WORD)0x00FF);
+ mir_snprintf(buff, SIZEOF(buff), "%sAs = w%d", F.prefix, (WORD)0x00FF);
WriteLine(fhand, buff);
}
- mir_snprintf(buff, SIZEOF(buff), "%sFlags=w%d", F.prefix, (WORD)F.flags);
+ mir_snprintf(buff, SIZEOF(buff), "%sFlags = w%d", F.prefix, (WORD)F.flags);
WriteLine(fhand, buff);
}
@@ -218,7 +218,7 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<FontInternal>& flist,
strcpy(header, buff);
WriteLine(fhand, buff);
}
- mir_snprintf(buff, SIZEOF(buff), "%s=d%d", C.setting, (DWORD)C.value);
+ mir_snprintf(buff, SIZEOF(buff), "%s = d%d", C.setting, (DWORD)C.value);
WriteLine(fhand, buff);
}
@@ -231,11 +231,11 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<FontInternal>& flist,
strcpy(header, buff);
WriteLine(fhand, buff);
}
- mir_snprintf(buff, SIZEOF(buff), "%sEffect=b%d", E.setting, E.value.effectIndex);
+ mir_snprintf(buff, SIZEOF(buff), "%sEffect = b%d", E.setting, E.value.effectIndex);
WriteLine(fhand, buff);
- mir_snprintf(buff, SIZEOF(buff), "%sEffectCol1=d%d", E.setting, E.value.baseColour);
+ mir_snprintf(buff, SIZEOF(buff), "%sEffectCol1 = d%d", E.setting, E.value.baseColour);
WriteLine(fhand, buff);
- mir_snprintf(buff, SIZEOF(buff), "%sEffectCol2=d%d", E.setting, E.value.secondaryColour);
+ mir_snprintf(buff, SIZEOF(buff), "%sEffectCol2 = d%d", E.setting, E.value.secondaryColour);
WriteLine(fhand, buff);
}
@@ -287,7 +287,7 @@ static BOOL sttFsuiBindColourIdToFonts(HWND hwndList, const TCHAR *name, const T
for (i = SendMessage(hwndList, LB_GETCOUNT, 0, 0); i--;)
{
FSUIListItemData *itemData = (FSUIListItemData *)SendMessage(hwndList, LB_GETITEMDATA, i, 0);
- if (itemData && itemData->font_id >= 0) {
+ if (itemData && itemData->font_id >= 0) {
FontInternal& F = font_id_list_w2[itemData->font_id];
if (name && !_tcscmp(F.name, name)) {
@@ -310,7 +310,7 @@ static BOOL sttFsuiBindEffectIdToFonts(HWND hwndList, const TCHAR *name, int eff
for (i = SendMessage(hwndList, LB_GETCOUNT, 0, 0); i--;)
{
FSUIListItemData *itemData = (FSUIListItemData *)SendMessage(hwndList, LB_GETITEMDATA, i, 0);
- if (itemData && itemData->font_id >= 0) {
+ if (itemData && itemData->font_id >= 0) {
FontInternal& F = font_id_list_w2[itemData->font_id];
if (name && !_tcscmp(F.name, name)) {
@@ -487,7 +487,7 @@ static INT_PTR CALLBACK ChooseEffectDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPar
}
int cnt = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETCOUNT, 0, 0);
- for (i = 0; i < cnt; i++) {
+ for (i=0; i < cnt; i++) {
if (SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETITEMDATA, i, 0) == pEffect->effectIndex) {
SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_SETCURSEL, i, 0);
break;
@@ -507,9 +507,9 @@ static INT_PTR CALLBACK ChooseEffectDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPar
case IDOK:
{
int i = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETCURSEL, 0, 0);
- pEffect->effectIndex=(BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETITEMDATA, i, 0);
- pEffect->baseColour=SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR1, CPM_GETCOLOUR, 0, 0)|((~(BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN1, UDM_GETPOS, 0, 0))<<24);
- pEffect->secondaryColour=SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR2, CPM_GETCOLOUR, 0, 0)|((~(BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN2, UDM_GETPOS, 0, 0))<<24);;
+ pEffect->effectIndex = (BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETITEMDATA, i, 0);
+ pEffect->baseColour = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR1, CPM_GETCOLOUR, 0, 0)|((~(BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN1, UDM_GETPOS, 0, 0))<<24);
+ pEffect->secondaryColour = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR2, CPM_GETCOLOUR, 0, 0)|((~(BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN2, UDM_GETPOS, 0, 0))<<24);;
}
EndDialog(hwndDlg, IDOK);
return TRUE;
@@ -599,14 +599,14 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
effect_id_list_w2 = effect_id_list;
effect_id_list_w3 = effect_id_list;
- for (i = 0; i < font_id_list_w2.getCount(); i++) {
+ for (i=0; i < font_id_list_w2.getCount(); i++) {
FontInternal& F = font_id_list_w2[i];
// sync settings with database
UpdateFontSettings(&F, &F.value);
sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), F.group, F.hLangpack);
}
- for (i = 0; i < colour_id_list_w2.getCount(); i++) {
+ for (i=0; i < colour_id_list_w2.getCount(); i++) {
ColourInternal& C = colour_id_list_w2[i];
// sync settings with database
@@ -614,7 +614,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), C.group, C.hLangpack);
}
- for (i = 0; i < effect_id_list_w2.getCount(); i++) {
+ for (i=0; i < effect_id_list_w2.getCount(); i++) {
EffectInternal& E = effect_id_list_w2[i];
// sync settings with database
@@ -927,7 +927,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
if (selCount = SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETSELCOUNT, (WPARAM)0, (LPARAM)0)) {
int *selItems = (int *)mir_alloc(font_id_list_w2.getCount() * sizeof(int));
SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETSELITEMS, (WPARAM)selCount, (LPARAM)selItems);
- for (i = 0; i < selCount; ++i) {
+ for (i=0; i < selCount; ++i) {
FSUIListItemData *itemData = (FSUIListItemData *)SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETITEMDATA, selItems[i], 0);
if (IsBadReadPtr(itemData, sizeof(FSUIListItemData))) continue; // prevent possible problems with corrupted itemData
@@ -1017,7 +1017,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
else cf.Flags = CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS;
if (ChooseFont(&cf)) {
- for (i = 0; i < selCount; ++i) {
+ for (i=0; i < selCount; ++i) {
FSUIListItemData *itemData = (FSUIListItemData *)SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETITEMDATA, selItems[i], 0);
if (itemData->font_id < 0)
continue;
@@ -1075,7 +1075,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
if (selCount = SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETSELCOUNT, 0, 0)) {
int *selItems = (int *)mir_alloc(selCount * sizeof(int));
SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETSELITEMS, (WPARAM)selCount, (LPARAM) selItems);
- for (int i = 0; i < selCount; i++) {
+ for (int i=0; i < selCount; i++) {
FSUIListItemData *itemData = (FSUIListItemData *)SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETITEMDATA, selItems[i], 0);
if (itemData->font_id < 0) continue;
font_id_list_w2[itemData->font_id].value.colour = SendDlgItemMessage(hwndDlg, IDC_FONTCOLOUR, CPM_GETCOLOUR, 0, 0);
@@ -1090,7 +1090,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
if (selCount = SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETSELCOUNT, 0, 0)) {
int *selItems = (int *)mir_alloc(selCount * sizeof(int));
SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETSELITEMS, (WPARAM)selCount, (LPARAM) selItems);
- for (i = 0; i < selCount; i++) {
+ for (i=0; i < selCount; i++) {
FSUIListItemData *itemData = (FSUIListItemData *)SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETITEMDATA, selItems[i], 0);
if (itemData->colour_id < 0) continue;
colour_id_list_w2[itemData->colour_id].value = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0);
@@ -1110,7 +1110,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
if (font_id_list_w2.getCount() && (selCount = SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETSELCOUNT, (WPARAM)0, (LPARAM)0))) {
int *selItems = (int *)mir_alloc(font_id_list_w2.getCount() * sizeof(int));
SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETSELITEMS, (WPARAM)selCount, (LPARAM)selItems);
- for (i = 0; i < selCount; ++i) {
+ for (i=0; i < selCount; ++i) {
FSUIListItemData *itemData = (FSUIListItemData *)SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETITEMDATA, selItems[i], 0);
if (IsBadReadPtr(itemData, sizeof(FSUIListItemData))) continue; // prevent possible problems with corrupted itemData
@@ -1274,7 +1274,7 @@ int OptInit(WPARAM wParam, LPARAM)
static FontInternal *sttFindFont(OBJLIST<FontInternal> &fonts, char *module, char *prefix)
{
- for (int i = 0; i < fonts.getCount(); i++)
+ for (int i=0; i < fonts.getCount(); i++)
{
FontInternal& F = fonts[i];
if ( !lstrcmpA(F.dbSettingsGroup, module) && !lstrcmpA(F.prefix, prefix))
@@ -1418,7 +1418,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND, UINT, WPARAM, LPARAM);
int FontsModernOptInit(WPARAM wParam, LPARAM lParam)
{
- static int iBoldControls[] =
+ static int iBoldControls[] =
{
IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
MODERNOPT_CTRL_LAST
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp
index f4804c839a..5a7c9696ab 100644
--- a/src/modules/fonts/services.cpp
+++ b/src/modules/fonts/services.cpp
@@ -237,7 +237,7 @@ void UpdateFontSettings(FontIDW* font_id, FontSettingsT* fontsettings)
colour = GetColorFromDefault(font_id->deffontsettings.colour);
}
- fontsettings->style =
+ fontsettings->style =
(lf.lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf.lfItalic ? DBFONTF_ITALIC : 0) | (lf.lfUnderline ? DBFONTF_UNDERLINE : 0) | (lf.lfStrikeOut ? DBFONTF_STRIKEOUT : 0);
fontsettings->size = (char)lf.lfHeight;
@@ -288,7 +288,7 @@ static int sttRegisterFontWorker(FontIDW* font_id, int hLangpack)
if (font_id->cbSize != sizeof(FontIDW) && font_id->cbSize != FontIDW_OLDSIZE)
return -1;
- for (int i = 0; i < font_id_list.getCount(); i++) {
+ for (int i=0; i < font_id_list.getCount(); i++) {
FontInternal& F = font_id_list[i];
if ( !lstrcmp(F.group, font_id->group) && !lstrcmp(F.name, font_id->name) && !(F.flags & FIDF_ALLOWREREGISTER))
return 1;
@@ -335,7 +335,7 @@ static INT_PTR sttGetFontWorker(FontIDW* font_id, LOGFONT* lf)
{
COLORREF colour;
- for (int i = 0; i < font_id_list.getCount(); i++) {
+ for (int i=0; i < font_id_list.getCount(); i++) {
FontInternal& F = font_id_list[i];
if ( !_tcsncmp(F.name, font_id->name, SIZEOF(F.name)) && !_tcsncmp(F.group, font_id->group, SIZEOF(F.group))) {
if (GetFontSettingFromDB(F.dbSettingsGroup, F.prefix, lf, &colour, F.flags) && (F.flags & FIDF_DEFAULTVALID)) {
@@ -372,7 +372,7 @@ INT_PTR GetFont(WPARAM wParam, LPARAM lParam)
void KillModuleFonts(int hLangpack)
{
- for (int i=font_id_list.getCount()-1; i >= 0; i--)
+ for (int i = font_id_list.getCount()-1; i >= 0; i--)
if ( font_id_list[i].hLangpack == hLangpack)
font_id_list.remove(i);
}
@@ -390,7 +390,7 @@ static INT_PTR sttRegisterColourWorker(ColourIDW* colour_id, int hLangpack)
if (colour_id->cbSize != sizeof(ColourIDW))
return -1;
- for (int i = 0; i < colour_id_list.getCount(); i++) {
+ for (int i=0; i < colour_id_list.getCount(); i++) {
ColourInternal& C = colour_id_list[i];
if ( !_tcscmp(C.group, colour_id->group) && !_tcscmp(C.name, colour_id->name))
return 1;
@@ -422,7 +422,7 @@ INT_PTR RegisterColour(WPARAM wParam, LPARAM lParam)
static INT_PTR sttGetColourWorker(ColourIDW* colour_id)
{
- for (int i = 0; i < colour_id_list.getCount(); i++) {
+ for (int i=0; i < colour_id_list.getCount(); i++) {
ColourInternal& C = colour_id_list[i];
if ( !_tcscmp(C.group, colour_id->group) && !_tcscmp(C.name, colour_id->name))
return DBGetContactSettingDword(NULL, C.dbSettingsGroup, C.setting, GetColorFromDefault(C.defcolour));
@@ -447,7 +447,7 @@ INT_PTR GetColour(WPARAM wParam, LPARAM)
void KillModuleColours(int hLangpack)
{
- for (int i=colour_id_list.getCount()-1; i >= 0; i--)
+ for (int i = colour_id_list.getCount()-1; i >= 0; i--)
if (colour_id_list[i].hLangpack == hLangpack)
colour_id_list.remove(i);
}
@@ -476,7 +476,7 @@ static INT_PTR sttRegisterEffectWorker(EffectIDW* effect_id, int hLangpack)
if (effect_id->cbSize != sizeof(EffectIDW))
return -1;
- for (int i = 0; i < effect_id_list.getCount(); i++) {
+ for (int i=0; i < effect_id_list.getCount(); i++) {
EffectInternal& E = effect_id_list[i];
if ( !_tcscmp(E.group, effect_id->group) && !_tcscmp(E.name, effect_id->name))
return 1;
@@ -508,14 +508,14 @@ INT_PTR RegisterEffect(WPARAM wParam, LPARAM lParam)
static INT_PTR sttGetEffectWorker(EffectIDW* effect_id, FONTEFFECT* effect)
{
- for (int i = 0; i < effect_id_list.getCount(); i++) {
+ for (int i=0; i < effect_id_list.getCount(); i++) {
EffectInternal& E = effect_id_list[i];
if ( !_tcsncmp(E.name, effect_id->name, SIZEOF(E.name)) && !_tcsncmp(E.group, effect_id->group, SIZEOF(E.group))) {
FONTEFFECT temp;
UpdateEffectSettings(effect_id, &temp);
effect->effectIndex = temp.effectIndex;
- effect->baseColour = temp.baseColour;
+ effect->baseColour = temp.baseColour;
effect->secondaryColour = temp.secondaryColour;
return TRUE;
} }
@@ -539,7 +539,7 @@ INT_PTR GetEffect(WPARAM wParam, LPARAM lParam)
void KillModuleEffects(int hLangpack)
{
- for (int i=effect_id_list.getCount()-1; i >= 0; i--)
+ for (int i = effect_id_list.getCount()-1; i >= 0; i--)
if (effect_id_list[i].hLangpack == hLangpack)
effect_id_list.remove(i);
}
diff --git a/src/modules/help/about.cpp b/src/modules/help/about.cpp
index 93f869466a..b01e139a01 100644
--- a/src/modules/help/about.cpp
+++ b/src/modules/help/about.cpp
@@ -37,8 +37,8 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
PVOID pVerInfo;
GetModuleFileName(NULL, filename, SIZEOF(filename));
- verInfoSize=GetFileVersionInfoSize(filename, &unused);
- pVerInfo=mir_alloc(verInfoSize);
+ verInfoSize = GetFileVersionInfoSize(filename, &unused);
+ pVerInfo = mir_alloc(verInfoSize);
GetFileVersionInfo(filename, 0, verInfoSize, pVerInfo);
VerQueryValue(pVerInfo, _T("\\StringFileInfo\\000004b0\\LegalCopyright"), (LPVOID*)&productCopyright, &blockSize);
SetDlgItemText(hwndDlg, IDC_DEVS, productCopyright);
@@ -67,10 +67,10 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
}
ShowWindow(GetDlgItem(hwndDlg, IDC_CREDITSFILE), SW_HIDE);
{
- HRSRC hResInfo = FindResource(hInst, MAKEINTRESOURCE(IDR_CREDITS), _T("TEXT"));
- DWORD ResSize = SizeofResource(hInst, hResInfo);
- HGLOBAL hRes = LoadResource(hInst, hResInfo);
- char* pszMsg = (char*)LockResource(hRes);
+ HRSRC hResInfo = FindResource(hInst, MAKEINTRESOURCE(IDR_CREDITS), _T("TEXT"));
+ DWORD ResSize = SizeofResource(hInst, hResInfo);
+ HGLOBAL hRes = LoadResource(hInst, hResInfo);
+ char* pszMsg = (char*)LockResource(hRes);
if (pszMsg)
{
char* pszMsgt = (char*)alloca(ResSize + 1);
@@ -134,7 +134,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
case WM_DESTROY:
Window_FreeIcon_IcoLib(hwndDlg);
{
- HFONT hFont=(HFONT)SendDlgItemMessage(hwndDlg, IDC_VERSION, WM_GETFONT, 0, 0);
+ HFONT hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_VERSION, WM_GETFONT, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_VERSION, WM_SETFONT, SendDlgItemMessage(hwndDlg, IDOK, WM_GETFONT, 0, 0), 0);
DeleteObject(hFont);
}
diff --git a/src/modules/help/help.cpp b/src/modules/help/help.cpp
index a1984ca32e..30c25ff87c 100644
--- a/src/modules/help/help.cpp
+++ b/src/modules/help/help.cpp
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-HWND hAboutDlg=NULL;
+HWND hAboutDlg = NULL;
static HANDLE hBugEvent = NULL;
static INT_PTR AboutCommand(WPARAM wParam, LPARAM)
@@ -34,7 +34,7 @@ static INT_PTR AboutCommand(WPARAM wParam, LPARAM)
SetFocus(hAboutDlg);
return 0;
}
- hAboutDlg=CreateDialog(hInst, MAKEINTRESOURCE(IDD_ABOUT), (HWND)wParam, DlgProcAbout);
+ hAboutDlg = CreateDialog(hInst, MAKEINTRESOURCE(IDD_ABOUT), (HWND)wParam, DlgProcAbout);
return 0;
}
@@ -68,7 +68,7 @@ static INT_PTR BugCommand(WPARAM, LPARAM)
int ShutdownHelpModule(WPARAM, LPARAM)
{
if (IsWindow(hAboutDlg)) DestroyWindow(hAboutDlg);
- hAboutDlg=NULL;
+ hAboutDlg = NULL;
return 0;
}
diff --git a/src/modules/history/history.cpp b/src/modules/history/history.cpp
index 403ffecd79..c4d56a858a 100644
--- a/src/modules/history/history.cpp
+++ b/src/modules/history/history.cpp
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcHistoryFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-static HANDLE hWindowList=0;
+static HANDLE hWindowList = 0;
static INT_PTR UserHistoryCommand(WPARAM wParam, LPARAM)
{
@@ -70,7 +70,7 @@ int LoadHistoryModule(void)
Menu_AddContactMenuItem(&mi);
CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY, UserHistoryCommand);
- hWindowList=(HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
HookEvent(ME_DB_CONTACT_DELETED, HistoryContactDelete);
HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdownHistoryModule);
return 0;
@@ -194,21 +194,21 @@ static void FillHistoryThread(void* param)
THistoryThread *hInfo = (THistoryThread*)param;
SendDlgItemMessage(hInfo->hwnd, IDC_LIST, LB_RESETCONTENT, 0, 0);
- i=CallService(MS_DB_EVENT_GETCOUNT, (WPARAM)hInfo->hContact, 0);
+ i = CallService(MS_DB_EVENT_GETCOUNT, (WPARAM)hInfo->hContact, 0);
SendDlgItemMessage(hInfo->hwnd, IDC_LIST, LB_INITSTORAGE, i, i*40);
ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize=sizeof(dbei);
- oldBlobSize=0;
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hInfo->hContact, 0);
+ dbei.cbSize = sizeof(dbei);
+ oldBlobSize = 0;
+ hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hInfo->hContact, 0);
hwndList = GetDlgItem(hInfo->hwnd, IDC_LIST);
while (hDbEvent != NULL) {
if ( !IsWindow(hInfo->hwnd))
break;
- newBlobSize=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
+ newBlobSize = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
if (newBlobSize>oldBlobSize) {
- dbei.pBlob=(PBYTE)mir_realloc(dbei.pBlob, newBlobSize);
- oldBlobSize=newBlobSize;
+ dbei.pBlob = (PBYTE)mir_realloc(dbei.pBlob, newBlobSize);
+ oldBlobSize = newBlobSize;
}
dbei.cbBlob = oldBlobSize;
CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
@@ -219,7 +219,7 @@ static void FillHistoryThread(void* param)
i = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)eventText);
SendMessage(hwndList, LB_SETITEMDATA, i, (LPARAM)hDbEvent);
}
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hDbEvent, 0);
+ hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hDbEvent, 0);
}
mir_free(dbei.pBlob);
@@ -249,7 +249,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
HANDLE hContact;
- hContact=(HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
@@ -284,18 +284,18 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
return TRUE;
case WM_GETMINMAXINFO:
- ((MINMAXINFO*)lParam)->ptMinTrackSize.x=300;
- ((MINMAXINFO*)lParam)->ptMinTrackSize.y=230;
+ ((MINMAXINFO*)lParam)->ptMinTrackSize.x = 300;
+ ((MINMAXINFO*)lParam)->ptMinTrackSize.y = 230;
case WM_SIZE:
{
- UTILRESIZEDIALOG urd={0};
- urd.cbSize=sizeof(urd);
- urd.hwndDlg=hwndDlg;
- urd.hInstance=hInst;
- urd.lpTemplate=MAKEINTRESOURCEA(IDD_HISTORY);
- urd.lParam=(LPARAM)NULL;
- urd.pfnResizer=HistoryDlgResizer;
+ UTILRESIZEDIALOG urd = {0};
+ urd.cbSize = sizeof(urd);
+ urd.hwndDlg = hwndDlg;
+ urd.hInstance = hInst;
+ urd.lpTemplate = MAKEINTRESOURCEA(IDD_HISTORY);
+ urd.lParam = (LPARAM)NULL;
+ urd.pfnResizer = HistoryDlgResizer;
CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd);
return TRUE;
}
@@ -330,17 +330,17 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
HANDLE hDbEvent;
DBEVENTINFO dbei;
int sel;
- sel=SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETCURSEL, 0, 0);
+ sel = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETCURSEL, 0, 0);
if (sel == LB_ERR) { EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEHISTORY), FALSE); break; }
EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEHISTORY), TRUE);
contactName = cli.pfnGetContactDisplayName(hContact, 0);
- hDbEvent=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0);
+ hDbEvent = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0);
ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
+ dbei.cbSize = sizeof(dbei);
+ dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
if ((int)dbei.cbBlob != -1)
{
- dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob);
+ dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
if (CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei) == 0)
{
GetObjectDescription(&dbei, str, SIZEOF(str));
@@ -364,11 +364,11 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (index == LB_ERR)
break;
- hDbEventStart=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0);
+ hDbEventStart = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0);
ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize=sizeof(dbei);
- dbei.pBlob=NULL;
- oldBlobSize=0;
+ dbei.cbSize = sizeof(dbei);
+ dbei.pBlob = NULL;
+ oldBlobSize = 0;
for (;;) {
hDbEvent = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, ++index, 0);
if (hDbEvent == (HANDLE)LB_ERR) {
@@ -376,12 +376,12 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
continue;
}
if (hDbEvent == hDbEventStart) break;
- newBlobSize=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
+ newBlobSize = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
if (newBlobSize>oldBlobSize) {
- dbei.pBlob=(PBYTE)mir_realloc(dbei.pBlob, newBlobSize);
- oldBlobSize=newBlobSize;
+ dbei.pBlob = (PBYTE)mir_realloc(dbei.pBlob, newBlobSize);
+ oldBlobSize = newBlobSize;
}
- dbei.cbBlob=oldBlobSize;
+ dbei.cbBlob = oldBlobSize;
CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
GetObjectDescription(&dbei, str, SIZEOF(str));
if (str[0]) {
diff --git a/src/modules/icolib/extracticon.cpp b/src/modules/icolib/extracticon.cpp
index 6a9b3a2ccc..6a53f767cc 100644
--- a/src/modules/icolib/extracticon.cpp
+++ b/src/modules/icolib/extracticon.cpp
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#undef _ASSERT
#endif
#define _ASSERT(n)
-// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/introductiontoresources/resourcereference/resourcestructures/newheader.asp
+// http://msdn.microsoft.com/library/default.asp?url = /library/en-us/winui/winui/windowsuserinterface/resources/introductiontoresources/resourcereference/resourcestructures/newheader.asp
typedef struct
{
WORD Reserved;
@@ -53,7 +53,7 @@ void* _RelativeVirtualAddresstoPtr(IMAGE_DOS_HEADER* pDosHeader, DWORD rva)
IMAGE_SECTION_HEADER* pSection = IMAGE_FIRST_SECTION(pPE);
int i;
- for (i = 0; i < pPE->FileHeader.NumberOfSections; i++) {
+ for (i=0; i < pPE->FileHeader.NumberOfSections; i++) {
IMAGE_SECTION_HEADER* cSection = &pSection[i];
DWORD size = cSection->Misc.VirtualSize ? cSection->Misc.VirtualSize : cSection->SizeOfRawData;
@@ -103,7 +103,7 @@ IMAGE_RESOURCE_DIRECTORY_ENTRY* _FindResourceBase(void* prt, int resType, int* p
count = pDir->NumberOfIdEntries + pDir->NumberOfNamedEntries;
pRes = (IMAGE_RESOURCE_DIRECTORY_ENTRY*)(pDir+1);
- for (i = 0; i < count; i++)
+ for (i=0; i < count; i++)
if (pRes[i].Name == (DWORD)resType) break;
if (i == count) return NULL;
@@ -111,7 +111,7 @@ IMAGE_RESOURCE_DIRECTORY_ENTRY* _FindResourceBase(void* prt, int resType, int* p
pDir = (IMAGE_RESOURCE_DIRECTORY*)((LPBYTE)prt +
(pRes[i].OffsetToData & ~IMAGE_RESOURCE_DATA_IS_DIRECTORY));
- count = pDir->NumberOfIdEntries + pDir->NumberOfNamedEntries;
+ count = pDir->NumberOfIdEntries + pDir->NumberOfNamedEntries;
*pCount = count;
pRes = (IMAGE_RESOURCE_DIRECTORY_ENTRY*)(pDir+1);
diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp
index 62ab6b15cf..b838e7def6 100644
--- a/src/modules/icolib/skin2icons.cpp
+++ b/src/modules/icolib/skin2icons.cpp
@@ -364,7 +364,7 @@ IconSourceItem* CreateStaticIconSourceItem(int cxIcon, int cyIcon)
TCHAR sourceName[ MAX_PATH ];
IconSourceFile key = { sourceName };
- int i = 0;
+ int i=0;
do { // find new unique name
mir_sntprintf(sourceName, SIZEOF(sourceName), _T("*StaticIcon_%d"), ++i);
} while (iconSourceFileList.getIndex(&key) != -1);
@@ -594,7 +594,7 @@ void KillModuleIcons(int hLangpack)
return;
mir_cslock lck(csIconList);
- for (int i=iconList.getCount()-1; i >= 0; i--) {
+ for (int i = iconList.getCount()-1; i >= 0; i--) {
IconItem *item = iconList[i];
if ( item->hLangpack == hLangpack) {
IcoLib_FreeIcon(item);
@@ -821,15 +821,15 @@ int LoadIcoLibModule(void)
hIconBlank = LoadIconEx(NULL, MAKEINTRESOURCE(IDI_BLANK), 0);
InitializeCriticalSection(&csIconList);
- hIcoLib_AddNewIcon = CreateServiceFunction("Skin2/Icons/AddIcon", sttIcoLib_AddNewIcon);
- hIcoLib_RemoveIcon = CreateServiceFunction(MS_SKIN2_REMOVEICON, IcoLib_RemoveIcon);
- hIcoLib_GetIcon = CreateServiceFunction(MS_SKIN2_GETICON, sttIcoLib_GetIcon);
+ hIcoLib_AddNewIcon = CreateServiceFunction("Skin2/Icons/AddIcon", sttIcoLib_AddNewIcon);
+ hIcoLib_RemoveIcon = CreateServiceFunction(MS_SKIN2_REMOVEICON, IcoLib_RemoveIcon);
+ hIcoLib_GetIcon = CreateServiceFunction(MS_SKIN2_GETICON, sttIcoLib_GetIcon);
hIcoLib_GetIconHandle = CreateServiceFunction(MS_SKIN2_GETICONHANDLE, sttIcoLib_GetIconHandle);
- hIcoLib_GetIcon2 = CreateServiceFunction(MS_SKIN2_GETICONBYHANDLE, sttIcoLib_GetIconByHandle);
- hIcoLib_IsManaged = CreateServiceFunction(MS_SKIN2_ISMANAGEDICON, sttIcoLib_IsManaged);
- hIcoLib_AddRef = CreateServiceFunction(MS_SKIN2_ADDREFICON, IcoLib_AddRef);
- hIcoLib_ReleaseIcon = CreateServiceFunction(MS_SKIN2_RELEASEICON, sttIcoLib_ReleaseIcon);
- hIcoLib_ReleaseIcon = CreateServiceFunction(MS_SKIN2_RELEASEICONBIG, sttIcoLib_ReleaseIconBig);
+ hIcoLib_GetIcon2 = CreateServiceFunction(MS_SKIN2_GETICONBYHANDLE, sttIcoLib_GetIconByHandle);
+ hIcoLib_IsManaged = CreateServiceFunction(MS_SKIN2_ISMANAGEDICON, sttIcoLib_IsManaged);
+ hIcoLib_AddRef = CreateServiceFunction(MS_SKIN2_ADDREFICON, IcoLib_AddRef);
+ hIcoLib_ReleaseIcon = CreateServiceFunction(MS_SKIN2_RELEASEICON, sttIcoLib_ReleaseIcon);
+ hIcoLib_ReleaseIcon = CreateServiceFunction(MS_SKIN2_RELEASEICONBIG, sttIcoLib_ReleaseIconBig);
hIcons2ChangedEvent = CreateHookableEvent(ME_SKIN2_ICONSCHANGED);
hIconsChangedEvent = CreateHookableEvent(ME_SKIN_ICONSCHANGED);
diff --git a/src/modules/icolib/skin2opts.cpp b/src/modules/icolib/skin2opts.cpp
index 97529762e3..d9bcdaf8d9 100644
--- a/src/modules/icolib/skin2opts.cpp
+++ b/src/modules/icolib/skin2opts.cpp
@@ -227,7 +227,7 @@ void UndoSubItemChanges(HWND htv, HTREEITEM hItem, int cmd)
static void OpenIconsPage()
{
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://addons.miranda-im.org/index.php?action=display&id=35");
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://addons.miranda-im.org/index.php?action = display&id = 35");
}
static int OpenPopupMenu(HWND hwndDlg)
@@ -259,7 +259,7 @@ static TCHAR* OpenFileDlg(HWND hParent, const TCHAR* szFile, BOOL bAll)
else
lstrcat(filter, _T(" (*.dll)"));
- pfilter=filter+lstrlen(filter)+1;
+ pfilter = filter+lstrlen(filter)+1;
if (bAll)
lstrcpy(pfilter, _T("*.DLL;*.ICL;*.EXE;*.ICO"));
else
@@ -271,7 +271,7 @@ static TCHAR* OpenFileDlg(HWND hParent, const TCHAR* szFile, BOOL bAll)
pfilter += lstrlen(pfilter) + 1;
lstrcpy(pfilter, _T("*"));
pfilter += lstrlen(pfilter) + 1;
- *pfilter='\0';
+ *pfilter = '\0';
ofn.lpstrFilter = filter;
ofn.lpstrDefExt = _T("dll");
@@ -444,7 +444,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
lvi.iSubItem = 0;
lvi.iItem = 0;
int count = (int)_ExtractIconEx(filename, -1, 16, 16, NULL, LR_DEFAULTCOLOR);
- for (int i = 0; i < count; lvi.iItem++, i++) {
+ for (int i=0; i < count; lvi.iItem++, i++) {
mir_sntprintf(caption, SIZEOF(caption), _T("%d"), i+1);
lvi.pszText = caption;
@@ -486,7 +486,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case WM_MOUSEMOVE:
if (dragging) {
LVHITTESTINFO lvhti;
- int onItem=0;
+ int onItem = 0;
HWND hwndOver;
RECT rc;
POINT ptDrag;
@@ -542,7 +542,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
GetDlgItemText(hwndDlg, IDC_ICONSET, fullPath, SIZEOF(fullPath));
CallService(MS_UTILS_PATHTORELATIVET, (WPARAM)fullPath, (LPARAM)filename);
- lvi.mask=LVIF_PARAM;
+ lvi.mask = LVIF_PARAM;
lvi.iItem = dragItem; lvi.iSubItem = 0;
ListView_GetItem(hPreview, &lvi);
mir_sntprintf(path, MAX_PATH, _T("%s,%d"), filename, (int)lvi.lParam);
@@ -1019,7 +1019,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
return FALSE;
}
-static UINT iconsExpertOnlyControls[]={IDC_IMPORT};
+static UINT iconsExpertOnlyControls[] = {IDC_IMPORT};
int SkinOptionsInit(WPARAM wParam, LPARAM)
{
diff --git a/src/modules/idle/idle.cpp b/src/modules/idle/idle.cpp
index dfd2fdf628..fdd842ef79 100644
--- a/src/modules/idle/idle.cpp
+++ b/src/modules/idle/idle.cpp
@@ -187,7 +187,7 @@ static void IdleObject_ReadSettings(IdleObject * obj)
static void IdleObject_Create(IdleObject * obj)
{
ZeroMemory(obj, sizeof(IdleObject));
- obj->hTimer=SetTimer(NULL, 0, 2000, IdleTimer);
+ obj->hTimer = SetTimer(NULL, 0, 2000, IdleTimer);
IdleObject_ReadSettings(obj);
}
@@ -210,7 +210,7 @@ static int IdleObject_IsUserIdle(IdleObject * obj)
if (MyGetLastInputInfo != NULL) {
LASTINPUTINFO ii;
ZeroMemory(&ii, sizeof(ii));
- ii.cbSize=sizeof(ii);
+ ii.cbSize = sizeof(ii);
if (MyGetLastInputInfo(&ii))
return GetTickCount() - ii.dwTime > (obj->minutes * 60 * 1000);
}
@@ -218,8 +218,8 @@ static int IdleObject_IsUserIdle(IdleObject * obj)
POINT pt;
GetCursorPos(&pt);
if (pt.x != obj->mousepos.x || pt.y != obj->mousepos.y) {
- obj->mousepos=pt;
- obj->mouseidle=0;
+ obj->mousepos = pt;
+ obj->mouseidle = 0;
}
else obj->mouseidle += 2;
@@ -424,7 +424,7 @@ static INT_PTR CALLBACK IdleOptsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
{
int min;
if ((HWND)lParam != GetFocus() || HIWORD(wParam) != EN_CHANGE) return FALSE;
- min=GetDlgItemInt(hwndDlg, IDC_IDLE1STTIME, NULL, FALSE);
+ min = GetDlgItemInt(hwndDlg, IDC_IDLE1STTIME, NULL, FALSE);
if (min == 0 && GetWindowTextLength(GetDlgItem(hwndDlg, IDC_IDLE1STTIME)))
SendDlgItemMessage(hwndDlg, IDC_IDLESPIN, UDM_SETPOS, 0, MAKELONG((short) 1, 0));
break;
@@ -478,7 +478,7 @@ static INT_PTR IdleGetInfo(WPARAM, LPARAM lParam)
static int IdleModernOptInit(WPARAM wParam, LPARAM)
{
- static const int iBoldControls[] =
+ static const int iBoldControls[] =
{
IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
MODERNOPT_CTRL_LAST
@@ -505,8 +505,8 @@ int LoadIdleModule(void)
bModuleInitialized = TRUE;
bIsWTSApiPresent = InitWTSAPI();
- MyGetLastInputInfo=(BOOL (WINAPI *)(LASTINPUTINFO*))GetProcAddress(GetModuleHandleA("user32"), "GetLastInputInfo");
- hIdleEvent=CreateHookableEvent(ME_IDLE_CHANGED);
+ MyGetLastInputInfo = (BOOL (WINAPI *)(LASTINPUTINFO*))GetProcAddress(GetModuleHandleA("user32"), "GetLastInputInfo");
+ hIdleEvent = CreateHookableEvent(ME_IDLE_CHANGED);
IdleObject_Create(&gIdleObject);
CreateServiceFunction(MS_IDLE_GETIDLEINFO, IdleGetInfo);
HookEvent(ME_OPT_INITIALISE, IdleOptInit);
@@ -520,5 +520,5 @@ void UnloadIdleModule()
IdleObject_Destroy(&gIdleObject);
DestroyHookableEvent(hIdleEvent);
- hIdleEvent=NULL;
+ hIdleEvent = NULL;
}
diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp
index b5b88343d0..21f1207386 100644
--- a/src/modules/ignore/ignore.cpp
+++ b/src/modules/ignore/ignore.cpp
@@ -24,19 +24,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define IGNOREEVENT_MAX 7
-static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX]={PF1_IMRECV, PF1_URLRECV, PF1_FILERECV, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
-static const DWORD ignoreIdToPf4[IGNOREEVENT_MAX]={0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, PF4_SUPPORTTYPING};
+static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX] = {PF1_IMRECV, PF1_URLRECV, PF1_FILERECV, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
+static const DWORD ignoreIdToPf4[IGNOREEVENT_MAX] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, PF4_SUPPORTTYPING};
static DWORD GetMask(HANDLE hContact)
{
- DWORD mask=DBGetContactSettingDword(hContact, "Ignore", "Mask1", (DWORD)(-1));
+ DWORD mask = DBGetContactSettingDword(hContact, "Ignore", "Mask1", (DWORD)(-1));
if (mask == (DWORD)(-1)) {
- if (hContact == NULL) mask=0;
+ if (hContact == NULL) mask = 0;
else {
if (DBGetContactSettingByte(hContact, "CList", "Hidden", 0) || DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
- mask=DBGetContactSettingDword(NULL, "Ignore", "Mask1", 0);
+ mask = DBGetContactSettingDword(NULL, "Ignore", "Mask1", 0);
else
- mask=DBGetContactSettingDword(NULL, "Ignore", "Default1", 0);
+ mask = DBGetContactSettingDword(NULL, "Ignore", "Default1", 0);
}
}
return mask;
@@ -45,32 +45,32 @@ static DWORD GetMask(HANDLE hContact)
static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentItem, int *groupChildCount)
{
int typeOfFirst;
- int iconOn[IGNOREEVENT_MAX]={1, 1, 1, 1, 1, 1, 1};
- int childCount[IGNOREEVENT_MAX]={0, 0, 0, 0, 0, 0, 0}, i;
+ int iconOn[IGNOREEVENT_MAX] = {1, 1, 1, 1, 1, 1, 1};
+ int childCount[IGNOREEVENT_MAX] = {0, 0, 0, 0, 0, 0, 0}, i;
int iImage;
HANDLE hItem, hChildItem;
- typeOfFirst=SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
+ typeOfFirst = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
//check groups
- if (typeOfFirst == CLCIT_GROUP) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_GROUP) hItem = hFirstItem;
+ else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
while (hItem) {
- hChildItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ hChildItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hChildItem) SetListGroupIcons(hwndList, hChildItem, hItem, childCount);
for (i=0; i < SIZEOF(iconOn); i++)
- if (iconOn[i] && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i) == 0) iconOn[i]=0;
- hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
+ if (iconOn[i] && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i) == 0) iconOn[i] = 0;
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
//check contacts
- if (typeOfFirst == CLCIT_CONTACT) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_CONTACT) hItem = hFirstItem;
+ else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
for (i=0; i < SIZEOF(iconOn); i++) {
- iImage=SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i);
- if (iconOn[i] && iImage == 0) iconOn[i]=0;
+ iImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i);
+ if (iconOn[i] && iImage == 0) iconOn[i] = 0;
if (iImage != 0xFF) childCount[i]++;
}
- hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
//set icons
for (i=0; i < SIZEOF(iconOn); i++) {
@@ -86,22 +86,22 @@ static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int
int typeOfFirst, iOldIcon;
HANDLE hItem, hChildItem;
- typeOfFirst=SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
+ typeOfFirst = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
//check groups
- if (typeOfFirst == CLCIT_GROUP) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_GROUP) hItem = hFirstItem;
+ else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
while (hItem) {
- hChildItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ hChildItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hChildItem) SetAllChildIcons(hwndList, hChildItem, iColumn, iImage);
- hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
//check contacts
- if (typeOfFirst == CLCIT_CONTACT) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_CONTACT) hItem = hFirstItem;
+ else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
- iOldIcon=SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
+ iOldIcon = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
if (iOldIcon != 0xFF && iOldIcon != iImage) SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
- hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
}
@@ -115,7 +115,7 @@ static void ResetListOptions(HWND hwndList)
SendMessage(hwndList, CLM_SETLEFTMARGIN, 4, 0);
SendMessage(hwndList, CLM_SETINDENT, 10, 0);
SendMessage(hwndList, CLM_SETHIDEEMPTYGROUPS, 1, 0);
- for (i=0;i<=FONTID_MAX;i++)
+ for (i=0;i <= FONTID_MAX;i++)
SendMessage(hwndList, CLM_SETTEXTCOLOR, i, GetSysColor(COLOR_WINDOWTEXT));
}
@@ -123,7 +123,7 @@ static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int
{
int itemType;
- itemType=SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hItem, 0);
+ itemType = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hItem, 0);
if (itemType == CLCIT_CONTACT) {
int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
if (oldiImage != 0xFF && oldiImage != iImage)
@@ -134,7 +134,7 @@ static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int
else SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage)); //hItemUnknown
}
else if (itemType == CLCIT_GROUP) {
- hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hItem) SetAllChildIcons(hwndList, hItem, iColumn, iImage);
}
}
@@ -144,7 +144,7 @@ static void InitialiseItem(HWND hwndList, HANDLE hContact, HANDLE hItem, DWORD p
DWORD mask;
int i;
- mask=GetMask(hContact);
+ mask = GetMask(hContact);
for (i=0;i<IGNOREEVENT_MAX;i++)
if ((ignoreIdToPf1[i] == 0xFFFFFFFF && ignoreIdToPf4[i] == 0xFFFFFFFF) || (proto1Caps&ignoreIdToPf1[i] || proto4Caps&ignoreIdToPf4[i]))
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, mask&(1<<i)?i+3:0));
@@ -157,9 +157,9 @@ static void SaveItemMask(HWND hwndList, HANDLE hContact, HANDLE hItem, const cha
DWORD mask;
int i, iImage;
- mask=0;
+ mask = 0;
for (i=0;i<IGNOREEVENT_MAX;i++) {
- iImage=SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0));
+ iImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0));
if (iImage && iImage != 0xFF) mask|=1<<i;
}
DBWriteContactSettingDword(hContact, "Ignore", pszSetting, mask);
@@ -171,21 +171,21 @@ static void SetAllContactIcons(HWND hwndList)
DWORD proto1Caps, proto4Caps;
char *szProto;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
do {
- hItem=(HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == 0xFF) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if (szProto == NULL) proto1Caps=proto4Caps=0;
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (szProto == NULL) proto1Caps = proto4Caps = 0;
else {
- proto1Caps=CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
- proto4Caps=CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_4, 0);
+ proto1Caps = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
+ proto4Caps = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_4, 0);
}
InitialiseItem(hwndList, hContact, hItem, proto1Caps, proto4Caps);
if ( !DBGetContactSettingByte(hContact, "CList", "Hidden", 0))
SendMessage(hwndList, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
}
- } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ } while (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
}
static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
@@ -199,7 +199,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
TranslateDialogDefault(hwndDlg);
{ HIMAGELIST hIml;
int i;
- hIml=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, 3+IGNOREEVENT_MAX, 3+IGNOREEVENT_MAX);
+ hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, 3+IGNOREEVENT_MAX, 3+IGNOREEVENT_MAX);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_FILLEDBLOB);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_EMPTYBLOB);
@@ -213,7 +213,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
for (i=0; i < SIZEOF(hIcons); i++)
- hIcons[i]=ImageList_GetIcon(hIml, 1+i, ILD_NORMAL);
+ hIcons[i] = ImageList_GetIcon(hIml, 1+i, ILD_NORMAL);
}
SendDlgItemMessage(hwndDlg, IDC_ALLICON, STM_SETICON, (WPARAM)hIcons[0], 0);
@@ -234,14 +234,14 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST));
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRACOLUMNS, IGNOREEVENT_MAX+2, 0);
- { CLCINFOITEM cii={0};
- cii.cbSize=sizeof(cii);
- cii.flags=CLCIIF_GROUPFONT;
- cii.pszText=TranslateT("** All contacts **");
- hItemAll=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
+ { CLCINFOITEM cii = {0};
+ cii.cbSize = sizeof(cii);
+ cii.flags = CLCIIF_GROUPFONT;
+ cii.pszText = TranslateT("** All contacts **");
+ hItemAll = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
- cii.pszText=TranslateT("** Unknown contacts **");
- hItemUnknown=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
+ cii.pszText = TranslateT("** Unknown contacts **");
+ hItemUnknown = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
InitialiseItem(GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemUnknown, 0xFFFFFFFF, 0xFFFFFFFF);
}
@@ -271,26 +271,26 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
break;
case NM_CLICK:
{ HANDLE hItem;
- NMCLISTCONTROL *nm=(NMCLISTCONTROL*)lParam;
+ NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam;
DWORD hitFlags;
int iImage;
if (nm->iColumn == -1) break;
- hItem=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
+ hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
if (hItem == NULL) break;
if ( !(hitFlags&CLCHT_ONITEMEXTRA)) break;
if (nm->iColumn == IGNOREEVENT_MAX) { //ignore all
- for (iImage=0;iImage<IGNOREEVENT_MAX;iImage++)
+ for (iImage = 0;iImage<IGNOREEVENT_MAX;iImage++)
SetIconsForColumn(GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, iImage, iImage+3);
}
else if (nm->iColumn == IGNOREEVENT_MAX+1) { //ignore none
- for (iImage=0;iImage<IGNOREEVENT_MAX;iImage++)
+ for (iImage = 0;iImage<IGNOREEVENT_MAX;iImage++)
SetIconsForColumn(GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, iImage, 0);
}
else {
- iImage=SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0));
- if (iImage == 0) iImage=nm->iColumn+3;
- else if (iImage != 0xFF) iImage=0;
+ iImage = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0));
+ if (iImage == 0) iImage = nm->iColumn+3;
+ else if (iImage != 0xFF) iImage = 0;
SetIconsForColumn(GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, nm->iColumn, iImage);
}
SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
@@ -305,15 +305,15 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
case PSN_APPLY:
{ HANDLE hContact, hItem;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
do {
- hItem=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), hContact, hItem, "Mask1");
if (SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0))
DBDeleteContactSetting(hContact, "CList", "Hidden");
else
DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
- } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ } while (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemAll, "Default1");
SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemUnknown, "Mask1");
return TRUE;
@@ -331,7 +331,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
HIMAGELIST hIml;
for (i=0; i < SIZEOF(hIcons); i++)
DestroyIcon(hIcons[i]);
- hIml=(HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0);
+ hIml = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0);
ImageList_Destroy(hIml);
break;
}
@@ -339,7 +339,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
return FALSE;
}
-static UINT expertOnlyControls[]={IDC_STCHECKMARKS};
+static UINT expertOnlyControls[] = {IDC_STCHECKMARKS};
static int IgnoreOptInitialise(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
@@ -359,16 +359,16 @@ static int IgnoreOptInitialise(WPARAM wParam, LPARAM)
static INT_PTR IsIgnored(WPARAM wParam, LPARAM lParam)
{
- DWORD mask=GetMask((HANDLE)wParam);
+ DWORD mask = GetMask((HANDLE)wParam);
if (lParam<1 || lParam>IGNOREEVENT_MAX) return 1;
return (mask>>(lParam-1))&1;
}
static INT_PTR Ignore(WPARAM wParam, LPARAM lParam)
{
- DWORD mask=GetMask((HANDLE)wParam);
+ DWORD mask = GetMask((HANDLE)wParam);
if ((lParam<1 || lParam>IGNOREEVENT_MAX) && lParam != IGNOREEVENT_ALL) return 1;
- if (lParam == IGNOREEVENT_ALL) mask=(1<<IGNOREEVENT_MAX)-1;
+ if (lParam == IGNOREEVENT_ALL) mask = (1<<IGNOREEVENT_MAX)-1;
else mask|=1<<(lParam-1);
DBWriteContactSettingDword((HANDLE)wParam, "Ignore", "Mask1", mask);
return 0;
@@ -376,9 +376,9 @@ static INT_PTR Ignore(WPARAM wParam, LPARAM lParam)
static INT_PTR Unignore(WPARAM wParam, LPARAM lParam)
{
- DWORD mask=GetMask((HANDLE)wParam);
+ DWORD mask = GetMask((HANDLE)wParam);
if ((lParam<1 || lParam>IGNOREEVENT_MAX) && lParam != IGNOREEVENT_ALL) return 1;
- if (lParam == IGNOREEVENT_ALL) mask=0;
+ if (lParam == IGNOREEVENT_ALL) mask = 0;
else mask&=~(1<<(lParam-1));
DBWriteContactSettingDword((HANDLE)wParam, "Ignore", "Mask1", mask);
return 0;
@@ -416,11 +416,11 @@ static INT_PTR IgnoreRecvAuth(WPARAM wParam, LPARAM lParam)
static int IgnoreAddedNotify(WPARAM, LPARAM lParam)
{
- DBEVENTINFO *dbei=(DBEVENTINFO*)lParam;
+ DBEVENTINFO *dbei = (DBEVENTINFO*)lParam;
if (dbei && dbei->eventType == EVENTTYPE_ADDED && dbei->pBlob != NULL) {
HANDLE hContact;
- hContact=*((PHANDLE)(dbei->pBlob+sizeof(DWORD)));
+ hContact = *((PHANDLE)(dbei->pBlob+sizeof(DWORD)));
if (CallService(MS_DB_CONTACT_IS, (WPARAM)hContact, 0) && IsIgnored((WPARAM)hContact, IGNOREEVENT_YOUWEREADDED))
return 1;
}
@@ -429,7 +429,7 @@ static int IgnoreAddedNotify(WPARAM, LPARAM lParam)
static int IgnoreModernOptInit(WPARAM wParam, LPARAM)
{
- static int iBoldControls[] =
+ static int iBoldControls[] =
{
IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
MODERNOPT_CTRL_LAST
@@ -453,16 +453,16 @@ static int IgnoreModernOptInit(WPARAM wParam, LPARAM)
int LoadIgnoreModule(void)
{
PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize=sizeof(pd);
- pd.szName="Ignore";
- pd.type=PROTOTYPE_IGNORE;
+ pd.cbSize = sizeof(pd);
+ pd.szName = "Ignore";
+ pd.type = PROTOTYPE_IGNORE;
CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact != NULL) {
if ( !CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)"Ignore"))
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)"Ignore");
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}
CreateServiceFunction("Ignore"PSR_MESSAGE, IgnoreRecvMessage);
diff --git a/src/modules/json/JSONChildren.cpp b/src/modules/json/JSONChildren.cpp
index 371c19880a..f55f0fa676 100644
--- a/src/modules/json/JSONChildren.cpp
+++ b/src/modules/json/JSONChildren.cpp
@@ -1,28 +1,28 @@
-/*
-
-Miranda IM: the free IM client for Microsoft* Windows*
-
-Copyright 2000-2009 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-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; either version 2
-of the License, or (at your option) any later version.
-
-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, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "..\..\core\commonheaders.h"
-
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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; either version 2
+of the License, or (at your option) any later version.
+
+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, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "..\..\core\commonheaders.h"
+
#include "JSONChildren.h"
#include "JSONNode.h"
diff --git a/src/modules/json/JSONDebug.cpp b/src/modules/json/JSONDebug.cpp
index 7e13c11a85..990a594679 100644
--- a/src/modules/json/JSONDebug.cpp
+++ b/src/modules/json/JSONDebug.cpp
@@ -1,30 +1,30 @@
-/*
-
-Miranda IM: the free IM client for Microsoft* Windows*
-
-Copyright 2000-2009 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-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; either version 2
-of the License, or (at your option) any later version.
-
-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, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "..\..\core\commonheaders.h"
-
-#include "libJSON.h"
-#include "m_json.h"
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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; either version 2
+of the License, or (at your option) any later version.
+
+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, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "..\..\core\commonheaders.h"
+
+#include "libJSON.h"
+#include "m_json.h"
#ifdef JSON_DEBUG
diff --git a/src/modules/json/JSONIterators.cpp b/src/modules/json/JSONIterators.cpp
index edb8ff7618..716be5f8e1 100644
--- a/src/modules/json/JSONIterators.cpp
+++ b/src/modules/json/JSONIterators.cpp
@@ -1,28 +1,28 @@
-/*
-
-Miranda IM: the free IM client for Microsoft* Windows*
-
-Copyright 2000-2009 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-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; either version 2
-of the License, or (at your option) any later version.
-
-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, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "..\..\core\commonheaders.h"
-
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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; either version 2
+of the License, or (at your option) any later version.
+
+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, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "..\..\core\commonheaders.h"
+
#include "JSONNode.h"
#ifdef JSON_ITERATORS
@@ -119,7 +119,7 @@ JSONNode::json_iterator JSONNode::insertFFF(json_iterator pos, JSONNode ** const
json_auto<JSONNode *> mem(num);
JSONNode ** runner = mem.ptr;
for (JSONNode ** po = _start; po < _end; ++po){
- *runner++ = newJSONNode(*(*po) JSON_MUTEX_COPY2);
+ *runner++=newJSONNode(*(*po) JSON_MUTEX_COPY2);
}
internal -> Children.insert(json_iterator_ptr(pos), mem.ptr, num);
return pos;
@@ -213,7 +213,7 @@ JSONNode::json_iterator JSONNode::insertFFF(json_iterator pos, JSONNode ** const
json_auto<JSONNode *> mem(num);
JSONNode ** runner = mem.ptr;
for (JSONNode ** po = _start; po > _end; --po){
- *runner++ = newJSONNode(*(*po) JSON_MUTEX_COPY2);
+ *runner++=newJSONNode(*(*po) JSON_MUTEX_COPY2);
}
internal -> Children.insert(pos.it, mem.ptr, num);
return pos;
@@ -229,7 +229,7 @@ JSONNode::json_iterator JSONNode::insertFFF(json_iterator pos, JSONNode ** const
json_auto<JSONNode *> mem(num);
JSONNode ** runner = mem.ptr;
for (JSONNode ** po = _start; po > _end; --po){
- *runner++ = newJSONNode(*(*po) JSON_MUTEX_COPY2);
+ *runner++=newJSONNode(*(*po) JSON_MUTEX_COPY2);
}
internal -> Children.insert(++pos.it, mem.ptr, num);
return pos - num + 1;
diff --git a/src/modules/json/JSONMemory.cpp b/src/modules/json/JSONMemory.cpp
index 08b6d7fd70..4c2c851022 100644
--- a/src/modules/json/JSONMemory.cpp
+++ b/src/modules/json/JSONMemory.cpp
@@ -1,28 +1,28 @@
-/*
-
-Miranda IM: the free IM client for Microsoft* Windows*
-
-Copyright 2000-2009 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-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; either version 2
-of the License, or (at your option) any later version.
-
-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, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "..\..\core\commonheaders.h"
-
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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; either version 2
+of the License, or (at your option) any later version.
+
+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, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "..\..\core\commonheaders.h"
+
#include "JSONMemory.h"
#include "JSONNode.h"
diff --git a/src/modules/json/JSONMemory.h b/src/modules/json/JSONMemory.h
index c04c45eff5..899d73b6fc 100644
--- a/src/modules/json/JSONMemory.h
+++ b/src/modules/json/JSONMemory.h
@@ -119,7 +119,7 @@ class json_auto {
T * ptr;
private:
json_auto(const json_auto &);
- json_auto & operator =(const json_auto &);
+ json_auto & operator = (const json_auto &);
};
//Clears a string, if required, frees the memory
diff --git a/src/modules/json/JSONNode.cpp b/src/modules/json/JSONNode.cpp
index 8d2a046f69..8e4ca34678 100644
--- a/src/modules/json/JSONNode.cpp
+++ b/src/modules/json/JSONNode.cpp
@@ -1,28 +1,28 @@
-/*
-
-Miranda IM: the free IM client for Microsoft* Windows*
-
-Copyright 2000-2009 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-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; either version 2
-of the License, or (at your option) any later version.
-
-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, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "..\..\core\commonheaders.h"
-
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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; either version 2
+of the License, or (at your option) any later version.
+
+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, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "..\..\core\commonheaders.h"
+
#include "JSONNode.h"
#ifdef JSON_UNIT_TEST
@@ -158,7 +158,7 @@ void JSONNode::merge(JSONNode &) {
#ifdef JSON_REF_COUNT
va_list args;
va_start(args, num);
- for(unsigned int i = 0; i < num; ++i){
+ for(unsigned int i=0; i < num; ++i){
merge(va_arg(args, JSONNode*));
}
va_end(args);
diff --git a/src/modules/json/JSONNode.h b/src/modules/json/JSONNode.h
index 36ebcd6145..3552f9f73c 100644
--- a/src/modules/json/JSONNode.h
+++ b/src/modules/json/JSONNode.h
@@ -158,7 +158,7 @@ public:
JSONNode JSON_PTR_LIB pop_back_nocase(const json_string & name_t);
#endif
- DECLARE_FOR_ALL_TYPES(JSONNode & operator =)
+ DECLARE_FOR_ALL_TYPES(JSONNode & operator = )
JSONNode & operator = (const JSONNode &);
DECLARE_FOR_ALL_TYPES_CONST(bool operator ==)
@@ -253,7 +253,7 @@ public:
inline bool operator >= (const const_iterator & other) const { return it >= other.it; }
inline bool operator < (const const_iterator & other) const { return it < other.it; }
inline bool operator <= (const const_iterator & other) const { return it <= other.it; }
- inline const_iterator & operator =(const const_iterator & orig){ it = orig.it; return *this; }
+ inline const_iterator & operator = (const const_iterator & orig){ it = orig.it; return *this; }
const_iterator (const const_iterator & orig) : it(orig.it) {}
private:
JSONNode ** it;
diff --git a/src/modules/json/JSONWorker.cpp b/src/modules/json/JSONWorker.cpp
index 25589a8d2f..488089345f 100644
--- a/src/modules/json/JSONWorker.cpp
+++ b/src/modules/json/JSONWorker.cpp
@@ -143,12 +143,12 @@ size_t JSONWorker::FindNextRelevant(json_char ch, const json_string & value_t, c
}
#ifdef JSON_COMMENTS
- #define COMMENT_DELIMITER() *runner++ = '\5'
+ #define COMMENT_DELIMITER() *runner++='\5'
#define AND_RUNNER ,runner
inline void SingleLineComment(const json_char * & p, json_char * & runner){
COMMENT_DELIMITER();
while((*(++p)) && (*p != JSON_TEXT('\n'))) {
- *runner++ = *p;
+ *runner++=*p;
}
COMMENT_DELIMITER();
}
@@ -183,7 +183,7 @@ inline void SingleLineComment(const json_char * & p){
COMMENT_DELIMITER();
while ((*(++p) != JSON_TEXT('*')) || (*(p + 1) != JSON_TEXT('/'))) {
JSON_ASSERT_SAFE(*p, JSON_TEXT("Null terminator inside of a multiline quote"), COMMENT_DELIMITER(); goto endofloop;);
- *runner++ = *p;
+ *runner++=*p;
}
++p;
COMMENT_DELIMITER();
@@ -195,16 +195,16 @@ inline void SingleLineComment(const json_char * & p){
SingleLineComment(p AND_RUNNER);
break;
case JSON_TEXT('\"'): //a quote
- *runner++ = JSON_TEXT('\"');
+ *runner++=JSON_TEXT('\"');
while(*(++p) != JSON_TEXT('\"')) { //find the end of the quotation, as white space is preserved within it
JSON_ASSERT_SAFE(*p, JSON_TEXT("Null terminator inside of a quotation"), goto endofloop;);
switch(*p){
case JSON_TEXT('\\'):
- *runner++ = JSON_TEXT('\\');
- *runner++ = (*++p == JSON_TEXT('\"')) ? JSON_TEXT('\1') : *p; //an escaped quote will reak havoc will all of my searching functions, so change it into an illegal character in JSON for convertion later on
+ *runner++=JSON_TEXT('\\');
+ *runner++=(*++p == JSON_TEXT('\"')) ? JSON_TEXT('\1') : *p; //an escaped quote will reak havoc will all of my searching functions, so change it into an illegal character in JSON for convertion later on
break;
default:
- *runner++ = *p;
+ *runner++=*p;
break;
}
}
@@ -212,7 +212,7 @@ inline void SingleLineComment(const json_char * & p){
default:
JSON_ASSERT_SAFE((json_uchar)*p >= 32, JSON_TEXT("Invalid JSON character detected (lo)"), goto endofloop;);
JSON_ASSERT_SAFE((json_uchar)*p <= 126, JSON_TEXT("Invalid JSON character detected (hi)"), goto endofloop;);
- *runner++ = *p;
+ *runner++=*p;
break;
}
++p;
@@ -333,8 +333,8 @@ json_char* JSONWorker::UTF8_2(const json_char * & pos){
++pos;
json_uchar temp = Hex(pos) << 8;
++pos;
- *szU8Buffer= temp | Hex(pos);
- szU8Buffer[1]=0;
+ *szU8Buffer = temp | Hex(pos);
+ szU8Buffer[1] = 0;
return szU8Buffer;
#else
union {
@@ -343,20 +343,20 @@ json_char* JSONWorker::UTF8_2(const json_char * & pos){
};
pos++;
strncpy(szU8Buffer+5,pos,4);
- szU8Buffer[9]=0;
- uChar=strtoul(szU8Buffer+5,NULL,16);
+ szU8Buffer[9] = 0;
+ uChar = strtoul(szU8Buffer+5,NULL,16);
if (uChar<0x80) {
- szU8Buffer[0]=uChar;
- szU8Buffer[1]=0;
+ szU8Buffer[0] = uChar;
+ szU8Buffer[1] = 0;
} else if (uChar<0x7ff) {
- szU8Buffer[0]=0xc0+(uByte[1]<<2)+(uByte[0]>>6);
- szU8Buffer[1]=0x80+(uByte[0]&0x3f);
- szU8Buffer[2]=0;
+ szU8Buffer[0] = 0xc0+(uByte[1]<<2)+(uByte[0]>>6);
+ szU8Buffer[1] = 0x80+(uByte[0]&0x3f);
+ szU8Buffer[2] = 0;
} else {
- szU8Buffer[0]=0xe0+(uByte[1]>>4);
- szU8Buffer[1]=0x80+((uByte[1]&0x0f)<<2)+(uByte[0]>>6);
- szU8Buffer[2]=0x80+(uByte[0]&0x3f);
- szU8Buffer[3]=0;
+ szU8Buffer[0] = 0xe0+(uByte[1]>>4);
+ szU8Buffer[1] = 0x80+((uByte[1]&0x0f)<<2)+(uByte[0]>>6);
+ szU8Buffer[2] = 0x80+(uByte[0]&0x3f);
+ szU8Buffer[3] = 0;
}
pos += 3;
diff --git a/src/modules/json/JSONWriter.cpp b/src/modules/json/JSONWriter.cpp
index ae95773f6d..550a03dadd 100644
--- a/src/modules/json/JSONWriter.cpp
+++ b/src/modules/json/JSONWriter.cpp
@@ -41,7 +41,7 @@ const static json_string WRITER_EMPTY;
if (amount == 0xFFFFFFFF) return WRITER_EMPTY;
json_string result;
result.reserve(amount);
- for(unsigned int i = 0; i < amount; ++i){
+ for(unsigned int i=0; i < amount; ++i){
result += INDENT;
}
return result;
@@ -75,7 +75,7 @@ json_string internalJSONNode::WriteChildren(unsigned int indent){
}
//else it's not formatted, leave the indentation strings empty
const size_t size_minus_one = Children.size() - 1;
- size_t i = 0;
+ size_t i=0;
json_foreach(Children, it){
res += indent_plus_one + (*it) -> internal -> Write(indent, type() == JSON_ARRAY);
if (i < size_minus_one) res += JSON_TEXT(","); //the last one does not get a comma, but all of the others do
diff --git a/src/modules/json/JSON_Base64.cpp b/src/modules/json/JSON_Base64.cpp
index 4759b112bb..07147afadc 100644
--- a/src/modules/json/JSON_Base64.cpp
+++ b/src/modules/json/JSON_Base64.cpp
@@ -1,28 +1,28 @@
-/*
-
-Miranda IM: the free IM client for Microsoft* Windows*
-
-Copyright 2000-2009 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-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; either version 2
-of the License, or (at your option) any later version.
-
-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, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "..\..\core\commonheaders.h"
-
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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; either version 2
+of the License, or (at your option) any later version.
+
+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, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "..\..\core\commonheaders.h"
+
#include "JSON_Base64.h"
#include "JSONDefs.h"
@@ -42,7 +42,7 @@ json_string JSONBase64::json_encode64(const unsigned char * binary, size_t bytes
result.reserve((size_t)(((float)bytes) * 1.37f) + 4);
//do all of the ones that are 3 byte aligned
- for (size_t i = 0; i < aligned; ++i){
+ for (size_t i=0; i < aligned; ++i){
result += chars64[(binary[0] & 0xFC) >> 2];
result += chars64[((binary[0] & 0x03) << 4) + ((binary[1] & 0xF0) >> 4)];
result += chars64[((binary[1] & 0x0F) << 2) + ((binary[2] & 0xC0) >> 6)];
@@ -53,7 +53,7 @@ json_string JSONBase64::json_encode64(const unsigned char * binary, size_t bytes
if (misaligned){
//copy the rest into a temporary buffer
unsigned char temp[3];
- for (unsigned int i = 0; i < misaligned; ++i){
+ for (unsigned int i=0; i < misaligned; ++i){
temp[i] = *binary++;
}
for (unsigned int i = (unsigned int)misaligned; i < 3; ++i){
@@ -67,7 +67,7 @@ json_string JSONBase64::json_encode64(const unsigned char * binary, size_t bytes
result += chars64[((temp[1] & 0x0F) << 2) + ((temp[2] & 0xC0) >> 6)];
result += JSON_TEXT('=');
} else {
- result += JSON_TEXT("==");
+ result += JSON_TEXT(" = = ");
}
}
JSON_ASSERT((size_t)(((float)bytes) * 1.37f) + 4 >= result.length(), JSON_TEXT("Didn't reserve enough space for a one-time go"));
@@ -110,7 +110,7 @@ std::string JSONBase64::json_decode64(const json_string & encoded){
result.reserve((size_t)((float)length / 1.37) + 1);
//first do the ones that can not have any padding
- for (unsigned int i = 0; i < aligned; ++i){
+ for (unsigned int i=0; i < aligned; ++i){
const json_char second = toBinary(runner[1]);
const json_char third = toBinary(runner[2]);
result += (toBinary(runner[0]) << 2) + ((second & 0x30) >> 4);
diff --git a/src/modules/json/NumberToString.h b/src/modules/json/NumberToString.h
index a5e93d4302..35c6c98d0a 100644
--- a/src/modules/json/NumberToString.h
+++ b/src/modules/json/NumberToString.h
@@ -41,7 +41,7 @@ public:
//create the string
do {
- *runner-- = (json_char)(value % 10) + JSON_TEXT('0');
+ *runner--=(json_char)(value % 10) + JSON_TEXT('0');
} while(value /= 10);
//if it's negative, add the negation
@@ -66,7 +66,7 @@ public:
//create the string
do {
- *runner-- = (json_char)(value % 10) + JSON_TEXT('0');
+ *runner--=(json_char)(value % 10) + JSON_TEXT('0');
} while(value /= 10);
json_string res = runner + 1;
diff --git a/src/modules/json/json.cpp b/src/modules/json/json.cpp
index ee71ee4ef7..4b3e35d926 100644
--- a/src/modules/json/json.cpp
+++ b/src/modules/json/json.cpp
@@ -31,12 +31,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
INT_PTR GetInterface(WPARAM wParam, LPARAM lParam)
{
- LPJSONSERVICEINTERFACE lpJSI=(LPJSONSERVICEINTERFACE)wParam;
+ LPJSONSERVICEINTERFACE lpJSI = (LPJSONSERVICEINTERFACE)wParam;
memset(lpJSI,0,sizeof(JSONSERVICEINTERFACE));
-#define SETJSI(x) lpJSI->##x=json_##x
+#define SETJSI(x) lpJSI->##x = json_##x
SETJSI(free);
- lpJSI->delete_=json_delete;
+ lpJSI->delete_ = json_delete;
#ifdef JSON_MEMORY_MANAGE
SETJSI(free_all);
SETJSI(delete_all);
@@ -50,7 +50,7 @@ INT_PTR GetInterface(WPARAM wParam, LPARAM lParam)
SETJSI(new_i);
SETJSI(new_f);
SETJSI(new_b);
- lpJSI->new_=json_new;
+ lpJSI->new_ = json_new;
SETJSI(copy);
SETJSI(duplicate);
SETJSI(set_a);
diff --git a/src/modules/netlib/netlib.cpp b/src/modules/netlib/netlib.cpp
index bd72a8374b..670a882d90 100644
--- a/src/modules/netlib/netlib.cpp
+++ b/src/modules/netlib/netlib.cpp
@@ -28,7 +28,7 @@ static BOOL bModuleInitialized = FALSE;
HANDLE hConnectionHeaderMutex, hConnectionOpenMutex;
DWORD g_LastConnectionTick;
int connectionTimeout;
-HANDLE hSendEvent=NULL, hRecvEvent=NULL;
+HANDLE hSendEvent = NULL, hRecvEvent = NULL;
typedef BOOL (WINAPI *tGetProductInfo)(DWORD, DWORD, DWORD, DWORD, PDWORD);
@@ -53,9 +53,9 @@ void NetlibFreeUserSettingsStruct(NETLIBUSERSETTINGS *settings)
void NetlibInitializeNestedCS(struct NetlibNestedCriticalSection *nlncs)
{
- nlncs->dwOwningThreadId= 0;
- nlncs->lockCount=0;
- nlncs->hMutex=CreateMutex(NULL, FALSE, NULL);
+ nlncs->dwOwningThreadId = 0;
+ nlncs->lockCount = 0;
+ nlncs->hMutex = CreateMutex(NULL, FALSE, NULL);
}
void NetlibDeleteNestedCS(struct NetlibNestedCriticalSection *nlncs)
@@ -66,7 +66,7 @@ void NetlibDeleteNestedCS(struct NetlibNestedCriticalSection *nlncs)
int NetlibEnterNestedCS(struct NetlibConnection *nlc, int which)
{
struct NetlibNestedCriticalSection *nlncs;
- DWORD dwCurrentThreadId=GetCurrentThreadId();
+ DWORD dwCurrentThreadId = GetCurrentThreadId();
WaitForSingleObject(hConnectionHeaderMutex, INFINITE);
if (nlc == NULL || nlc->handleType != NLH_CONNECTION) {
@@ -84,8 +84,8 @@ int NetlibEnterNestedCS(struct NetlibConnection *nlc, int which)
ResetEvent(nlc->hOkToCloseEvent);
ReleaseMutex(hConnectionHeaderMutex);
WaitForSingleObject(nlncs->hMutex, INFINITE);
- nlncs->dwOwningThreadId=dwCurrentThreadId;
- nlncs->lockCount=1;
+ nlncs->dwOwningThreadId = dwCurrentThreadId;
+ nlncs->lockCount = 1;
if (InterlockedDecrement(&nlc->dontCloseNow) == 0)
SetEvent(nlc->hOkToCloseEvent);
return 1;
@@ -94,7 +94,7 @@ int NetlibEnterNestedCS(struct NetlibConnection *nlc, int which)
void NetlibLeaveNestedCS(struct NetlibNestedCriticalSection *nlncs)
{
if (--nlncs->lockCount == 0) {
- nlncs->dwOwningThreadId=0;
+ nlncs->dwOwningThreadId = 0;
ReleaseMutex(nlncs->hMutex);
}
}
@@ -120,7 +120,7 @@ static char *GetNetlibUserSettingString(const char *szUserModule, const char *sz
else {
char *szRet;
if (decode) CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
- szRet=mir_strdup(dbv.pszVal);
+ szRet = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
if (szRet == NULL) SetLastError(ERROR_OUTOFMEMORY);
return szRet;
@@ -129,7 +129,7 @@ static char *GetNetlibUserSettingString(const char *szUserModule, const char *sz
static INT_PTR NetlibRegisterUser(WPARAM, LPARAM lParam)
{
- NETLIBUSER *nlu=(NETLIBUSER*)lParam;
+ NETLIBUSER *nlu = (NETLIBUSER*)lParam;
if (nlu == NULL || nlu->cbSize != sizeof(NETLIBUSER) || nlu->szSettingsModule == NULL
|| ( !(nlu->flags&NUF_NOOPTIONS) && nlu->szDescriptiveName == NULL)
|| (nlu->flags&NUF_HTTPGATEWAY && (nlu->pfnHttpGatewayInit == NULL))) {
@@ -155,42 +155,42 @@ static INT_PTR NetlibRegisterUser(WPARAM, LPARAM lParam)
if (nlu->szDescriptiveName) {
thisUser->user.ptszDescriptiveName = (thisUser->user.flags&NUF_UNICODE ? mir_u2t((WCHAR*)nlu->ptszDescriptiveName) : mir_a2t(nlu->szDescriptiveName));
}
- if ((thisUser->user.szSettingsModule=mir_strdup(nlu->szSettingsModule)) == NULL
+ if ((thisUser->user.szSettingsModule = mir_strdup(nlu->szSettingsModule)) == NULL
|| (nlu->szDescriptiveName && thisUser->user.ptszDescriptiveName == NULL)
- || (nlu->szHttpGatewayUserAgent && (thisUser->user.szHttpGatewayUserAgent=mir_strdup(nlu->szHttpGatewayUserAgent)) == NULL))
+ || (nlu->szHttpGatewayUserAgent && (thisUser->user.szHttpGatewayUserAgent = mir_strdup(nlu->szHttpGatewayUserAgent)) == NULL))
{
mir_free(thisUser);
SetLastError(ERROR_OUTOFMEMORY);
return 0;
}
if (nlu->szHttpGatewayHello)
- thisUser->user.szHttpGatewayHello=mir_strdup(nlu->szHttpGatewayHello);
+ thisUser->user.szHttpGatewayHello = mir_strdup(nlu->szHttpGatewayHello);
else
- thisUser->user.szHttpGatewayHello=NULL;
+ thisUser->user.szHttpGatewayHello = NULL;
- thisUser->settings.cbSize=sizeof(NETLIBUSERSETTINGS);
- thisUser->settings.useProxy=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLUseProxy", 0);
- thisUser->settings.proxyType=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLProxyType", PROXYTYPE_SOCKS5);
+ thisUser->settings.cbSize = sizeof(NETLIBUSERSETTINGS);
+ thisUser->settings.useProxy = GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLUseProxy", 0);
+ thisUser->settings.proxyType = GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLProxyType", PROXYTYPE_SOCKS5);
if (thisUser->user.flags&NUF_NOHTTPSOPTION && thisUser->settings.proxyType == PROXYTYPE_HTTPS)
- thisUser->settings.proxyType=PROXYTYPE_HTTP;
+ thisUser->settings.proxyType = PROXYTYPE_HTTP;
if ( !(thisUser->user.flags&(NUF_HTTPCONNS|NUF_HTTPGATEWAY)) && thisUser->settings.proxyType == PROXYTYPE_HTTP) {
- thisUser->settings.useProxy=0;
- thisUser->settings.proxyType=PROXYTYPE_SOCKS5;
+ thisUser->settings.useProxy = 0;
+ thisUser->settings.proxyType = PROXYTYPE_SOCKS5;
}
- thisUser->settings.szProxyServer=GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLProxyServer", 0);
- thisUser->settings.wProxyPort=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLProxyPort", 1080);
- thisUser->settings.useProxyAuth=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLUseProxyAuth", 0);
- thisUser->settings.szProxyAuthUser=GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLProxyAuthUser", 0);
- thisUser->settings.szProxyAuthPassword=GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLProxyAuthPassword", 1);
- thisUser->settings.dnsThroughProxy=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLDnsThroughProxy", 1);
- thisUser->settings.specifyIncomingPorts=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLSpecifyIncomingPorts", 0);
- thisUser->settings.szIncomingPorts=GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLIncomingPorts", 0);
- thisUser->settings.specifyOutgoingPorts=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLSpecifyOutgoingPorts", 0);
- thisUser->settings.szOutgoingPorts=GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLOutgoingPorts", 0);
- thisUser->settings.enableUPnP=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLEnableUPnP", 1); //default to on
- thisUser->settings.validateSSL=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLValidateSSL", 0);
-
- thisUser->toLog=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLlog", 1);
+ thisUser->settings.szProxyServer = GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLProxyServer", 0);
+ thisUser->settings.wProxyPort = GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLProxyPort", 1080);
+ thisUser->settings.useProxyAuth = GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLUseProxyAuth", 0);
+ thisUser->settings.szProxyAuthUser = GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLProxyAuthUser", 0);
+ thisUser->settings.szProxyAuthPassword = GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLProxyAuthPassword", 1);
+ thisUser->settings.dnsThroughProxy = GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLDnsThroughProxy", 1);
+ thisUser->settings.specifyIncomingPorts = GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLSpecifyIncomingPorts", 0);
+ thisUser->settings.szIncomingPorts = GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLIncomingPorts", 0);
+ thisUser->settings.specifyOutgoingPorts = GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLSpecifyOutgoingPorts", 0);
+ thisUser->settings.szOutgoingPorts = GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLOutgoingPorts", 0);
+ thisUser->settings.enableUPnP = GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLEnableUPnP", 1); //default to on
+ thisUser->settings.validateSSL = GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLValidateSSL", 0);
+
+ thisUser->toLog = GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLlog", 1);
mir_cslock lck(csNetlibUser);
netlibUser.insert(thisUser);
@@ -199,21 +199,21 @@ static INT_PTR NetlibRegisterUser(WPARAM, LPARAM lParam)
static INT_PTR NetlibGetUserSettings(WPARAM wParam, LPARAM lParam)
{
- NETLIBUSERSETTINGS *nlus=(NETLIBUSERSETTINGS*)lParam;
- struct NetlibUser *nlu=(struct NetlibUser*)wParam;
+ NETLIBUSERSETTINGS *nlus = (NETLIBUSERSETTINGS*)lParam;
+ struct NetlibUser *nlu = (struct NetlibUser*)wParam;
if (GetNetlibHandleType(nlu) != NLH_USER || nlus == NULL || nlus->cbSize != sizeof(NETLIBUSERSETTINGS)) {
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
- *nlus=nlu->settings;
+ *nlus = nlu->settings;
return 1;
}
static INT_PTR NetlibSetUserSettings(WPARAM wParam, LPARAM lParam)
{
- NETLIBUSERSETTINGS *nlus=(NETLIBUSERSETTINGS*)lParam;
- struct NetlibUser *nlu=(struct NetlibUser*)wParam;
+ NETLIBUSERSETTINGS *nlus = (NETLIBUSERSETTINGS*)lParam;
+ struct NetlibUser *nlu = (struct NetlibUser*)wParam;
if (GetNetlibHandleType(nlu) != NLH_USER || nlus == NULL || nlus->cbSize != sizeof(NETLIBUSERSETTINGS)) {
SetLastError(ERROR_INVALID_PARAMETER);
@@ -244,7 +244,7 @@ INT_PTR NetlibCloseHandle(WPARAM wParam, LPARAM)
{
case NLH_USER:
{
- struct NetlibUser *nlu=(struct NetlibUser*)wParam;
+ struct NetlibUser *nlu = (struct NetlibUser*)wParam;
{
mir_cslock lck(csNetlibUser);
int i = netlibUser.getIndex(nlu);
@@ -261,7 +261,7 @@ INT_PTR NetlibCloseHandle(WPARAM wParam, LPARAM)
break;
}
case NLH_CONNECTION:
- { struct NetlibConnection *nlc=(struct NetlibConnection*)wParam;
+ { struct NetlibConnection *nlc = (struct NetlibConnection*)wParam;
HANDLE waitHandles[4];
DWORD waitResult;
@@ -280,17 +280,17 @@ INT_PTR NetlibCloseHandle(WPARAM wParam, LPARAM)
}
ReleaseMutex(hConnectionHeaderMutex);
- waitHandles[0]=hConnectionHeaderMutex;
- waitHandles[1]=nlc->hOkToCloseEvent;
- waitHandles[2]=nlc->ncsRecv.hMutex;
- waitHandles[3]=nlc->ncsSend.hMutex;
- waitResult=WaitForMultipleObjects(SIZEOF(waitHandles), waitHandles, TRUE, INFINITE);
+ waitHandles[0] = hConnectionHeaderMutex;
+ waitHandles[1] = nlc->hOkToCloseEvent;
+ waitHandles[2] = nlc->ncsRecv.hMutex;
+ waitHandles[3] = nlc->ncsSend.hMutex;
+ waitResult = WaitForMultipleObjects(SIZEOF(waitHandles), waitHandles, TRUE, INFINITE);
if (waitResult<WAIT_OBJECT_0 || waitResult >= WAIT_OBJECT_0 + SIZEOF(waitHandles)) {
ReleaseMutex(hConnectionHeaderMutex);
SetLastError(ERROR_INVALID_PARAMETER); //already been closed
return 0;
}
- nlc->handleType=0;
+ nlc->handleType = 0;
mir_free(nlc->nlhpi.szHttpPostUrl);
mir_free(nlc->nlhpi.szHttpGetUrl);
mir_free(nlc->dataBuffer);
@@ -308,7 +308,7 @@ INT_PTR NetlibCloseHandle(WPARAM wParam, LPARAM)
case NLH_BOUNDPORT:
return NetlibFreeBoundPort((struct NetlibBoundPort*)wParam);
case NLH_PACKETRECVER:
- { struct NetlibPacketRecver *nlpr=(struct NetlibPacketRecver*)wParam;
+ { struct NetlibPacketRecver *nlpr = (struct NetlibPacketRecver*)wParam;
mir_free(nlpr->packetRecver.buffer);
break;
}
@@ -406,10 +406,10 @@ INT_PTR NetlibShutdown(WPARAM wParam, LPARAM)
return 0;
}
-static const char szHexDigits[]="0123456789ABCDEF";
+static const char szHexDigits[] = "0123456789ABCDEF";
INT_PTR NetlibHttpUrlEncode(WPARAM, LPARAM lParam)
{
- unsigned char *szOutput, *szInput=(unsigned char*)lParam;
+ unsigned char *szOutput, *szInput = (unsigned char*)lParam;
unsigned char *pszIn, *pszOut;
int outputLen;
@@ -417,19 +417,19 @@ INT_PTR NetlibHttpUrlEncode(WPARAM, LPARAM lParam)
SetLastError(ERROR_INVALID_PARAMETER);
return (INT_PTR)(char*)NULL;
}
- for (outputLen=0, pszIn=szInput;*pszIn;pszIn++) {
+ for (outputLen = 0, pszIn = szInput;*pszIn;pszIn++) {
if ((48 <= *pszIn && *pszIn <= 57) || //0-9
(65 <= *pszIn && *pszIn <= 90) || //ABC...XYZ
(97 <= *pszIn && *pszIn <= 122) || //abc...xyz
*pszIn == '-' || *pszIn == '_' || *pszIn == '.' || *pszIn == ' ') outputLen++;
else outputLen+=3;
}
- szOutput=(unsigned char*)HeapAlloc(GetProcessHeap(), 0, outputLen+1);
+ szOutput = (unsigned char*)HeapAlloc(GetProcessHeap(), 0, outputLen+1);
if (szOutput == NULL) {
SetLastError(ERROR_OUTOFMEMORY);
return (INT_PTR)(unsigned char*)NULL;
}
- for (pszOut=szOutput, pszIn=szInput;*pszIn;pszIn++) {
+ for (pszOut = szOutput, pszIn = szInput;*pszIn;pszIn++) {
if ((48 <= *pszIn && *pszIn <= 57) ||
(65 <= *pszIn && *pszIn <= 90) ||
(97 <= *pszIn && *pszIn <= 122) ||
@@ -441,14 +441,14 @@ INT_PTR NetlibHttpUrlEncode(WPARAM, LPARAM lParam)
*pszOut++=szHexDigits[*pszIn&0xF];
}
}
- *pszOut='\0';
+ *pszOut = '\0';
return (INT_PTR)szOutput;
}
-static const char base64chars[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static const char base64chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
INT_PTR NetlibBase64Encode(WPARAM, LPARAM lParam)
{
- NETLIBBASE64 *nlb64=(NETLIBBASE64*)lParam;
+ NETLIBBASE64 *nlb64 = (NETLIBBASE64*)lParam;
int iIn;
char *pszOut;
PBYTE pbIn;
@@ -461,35 +461,35 @@ INT_PTR NetlibBase64Encode(WPARAM, LPARAM lParam)
SetLastError(ERROR_BUFFER_OVERFLOW);
return 0;
}
- nlb64->cchEncoded=Netlib_GetBase64EncodedBufferSize(nlb64->cbDecoded);
- for (iIn=0, pbIn=nlb64->pbDecoded, pszOut=nlb64->pszEncoded;iIn<nlb64->cbDecoded;iIn+=3, pbIn+=3, pszOut+=4) {
- pszOut[0]=base64chars[pbIn[0]>>2];
+ nlb64->cchEncoded = Netlib_GetBase64EncodedBufferSize(nlb64->cbDecoded);
+ for (iIn = 0, pbIn = nlb64->pbDecoded, pszOut = nlb64->pszEncoded;iIn<nlb64->cbDecoded;iIn+=3, pbIn+=3, pszOut+=4) {
+ pszOut[0] = base64chars[pbIn[0]>>2];
if (nlb64->cbDecoded-iIn == 1) {
- pszOut[1]=base64chars[(pbIn[0]&3)<<4];
- pszOut[2]='=';
- pszOut[3]='=';
+ pszOut[1] = base64chars[(pbIn[0]&3)<<4];
+ pszOut[2] = '=';
+ pszOut[3] = '=';
pszOut+=4;
break;
}
- pszOut[1]=base64chars[((pbIn[0]&3)<<4)|(pbIn[1]>>4)];
+ pszOut[1] = base64chars[((pbIn[0]&3)<<4)|(pbIn[1]>>4)];
if (nlb64->cbDecoded-iIn == 2) {
- pszOut[2]=base64chars[(pbIn[1]&0xF)<<2];
- pszOut[3]='=';
+ pszOut[2] = base64chars[(pbIn[1]&0xF)<<2];
+ pszOut[3] = '=';
pszOut+=4;
break;
}
- pszOut[2]=base64chars[((pbIn[1]&0xF)<<2)|(pbIn[2]>>6)];
- pszOut[3]=base64chars[pbIn[2]&0x3F];
+ pszOut[2] = base64chars[((pbIn[1]&0xF)<<2)|(pbIn[2]>>6)];
+ pszOut[3] = base64chars[pbIn[2]&0x3F];
}
- pszOut[0]='\0';
+ pszOut[0] = '\0';
return 1;
}
static BYTE Base64CharToInt(char c)
{
- if (c>='A' && c<='Z') return c-'A';
- if (c>='a' && c<='z') return c-'a'+26;
- if (c>='0' && c<='9') return c-'0'+52;
+ if (c>='A' && c <= 'Z') return c-'A';
+ if (c>='a' && c <= 'z') return c-'a'+26;
+ if (c>='0' && c <= '9') return c-'0'+52;
if (c == '+') return 62;
if (c == '/') return 63;
if (c == '=') return 64;
@@ -498,7 +498,7 @@ static BYTE Base64CharToInt(char c)
INT_PTR NetlibBase64Decode(WPARAM, LPARAM lParam)
{
- NETLIBBASE64 *nlb64=(NETLIBBASE64*)lParam;
+ NETLIBBASE64 *nlb64 = (NETLIBBASE64*)lParam;
char *pszIn;
PBYTE pbOut;
BYTE b1, b2, b3, b4;
@@ -516,21 +516,21 @@ INT_PTR NetlibBase64Decode(WPARAM, LPARAM lParam)
SetLastError(ERROR_BUFFER_OVERFLOW);
return 0;
}
- nlb64->cbDecoded=Netlib_GetBase64DecodedBufferSize(nlb64->cchEncoded);
- for (iIn=0, pszIn=nlb64->pszEncoded, pbOut=nlb64->pbDecoded;iIn<nlb64->cchEncoded;iIn+=4, pszIn+=4, pbOut+=3) {
- b1=Base64CharToInt(pszIn[0]);
- b2=Base64CharToInt(pszIn[1]);
- b3=Base64CharToInt(pszIn[2]);
- b4=Base64CharToInt(pszIn[3]);
+ nlb64->cbDecoded = Netlib_GetBase64DecodedBufferSize(nlb64->cchEncoded);
+ for (iIn = 0, pszIn = nlb64->pszEncoded, pbOut = nlb64->pbDecoded;iIn<nlb64->cchEncoded;iIn+=4, pszIn+=4, pbOut+=3) {
+ b1 = Base64CharToInt(pszIn[0]);
+ b2 = Base64CharToInt(pszIn[1]);
+ b3 = Base64CharToInt(pszIn[2]);
+ b4 = Base64CharToInt(pszIn[3]);
if (b1 == 255 || b1 == 64 || b2 == 255 || b2 == 64 || b3 == 255 || b4 == 255) {
SetLastError(ERROR_INVALID_DATA);
return 0;
}
- pbOut[0]=(b1<<2)|(b2>>4);
+ pbOut[0] = (b1<<2)|(b2>>4);
if (b3 == 64) {nlb64->cbDecoded-=2; break;}
- pbOut[1]=(b2<<4)|(b3>>2);
+ pbOut[1] = (b2<<4)|(b3>>2);
if (b4 == 64) {nlb64->cbDecoded--; break;}
- pbOut[2]=b4|(b3<<6);
+ pbOut[2] = b4|(b3<<6);
}
return 1;
}
@@ -574,7 +574,7 @@ int LoadNetlibModule(void)
HookEvent(ME_OPT_INITIALISE, NetlibOptInitialise);
InitializeCriticalSection(&csNetlibUser);
- hConnectionHeaderMutex=CreateMutex(NULL, FALSE, NULL);
+ hConnectionHeaderMutex = CreateMutex(NULL, FALSE, NULL);
NetlibLogInit();
connectionTimeout = 0;
diff --git a/src/modules/netlib/netlib.h b/src/modules/netlib/netlib.h
index f152eafe10..f20d123fee 100644
--- a/src/modules/netlib/netlib.h
+++ b/src/modules/netlib/netlib.h
@@ -210,10 +210,10 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge
static __inline INT_PTR NLSend(struct NetlibConnection *nlc, const char *buf, int len, int flags) {
- NETLIBBUFFER nlb={(char*)buf, len, flags};
+ NETLIBBUFFER nlb = {(char*)buf, len, flags};
return NetlibSend((WPARAM)nlc, (LPARAM)&nlb);
}
static __inline INT_PTR NLRecv(struct NetlibConnection *nlc, char *buf, int len, int flags) {
- NETLIBBUFFER nlb={buf, len, flags};
+ NETLIBBUFFER nlb = {buf, len, flags};
return NetlibRecv((WPARAM)nlc, (LPARAM)&nlb);
}
diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp
index 37c3e88e22..e0428bf687 100644
--- a/src/modules/netlib/netlibautoproxy.cpp
+++ b/src/modules/netlib/netlibautoproxy.cpp
@@ -325,7 +325,7 @@ char* NetlibGetIeProxy(char *szUrl)
if (bEnabled)
{
- for (int i = 0; i < proxyBypass.getCount(); ++i)
+ for (int i=0; i < proxyBypass.getCount(); ++i)
{
if (strcmp(proxyBypass[i], "<local>") == 0)
{
@@ -399,9 +399,9 @@ void NetlibLoadIeProxy(void)
if (szProxyEnd) *szProxyEnd = 0;
int ind = -1;
- if (strncmp(szProxy, "http=", 5) == 0) { ind = 0; szProxy += 5; }
- else if (strncmp(szProxy, "https=", 6) == 0) { ind = 1; szProxy += 6; }
- else if (strncmp(szProxy, "socks=", 6) == 0) { ind = 2; szProxy += 6; }
+ if (strncmp(szProxy, "http = ", 5) == 0) { ind = 0; szProxy += 5; }
+ else if (strncmp(szProxy, "https = ", 6) == 0) { ind = 1; szProxy += 6; }
+ else if (strncmp(szProxy, "socks = ", 6) == 0) { ind = 2; szProxy += 6; }
else if (strchr(szProxy, '=')) ind = -2;
if (ind != -2)
@@ -447,10 +447,10 @@ void NetlibUnloadIeProxy(void)
{
int i;
- for (i = 0; i < 3; ++i)
+ for (i=0; i < 3; ++i)
mir_free(szProxyHost[i]);
- for (i = 0; i < proxyBypass.getCount(); ++i)
+ for (i=0; i < proxyBypass.getCount(); ++i)
mir_free(proxyBypass[i]);
proxyBypass.destroy();
diff --git a/src/modules/netlib/netlibbind.cpp b/src/modules/netlib/netlibbind.cpp
index 582358b619..7bb862f284 100644
--- a/src/modules/netlib/netlibbind.cpp
+++ b/src/modules/netlib/netlibbind.cpp
@@ -43,13 +43,13 @@ bool BindSocketToPort(const char *szPorts, SOCKET s, SOCKET s6, int* portn)
*portn = num % *portn;
}
- bool before=false;
+ bool before = false;
while (true) {
const char *psz;
char *pszEnd;
int portMin, portMax, port, portnum = 0;
- for (psz=szPorts;*psz;) {
+ for (psz = szPorts;*psz;) {
while (*psz == ' ' || *psz == ',') psz++;
portMin = strtol(psz, &pszEnd, 0);
if (pszEnd == psz)
diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp
index 7296b339bd..8a87d330d0 100644
--- a/src/modules/netlib/netlibhttp.cpp
+++ b/src/modules/netlib/netlibhttp.cpp
@@ -138,7 +138,7 @@ static int RecvWithTimeoutTime(struct NetlibConnection *nlc, unsigned dwTimeoutT
static char* NetlibHttpFindHeader(NETLIBHTTPREQUEST *nlhrReply, const char *hdr)
{
- for (int i = 0; i < nlhrReply->headersCount; i++)
+ for (int i=0; i < nlhrReply->headersCount; i++)
{
if (_stricmp(nlhrReply->headers[i].szName, hdr) == 0)
{
@@ -154,7 +154,7 @@ static char* NetlibHttpFindAuthHeader(NETLIBHTTPREQUEST *nlhrReply, const char *
char *szNegoHdr = NULL;
char *szNtlmHdr = NULL;
- for (int i = 0; i < nlhrReply->headersCount; i++)
+ for (int i=0; i < nlhrReply->headersCount; i++)
{
if (_stricmp(nlhrReply->headers[i].szName, hdr) == 0)
{
@@ -423,12 +423,12 @@ static int SendHttpRequestAndData(struct NetlibConnection *nlc, struct Resizable
INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam)
{
- struct NetlibConnection *nlc=(struct NetlibConnection*)wParam;
- NETLIBHTTPREQUEST *nlhr=(NETLIBHTTPREQUEST*)lParam;
+ struct NetlibConnection *nlc = (struct NetlibConnection*)wParam;
+ NETLIBHTTPREQUEST *nlhr = (NETLIBHTTPREQUEST*)lParam;
NETLIBHTTPREQUEST *nlhrReply = NULL;
HttpSecurityContext httpSecurity;
- struct ResizableCharBuffer httpRequest={0};
+ struct ResizableCharBuffer httpRequest = {0};
const char *pszRequest, *pszUrl, *pszFullUrl;
char *szHost = NULL, *szNewUrl = NULL;
char *pszProxyAuthHdr = NULL, *pszAuthHdr = NULL;
@@ -531,7 +531,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam)
if (phost)
{
phost += 3;
- size_t len = phost - pszUrl;
+ size_t len = phost - pszUrl;
memcpy(szNewUrl, pszUrl, len);
szNewUrl[len] = 0;
}
@@ -806,7 +806,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam)
INT_PTR NetlibHttpFreeRequestStruct(WPARAM, LPARAM lParam)
{
- NETLIBHTTPREQUEST *nlhr=(NETLIBHTTPREQUEST*)lParam;
+ NETLIBHTTPREQUEST *nlhr = (NETLIBHTTPREQUEST*)lParam;
if (nlhr == NULL || nlhr->cbSize != sizeof(NETLIBHTTPREQUEST) || nlhr->requestType != REQUEST_RESPONSE)
{
@@ -950,7 +950,7 @@ INT_PTR NetlibHttpRecvHeaders(WPARAM wParam, LPARAM lParam)
INT_PTR NetlibHttpTransaction(WPARAM wParam, LPARAM lParam)
{
- NetlibUser *nlu = (NetlibUser*)wParam;
+ NetlibUser *nlu = (NetlibUser*)wParam;
NETLIBHTTPREQUEST *nlhr = (NETLIBHTTPREQUEST*)lParam, *nlhrReply;
DWORD dflags, hflags;
@@ -989,10 +989,10 @@ INT_PTR NetlibHttpTransaction(WPARAM wParam, LPARAM lParam)
nlhrSend.headers[nlhrSend.headersCount].szValue = szUserAgent;
++nlhrSend.headersCount;
CallService(MS_SYSTEM_GETVERSIONTEXT, SIZEOF(szMirandaVer), (LPARAM)szMirandaVer);
- pspace=strchr(szMirandaVer, ' ');
+ pspace = strchr(szMirandaVer, ' ');
if (pspace)
{
- *pspace++ = '\0';
+ *pspace++='\0';
mir_snprintf(szUserAgent, SIZEOF(szUserAgent), "Miranda/%s (%s)", szMirandaVer, pspace);
}
else
@@ -1099,8 +1099,7 @@ char* gzip_decode(char *gzip_data, int *len_ptr, int window)
gzip_len = gzip_err == Z_STREAM_END ? zstr.total_out : -1;
- if (gzip_len <= 0)
- {
+ if (gzip_len <= 0) {
mir_free(output_data);
output_data = NULL;
}
diff --git a/src/modules/netlib/netlibhttpproxy.cpp b/src/modules/netlib/netlibhttpproxy.cpp
index 77a70a1dce..7c1ddd53c9 100644
--- a/src/modules/netlib/netlibhttpproxy.cpp
+++ b/src/modules/netlib/netlibhttpproxy.cpp
@@ -81,7 +81,7 @@ static bool NetlibHttpGatewaySend(struct NetlibConnection *nlc, RequestType reqT
{
case reqHelloGet:
nlhrSend.requestType = REQUEST_GET;
- nlhrSend.szUrl=nlc->nlu->user.szHttpGatewayHello;
+ nlhrSend.szUrl = nlc->nlu->user.szHttpGatewayHello;
break;
case reqOldGet:
@@ -136,13 +136,13 @@ static bool NetlibHttpGatewaySend(struct NetlibConnection *nlc, RequestType reqT
nlhrSend.headersCount = 3;
nlhrSend.headers = (NETLIBHTTPHEADER*)alloca(sizeof(NETLIBHTTPHEADER) * nlhrSend.headersCount);
- nlhrSend.headers[0].szName = "User-Agent";
+ nlhrSend.headers[0].szName = "User-Agent";
nlhrSend.headers[0].szValue = nlc->nlu->user.szHttpGatewayUserAgent;
- nlhrSend.headers[1].szName = "Cache-Control";
+ nlhrSend.headers[1].szName = "Cache-Control";
nlhrSend.headers[1].szValue = "no-cache, no-store ";
- nlhrSend.headers[2].szName = "Pragma";
+ nlhrSend.headers[2].szName = "Pragma";
nlhrSend.headers[2].szValue = "no-cache";
-// nlhrSend.headers[3].szName = "Accept-Encoding";
+// nlhrSend.headers[3].szName = "Accept-Encoding";
// nlhrSend.headers[3].szValue = "deflate, gzip";
return NetlibHttpSendRequest((WPARAM)nlc, (LPARAM)&nlhrSend) != SOCKET_ERROR;
@@ -179,19 +179,19 @@ static bool NetlibHttpGatewayOscarPost(NetlibConnection *nlc, const char *buf, i
NETLIBHTTPREQUEST *nlhrReply = NULL;
NetlibConnection nlcSend = {0};
- nlcSend.handleType = NLH_CONNECTION;
- nlcSend.nlu = nlc->nlu;
- nlcSend.nlhpi = nlc->nlhpi;
- nlcSend.s = nlc->s2;
+ nlcSend.handleType = NLH_CONNECTION;
+ nlcSend.nlu = nlc->nlu;
+ nlcSend.nlhpi = nlc->nlhpi;
+ nlcSend.s = nlc->s2;
nlcSend.usingHttpGateway = nlc->usingHttpGateway;
- nlcSend.szProxyServer = nlc->szProxyServer;
- nlcSend.wProxyPort = nlc->wProxyPort;
- nlcSend.proxyType = nlc->proxyType;
+ nlcSend.szProxyServer = nlc->szProxyServer;
+ nlcSend.wProxyPort = nlc->wProxyPort;
+ nlcSend.proxyType = nlc->proxyType;
if ( !NetlibReconnect(&nlcSend)) return false;
nlc->s2 = nlcSend.s;
- nlcSend.hOkToCloseEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
+ nlcSend.hOkToCloseEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
NetlibInitializeNestedCS(&nlcSend.ncsRecv);
NetlibInitializeNestedCS(&nlcSend.ncsSend);
@@ -404,7 +404,7 @@ int NetlibInitHttpConnection(struct NetlibConnection *nlc, struct NetlibUser *nl
{
NETLIBHTTPREQUEST *nlhrReply = NULL;
- nlc->nlhpi.firstGetSequence = 1;
+ nlc->nlhpi.firstGetSequence = 1;
nlc->nlhpi.firstPostSequence = 1;
if (nlu->user.szHttpGatewayHello != NULL)
@@ -449,8 +449,8 @@ int NetlibInitHttpConnection(struct NetlibConnection *nlc, struct NetlibUser *nl
INT_PTR NetlibHttpGatewaySetInfo(WPARAM wParam, LPARAM lParam)
{
- NETLIBHTTPPROXYINFO *nlhpi=(NETLIBHTTPPROXYINFO*)lParam;
- struct NetlibConnection *nlc=(struct NetlibConnection*)wParam;
+ NETLIBHTTPPROXYINFO *nlhpi = (NETLIBHTTPPROXYINFO*)lParam;
+ struct NetlibConnection *nlc = (struct NetlibConnection*)wParam;
if (GetNetlibHandleType(nlc) != NLH_CONNECTION || nlhpi == NULL ||
nlhpi->cbSize < (sizeof(NETLIBHTTPPROXYINFO) - sizeof(int)) ||
@@ -467,7 +467,7 @@ INT_PTR NetlibHttpGatewaySetInfo(WPARAM wParam, LPARAM lParam)
memcpy(&nlc->nlhpi, nlhpi, min(nlhpi->cbSize, sizeof(*nlhpi)));
if (nlc->nlhpi.combinePackets == 0) nlc->nlhpi.combinePackets = 1;
- nlc->nlhpi.szHttpGetUrl = mir_strdup(nlc->nlhpi.szHttpGetUrl);
+ nlc->nlhpi.szHttpGetUrl = mir_strdup(nlc->nlhpi.szHttpGetUrl);
nlc->nlhpi.szHttpPostUrl = mir_strdup(nlc->nlhpi.szHttpPostUrl);
return 1;
@@ -485,7 +485,7 @@ INT_PTR NetlibHttpSetSticky(WPARAM wParam, LPARAM lParam)
INT_PTR NetlibHttpSetPollingTimeout(WPARAM wParam, LPARAM lParam)
{
int oldTimeout;
- struct NetlibConnection *nlc=(struct NetlibConnection*)wParam;
+ struct NetlibConnection *nlc = (struct NetlibConnection*)wParam;
if (GetNetlibHandleType(nlc) != NLH_CONNECTION) return -1;
oldTimeout = nlc->pollingTimeout;
nlc->pollingTimeout = lParam;
diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp
index 2e9f7a4365..ff352b5b55 100644
--- a/src/modules/netlib/netliblog.cpp
+++ b/src/modules/netlib/netliblog.cpp
@@ -57,7 +57,7 @@ static __int64 mirandaStartTime, perfCounterFreq;
static int bIsActive = TRUE;
static HANDLE hLogEvent = NULL;
-static const TCHAR* szTimeFormats[] =
+static const TCHAR* szTimeFormats[] =
{
_T("No times"),
_T("Standard hh:mm:ss times"),
@@ -69,7 +69,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
{
switch(message) {
case WM_INITDIALOG:
- logOptions.hwndOpts=hwndDlg;
+ logOptions.hwndOpts = hwndDlg;
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_DUMPRECV, logOptions.dumpRecv?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DUMPSENT, logOptions.dumpSent?BST_CHECKED:BST_UNCHECKED);
@@ -102,21 +102,21 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
SetWindowLongPtr(hwndFilter, GWL_STYLE, GetWindowLongPtr(hwndFilter, GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
- tvis.hParent=NULL;
- tvis.hInsertAfter=TVI_SORT;
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_STATE;
- tvis.item.stateMask=TVIS_STATEIMAGEMASK;
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = TVI_SORT;
+ tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_STATE;
+ tvis.item.stateMask = TVIS_STATEIMAGEMASK;
- for (i = 0; i < netlibUser.getCount(); ++i)
+ for (i=0; i < netlibUser.getCount(); ++i)
{
- tvis.item.pszText=netlibUser[i]->user.ptszDescriptiveName;
- tvis.item.lParam=i;
- tvis.item.state=INDEXTOSTATEIMAGEMASK((netlibUser[i]->toLog) ? 2 : 1);
+ tvis.item.pszText = netlibUser[i]->user.ptszDescriptiveName;
+ tvis.item.lParam = i;
+ tvis.item.state = INDEXTOSTATEIMAGEMASK((netlibUser[i]->toLog) ? 2 : 1);
TreeView_InsertItem(hwndFilter, &tvis);
}
- tvis.item.lParam=-1;
- tvis.item.pszText=TranslateT("(Miranda Core Logging)");
- tvis.item.state=INDEXTOSTATEIMAGEMASK((logOptions.toLog) ? 2 : 1);
+ tvis.item.lParam = -1;
+ tvis.item.pszText = TranslateT("(Miranda Core Logging)");
+ tvis.item.state = INDEXTOSTATEIMAGEMASK((logOptions.toLog) ? 2 : 1);
TreeView_InsertItem(hwndFilter, &tvis);
}
return TRUE;
@@ -154,29 +154,29 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
case IDC_FILENAMEBROWSE:
case IDC_RUNATSTARTBROWSE:
{ TCHAR str[MAX_PATH+2];
- OPENFILENAME ofn={0};
+ OPENFILENAME ofn = {0};
TCHAR filter[512], *pfilter;
GetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str, SIZEOF(str));
- ofn.lStructSize=OPENFILENAME_SIZE_VERSION_400;
- ofn.hwndOwner=hwndDlg;
- ofn.Flags=OFN_HIDEREADONLY | OFN_DONTADDTORECENT;
+ ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
+ ofn.hwndOwner = hwndDlg;
+ ofn.Flags = OFN_HIDEREADONLY | OFN_DONTADDTORECENT;
if (LOWORD(wParam) == IDC_FILENAMEBROWSE) {
- ofn.lpstrTitle=TranslateT("Select where log file will be created");
+ ofn.lpstrTitle = TranslateT("Select where log file will be created");
} else {
ofn.Flags|=OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
- ofn.lpstrTitle=TranslateT("Select program to be run");
+ ofn.lpstrTitle = TranslateT("Select program to be run");
}
_tcscpy(filter, TranslateT("All Files"));
_tcscat(filter, _T(" (*)"));
- pfilter=filter+lstrlen(filter)+1;
+ pfilter = filter+lstrlen(filter)+1;
_tcscpy(pfilter, _T("*"));
- pfilter=pfilter+lstrlen(pfilter)+1;
- *pfilter='\0';
- ofn.lpstrFilter=filter;
- ofn.lpstrFile=str;
- ofn.nMaxFile=SIZEOF(str)-2;
- ofn.nMaxFileTitle=MAX_PATH;
+ pfilter = pfilter+lstrlen(pfilter)+1;
+ *pfilter = '\0';
+ ofn.lpstrFilter = filter;
+ ofn.lpstrFile = str;
+ ofn.nMaxFile = SIZEOF(str)-2;
+ ofn.nMaxFileTitle = MAX_PATH;
if (LOWORD(wParam) == IDC_FILENAMEBROWSE) {
if ( !GetSaveFileName(&ofn)) return 1;
} else {
@@ -184,7 +184,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
}
if (LOWORD(wParam) == IDC_RUNATSTARTBROWSE && _tcschr(str, ' ') != NULL) {
MoveMemory(str+1, str, SIZEOF(str)-2);
- str[0]='"';
+ str[0] = '"';
lstrcat(str, _T("\""));
}
SetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str);
@@ -192,10 +192,10 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
}
case IDC_RUNNOW:
{ TCHAR str[MAX_PATH+1];
- STARTUPINFO si={0};
+ STARTUPINFO si = {0};
PROCESS_INFORMATION pi;
GetDlgItemText(hwndDlg, IDC_RUNATSTART, str, MAX_PATH);
- si.cb=sizeof(si);
+ si.cb = sizeof(si);
if (str[0]) CreateProcess(NULL, str, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
}
break;
@@ -220,24 +220,24 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
GetWindowText(GetDlgItem(hwndDlg, IDC_PATH), str, MAX_PATH);
logOptions.szFile = mir_tstrdup(str);
- logOptions.dumpRecv=IsDlgButtonChecked(hwndDlg, IDC_DUMPRECV);
- logOptions.dumpSent=IsDlgButtonChecked(hwndDlg, IDC_DUMPSENT);
- logOptions.dumpProxy=IsDlgButtonChecked(hwndDlg, IDC_DUMPPROXY);
- logOptions.dumpSsl=IsDlgButtonChecked(hwndDlg, IDC_DUMPSSL);
- logOptions.textDumps=IsDlgButtonChecked(hwndDlg, IDC_TEXTDUMPS);
- logOptions.autoDetectText=IsDlgButtonChecked(hwndDlg, IDC_AUTODETECTTEXT);
- logOptions.timeFormat=SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_GETCURSEL, 0, 0);
- logOptions.showUser=IsDlgButtonChecked(hwndDlg, IDC_SHOWNAMES);
- logOptions.toOutputDebugString=IsDlgButtonChecked(hwndDlg, IDC_TOOUTPUTDEBUGSTRING);
- logOptions.toFile=IsDlgButtonChecked(hwndDlg, IDC_TOFILE);
+ logOptions.dumpRecv = IsDlgButtonChecked(hwndDlg, IDC_DUMPRECV);
+ logOptions.dumpSent = IsDlgButtonChecked(hwndDlg, IDC_DUMPSENT);
+ logOptions.dumpProxy = IsDlgButtonChecked(hwndDlg, IDC_DUMPPROXY);
+ logOptions.dumpSsl = IsDlgButtonChecked(hwndDlg, IDC_DUMPSSL);
+ logOptions.textDumps = IsDlgButtonChecked(hwndDlg, IDC_TEXTDUMPS);
+ logOptions.autoDetectText = IsDlgButtonChecked(hwndDlg, IDC_AUTODETECTTEXT);
+ logOptions.timeFormat = SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_GETCURSEL, 0, 0);
+ logOptions.showUser = IsDlgButtonChecked(hwndDlg, IDC_SHOWNAMES);
+ logOptions.toOutputDebugString = IsDlgButtonChecked(hwndDlg, IDC_TOOUTPUTDEBUGSTRING);
+ logOptions.toFile = IsDlgButtonChecked(hwndDlg, IDC_TOFILE);
}
{
HWND hwndFilter = GetDlgItem(logOptions.hwndOpts, IDC_FILTER);
- TVITEM tvi={0};
+ TVITEM tvi = {0};
BOOL checked;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_STATE|TVIF_TEXT;
- tvi.hItem=TreeView_GetRoot(hwndFilter);
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM|TVIF_STATE|TVIF_TEXT;
+ tvi.hItem = TreeView_GetRoot(hwndFilter);
while (tvi.hItem)
{
@@ -256,7 +256,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
DBWriteContactSettingDword(NULL, netlibUser[tvi.lParam]->user.szSettingsModule, "NLlog", checked);
}
- tvi.hItem=TreeView_GetNextSibling(hwndFilter, tvi.hItem);
+ tvi.hItem = TreeView_GetNextSibling(hwndFilter, tvi.hItem);
}
}
@@ -288,7 +288,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
break;
case WM_DESTROY:
ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_FILTER), TVSIL_STATE));
- logOptions.hwndOpts=NULL;
+ logOptions.hwndOpts = NULL;
break;
}
return FALSE;
@@ -297,7 +297,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
void NetlibLogShowOptions(void)
{
if (logOptions.hwndOpts == NULL)
- logOptions.hwndOpts=CreateDialog(hInst, MAKEINTRESOURCE(IDD_NETLIBLOGOPTS), NULL, LogOptionsDlgProc);
+ logOptions.hwndOpts = CreateDialog(hInst, MAKEINTRESOURCE(IDD_NETLIBLOGOPTS), NULL, LogOptionsDlgProc);
SetForegroundWindow(logOptions.hwndOpts);
}
@@ -365,7 +365,7 @@ static INT_PTR NetlibLog(WPARAM wParam, LPARAM lParam)
(logOptions.showUser && logOptions.timeFormat) ? " " : "",
logOptions.showUser ? nlu->user.szSettingsModule : "");
else
- szHead[0]=0;
+ szHead[0] = 0;
if (logOptions.toOutputDebugString) {
if (szHead[0])
@@ -428,7 +428,7 @@ void NetlibLogf(NetlibUser* nlu, const char *fmt, ...)
void NetlibDumpData(struct NetlibConnection *nlc, PBYTE buf, int len, int sent, int flags)
{
- int isText=1;
+ int isText = 1;
char szTitleLine[128];
char *szBuf;
int titleLineLen;
@@ -474,7 +474,7 @@ void NetlibDumpData(struct NetlibConnection *nlc, PBYTE buf, int len, int sent,
if (logOptions.autoDetectText)
{
int i;
- for (i = 0; i<len; i++)
+ for (i=0; i<len; i++)
{
if ((buf[i]<' ' && buf[i] != '\t' && buf[i] != '\r' && buf[i] != '\n') || buf[i]>=0x80)
{
@@ -526,17 +526,17 @@ void NetlibDumpData(struct NetlibConnection *nlc, PBYTE buf, int len, int sent,
lstrcpyA(pszBuf, " ");
pszBuf += 3;
}
- *pszBuf++ = ' ';
+ *pszBuf++=' ';
}
for (col = 0; col < colsInLine; col++)
- *pszBuf++ = buf[line+col]<' '?'.':(char)buf[line+col];
+ *pszBuf++=buf[line+col]<' '?'.':(char)buf[line+col];
- if (len-line<=16)
+ if (len-line <= 16)
break;
- *pszBuf++ = '\r'; // End each line with a break
- *pszBuf++ = '\n'; // End each line with a break
+ *pszBuf++='\r'; // End each line with a break
+ *pszBuf++='\n'; // End each line with a break
}
*pszBuf = '\0';
}
diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp
index 15623461c6..1f23c7e197 100644
--- a/src/modules/netlib/netlibopenconn.cpp
+++ b/src/modules/netlib/netlibopenconn.cpp
@@ -59,7 +59,7 @@ int WaitUntilReadable(SOCKET s, DWORD dwTimeout, bool check)
if (s == INVALID_SOCKET) return SOCKET_ERROR;
- tv.tv_sec = dwTimeout / 1000;
+ tv.tv_sec = dwTimeout / 1000;
tv.tv_usec = (dwTimeout % 1000) * 1000;
FD_ZERO(&readfd);
@@ -160,9 +160,9 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc, struct Netli
//rfc1928
BYTE buf[258];
- buf[0]=5; //yep, socks5
- buf[1]=1; //one auth method
- buf[2]=nlu->settings.useProxyAuth?2:0;
+ buf[0] = 5; //yep, socks5
+ buf[1] = 1; //one auth method
+ buf[2] = nlu->settings.useProxyAuth?2:0;
if (NLSend(nlc, (char*)buf, 3, MSG_DUMPPROXY) == SOCKET_ERROR) {
NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "NLSend", GetLastError());
return 0;
@@ -183,13 +183,13 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc, struct Netli
int nUserLen, nPassLen;
PBYTE pAuthBuf;
- nUserLen=lstrlenA(nlu->settings.szProxyAuthUser);
- nPassLen=lstrlenA(nlu->settings.szProxyAuthPassword);
- pAuthBuf=(PBYTE)mir_alloc(3+nUserLen+nPassLen);
- pAuthBuf[0]=1; //auth version
- pAuthBuf[1]=nUserLen;
+ nUserLen = lstrlenA(nlu->settings.szProxyAuthUser);
+ nPassLen = lstrlenA(nlu->settings.szProxyAuthPassword);
+ pAuthBuf = (PBYTE)mir_alloc(3+nUserLen+nPassLen);
+ pAuthBuf[0] = 1; //auth version
+ pAuthBuf[1] = nUserLen;
memcpy(pAuthBuf+2, nlu->settings.szProxyAuthUser, nUserLen);
- pAuthBuf[2+nUserLen]=nPassLen;
+ pAuthBuf[2+nUserLen] = nPassLen;
memcpy(pAuthBuf+3+nUserLen, nlu->settings.szProxyAuthPassword, nPassLen);
if (NLSend(nlc, (char*)pAuthBuf, 3+nUserLen+nPassLen, MSG_DUMPPROXY) == SOCKET_ERROR) {
NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "NLSend", GetLastError());
@@ -225,20 +225,20 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc, struct Netli
return 0;
nHostLen = 4;
}
- pInit=(PBYTE)mir_alloc(6+nHostLen);
- pInit[0]=5; //SOCKS5
- pInit[1]= nloc->flags & NLOCF_UDP ? 3 : 1; //connect or UDP
- pInit[2]=0; //reserved
+ pInit = (PBYTE)mir_alloc(6+nHostLen);
+ pInit[0] = 5; //SOCKS5
+ pInit[1] = nloc->flags & NLOCF_UDP ? 3 : 1; //connect or UDP
+ pInit[2] = 0; //reserved
if (hostIP == INADDR_NONE) { //DNS lookup through proxy
- pInit[3]=3;
- pInit[4]=nHostLen-1;
+ pInit[3] = 3;
+ pInit[4] = nHostLen-1;
memcpy(pInit+5, nloc->szHost, nHostLen-1);
}
else {
- pInit[3]=1;
- *(PDWORD)(pInit+4)=hostIP;
+ pInit[3] = 1;
+ *(PDWORD)(pInit+4) = hostIP;
}
- *(PWORD)(pInit+4+nHostLen)=htons(nloc->wPort);
+ *(PWORD)(pInit+4+nHostLen) = htons(nloc->wPort);
if (NLSend(nlc, (char*)pInit, 6+nHostLen, MSG_DUMPPROXY) == SOCKET_ERROR) {
NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "NLSend", GetLastError());
mir_free(pInit);
@@ -345,7 +345,7 @@ static bool NetlibInitHttpsConnection(struct NetlibConnection *nlc, struct Netli
static void FreePartiallyInitedConnection(struct NetlibConnection *nlc)
{
- DWORD dwOriginalLastError=GetLastError();
+ DWORD dwOriginalLastError = GetLastError();
if (nlc->s != INVALID_SOCKET) closesocket(nlc->s);
mir_free(nlc->nlhpi.szHttpPostUrl);
diff --git a/src/modules/netlib/netlibopts.cpp b/src/modules/netlib/netlibopts.cpp
index a8dc2b77b0..86fc34a6b5 100644
--- a/src/modules/netlib/netlibopts.cpp
+++ b/src/modules/netlib/netlibopts.cpp
@@ -32,7 +32,7 @@ struct NetlibTempSettings
static LIST <NetlibTempSettings> tempSettings(5);
-static const UINT outgoingConnectionsControls[] =
+static const UINT outgoingConnectionsControls[] =
{
IDC_STATIC12,
IDC_USEPROXY,
@@ -45,28 +45,28 @@ static const UINT outgoingConnectionsControls[] =
IDC_PORTSRANGEO,
IDC_STATIC54,
IDC_VALIDATESSL};
-static const UINT useProxyControls[]={
+static const UINT useProxyControls[] = {
IDC_STATIC21, IDC_PROXYTYPE,
IDC_STATIC22, IDC_PROXYHOST, IDC_STATIC23, IDC_PROXYPORT, IDC_STOFTENPORT,
IDC_PROXYAUTH,
IDC_STATIC31, IDC_PROXYUSER, IDC_STATIC32, IDC_PROXYPASS,
IDC_PROXYDNS};
-static const UINT specifyOPortsControls[]={
+static const UINT specifyOPortsControls[] = {
IDC_PORTSRANGEO,
IDC_STATIC54
};
-static const UINT incomingConnectionsControls[]={
+static const UINT incomingConnectionsControls[] = {
IDC_STATIC43,
IDC_SPECIFYPORTS,
IDC_PORTSRANGE,
IDC_STATIC52,
IDC_ENABLEUPNP};
-static const UINT specifyPortsControls[]={
+static const UINT specifyPortsControls[] = {
IDC_PORTSRANGE,
IDC_STATIC52};
-static const TCHAR* szProxyTypes[]={_T("<mixed>"), _T("SOCKS4"), _T("SOCKS5"), _T("HTTP"), _T("HTTPS"), _T("Internet Explorer")};
-static const WORD oftenProxyPorts[]={1080, 1080, 1080, 8080, 8080, 8080};
+static const TCHAR* szProxyTypes[] = {_T("<mixed>"), _T("SOCKS4"), _T("SOCKS5"), _T("HTTP"), _T("HTTPS"), _T("Internet Explorer")};
+static const WORD oftenProxyPorts[] = {1080, 1080, 1080, 8080, 8080, 8080};
#define M_REFRESHALL (WM_USER+100)
#define M_REFRESHENABLING (WM_USER+101)
@@ -93,68 +93,68 @@ static void AddProxyTypeItem(HWND hwndDlg, int type, int selectType)
static void CopySettingsStruct(NETLIBUSERSETTINGS *dest, NETLIBUSERSETTINGS *source)
{
- *dest=*source;
- if (dest->szIncomingPorts) dest->szIncomingPorts=mir_strdup(dest->szIncomingPorts);
- if (dest->szOutgoingPorts) dest->szOutgoingPorts=mir_strdup(dest->szOutgoingPorts);
- if (dest->szProxyAuthPassword) dest->szProxyAuthPassword=mir_strdup(dest->szProxyAuthPassword);
- if (dest->szProxyAuthUser) dest->szProxyAuthUser=mir_strdup(dest->szProxyAuthUser);
- if (dest->szProxyServer) dest->szProxyServer=mir_strdup(dest->szProxyServer);
+ *dest = *source;
+ if (dest->szIncomingPorts) dest->szIncomingPorts = mir_strdup(dest->szIncomingPorts);
+ if (dest->szOutgoingPorts) dest->szOutgoingPorts = mir_strdup(dest->szOutgoingPorts);
+ if (dest->szProxyAuthPassword) dest->szProxyAuthPassword = mir_strdup(dest->szProxyAuthPassword);
+ if (dest->szProxyAuthUser) dest->szProxyAuthUser = mir_strdup(dest->szProxyAuthUser);
+ if (dest->szProxyServer) dest->szProxyServer = mir_strdup(dest->szProxyServer);
}
static void CombineSettingsStrings(char **dest, char **source)
{
- if (*dest != NULL && (*source == NULL || lstrcmpiA(*dest, *source))) {mir_free(*dest); *dest=NULL;}
+ if (*dest != NULL && (*source == NULL || lstrcmpiA(*dest, *source))) {mir_free(*dest); *dest = NULL;}
}
static void CombineSettingsStructs(NETLIBUSERSETTINGS *dest, DWORD *destFlags, NETLIBUSERSETTINGS *source, DWORD sourceFlags)
{
if (sourceFlags&NUF_OUTGOING) {
if (*destFlags&NUF_OUTGOING) {
- if (dest->validateSSL != source->validateSSL) dest->validateSSL=2;
- if (dest->useProxy != source->useProxy) dest->useProxy=2;
- if (dest->proxyType != source->proxyType) dest->proxyType=0;
+ if (dest->validateSSL != source->validateSSL) dest->validateSSL = 2;
+ if (dest->useProxy != source->useProxy) dest->useProxy = 2;
+ if (dest->proxyType != source->proxyType) dest->proxyType = 0;
CombineSettingsStrings(&dest->szProxyServer, &source->szProxyServer);
- if (dest->wProxyPort != source->wProxyPort) dest->wProxyPort=0;
- if (dest->useProxyAuth != source->useProxyAuth) dest->useProxyAuth=2;
+ if (dest->wProxyPort != source->wProxyPort) dest->wProxyPort = 0;
+ if (dest->useProxyAuth != source->useProxyAuth) dest->useProxyAuth = 2;
CombineSettingsStrings(&dest->szProxyAuthUser, &source->szProxyAuthUser);
CombineSettingsStrings(&dest->szProxyAuthPassword, &source->szProxyAuthPassword);
- if (dest->dnsThroughProxy != source->dnsThroughProxy) dest->dnsThroughProxy=2;
- if (dest->specifyOutgoingPorts != source->specifyOutgoingPorts) dest->specifyOutgoingPorts=2;
+ if (dest->dnsThroughProxy != source->dnsThroughProxy) dest->dnsThroughProxy = 2;
+ if (dest->specifyOutgoingPorts != source->specifyOutgoingPorts) dest->specifyOutgoingPorts = 2;
CombineSettingsStrings(&dest->szOutgoingPorts, &source->szOutgoingPorts);
}
else {
- dest->validateSSL=source->validateSSL;
- dest->useProxy=source->useProxy;
- dest->proxyType=source->proxyType;
- dest->szProxyServer=source->szProxyServer;
- if (dest->szProxyServer) dest->szProxyServer=mir_strdup(dest->szProxyServer);
- dest->wProxyPort=source->wProxyPort;
- dest->useProxyAuth=source->useProxyAuth;
- dest->szProxyAuthUser=source->szProxyAuthUser;
- if (dest->szProxyAuthUser) dest->szProxyAuthUser=mir_strdup(dest->szProxyAuthUser);
- dest->szProxyAuthPassword=source->szProxyAuthPassword;
- if (dest->szProxyAuthPassword) dest->szProxyAuthPassword=mir_strdup(dest->szProxyAuthPassword);
- dest->dnsThroughProxy=source->dnsThroughProxy;
- dest->specifyOutgoingPorts=source->specifyOutgoingPorts;
- dest->szOutgoingPorts=source->szOutgoingPorts;
- if (dest->szOutgoingPorts) dest->szOutgoingPorts=mir_strdup(dest->szOutgoingPorts);
+ dest->validateSSL = source->validateSSL;
+ dest->useProxy = source->useProxy;
+ dest->proxyType = source->proxyType;
+ dest->szProxyServer = source->szProxyServer;
+ if (dest->szProxyServer) dest->szProxyServer = mir_strdup(dest->szProxyServer);
+ dest->wProxyPort = source->wProxyPort;
+ dest->useProxyAuth = source->useProxyAuth;
+ dest->szProxyAuthUser = source->szProxyAuthUser;
+ if (dest->szProxyAuthUser) dest->szProxyAuthUser = mir_strdup(dest->szProxyAuthUser);
+ dest->szProxyAuthPassword = source->szProxyAuthPassword;
+ if (dest->szProxyAuthPassword) dest->szProxyAuthPassword = mir_strdup(dest->szProxyAuthPassword);
+ dest->dnsThroughProxy = source->dnsThroughProxy;
+ dest->specifyOutgoingPorts = source->specifyOutgoingPorts;
+ dest->szOutgoingPorts = source->szOutgoingPorts;
+ if (dest->szOutgoingPorts) dest->szOutgoingPorts = mir_strdup(dest->szOutgoingPorts);
}
}
if (sourceFlags&NUF_INCOMING) {
if (*destFlags&NUF_INCOMING) {
- if (dest->enableUPnP != source->enableUPnP) dest->enableUPnP=2;
- if (dest->specifyIncomingPorts != source->specifyIncomingPorts) dest->specifyIncomingPorts=2;
+ if (dest->enableUPnP != source->enableUPnP) dest->enableUPnP = 2;
+ if (dest->specifyIncomingPorts != source->specifyIncomingPorts) dest->specifyIncomingPorts = 2;
CombineSettingsStrings(&dest->szIncomingPorts, &source->szIncomingPorts);
}
else {
- dest->enableUPnP=source->enableUPnP;
- dest->specifyIncomingPorts=source->specifyIncomingPorts;
- dest->szIncomingPorts=source->szIncomingPorts;
- if (dest->szIncomingPorts) dest->szIncomingPorts=mir_strdup(dest->szIncomingPorts);
+ dest->enableUPnP = source->enableUPnP;
+ dest->specifyIncomingPorts = source->specifyIncomingPorts;
+ dest->szIncomingPorts = source->szIncomingPorts;
+ if (dest->szIncomingPorts) dest->szIncomingPorts = mir_strdup(dest->szIncomingPorts);
}
}
if ((*destFlags&NUF_NOHTTPSOPTION) != (sourceFlags&NUF_NOHTTPSOPTION))
- *destFlags=(*destFlags|sourceFlags)&~NUF_NOHTTPSOPTION;
+ *destFlags = (*destFlags|sourceFlags)&~NUF_NOHTTPSOPTION;
else *destFlags|=sourceFlags;
}
@@ -167,26 +167,26 @@ static void ChangeSettingIntByCheckbox(HWND hwndDlg, UINT ctrlId, int iUser, int
if ( !(tempSettings[i]->flags & NUF_NOOPTIONS))
*(int*)(((PBYTE)&tempSettings[i]->settings) + memberOffset) = newValue;
}
- else *(int*)(((PBYTE)&tempSettings[iUser]->settings) + memberOffset)=newValue;
+ else *(int*)(((PBYTE)&tempSettings[iUser]->settings) + memberOffset) = newValue;
SendMessage(hwndDlg, M_REFRESHENABLING, 0, 0);
}
static void ChangeSettingStringByEdit(HWND hwndDlg, UINT ctrlId, int iUser, int memberOffset)
{
- int newValueLen=GetWindowTextLength(GetDlgItem(hwndDlg, ctrlId));
- char *szNewValue=(char*)mir_alloc(newValueLen+1);
+ int newValueLen = GetWindowTextLength(GetDlgItem(hwndDlg, ctrlId));
+ char *szNewValue = (char*)mir_alloc(newValueLen+1);
GetDlgItemTextA(hwndDlg, ctrlId, szNewValue, newValueLen+1);
if (iUser == -1) {
for (int i=0; i<tempSettings.getCount(); ++i)
if ( !(tempSettings[i]->flags & NUF_NOOPTIONS)) {
- char **ppszNew=(char**)(((PBYTE)&tempSettings[i]->settings)+memberOffset);
+ char **ppszNew = (char**)(((PBYTE)&tempSettings[i]->settings)+memberOffset);
mir_free(*ppszNew);
*ppszNew = mir_strdup(szNewValue);
}
mir_free(szNewValue);
}
else {
- char **ppszNew=(char**)(((PBYTE)&tempSettings[iUser]->settings)+memberOffset);
+ char **ppszNew = (char**)(((PBYTE)&tempSettings[iUser]->settings)+memberOffset);
mir_free(*ppszNew);
*ppszNew = szNewValue;
}
@@ -240,13 +240,13 @@ void NetlibSaveUserSettingsStruct(const char *szSettingsModule, NETLIBUSERSETTIN
continue;
CombineSettingsStructs(&combinedSettings, &flags, &thisUser->settings, thisUser->user.flags);
}
- if (combinedSettings.validateSSL == 2) combinedSettings.validateSSL=0;
- if (combinedSettings.useProxy == 2) combinedSettings.useProxy=0;
- if (combinedSettings.proxyType == 0) combinedSettings.proxyType=PROXYTYPE_SOCKS5;
- if (combinedSettings.useProxyAuth == 2) combinedSettings.useProxyAuth=0;
- if (combinedSettings.dnsThroughProxy == 2) combinedSettings.dnsThroughProxy=1;
- if (combinedSettings.enableUPnP == 2) combinedSettings.enableUPnP=1;
- if (combinedSettings.specifyIncomingPorts == 2) combinedSettings.specifyIncomingPorts=0;
+ if (combinedSettings.validateSSL == 2) combinedSettings.validateSSL = 0;
+ if (combinedSettings.useProxy == 2) combinedSettings.useProxy = 0;
+ if (combinedSettings.proxyType == 0) combinedSettings.proxyType = PROXYTYPE_SOCKS5;
+ if (combinedSettings.useProxyAuth == 2) combinedSettings.useProxyAuth = 0;
+ if (combinedSettings.dnsThroughProxy == 2) combinedSettings.dnsThroughProxy = 1;
+ if (combinedSettings.enableUPnP == 2) combinedSettings.enableUPnP = 1;
+ if (combinedSettings.specifyIncomingPorts == 2) combinedSettings.specifyIncomingPorts = 0;
WriteSettingsStructToDb("Netlib", &combinedSettings, flags);
NetlibFreeUserSettingsStruct(&combinedSettings);
}
@@ -289,8 +289,8 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
DWORD flags = 0;
if (iUser == -1) {
- settings.cbSize=sizeof(settings);
- for (int i = 0; i < tempSettings.getCount(); ++i) {
+ settings.cbSize = sizeof(settings);
+ for (int i=0; i < tempSettings.getCount(); ++i) {
if (tempSettings[i]->flags & NUF_NOOPTIONS) continue;
CombineSettingsStructs(&settings, &flags, &tempSettings[i]->settings, tempSettings[i]->flags);
}
@@ -344,24 +344,24 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
int enableAuth = 0, enableUser = 0, enablePass = 0, enableServer = 1;
EnableMultipleControls(hwndDlg, useProxyControls, SIZEOF(useProxyControls), TRUE);
if (selectedProxyType == 0) {
- for (int i = 0; i < tempSettings.getCount(); ++i) {
+ for (int i=0; i < tempSettings.getCount(); ++i) {
if ( !tempSettings[i]->settings.useProxy ||
tempSettings[i]->flags & NUF_NOOPTIONS || !(tempSettings[i]->flags & NUF_OUTGOING))
continue;
- if (tempSettings[i]->settings.proxyType == PROXYTYPE_SOCKS4) enableUser=1;
+ if (tempSettings[i]->settings.proxyType == PROXYTYPE_SOCKS4) enableUser = 1;
else {
enableAuth = 1;
if (tempSettings[i]->settings.useProxyAuth)
- enableUser=enablePass=1;
+ enableUser = enablePass = 1;
}
}
}
else {
- if (selectedProxyType == PROXYTYPE_SOCKS4) enableUser=1;
+ if (selectedProxyType == PROXYTYPE_SOCKS4) enableUser = 1;
else {
- if (selectedProxyType == PROXYTYPE_IE) enableServer=0;
- enableAuth=1;
+ if (selectedProxyType == PROXYTYPE_IE) enableServer = 0;
+ enableAuth = 1;
if (IsDlgButtonChecked(hwndDlg, IDC_PROXYAUTH) != BST_UNCHECKED)
enableUser = enablePass = 1;
}
@@ -397,7 +397,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
int newValue = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETCURSEL, 0, 0), 0);
if (iUser == -1) {
if (newValue == 0) return 0;
- for (int i = 0; i < tempSettings.getCount(); ++i) {
+ for (int i=0; i < tempSettings.getCount(); ++i) {
if (tempSettings[i]->flags & NUF_NOOPTIONS) continue;
if (newValue == PROXYTYPE_HTTP && !(tempSettings[i]->flags & (NUF_HTTPCONNS|NUF_HTTPGATEWAY)))
tempSettings[i]->settings.proxyType = PROXYTYPE_HTTPS;
@@ -444,7 +444,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
{
int newValue = GetDlgItemInt(hwndDlg, LOWORD(wParam), NULL, FALSE);
if (iUser == -1) {
- for (int i = 0; i < tempSettings.getCount(); ++i)
+ for (int i=0; i < tempSettings.getCount(); ++i)
if ( !(tempSettings[i]->flags & NUF_NOOPTIONS))
tempSettings[i]->settings.wProxyPort = newValue;
}
@@ -498,13 +498,13 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
return FALSE;
}
-static UINT expertOnlyControls[]={IDC_LOGOPTIONS};
+static UINT expertOnlyControls[] = {IDC_LOGOPTIONS};
int NetlibOptInitialise(WPARAM wParam, LPARAM)
{
int optionsCount = 0;
{
mir_cslock lck(csNetlibUser);
- for (int i = 0; i < netlibUser.getCount(); ++i)
+ for (int i=0; i < netlibUser.getCount(); ++i)
if ( !(netlibUser[i]->user.flags & NUF_NOOPTIONS))
++optionsCount;
}
diff --git a/src/modules/netlib/netlibpktrecver.cpp b/src/modules/netlib/netlibpktrecver.cpp
index d2b40559b3..4e887b1177 100644
--- a/src/modules/netlib/netlibpktrecver.cpp
+++ b/src/modules/netlib/netlibpktrecver.cpp
@@ -25,32 +25,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
INT_PTR NetlibPacketRecverCreate(WPARAM wParam, LPARAM lParam)
{
- struct NetlibConnection *nlc=(struct NetlibConnection*)wParam;
+ struct NetlibConnection *nlc = (struct NetlibConnection*)wParam;
struct NetlibPacketRecver *nlpr;
if (GetNetlibHandleType(nlc) != NLH_CONNECTION || lParam == 0) {
SetLastError(ERROR_INVALID_PARAMETER);
return (INT_PTR)(struct NetlibPacketRecver*)NULL;
}
- nlpr=(struct NetlibPacketRecver*)mir_calloc(sizeof(struct NetlibPacketRecver));
+ nlpr = (struct NetlibPacketRecver*)mir_calloc(sizeof(struct NetlibPacketRecver));
if (nlpr == NULL) {
SetLastError(ERROR_OUTOFMEMORY);
return (INT_PTR)(struct NetlibPacketRecver*)NULL;
}
- nlpr->handleType=NLH_PACKETRECVER;
- nlpr->nlc=nlc;
- nlpr->packetRecver.cbSize=sizeof(nlpr->packetRecver);
- nlpr->packetRecver.bufferSize=lParam;
- nlpr->packetRecver.buffer=(PBYTE)mir_alloc(nlpr->packetRecver.bufferSize);
- nlpr->packetRecver.bytesUsed=0;
- nlpr->packetRecver.bytesAvailable=0;
+ nlpr->handleType = NLH_PACKETRECVER;
+ nlpr->nlc = nlc;
+ nlpr->packetRecver.cbSize = sizeof(nlpr->packetRecver);
+ nlpr->packetRecver.bufferSize = lParam;
+ nlpr->packetRecver.buffer = (PBYTE)mir_alloc(nlpr->packetRecver.bufferSize);
+ nlpr->packetRecver.bytesUsed = 0;
+ nlpr->packetRecver.bytesAvailable = 0;
return (INT_PTR)nlpr;
}
INT_PTR NetlibPacketRecverGetMore(WPARAM wParam, LPARAM lParam)
{
- struct NetlibPacketRecver *nlpr=(struct NetlibPacketRecver*)wParam;
- NETLIBPACKETRECVER *nlprParam=(NETLIBPACKETRECVER*)lParam;
+ struct NetlibPacketRecver *nlpr = (struct NetlibPacketRecver*)wParam;
+ NETLIBPACKETRECVER *nlprParam = (NETLIBPACKETRECVER*)lParam;
INT_PTR recvResult;
if (GetNetlibHandleType(nlpr) != NLH_PACKETRECVER || nlprParam == NULL || nlprParam->cbSize != sizeof(NETLIBPACKETRECVER) || nlprParam->bytesUsed>nlpr->packetRecver.bytesAvailable) {
@@ -61,10 +61,10 @@ INT_PTR NetlibPacketRecverGetMore(WPARAM wParam, LPARAM lParam)
SetLastError(ERROR_TIMEOUT);
return SOCKET_ERROR;
}
- nlpr->packetRecver.dwTimeout=nlprParam->dwTimeout;
+ nlpr->packetRecver.dwTimeout = nlprParam->dwTimeout;
if (nlprParam->bytesUsed == 0) {
if (nlpr->packetRecver.bytesAvailable == nlpr->packetRecver.bufferSize) {
- nlpr->packetRecver.bytesAvailable=0;
+ nlpr->packetRecver.bytesAvailable = 0;
NetlibLogf(nlpr->nlc->nlu, "Packet recver: packet overflowed buffer, ditching");
}
}
@@ -74,12 +74,12 @@ INT_PTR NetlibPacketRecverGetMore(WPARAM wParam, LPARAM lParam)
}
if (nlprParam->dwTimeout != INFINITE) {
if ( !si.pending(nlpr->nlc->hSsl) && WaitUntilReadable(nlpr->nlc->s, nlprParam->dwTimeout) <= 0) {
- *nlprParam=nlpr->packetRecver;
+ *nlprParam = nlpr->packetRecver;
return SOCKET_ERROR;
}
}
- recvResult=NLRecv(nlpr->nlc, (char*)nlpr->packetRecver.buffer+nlpr->packetRecver.bytesAvailable, nlpr->packetRecver.bufferSize-nlpr->packetRecver.bytesAvailable, 0);
+ recvResult = NLRecv(nlpr->nlc, (char*)nlpr->packetRecver.buffer+nlpr->packetRecver.bytesAvailable, nlpr->packetRecver.bufferSize-nlpr->packetRecver.bytesAvailable, 0);
if (recvResult>0) nlpr->packetRecver.bytesAvailable+=recvResult;
- *nlprParam=nlpr->packetRecver;
+ *nlprParam = nlpr->packetRecver;
return recvResult;
}
diff --git a/src/modules/netlib/netlibsecurity.cpp b/src/modules/netlib/netlibsecurity.cpp
index 9ff92944e3..c95b4fd7ab 100644
--- a/src/modules/netlib/netlibsecurity.cpp
+++ b/src/modules/netlib/netlibsecurity.cpp
@@ -241,12 +241,12 @@ char* CompleteGssapi(HANDLE hSecurity, unsigned char *szChallenge, unsigned chls
}
unsigned i, ressz = 0;
- for (i = 0; i < outBuffersDesc.cBuffers; i++)
+ for (i=0; i < outBuffersDesc.cBuffers; i++)
ressz += outBuffersDesc.pBuffers[i].cbBuffer;
unsigned char *response = (unsigned char*)alloca(ressz), *p = response;
- for (i = 0; i < outBuffersDesc.cBuffers; i++)
+ for (i=0; i < outBuffersDesc.cBuffers; i++)
{
memcpy(p, outBuffersDesc.pBuffers[i].pvBuffer, outBuffersDesc.pBuffers[i].cbBuffer);
p += outBuffersDesc.pBuffers[i].cbBuffer;
@@ -430,7 +430,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge,
char *szAuth = (char*)alloca(authLen);
nlb64.cbDecoded = mir_snprintf(szAuth, authLen, "%s:%s", szLogin, szPassw);
- nlb64.pbDecoded=(PBYTE)szAuth;
+ nlb64.pbDecoded = (PBYTE)szAuth;
complete = true;
mir_free(szPassw);
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp
index badc1fe0ca..ac0435564e 100644
--- a/src/modules/netlib/netlibsock.cpp
+++ b/src/modules/netlib/netlibsock.cpp
@@ -106,7 +106,7 @@ static int ConnectionListToSocketList(HANDLE *hConns, fd_set *fd, int& pending)
int i;
FD_ZERO(fd);
- for (i = 0; hConns[i] && hConns[i] != INVALID_HANDLE_VALUE && i < FD_SETSIZE; i++)
+ for (i=0; hConns[i] && hConns[i] != INVALID_HANDLE_VALUE && i < FD_SETSIZE; i++)
{
nlcCheck = (NetlibConnection*)hConns[i];
if (nlcCheck->handleType != NLH_CONNECTION && nlcCheck->handleType != NLH_BOUNDPORT)
@@ -131,8 +131,8 @@ INT_PTR NetlibSelect(WPARAM, LPARAM lParam)
}
TIMEVAL tv;
- tv.tv_sec=nls->dwTimeout/1000;
- tv.tv_usec=(nls->dwTimeout%1000)*1000;
+ tv.tv_sec = nls->dwTimeout/1000;
+ tv.tv_usec = (nls->dwTimeout%1000)*1000;
int pending = 0;
fd_set readfd, writefd, exceptfd;
@@ -305,7 +305,7 @@ static NETLIBIPLIST* GetMyIpv6(unsigned flags)
NETLIBIPLIST *addr = (NETLIBIPLIST*)mir_calloc(n * 64 + 4);
addr->cbNum = n;
- unsigned i = 0;
+ unsigned i=0;
for (ai = air; ai; ai = ai->ai_next)
{
SOCKADDR_INET_M* iaddr = (SOCKADDR_INET_M*)ai->ai_addr;
@@ -336,7 +336,7 @@ static NETLIBIPLIST* GetMyIpv4(void)
NETLIBIPLIST *addr = (NETLIBIPLIST*)mir_calloc(n * 64 + 4);
addr->cbNum = n;
- for (unsigned i = 0; i < n; ++i)
+ for (unsigned i=0; i < n; ++i)
strcpy(addr->szIp[i], inet_ntoa(*(PIN_ADDR)he->h_addr_list[i]));
return addr;
diff --git a/src/modules/netlib/netlibssl.cpp b/src/modules/netlib/netlibssl.cpp
index 77c6bec8c9..a1910f3ca6 100644
--- a/src/modules/netlib/netlibssl.cpp
+++ b/src/modules/netlib/netlibssl.cpp
@@ -119,7 +119,7 @@ static bool AcquireCredentials(void)
ZeroMemory(&SchannelCred, sizeof(SchannelCred));
- SchannelCred.dwVersion = SCHANNEL_CRED_VERSION;
+ SchannelCred.dwVersion = SCHANNEL_CRED_VERSION;
SchannelCred.grbitEnabledProtocols = SP_PROT_SSL3TLS1_CLIENTS /*| 0xA00 TLS1.1 & 1.2*/;
SchannelCred.dwFlags |= SCH_CRED_NO_DEFAULT_CREDS | SCH_CRED_MANUAL_CRED_VALIDATION;
@@ -235,7 +235,7 @@ static bool VerifyCertificate(SslHandle *ssl, PCSTR pszServerName, DWORD dwCertF
ChainPara.cbSize = sizeof(ChainPara);
ChainPara.RequestedUsage.dwType = USAGE_MATCH_TYPE_OR;
- ChainPara.RequestedUsage.Usage.cUsageIdentifier = SIZEOF(rgszUsages);
+ ChainPara.RequestedUsage.Usage.cUsageIdentifier = SIZEOF(rgszUsages);
ChainPara.RequestedUsage.Usage.rgpszUsageIdentifier = rgszUsages;
if ( !fnCertGetCertificateChain(NULL, pServerCert, NULL, pServerCert->hCertStore,
@@ -245,12 +245,12 @@ static bool VerifyCertificate(SslHandle *ssl, PCSTR pszServerName, DWORD dwCertF
goto cleanup;
}
- polHttps.cbStruct = sizeof(HTTPSPolicyCallbackData);
- polHttps.dwAuthType = AUTHTYPE_SERVER;
- polHttps.fdwChecks = dwCertFlags;
- polHttps.pwszServerName = pwszServerName;
+ polHttps.cbStruct = sizeof(HTTPSPolicyCallbackData);
+ polHttps.dwAuthType = AUTHTYPE_SERVER;
+ polHttps.fdwChecks = dwCertFlags;
+ polHttps.pwszServerName = pwszServerName;
- PolicyPara.cbSize = sizeof(PolicyPara);
+ PolicyPara.cbSize = sizeof(PolicyPara);
PolicyPara.pvExtraPolicyPara = &polHttps;
PolicyStatus.cbSize = sizeof(PolicyStatus);
@@ -361,29 +361,29 @@ static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead)
// of this. Leftover data (if any) will be placed in buffer 1 and
// given a buffer type of SECBUFFER_EXTRA.
- InBuffers[0].pvBuffer = ssl->pbIoBuffer;
- InBuffers[0].cbBuffer = ssl->cbIoBuffer;
+ InBuffers[0].pvBuffer = ssl->pbIoBuffer;
+ InBuffers[0].cbBuffer = ssl->cbIoBuffer;
InBuffers[0].BufferType = SECBUFFER_TOKEN;
- InBuffers[1].pvBuffer = NULL;
- InBuffers[1].cbBuffer = 0;
+ InBuffers[1].pvBuffer = NULL;
+ InBuffers[1].cbBuffer = 0;
InBuffers[1].BufferType = SECBUFFER_EMPTY;
- InBuffer.cBuffers = 2;
- InBuffer.pBuffers = InBuffers;
- InBuffer.ulVersion = SECBUFFER_VERSION;
+ InBuffer.cBuffers = 2;
+ InBuffer.pBuffers = InBuffers;
+ InBuffer.ulVersion = SECBUFFER_VERSION;
// Set up the output buffers. These are initialized to NULL
// so as to make it less likely we'll attempt to free random
// garbage later.
- OutBuffers[0].pvBuffer = NULL;
- OutBuffers[0].BufferType= SECBUFFER_TOKEN;
- OutBuffers[0].cbBuffer = 0;
+ OutBuffers[0].pvBuffer = NULL;
+ OutBuffers[0].BufferType = SECBUFFER_TOKEN;
+ OutBuffers[0].cbBuffer = 0;
- OutBuffer.cBuffers = 1;
- OutBuffer.pBuffers = OutBuffers;
- OutBuffer.ulVersion = SECBUFFER_VERSION;
+ OutBuffer.cBuffers = 1;
+ OutBuffer.pBuffers = OutBuffers;
+ OutBuffer.ulVersion = SECBUFFER_VERSION;
scRet = g_pSSPI->InitializeSecurityContextA(
&hCreds,
@@ -509,9 +509,9 @@ static bool ClientConnect(SslHandle *ssl, const char *host)
// Initiate a ClientHello message and generate a token.
- OutBuffers[0].pvBuffer = NULL;
+ OutBuffers[0].pvBuffer = NULL;
OutBuffers[0].BufferType = SECBUFFER_TOKEN;
- OutBuffers[0].cbBuffer = 0;
+ OutBuffers[0].cbBuffer = 0;
OutBuffer.cBuffers = 1;
OutBuffer.pBuffers = OutBuffers;
@@ -600,12 +600,12 @@ void NetlibSslShutdown(SslHandle *ssl)
dwType = SCHANNEL_SHUTDOWN;
- OutBuffers[0].pvBuffer = &dwType;
+ OutBuffers[0].pvBuffer = &dwType;
OutBuffers[0].BufferType = SECBUFFER_TOKEN;
- OutBuffers[0].cbBuffer = sizeof(dwType);
+ OutBuffers[0].cbBuffer = sizeof(dwType);
- OutBuffer.cBuffers = 1;
- OutBuffer.pBuffers = OutBuffers;
+ OutBuffer.cBuffers = 1;
+ OutBuffer.pBuffers = OutBuffers;
OutBuffer.ulVersion = SECBUFFER_VERSION;
scRet = g_pSSPI->ApplyControlToken(&ssl->hContext, &OutBuffer);
@@ -622,12 +622,12 @@ void NetlibSslShutdown(SslHandle *ssl)
ISC_REQ_ALLOCATE_MEMORY |
ISC_REQ_STREAM;
- OutBuffers[0].pvBuffer = NULL;
+ OutBuffers[0].pvBuffer = NULL;
OutBuffers[0].BufferType = SECBUFFER_TOKEN;
- OutBuffers[0].cbBuffer = 0;
+ OutBuffers[0].cbBuffer = 0;
- OutBuffer.cBuffers = 1;
- OutBuffer.pBuffers = OutBuffers;
+ OutBuffer.cBuffers = 1;
+ OutBuffer.pBuffers = OutBuffers;
OutBuffer.ulVersion = SECBUFFER_VERSION;
scRet = g_pSSPI->InitializeSecurityContextA(
@@ -760,17 +760,17 @@ int NetlibSslRead(SslHandle *ssl, char *buf, int num, int peek)
}
// Attempt to decrypt the received data.
- Buffers[0].pvBuffer = ssl->pbIoBuffer;
- Buffers[0].cbBuffer = ssl->cbIoBuffer;
- Buffers[0].BufferType = SECBUFFER_DATA;
+ Buffers[0].pvBuffer = ssl->pbIoBuffer;
+ Buffers[0].cbBuffer = ssl->cbIoBuffer;
+ Buffers[0].BufferType = SECBUFFER_DATA;
- Buffers[1].BufferType = SECBUFFER_EMPTY;
- Buffers[2].BufferType = SECBUFFER_EMPTY;
- Buffers[3].BufferType = SECBUFFER_EMPTY;
+ Buffers[1].BufferType = SECBUFFER_EMPTY;
+ Buffers[2].BufferType = SECBUFFER_EMPTY;
+ Buffers[3].BufferType = SECBUFFER_EMPTY;
- Message.ulVersion = SECBUFFER_VERSION;
- Message.cBuffers = 4;
- Message.pBuffers = Buffers;
+ Message.ulVersion = SECBUFFER_VERSION;
+ Message.cBuffers = 4;
+ Message.pBuffers = Buffers;
if (g_pSSPI->DecryptMessage != NULL && g_pSSPI->DecryptMessage != PVOID(0x80000000))
scRet = g_pSSPI->DecryptMessage(&ssl->hContext, &Message, 0, NULL);
@@ -791,7 +791,7 @@ int NetlibSslRead(SslHandle *ssl, char *buf, int num, int peek)
}
// Locate data and (optional) extra buffers.
- pDataBuffer = NULL;
+ pDataBuffer = NULL;
pExtraBuffer = NULL;
for (i = 1; i < 4; i++)
{
@@ -900,23 +900,23 @@ int NetlibSslWrite(SslHandle *ssl, const char *buf, int num)
cbMessage = min(Sizes.cbMaximumMessage, (DWORD)num - sendOff);
CopyMemory(pbMessage, buf+sendOff, cbMessage);
- Buffers[0].pvBuffer = pbDataBuffer;
- Buffers[0].cbBuffer = Sizes.cbHeader;
- Buffers[0].BufferType = SECBUFFER_STREAM_HEADER;
+ Buffers[0].pvBuffer = pbDataBuffer;
+ Buffers[0].cbBuffer = Sizes.cbHeader;
+ Buffers[0].BufferType = SECBUFFER_STREAM_HEADER;
- Buffers[1].pvBuffer = pbMessage;
- Buffers[1].cbBuffer = cbMessage;
- Buffers[1].BufferType = SECBUFFER_DATA;
+ Buffers[1].pvBuffer = pbMessage;
+ Buffers[1].cbBuffer = cbMessage;
+ Buffers[1].BufferType = SECBUFFER_DATA;
- Buffers[2].pvBuffer = pbMessage + cbMessage;
- Buffers[2].cbBuffer = Sizes.cbTrailer;
- Buffers[2].BufferType = SECBUFFER_STREAM_TRAILER;
+ Buffers[2].pvBuffer = pbMessage + cbMessage;
+ Buffers[2].cbBuffer = Sizes.cbTrailer;
+ Buffers[2].BufferType = SECBUFFER_STREAM_TRAILER;
- Buffers[3].BufferType = SECBUFFER_EMPTY;
+ Buffers[3].BufferType = SECBUFFER_EMPTY;
- Message.ulVersion = SECBUFFER_VERSION;
- Message.cBuffers = 4;
- Message.pBuffers = Buffers;
+ Message.ulVersion = SECBUFFER_VERSION;
+ Message.cBuffers = 4;
+ Message.pBuffers = Buffers;
if (g_pSSPI->EncryptMessage != NULL)
scRet = g_pSSPI->EncryptMessage(&ssl->hContext, 0, &Message, 0);
@@ -953,12 +953,12 @@ static INT_PTR GetSslApi(WPARAM, LPARAM lParam)
if (si->cbSize != sizeof(SSL_API))
return FALSE;
- si->connect = (HSSL (__cdecl *)(SOCKET, const char *, int))NetlibSslConnect;
- si->pending = (BOOL (__cdecl *)(HSSL))NetlibSslPending;
- si->read = (int (__cdecl *)(HSSL, char *, int, int))NetlibSslRead;
- si->write = (int (__cdecl *)(HSSL, const char *, int))NetlibSslWrite;
+ si->connect = (HSSL (__cdecl *)(SOCKET, const char *, int))NetlibSslConnect;
+ si->pending = (BOOL (__cdecl *)(HSSL))NetlibSslPending;
+ si->read = (int (__cdecl *)(HSSL, char *, int, int))NetlibSslRead;
+ si->write = (int (__cdecl *)(HSSL, const char *, int))NetlibSslWrite;
si->shutdown = (void (__cdecl *)(HSSL))NetlibSslShutdown;
- si->sfree = (void (__cdecl *)(HSSL))NetlibSslFree;
+ si->sfree = (void (__cdecl *)(HSSL))NetlibSslFree;
return TRUE;
}
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp
index 8bec975111..b75953d280 100644
--- a/src/modules/netlib/netlibupnp.cpp
+++ b/src/modules/netlib/netlibupnp.cpp
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "..\..\core\commonheaders.h"
#include "netlib.h"
-static const char search_request_msg[] =
+static const char search_request_msg[] =
"M-SEARCH * HTTP/1.1\r\n"
"HOST: 239.255.255.250:1900\r\n"
"MAN: \"ssdp:discover\"\r\n"
@@ -31,55 +31,55 @@ static const char search_request_msg[] =
"ST: urn:schemas-upnp-org:service:%s\r\n"
"\r\n";
-static const char xml_get_hdr[] =
+static const char xml_get_hdr[] =
"GET %s HTTP/1.1\r\n"
"HOST: %s:%u\r\n"
"ACCEPT-LANGUAGE: *\r\n\r\n";
-static const char soap_post_hdr[] =
+static const char soap_post_hdr[] =
"POST %s HTTP/1.1\r\n"
"HOST: %s:%u\r\n"
"CONTENT-LENGTH: %u\r\n"
- "CONTENT-TYPE: text/xml; charset=\"utf-8\"\r\n"
+ "CONTENT-TYPE: text/xml; charset = \"utf-8\"\r\n"
"SOAPACTION: \"%s#%s\"\r\n\r\n"
"%s";
-static const char soap_post_hdr_m[] =
+static const char soap_post_hdr_m[] =
"M-POST %s URL HTTP/1.1\r\n"
"HOST: %s:%u\r\n"
"CONTENT-LENGTH: %u\r\n"
- "CONTENT-TYPE: text/xml; charset=\"utf-8\"\r\n"
- "MAN: \"http://schemas.xmlsoap.org/soap/envelope/\"; ns=01\r\n"
+ "CONTENT-TYPE: text/xml; charset = \"utf-8\"\r\n"
+ "MAN: \"http://schemas.xmlsoap.org/soap/envelope/\"; ns = 01\r\n"
"01-SOAPACTION: \"%s#%s\"\r\n\r\n"
"%s";
-static const char search_device[] =
+static const char search_device[] =
"<serviceType>%s</serviceType>";
-static const char soap_action[] =
- "<?xml version=\"1.0\"?>\r\n"
+static const char soap_action[] =
+ "<?xml version = \"1.0\"?>\r\n"
"<s:Envelope\r\n"
- " xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"\r\n"
- " s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n"
+ " xmlns:s = \"http://schemas.xmlsoap.org/soap/envelope/\"\r\n"
+ " s:encodingStyle = \"http://schemas.xmlsoap.org/soap/encoding/\">\r\n"
" <s:Body>\r\n"
- " <u:%s xmlns:u=\"%s\">\r\n"
+ " <u:%s xmlns:u = \"%s\">\r\n"
"%s"
" </u:%s>\r\n"
" </s:Body>\r\n"
"</s:Envelope>\r\n";
-static const char soap_query[] =
+static const char soap_query[] =
"<s:Envelope\r\n"
- " xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"\r\n"
- " s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n"
+ " xmlns:s = \"http://schemas.xmlsoap.org/soap/envelope/\"\r\n"
+ " s:encodingStyle = \"http://schemas.xmlsoap.org/soap/encoding/\">\r\n"
" <s:Body>\r\n"
- " <u:QueryStateVariable xmlns:u=\"urn:schemas-upnp-org:control-1-0\">\r\n"
+ " <u:QueryStateVariable xmlns:u = \"urn:schemas-upnp-org:control-1-0\">\r\n"
" <u:varName>%s</u:varName>\r\n"
" </u:QueryStateVariable>\r\n"
" </s:Body>\r\n"
"</s:Envelope>\r\n";
-static const char add_port_mapping[] =
+static const char add_port_mapping[] =
" <NewRemoteHost></NewRemoteHost>\r\n"
" <NewExternalPort>%i</NewExternalPort>\r\n"
" <NewProtocol>%s</NewProtocol>\r\n"
@@ -89,12 +89,12 @@ static const char add_port_mapping[] =
" <NewPortMappingDescription>Miranda</NewPortMappingDescription>\r\n"
" <NewLeaseDuration>0</NewLeaseDuration>\r\n";
-static const char delete_port_mapping[] =
+static const char delete_port_mapping[] =
" <NewRemoteHost></NewRemoteHost>\r\n"
" <NewExternalPort>%i</NewExternalPort>\r\n"
" <NewProtocol>%s</NewProtocol>\r\n";
-static const char get_port_mapping[] =
+static const char get_port_mapping[] =
" <NewPortMappingIndex>%i</NewPortMappingIndex>\r\n";
static bool gatewayFound;
@@ -249,7 +249,7 @@ static int httpTransact(char* szUrl, char* szResult, int resSize, char* szAction
const char* szPostHdr = soap_post_hdr;
char* szData = (char*)mir_alloc(4096);
- char* szReq = NULL;
+ char* szReq = NULL;
parseURL(szUrl, szHost, &sPort, szPath);
@@ -678,7 +678,7 @@ static void discoverUPnP(void)
}
txtParseParam(buf, NULL, "ST:", "\n", szDev, sizeof(szDev));
- txtParseParam(buf, "max-age", "=", "\n", age, sizeof(age));
+ txtParseParam(buf, "max-age", " = ", "\n", age, sizeof(age));
expireTime = atoi(lrtrimp(age));
lrtrim(szDev);
@@ -784,7 +784,7 @@ void NetlibUPnPDeletePortMapping(WORD extport, char* proto)
mir_snprintf(szData, 4096, delete_port_mapping, extport, proto);
httpTransact(szCtlUrl, szData, 4096, "DeletePortMapping", ControlAction);
- for (i = 0; i < numports; ++i)
+ for (i=0; i < numports; ++i)
if (portList[i] == extport && --numports > 0)
memmove(&portList[i], &portList[i+1], (numports - i) * sizeof(WORD));
@@ -802,7 +802,7 @@ void NetlibUPnPCleanup(void*)
{
int incoming = 0;
mir_cslock lck(csNetlibUser);
- for (int i = 0; i < netlibUser.getCount(); ++i)
+ for (int i=0; i < netlibUser.getCount(); ++i)
if (netlibUser[i]->user.flags & NUF_INCOMING) {
incoming = 1;
break;
@@ -851,7 +851,7 @@ void NetlibUPnPCleanup(void*)
if (j >= SIZEOF(ports))
break;
- for (k=0; k<numports; ++k)
+ for (k = 0; k<numports; ++k)
if (portList[k] == mport)
break;
diff --git a/src/modules/options/descbutton.cpp b/src/modules/options/descbutton.cpp
index 813779f375..e0f1baf02c 100644
--- a/src/modules/options/descbutton.cpp
+++ b/src/modules/options/descbutton.cpp
@@ -68,13 +68,13 @@ int LoadDescButtonModule()
WNDCLASSEX wc;
ZeroMemory(&wc, sizeof(wc));
- wc.cbSize = sizeof(wc);
- wc.lpszClassName = MIRANDADESCBUTTONCLASS;
- wc.lpfnWndProc = MDescButtonWndProc;
- wc.hCursor = LoadCursor(NULL, IDC_HAND);
- wc.cbWndExtra = sizeof(MDescButtonCtrl *);
- wc.hbrBackground = 0; //GetStockObject(WHITE_BRUSH);
- wc.style = CS_GLOBALCLASS|CS_SAVEBITS;
+ wc.cbSize = sizeof(wc);
+ wc.lpszClassName = MIRANDADESCBUTTONCLASS;
+ wc.lpfnWndProc = MDescButtonWndProc;
+ wc.hCursor = LoadCursor(NULL, IDC_HAND);
+ wc.cbWndExtra = sizeof(MDescButtonCtrl *);
+ wc.hbrBackground = 0; //GetStockObject(WHITE_BRUSH);
+ wc.style = CS_GLOBALCLASS|CS_SAVEBITS;
RegisterClassEx(&wc);
return 0;
}
@@ -84,36 +84,36 @@ static void MDescButton_SetupColors(MDescButtonCtrl *dat)
COLORREF cl;
cl = GetSysColor(COLOR_WINDOW);
- dat->rgbBkgBottom.rgbRed = (dat->rgbBkgTop.rgbRed = GetRValue(cl)) * .95;
- dat->rgbBkgBottom.rgbGreen = (dat->rgbBkgTop.rgbGreen = GetGValue(cl)) * .95;
- dat->rgbBkgBottom.rgbBlue = (dat->rgbBkgTop.rgbBlue = GetBValue(cl)) * .95;
+ dat->rgbBkgBottom.rgbRed = (dat->rgbBkgTop.rgbRed = GetRValue(cl)) * .95;
+ dat->rgbBkgBottom.rgbGreen = (dat->rgbBkgTop.rgbGreen = GetGValue(cl)) * .95;
+ dat->rgbBkgBottom.rgbBlue = (dat->rgbBkgTop.rgbBlue = GetBValue(cl)) * .95;
cl = GetSysColor(COLOR_HIGHLIGHT);
- dat->rgbSelTop.rgbRed = (dat->rgbSelBottom.rgbRed = GetRValue(cl)) * .75;
- dat->rgbSelTop.rgbGreen = (dat->rgbSelBottom.rgbGreen = GetGValue(cl)) * .75;
- dat->rgbSelTop.rgbBlue = (dat->rgbSelBottom.rgbBlue = GetBValue(cl)) * .75;
+ dat->rgbSelTop.rgbRed = (dat->rgbSelBottom.rgbRed = GetRValue(cl)) * .75;
+ dat->rgbSelTop.rgbGreen = (dat->rgbSelBottom.rgbGreen = GetGValue(cl)) * .75;
+ dat->rgbSelTop.rgbBlue = (dat->rgbSelBottom.rgbBlue = GetBValue(cl)) * .75;
- dat->rgbHotTop.rgbRed = (dat->rgbSelTop.rgbRed + 255) / 2;
- dat->rgbHotTop.rgbGreen = (dat->rgbSelTop.rgbGreen + 255) / 2;
- dat->rgbHotTop.rgbBlue = (dat->rgbSelTop.rgbBlue + 255) / 2;
+ dat->rgbHotTop.rgbRed = (dat->rgbSelTop.rgbRed + 255) / 2;
+ dat->rgbHotTop.rgbGreen = (dat->rgbSelTop.rgbGreen + 255) / 2;
+ dat->rgbHotTop.rgbBlue = (dat->rgbSelTop.rgbBlue + 255) / 2;
- dat->rgbHotBottom.rgbRed = (dat->rgbSelBottom.rgbRed + 255) / 2;
- dat->rgbHotBottom.rgbGreen = (dat->rgbSelBottom.rgbGreen + 255) / 2;
- dat->rgbHotBottom.rgbBlue = (dat->rgbSelBottom.rgbBlue + 255) / 2;
+ dat->rgbHotBottom.rgbRed = (dat->rgbSelBottom.rgbRed + 255) / 2;
+ dat->rgbHotBottom.rgbGreen = (dat->rgbSelBottom.rgbGreen + 255) / 2;
+ dat->rgbHotBottom.rgbBlue = (dat->rgbSelBottom.rgbBlue + 255) / 2;
- dat->clBackground = GetSysColor(COLOR_3DFACE);
- dat->clText = GetSysColor(COLOR_WINDOWTEXT);
- dat->clSelText = GetSysColor(COLOR_HIGHLIGHTTEXT);
- dat->clSelBorder = RGB(dat->rgbSelTop.rgbRed, dat->rgbSelTop.rgbGreen, dat->rgbSelTop.rgbBlue);
- dat->clHotBorder = RGB(dat->rgbHotTop.rgbRed, dat->rgbHotTop.rgbGreen, dat->rgbHotTop.rgbBlue);
+ dat->clBackground = GetSysColor(COLOR_3DFACE);
+ dat->clText = GetSysColor(COLOR_WINDOWTEXT);
+ dat->clSelText = GetSysColor(COLOR_HIGHLIGHTTEXT);
+ dat->clSelBorder = RGB(dat->rgbSelTop.rgbRed, dat->rgbSelTop.rgbGreen, dat->rgbSelTop.rgbBlue);
+ dat->clHotBorder = RGB(dat->rgbHotTop.rgbRed, dat->rgbHotTop.rgbGreen, dat->rgbHotTop.rgbBlue);
if ( !dat->hFont) dat->hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
}
static void MDescButton_FillRect(HDC hdc, int x, int y, int width, int height, COLORREF cl)
{
- int oldMode = SetBkMode(hdc, OPAQUE);
- COLORREF oldColor = SetBkColor(hdc, cl);
+ int oldMode = SetBkMode(hdc, OPAQUE);
+ COLORREF oldColor = SetBkColor(hdc, cl);
RECT rc; SetRect(&rc, x, y, x+width, y+height);
ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, 0);
@@ -124,11 +124,11 @@ static void MDescButton_FillRect(HDC hdc, int x, int y, int width, int height, C
static void MDescButton_DrawGradient(HDC hdc, int x, int y, int width, int height, RGBQUAD *rgb0, RGBQUAD *rgb1)
{
- int oldMode = SetBkMode(hdc, OPAQUE);
- COLORREF oldColor = SetBkColor(hdc, 0);
+ int oldMode = SetBkMode(hdc, OPAQUE);
+ COLORREF oldColor = SetBkColor(hdc, 0);
RECT rc; SetRect(&rc, x, 0, x+width, 0);
- for (int i=y+height; --i >= y;) {
+ for (int i = y+height; --i >= y;) {
COLORREF color = RGB(
((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height,
((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height,
@@ -150,17 +150,17 @@ static LRESULT MDescButton_OnPaint(HWND hwndDlg, MDescButtonCtrl *dat, UINT msg
RECT temprc;
HFONT hfntSave;
- HDC hdc=BeginPaint(hwndDlg, &ps);
- HDC tempDC=CreateCompatibleDC(hdc);
+ HDC hdc = BeginPaint(hwndDlg, &ps);
+ HDC tempDC = CreateCompatibleDC(hdc);
SIZE titleSize = {0};
- hBmp=CreateCompatibleBitmap(hdc, dat->width, dat->height);
- hOldBmp=(HBITMAP)SelectObject(tempDC, hBmp);
+ hBmp = CreateCompatibleBitmap(hdc, dat->width, dat->height);
+ hOldBmp = (HBITMAP)SelectObject(tempDC, hBmp);
- temprc.left=0;
- temprc.right=dat->width;
- temprc.top=0;
+ temprc.left = 0;
+ temprc.right = dat->width;
+ temprc.top = 0;
//Draw background
if (dat->bMouseInside || (GetFocus() == hwndDlg)) {
@@ -223,7 +223,7 @@ static LRESULT MDescButton_OnPaint(HWND hwndDlg, MDescButtonCtrl *dat, UINT msg
static LRESULT CALLBACK MDescButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- MDescButtonCtrl *dat = (MDescButtonCtrl *)GetWindowLongPtr(hwndDlg, 0);
+ MDescButtonCtrl *dat = (MDescButtonCtrl *)GetWindowLongPtr(hwndDlg, 0);
switch(msg) {
case WM_NCCREATE:
dat = (MDescButtonCtrl*)mir_alloc(sizeof(MDescButtonCtrl));
@@ -241,8 +241,8 @@ static LRESULT CALLBACK MDescButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wPara
case WM_SIZE:
GetClientRect(hwndDlg, &dat->rc);
- dat->width=dat->rc.right-dat->rc.left;
- dat->height=dat->rc.bottom-dat->rc.top;
+ dat->width = dat->rc.right-dat->rc.left;
+ dat->height = dat->rc.bottom-dat->rc.top;
return TRUE;
case WM_THEMECHANGED:
diff --git a/src/modules/options/filter.cpp b/src/modules/options/filter.cpp
index 8b72f4e67d..4a332b2259 100644
--- a/src/modules/options/filter.cpp
+++ b/src/modules/options/filter.cpp
@@ -94,7 +94,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key)
if (lstrcmpi(szClass, _T("listbox")) == 0) {
if (GetWindowStyle(hWndDlg) & LBS_HASSTRINGS) {
int count = ListBox_GetCount(hWndDlg);
- for (int i = 0; i < count; i++) {
+ for (int i=0; i < count; i++) {
title[0] = 0; //safety
int res = ListBox_GetText(hWndDlg, i, title);
if (res != LB_ERR) {
@@ -106,7 +106,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key)
else {
if (lstrcmpi(szClass, _T("SysListView32")) == 0) {
int count = ListView_GetItemCount(hWndDlg);
- for (int i = 0; i < count; i++) {
+ for (int i=0; i < count; i++) {
title[0] = 0; //safety
ListView_GetItemText(hWndDlg, i, 0, title, SIZEOF(title));
@@ -117,7 +117,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key)
if (lstrcmpi(szClass, _T("combobox")) == 0) {
if (GetWindowStyle(hWndDlg) & CBS_HASSTRINGS) {
int count = ComboBox_GetCount(hWndDlg);
- for (int i = 0; i < count; i++) {
+ for (int i=0; i < count; i++) {
title[0] = 0; //safety
int res = ComboBox_GetLBText(hWndDlg, i, title);
if (res != CB_ERR) {
@@ -134,7 +134,7 @@ static BOOL CALLBACK GetDialogStringsCallback(HWND hWnd, LPARAM lParam)
return TRUE;
}
-void GetDialogStrings(int enableKeywordFiltering, const PageHash key, TCHAR *pluginName, HWND hWnd, TCHAR * group, TCHAR * title, TCHAR * tab, TCHAR * name)
+void GetDialogStrings(int enableKeywordFiltering, const PageHash key, TCHAR *pluginName, HWND hWnd, TCHAR *group, TCHAR *title, TCHAR *tab, TCHAR *name)
{
AddFilterString(key, pluginName); //add the plugin name as keyword
if (group) AddFilterString(key, group);
diff --git a/src/modules/options/filter.h b/src/modules/options/filter.h
index 6bf38d17d5..39c16698f2 100644
--- a/src/modules/options/filter.h
+++ b/src/modules/options/filter.h
@@ -34,9 +34,9 @@ typedef DWORD PageHash;
void AddFilterString(const PageHash key, const TCHAR *data);
BOOL ContainsFilterString(const PageHash key, TCHAR *data);
void ClearFilterStrings();
-void GetDialogStrings(int enableKeywordFiltering, const PageHash key, TCHAR *pluginName, HWND hWnd, TCHAR * group, TCHAR * title, TCHAR * tab, TCHAR * name);
+void GetDialogStrings(int enableKeywordFiltering, const PageHash key, TCHAR *pluginName, HWND hWnd, TCHAR *group, TCHAR *title, TCHAR *tab, TCHAR *name);
-_inline TCHAR * _tcslwr_locale(TCHAR * buf)
+_inline TCHAR *_tcslwr_locale(TCHAR *buf)
{
LCMapString(Langpack_GetDefaultLocale() , LCMAP_LOWERCASE, buf, (int)_tcslen(buf), buf, (int)_tcslen(buf));
return buf;
@@ -55,24 +55,24 @@ public:
{
for (int j = 0; j < _pageKeyWords.getCount(); j++)
{
- TCHAR * data = _pageKeyWords[j];
+ TCHAR *data = _pageKeyWords[j];
mir_free(data);
}
_pageKeyWords.destroy();
};
- void AddKeyWord(TCHAR * ptKeyWord)
+ void AddKeyWord(TCHAR *ptKeyWord)
{
- TCHAR * plwrWord = _tcslwr_locale(mir_tstrdup(ptKeyWord));
+ TCHAR *plwrWord = _tcslwr_locale(mir_tstrdup(ptKeyWord));
if (_pageKeyWords.getIndex(plwrWord) == -1)
_pageKeyWords.insert(plwrWord);
else
mir_free(plwrWord);
};
- BOOL ContainsString(TCHAR * data)
+ BOOL ContainsString(TCHAR *data)
{
- for (int i = 0; i < _pageKeyWords.getCount(); i++)
+ for (int i=0; i < _pageKeyWords.getCount(); i++)
if (_tcsstr(_pageKeyWords[i], data))
return TRUE;
return FALSE;
diff --git a/src/modules/options/headerbar.cpp b/src/modules/options/headerbar.cpp
index 44a729089d..ad06f75f98 100644
--- a/src/modules/options/headerbar.cpp
+++ b/src/modules/options/headerbar.cpp
@@ -81,13 +81,13 @@ int LoadHeaderbarModule()
WNDCLASSEX wc;
ZeroMemory(&wc, sizeof(wc));
- wc.cbSize = sizeof(wc);
- wc.lpszClassName = _T("MHeaderbarCtrl"); //MIRANDAHEADERBARCLASS;
- wc.lpfnWndProc = MHeaderbarWndProc;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.cbWndExtra = sizeof(MHeaderbarCtrl*);
- wc.hbrBackground = 0; //GetStockObject(WHITE_BRUSH);
- wc.style = CS_GLOBALCLASS|CS_SAVEBITS;
+ wc.cbSize = sizeof(wc);
+ wc.lpszClassName = _T("MHeaderbarCtrl"); //MIRANDAHEADERBARCLASS;
+ wc.lpfnWndProc = MHeaderbarWndProc;
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.cbWndExtra = sizeof(MHeaderbarCtrl*);
+ wc.hbrBackground = 0; //GetStockObject(WHITE_BRUSH);
+ wc.style = CS_GLOBALCLASS|CS_SAVEBITS;
RegisterClassEx(&wc);
return 0;
}
@@ -97,19 +97,19 @@ static void MHeaderbar_SetupColors(MHeaderbarCtrl *dat)
COLORREF cl;
cl = GetSysColor(COLOR_WINDOW);
- dat->rgbBkgBottom.rgbRed = (dat->rgbBkgTop.rgbRed = GetRValue(cl)) * .95;
- dat->rgbBkgBottom.rgbGreen = (dat->rgbBkgTop.rgbGreen = GetGValue(cl)) * .95;
- dat->rgbBkgBottom.rgbBlue = (dat->rgbBkgTop.rgbBlue = GetBValue(cl)) * .95;
+ dat->rgbBkgBottom.rgbRed = (dat->rgbBkgTop.rgbRed = GetRValue(cl)) * .95;
+ dat->rgbBkgBottom.rgbGreen = (dat->rgbBkgTop.rgbGreen = GetGValue(cl)) * .95;
+ dat->rgbBkgBottom.rgbBlue = (dat->rgbBkgTop.rgbBlue = GetBValue(cl)) * .95;
- dat->clText = GetSysColor(COLOR_WINDOWTEXT);
+ dat->clText = GetSysColor(COLOR_WINDOWTEXT);
if ( !dat->hFont) dat->hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
}
static void MHeaderbar_FillRect(HDC hdc, int x, int y, int width, int height, COLORREF cl)
{
- int oldMode = SetBkMode(hdc, OPAQUE);
- COLORREF oldColor = SetBkColor(hdc, cl);
+ int oldMode = SetBkMode(hdc, OPAQUE);
+ COLORREF oldColor = SetBkColor(hdc, cl);
RECT rc; SetRect(&rc, x, y, x+width, y+height);
ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, 0);
@@ -122,11 +122,11 @@ static void MHeaderbar_DrawGradient(HDC hdc, int x, int y, int width, int height
{
int i;
- int oldMode = SetBkMode(hdc, OPAQUE);
- COLORREF oldColor = SetBkColor(hdc, 0);
+ int oldMode = SetBkMode(hdc, OPAQUE);
+ COLORREF oldColor = SetBkColor(hdc, 0);
RECT rc; SetRect(&rc, x, 0, x+width, 0);
- for (i=y+height; --i >= y;)
+ for (i = y+height; --i >= y;)
{
COLORREF color = RGB(
((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height,
@@ -153,10 +153,10 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg,
GetWindowText(hwndDlg, szTitle, titleLength);
TCHAR *szSubTitle = _tcschr(szTitle, _T('\n'));
- if (szSubTitle) *szSubTitle++ = 0;
+ if (szSubTitle) *szSubTitle++=0;
- HDC hdc=BeginPaint(hwndDlg, &ps);
- HDC tempDC=CreateCompatibleDC(hdc);
+ HDC hdc = BeginPaint(hwndDlg, &ps);
+ HDC tempDC = CreateCompatibleDC(hdc);
BITMAPINFO bmi;
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
@@ -167,14 +167,14 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg,
bmi.bmiHeader.biCompression = BI_RGB;
hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
- hOldBmp=(HBITMAP)SelectObject(tempDC, hBmp);
+ hOldBmp = (HBITMAP)SelectObject(tempDC, hBmp);
if (IsAeroMode()) {
RECT temprc;
- temprc.left=0;
- temprc.right=mit->width;
- temprc.top=0;
- temprc.bottom=mit->width;
+ temprc.left = 0;
+ temprc.right = mit->width;
+ temprc.top = 0;
+ temprc.bottom = mit->width;
FillRect(tempDC, &temprc, (HBRUSH)GetStockObject(BLACK_BRUSH));
MARGINS margins = {0, 0, mit->height, 0};
@@ -213,10 +213,10 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg,
}
RECT textRect;
- textRect.left=50;
- textRect.right=mit->width;
- textRect.top=2 + iTopSpace;
- textRect.bottom=GetSystemMetrics(SM_CYICON)-2 + iTopSpace;
+ textRect.left = 50;
+ textRect.right = mit->width;
+ textRect.top = 2 + iTopSpace;
+ textRect.bottom = GetSystemMetrics(SM_CYICON)-2 + iTopSpace;
if (IsAeroMode()) {
DTTOPTS dto = {0};
@@ -225,7 +225,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg,
dto.iGlowSize = 10;
HANDLE hTheme = openThemeData(hwndDlg, L"Window");
- textRect.left=50;
+ textRect.left = 50;
SelectObject(tempDC, hFntBold);
wchar_t *szTitleW = mir_t2u(szTitle);
@@ -233,7 +233,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg,
mir_free(szTitleW);
if (szSubTitle) {
- textRect.left=66;
+ textRect.left = 66;
SelectObject(tempDC, hFont);
wchar_t *szSubTitleW = mir_t2u(szSubTitle);
@@ -243,12 +243,12 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg,
closeThemeData(hTheme);
}
else {
- textRect.left=50;
+ textRect.left = 50;
SelectObject(tempDC, hFntBold);
DrawText(tempDC, szTitle, -1, &textRect, DT_TOP|DT_LEFT|DT_SINGLELINE|DT_NOPREFIX|DT_NOCLIP|DT_END_ELLIPSIS);
if (szSubTitle) {
- textRect.left=66;
+ textRect.left = 66;
SelectObject(tempDC, hFont);
DrawText(tempDC, szSubTitle, -1, &textRect, DT_BOTTOM|DT_LEFT|DT_SINGLELINE|DT_NOPREFIX|DT_NOCLIP|DT_END_ELLIPSIS);
} }
@@ -261,13 +261,13 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg,
if (mit->nControlsToRedraw)
{
RECT temprc;
- temprc.left=0;
- temprc.right=mit->width;
- temprc.top=0;
- temprc.bottom=mit->width;
+ temprc.left = 0;
+ temprc.right = mit->width;
+ temprc.top = 0;
+ temprc.bottom = mit->width;
HRGN hRgn = CreateRectRgnIndirect(&temprc);
- for (int i = 0; i < mit->nControlsToRedraw; ++i)
+ for (int i=0; i < mit->nControlsToRedraw; ++i)
{
GetWindowRect(mit->controlsToRedraw[i], &temprc);
MapWindowPoints(NULL, hwndDlg, (LPPOINT)&temprc, 2);
@@ -294,7 +294,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg,
static LRESULT CALLBACK MHeaderbarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- MHeaderbarCtrl* itc = (MHeaderbarCtrl *)GetWindowLongPtr(hwndDlg, 0);
+ MHeaderbarCtrl* itc = (MHeaderbarCtrl *)GetWindowLongPtr(hwndDlg, 0);
switch(msg) {
case WM_NCCREATE:
itc = new MHeaderbarCtrl; //(MHeaderbarCtrl*)mir_alloc(sizeof(MHeaderbarCtrl));
@@ -333,8 +333,8 @@ static LRESULT CALLBACK MHeaderbarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam
case WM_SIZE:
GetClientRect(hwndDlg, &itc->rc);
- itc->width=itc->rc.right-itc->rc.left;
- itc->height=itc->rc.bottom-itc->rc.top;
+ itc->width = itc->rc.right-itc->rc.left;
+ itc->height = itc->rc.bottom-itc->rc.top;
return TRUE;
case WM_THEMECHANGED:
diff --git a/src/modules/options/iconheader.cpp b/src/modules/options/iconheader.cpp
index e3f27c8289..afaf893d04 100644
--- a/src/modules/options/iconheader.cpp
+++ b/src/modules/options/iconheader.cpp
@@ -91,7 +91,7 @@ typedef void (*ItemDestuctor)(void*);
static void MITListDestructor(void * adr)
{
- MIcoTab * mit=(MIcoTab *)adr;
+ MIcoTab * mit = (MIcoTab *)adr;
mir_free(mit->tcsName);
if (mit->hIcon && !(mit->flag&MITCF_SHAREDICON))
DestroyIcon(mit->hIcon);
@@ -109,14 +109,14 @@ int LoadIcoTabsModule()
WNDCLASSEX wc;
ZeroMemory(&wc, sizeof(wc));
- wc.cbSize = sizeof(wc);
- wc.lpszClassName = MIRANDAICOTABCLASS;
- wc.lpfnWndProc = MIcoTabWndProc;
-// wc.hCursor = LoadCursor(NULL, IDC_HAND);
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.cbWndExtra = sizeof(MIcoTabCtrl*);
- wc.hbrBackground = 0; //GetStockObject(WHITE_BRUSH);
- wc.style = CS_GLOBALCLASS/*|CS_SAVEBITS*/;
+ wc.cbSize = sizeof(wc);
+ wc.lpszClassName = MIRANDAICOTABCLASS;
+ wc.lpfnWndProc = MIcoTabWndProc;
+// wc.hCursor = LoadCursor(NULL, IDC_HAND);
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.cbWndExtra = sizeof(MIcoTabCtrl*);
+ wc.hbrBackground = 0; //GetStockObject(WHITE_BRUSH);
+ wc.style = CS_GLOBALCLASS/*|CS_SAVEBITS*/;
RegisterClassEx(&wc);
return 0;
}
@@ -126,35 +126,35 @@ static void MIcoTab_SetupColors(MIcoTabCtrl *dat)
COLORREF cl;
cl = GetSysColor(COLOR_WINDOW);
- dat->rgbBkgBottom.rgbRed = (dat->rgbBkgTop.rgbRed = GetRValue(cl)) * .95;
- dat->rgbBkgBottom.rgbGreen = (dat->rgbBkgTop.rgbGreen = GetGValue(cl)) * .95;
- dat->rgbBkgBottom.rgbBlue = (dat->rgbBkgTop.rgbBlue = GetBValue(cl)) * .95;
+ dat->rgbBkgBottom.rgbRed = (dat->rgbBkgTop.rgbRed = GetRValue(cl)) * .95;
+ dat->rgbBkgBottom.rgbGreen = (dat->rgbBkgTop.rgbGreen = GetGValue(cl)) * .95;
+ dat->rgbBkgBottom.rgbBlue = (dat->rgbBkgTop.rgbBlue = GetBValue(cl)) * .95;
cl = GetSysColor(COLOR_HIGHLIGHT);
- dat->rgbSelTop.rgbRed = (dat->rgbSelBottom.rgbRed = GetRValue(cl)) * .75;
- dat->rgbSelTop.rgbGreen = (dat->rgbSelBottom.rgbGreen = GetGValue(cl)) * .75;
- dat->rgbSelTop.rgbBlue = (dat->rgbSelBottom.rgbBlue = GetBValue(cl)) * .75;
+ dat->rgbSelTop.rgbRed = (dat->rgbSelBottom.rgbRed = GetRValue(cl)) * .75;
+ dat->rgbSelTop.rgbGreen = (dat->rgbSelBottom.rgbGreen = GetGValue(cl)) * .75;
+ dat->rgbSelTop.rgbBlue = (dat->rgbSelBottom.rgbBlue = GetBValue(cl)) * .75;
- dat->rgbHotTop.rgbRed = (dat->rgbSelTop.rgbRed + 255) / 2;
- dat->rgbHotTop.rgbGreen = (dat->rgbSelTop.rgbGreen + 255) / 2;
- dat->rgbHotTop.rgbBlue = (dat->rgbSelTop.rgbBlue + 255) / 2;
+ dat->rgbHotTop.rgbRed = (dat->rgbSelTop.rgbRed + 255) / 2;
+ dat->rgbHotTop.rgbGreen = (dat->rgbSelTop.rgbGreen + 255) / 2;
+ dat->rgbHotTop.rgbBlue = (dat->rgbSelTop.rgbBlue + 255) / 2;
- dat->rgbHotBottom.rgbRed = (dat->rgbSelBottom.rgbRed + 255) / 2;
- dat->rgbHotBottom.rgbGreen = (dat->rgbSelBottom.rgbGreen + 255) / 2;
- dat->rgbHotBottom.rgbBlue = (dat->rgbSelBottom.rgbBlue + 255) / 2;
+ dat->rgbHotBottom.rgbRed = (dat->rgbSelBottom.rgbRed + 255) / 2;
+ dat->rgbHotBottom.rgbGreen = (dat->rgbSelBottom.rgbGreen + 255) / 2;
+ dat->rgbHotBottom.rgbBlue = (dat->rgbSelBottom.rgbBlue + 255) / 2;
- dat->clText = GetSysColor(COLOR_WINDOWTEXT);
- dat->clSelText = GetSysColor(COLOR_HIGHLIGHTTEXT);
- dat->clSelBorder = RGB(dat->rgbSelTop.rgbRed, dat->rgbSelTop.rgbGreen, dat->rgbSelTop.rgbBlue);
- dat->clHotBorder = RGB(dat->rgbHotTop.rgbRed, dat->rgbHotTop.rgbGreen, dat->rgbHotTop.rgbBlue);
+ dat->clText = GetSysColor(COLOR_WINDOWTEXT);
+ dat->clSelText = GetSysColor(COLOR_HIGHLIGHTTEXT);
+ dat->clSelBorder = RGB(dat->rgbSelTop.rgbRed, dat->rgbSelTop.rgbGreen, dat->rgbSelTop.rgbBlue);
+ dat->clHotBorder = RGB(dat->rgbHotTop.rgbRed, dat->rgbHotTop.rgbGreen, dat->rgbHotTop.rgbBlue);
if ( !dat->hFont) dat->hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
}
static void MIcoTab_FillRect(HDC hdc, int x, int y, int width, int height, COLORREF cl)
{
- int oldMode = SetBkMode(hdc, OPAQUE);
- COLORREF oldColor = SetBkColor(hdc, cl);
+ int oldMode = SetBkMode(hdc, OPAQUE);
+ COLORREF oldColor = SetBkColor(hdc, cl);
RECT rc; SetRect(&rc, x, y, x+width, y+height);
ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rc, "", 0, 0);
@@ -165,11 +165,11 @@ static void MIcoTab_FillRect(HDC hdc, int x, int y, int width, int height, COLOR
static void MIcoTab_DrawGradient(HDC hdc, int x, int y, int width, int height, RGBQUAD *rgb0, RGBQUAD *rgb1)
{
- int oldMode = SetBkMode(hdc, OPAQUE);
- COLORREF oldColor = SetBkColor(hdc, 0);
+ int oldMode = SetBkMode(hdc, OPAQUE);
+ COLORREF oldColor = SetBkColor(hdc, 0);
RECT rc; SetRect(&rc, x, 0, x+width, 0);
- for (int i=y+height; --i >= y;) {
+ for (int i = y+height; --i >= y;) {
COLORREF color = RGB(
((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height,
((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height,
@@ -187,9 +187,9 @@ static void MIcoTab_DrawGradient(HDC hdc, int x, int y, int width, int height, R
static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab, int i)
{
int iTopSpace = IsAeroMode() ? 0 : ITC_BORDER_SIZE;
- int itemX = ITC_BORDER_SIZE + dat->itemWidth * i;
- int iconTop = iTopSpace + 5;
- int textTop = iconTop + 32 + 3;
+ int itemX = ITC_BORDER_SIZE + dat->itemWidth * i;
+ int iconTop = iTopSpace + 5;
+ int textTop = iconTop + 32 + 3;
HFONT hFntSave = NULL;
@@ -240,10 +240,10 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab,
else SetTextColor(hdc, dat->clText);
RECT textRect;
- textRect.left=itemX;
- textRect.right=itemX+dat->itemWidth;
- textRect.top=textTop;
- textRect.bottom=iconTop+dat->itemHeight;
+ textRect.left = itemX;
+ textRect.right = itemX+dat->itemWidth;
+ textRect.top = textTop;
+ textRect.bottom = iconTop+dat->itemHeight;
DrawIcon(hdc, itemX+dat->itemWidth/2-16, iconTop, tab->hIcon);
if (IsVSMode()) {
@@ -270,8 +270,8 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM
RECT temprc;
int i;
- HDC hdc=BeginPaint(hwndDlg, &ps);
- HDC tempDC=CreateCompatibleDC(hdc);
+ HDC hdc = BeginPaint(hwndDlg, &ps);
+ HDC tempDC = CreateCompatibleDC(hdc);
HFONT hFont = 0;
@@ -284,13 +284,13 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM
bmi.bmiHeader.biCompression = BI_RGB;
hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
- hOldBmp=(HBITMAP)SelectObject(tempDC, hBmp);
+ hOldBmp = (HBITMAP)SelectObject(tempDC, hBmp);
if (IsAeroMode()) {
- temprc.left=0;
- temprc.right=mit->width;
- temprc.top=0;
- temprc.bottom=mit->width;
+ temprc.left = 0;
+ temprc.right = mit->width;
+ temprc.top = 0;
+ temprc.bottom = mit->width;
FillRect(tempDC, &temprc, (HBRUSH)GetStockObject(BLACK_BRUSH));
}
else {
@@ -329,13 +329,13 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM
static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- MIcoTabCtrl* itc = (MIcoTabCtrl *)GetWindowLongPtr(hwndDlg, 0);
+ MIcoTabCtrl* itc = (MIcoTabCtrl *)GetWindowLongPtr(hwndDlg, 0);
switch(msg) {
case WM_NCCREATE:
itc = new MIcoTabCtrl; //(MIcoTabCtrl*)mir_alloc(sizeof(MIcoTabCtrl));
if (itc == NULL) return FALSE;
- itc->nSelectedIdx=-1;
- itc->nHotIdx=-1;
+ itc->nSelectedIdx = -1;
+ itc->nHotIdx = -1;
itc->bMouseInside = FALSE;
SetWindowLongPtr(hwndDlg, 0, (LONG_PTR)itc);
MIcoTab_SetupColors(itc);
@@ -354,12 +354,12 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_SIZE:
GetClientRect(hwndDlg, &itc->rc);
- itc->width=itc->rc.right-itc->rc.left;
- itc->height=itc->rc.bottom-itc->rc.top;
+ itc->width = itc->rc.right-itc->rc.left;
+ itc->height = itc->rc.bottom-itc->rc.top;
if (itc->pList.getCount()) {
- itc->itemWidth=(itc->width-2*ITC_BORDER_SIZE)/itc->pList.getCount();
- itc->itemHeight=itc->height-2*ITC_BORDER_SIZE-2;
+ itc->itemWidth = (itc->width-2*ITC_BORDER_SIZE)/itc->pList.getCount();
+ itc->itemHeight = itc->height-2*ITC_BORDER_SIZE-2;
}
else itc->itemWidth = itc->itemHeight = 0;
return TRUE;
@@ -473,41 +473,41 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
break;
case ITCM_SETBACKGROUND:
- itc->hBkgBmp=(HBITMAP)lParam;
+ itc->hBkgBmp = (HBITMAP)lParam;
if ( !itc->hBkgDC)
itc->hBkgDC = CreateCompatibleDC(NULL);
itc->hBkgOldBmp = (HBITMAP)SelectObject(itc->hBkgDC, itc->hBkgBmp);
{
BITMAPINFO bmp;
GetObject(itc->hBkgBmp, sizeof(bmp), &bmp);
- itc->BkgSize.cx=bmp.bmiHeader.biWidth;
- itc->BkgSize.cy=bmp.bmiHeader.biHeight;
+ itc->BkgSize.cx = bmp.bmiHeader.biWidth;
+ itc->BkgSize.cy = bmp.bmiHeader.biHeight;
}
return TRUE;
case ITCM_ADDITEM:
{
- MIcoTab* pMit=(MIcoTab *)wParam;
+ MIcoTab* pMit = (MIcoTab *)wParam;
if ( !pMit)
return FALSE;
- MIcoTab* pListMit=(MIcoTab *)mir_calloc(sizeof(MIcoTab));
- pListMit->flag=pMit->flag;
- pListMit->data=pMit->data;
+ MIcoTab* pListMit = (MIcoTab *)mir_calloc(sizeof(MIcoTab));
+ pListMit->flag = pMit->flag;
+ pListMit->data = pMit->data;
if (pMit->flag & MITCF_UNICODE)
- pListMit->tcsName=mir_u2t(pMit->lpwzName);
+ pListMit->tcsName = mir_u2t(pMit->lpwzName);
else
- pListMit->tcsName=mir_a2t(pMit->lpzName);
+ pListMit->tcsName = mir_a2t(pMit->lpzName);
if (pMit->hIcon) {
if (pListMit->flag&MITCF_SHAREDICON)
- pListMit->hIcon=pMit->hIcon;
+ pListMit->hIcon = pMit->hIcon;
else
- pListMit->hIcon=CopyIcon(pMit->hIcon);
+ pListMit->hIcon = CopyIcon(pMit->hIcon);
}
itc->pList.insert(pListMit);
- itc->itemWidth=(itc->width-2*ITC_BORDER_SIZE)/itc->pList.getCount();
- itc->itemHeight=itc->height-2*ITC_BORDER_SIZE-2;
+ itc->itemWidth = (itc->width-2*ITC_BORDER_SIZE)/itc->pList.getCount();
+ itc->itemHeight = itc->height-2*ITC_BORDER_SIZE-2;
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE);
return TRUE;
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp
index e049105253..4a4f79688b 100644
--- a/src/modules/options/options.cpp
+++ b/src/modules/options/options.cpp
@@ -254,7 +254,7 @@ static void FindFilterStrings(int enableKeywordFiltering, int current, HWND hWnd
DWORD key = GetPluginPageHash(page); //get the plugin page hash
- TCHAR * PluginFullName = NULL;
+ TCHAR *PluginFullName = NULL;
char * temp = GetPluginNameByInstance(page->hInst);
if (temp) PluginFullName = mir_a2t(temp);
GetDialogStrings(enableKeywordFiltering, key, GetPluginName(page->hInst, pluginName, SIZEOF(pluginName)), hWnd, page->ptszGroup, page->ptszTitle, page->ptszTab, PluginFullName);
@@ -309,10 +309,10 @@ static LRESULT CALLBACK OptionsFilterSubclassProc(HWND hWnd, UINT message, WPARA
RECT rc2;
getThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &rc, &rc2);
- rc2.top = 2 * rc.top - rc2.top;
- rc2.left = 2 * rc.left - rc2.left;
+ rc2.top = 2 * rc.top - rc2.top;
+ rc2.left = 2 * rc.left - rc2.left;
rc2.bottom = 2 * rc.bottom - rc2.bottom;
- rc2.right = 2 * rc.right - rc2.right;
+ rc2.right = 2 * rc.right - rc2.right;
drawThemeBackground(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &rc2, &rc);
HFONT hFont = (HFONT) SendMessage(hWnd, WM_GETFONT, 0, 0);
@@ -365,7 +365,7 @@ static BOOL IsAeroMode()
static void FreeOptionsData(OptionsPageInit* popi)
{
- for (int i = 0; i < popi->pageCount; i++) {
+ for (int i=0; i < popi->pageCount; i++) {
mir_free((char*)popi->odp[i].pszTitle);
mir_free(popi->odp[i].pszGroup);
mir_free(popi->odp[i].pszTab);
@@ -412,7 +412,7 @@ static void AeroPaintControl(HWND hwnd, HDC hdc, WNDPROC OldWndProc, UINT msg =
// Fix alpha channel
GdiFlush();
- for (int i = 0; i < rc.right*rc.bottom; ++i, pBits += 4)
+ for (int i=0; i < rc.right*rc.bottom; ++i, pBits += 4)
if ( !pBits[3]) pBits[3] = 255;
//Copy to output
@@ -499,8 +499,8 @@ static void FillFilterCombo(int enableKeywordFiltering, HWND hDlg, OptionsDlgDat
index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT) CB_ADDSTRING, (WPARAM)0, (LPARAM)TranslateTS(CORE_MODULES_FILTER));
SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT) CB_SETITEMDATA, (WPARAM)index, (LPARAM)hInst);
TCHAR* tszModuleName = (TCHAR*)alloca(MAX_PATH*sizeof(TCHAR));
- for (int i = 0; i < dat->arOpd.getCount(); i++) {
- TCHAR * dllName = NULL;
+ for (int i=0; i < dat->arOpd.getCount(); i++) {
+ TCHAR *dllName = NULL;
int j;
HINSTANCE inst = dat->arOpd[i]->hInst;
@@ -736,7 +736,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
else lastTab = Langpack_PcharToTchar(ood->pszTab);
OPTIONSDIALOGPAGE *odp = (OPTIONSDIALOGPAGE*)psh->ppsp;
- for (size_t i = 0; i < psh->nPages; i++, odp++) {
+ for (size_t i=0; i < psh->nPages; i++, odp++) {
OptionsPageData* opd = (OptionsPageData*)mir_calloc(sizeof(OptionsPageData));
if ( !LoadOptionsPage(odp, opd)) {
mir_free(opd);
@@ -832,7 +832,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
tvis.hInsertAfter = TVI_SORT;
tvis.item.mask = TVIF_TEXT | TVIF_STATE | TVIF_PARAM;
tvis.item.state = tvis.item.stateMask = TVIS_EXPANDED;
- for (int i = 0; i < dat->arOpd.getCount(); i++) {
+ for (int i=0; i < dat->arOpd.getCount(); i++) {
static TCHAR *fullTitle = NULL;
mir_free(fullTitle); fullTitle = NULL;
if ( !CheckPageShow(hdlg, dat, i))
@@ -841,7 +841,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
OptionsPageData* opd = dat->arOpd[i];
TCHAR* ptszGroup = TranslateTH(opd->hLangpack, opd->ptszGroup);
TCHAR* ptszTitle = TranslateTH(opd->hLangpack, opd->ptszTitle);
- TCHAR* ptszTab = TranslateTH(opd->hLangpack, opd->ptszTab);
+ TCHAR* ptszTab = TranslateTH(opd->hLangpack, opd->ptszTab);
tvis.hParent = NULL;
if (FilterInst != NULL) {
@@ -1051,7 +1051,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
h = p->expertHeight;
}
else {
- for (int i = 0; i < p->nExpertOnlyControls; i++)
+ for (int i=0; i < p->nExpertOnlyControls; i++)
ShowWindow(GetDlgItem(p->hwnd, p->expertOnlyControls[i]), SW_HIDE);
w = p->simpleWidth;
h = p->simpleHeight;
@@ -1081,7 +1081,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
TCITEM tie;
tie.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
tie.iImage = -1;
- for (int i = 0; i < dat->arOpd.getCount(); i++) {
+ for (int i=0; i < dat->arOpd.getCount(); i++) {
if ( !CheckPageShow(hdlg, dat, i))
continue;
@@ -1124,13 +1124,13 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
parentPageRect = &dat->rcTab;
pageHeight = min(pageHeight, parentPageRect->bottom - parentPageRect->top);
- pageWidth = min(pageWidth, parentPageRect->right - parentPageRect->left);
+ pageWidth = min(pageWidth, parentPageRect->right - parentPageRect->left);
int newOffsetX = (parentPageRect->right - parentPageRect->left - pageWidth) >> 1;
int newOffsetY = p->insideTab ? 0 : (parentPageRect->bottom - parentPageRect->top - pageHeight) >> 1;
struct MoveChildParam mcp;
- mcp.hDlg = p->hwnd;
+ mcp.hDlg = p->hwnd;
mcp.offset.x = newOffsetX - p->offsetX;
mcp.offset.y = newOffsetY - p->offsetY;
@@ -1194,7 +1194,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
pshn.lParam = expert;
pshn.hdr.code = PSN_EXPERTCHANGED;
- for (int i = 0; i <dat->arOpd.getCount(); i++) {
+ for (int i=0; i <dat->arOpd.getCount(); i++) {
OptionsPageData *opd = dat->arOpd[i];
if (opd->hwnd == NULL) continue;
if ( !CheckPageShow(hdlg, dat, i)) continue;
@@ -1273,7 +1273,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
pshn.hdr.idFrom = 0;
pshn.lParam = 0;
pshn.hdr.code = PSN_RESET;
- for (int i = 0;i<dat->arOpd.getCount();i++) {
+ for (int i=0;i<dat->arOpd.getCount();i++) {
if (dat->arOpd[i]->hwnd == NULL || !dat->arOpd[i]->changed)
continue;
pshn.hdr.hwndFrom = dat->arOpd[i]->hwnd;
@@ -1302,7 +1302,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
}
pshn.hdr.code = PSN_APPLY;
- for (int i = 0;i<dat->arOpd.getCount();i++) {
+ for (int i=0;i<dat->arOpd.getCount();i++) {
if (dat->arOpd[i]->hwnd == NULL || !dat->arOpd[i]->changed) continue;
dat->arOpd[i]->changed = 0;
pshn.hdr.hwndFrom = dat->arOpd[i]->hwnd;
@@ -1351,7 +1351,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
}
Utils_SaveWindowPosition(hdlg, NULL, "Options", "");
{
- for (int i = 0; i < dat->arOpd.getCount(); i++)
+ for (int i=0; i < dat->arOpd.getCount(); i++)
FreeOptionsPageData(dat->arOpd[i]);
}
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index 237d2140b3..a07f371e42 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -37,7 +37,7 @@ struct PluginUUIDList {
MUUID uuid;
DWORD maxVersion;
}
-static const pluginBannedList[] =
+static const pluginBannedList[] =
{
{{0x7f65393b, 0x7771, 0x4f3f, { 0xa9, 0xeb, 0x5d, 0xba, 0xf2, 0xb3, 0x61, 0xf1 }}, MAX_MIR_VER}, // png2dib
{{0xe00f1643, 0x263c, 0x4599, { 0xb8, 0x4b, 0x05, 0x3e, 0x5c, 0x51, 0x1d, 0x28 }}, MAX_MIR_VER}, // loadavatars (unicode)
@@ -46,22 +46,22 @@ static const pluginBannedList[] =
MuuidReplacement pluginDefault[] =
{
- { MIID_UIUSERINFO, NULL }, // 0
- { MIID_SRURL, NULL }, // 1
- { MIID_SREMAIL, NULL }, // 2
- { MIID_SRAUTH, NULL }, // 3
- { MIID_SRFILE, NULL }, // 4
- { MIID_UIHELP, NULL }, // 5
- { MIID_UIHISTORY, NULL }, // 6
- { MIID_IDLE, NULL }, // 7
- { MIID_AUTOAWAY, NULL }, // 8
- { MIID_USERONLINE, NULL }, // 9
- { MIID_UPDATENOTIFY, NULL }, // 10
-
- { MIID_CLIST, NULL }, // 11
- { MIID_CHAT, NULL }, // 12
- { MIID_SRMM, NULL }, // 13
- { MIID_DATABASE, NULL }, // 14
+ { MIID_UIUSERINFO, _T("stduserinfo"), NULL }, // 0
+ { MIID_SRURL, _T("stdurl"), NULL }, // 1
+ { MIID_SREMAIL, _T("stdemail"), NULL }, // 2
+ { MIID_SRAUTH, _T("stdauth"), NULL }, // 3
+ { MIID_SRFILE, _T("stdfile"), NULL }, // 4
+ { MIID_UIHELP, _T("stdhelp"), NULL }, // 5
+ { MIID_UIHISTORY, _T("stduihist"), NULL }, // 6
+ { MIID_IDLE, _T("stdidle"), NULL }, // 7
+ { MIID_AUTOAWAY, _T("stdautoaway"), NULL }, // 8
+ { MIID_USERONLINE, _T("stduseronline"), NULL }, // 9
+ { MIID_UPDATENOTIFY, _T("stdupdate"), NULL }, // 10
+
+ { MIID_CLIST, NULL, NULL }, // 11
+ { MIID_CHAT, NULL, NULL }, // 12
+ { MIID_SRMM, NULL, NULL }, // 13
+ { MIID_DATABASE, NULL, NULL }, // 14
};
static BOOL bModuleInitialized = FALSE;
@@ -86,7 +86,7 @@ char* GetPluginNameByInstance(HINSTANCE hInstance)
if (pluginList.getCount() == 0)
return NULL;
- for (int i = 0; i < pluginList.getCount(); i++) {
+ for (int i=0; i < pluginList.getCount(); i++) {
pluginEntry* pe = pluginList[i];
if (pe->bpi.pluginInfo && pe->bpi.hInst == hInstance)
return pe->bpi.pluginInfo->shortName;
@@ -164,14 +164,14 @@ static int isPluginBanned(MUUID u1, DWORD dwVersion)
* storage
*/
-static const TCHAR* modulesToSkip[] =
+static const TCHAR* modulesToSkip[] =
{
_T("autoloadavatars.dll"), _T("multiwindow.dll"), _T("fontservice.dll"),
_T("icolib.dll"), _T("historyeditor.dll")
};
// The following plugins will be checked for a valid MUUID or they will not be loaded
-static const TCHAR* expiredModulesToSkip[] =
+static const TCHAR* expiredModulesToSkip[] =
{
_T("scriver.dll"), _T("nconvers.dll"), _T("tabsrmm.dll"), _T("nhistory.dll"),
_T("historypp.dll"), _T("help.dll"), _T("loadavatars.dll"), _T("tabsrmm_unicode.dll"),
@@ -207,7 +207,7 @@ int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion, int ch
// fontservice plugin is built into the core now
TCHAR* p = _tcsrchr(plugin, '\\');
if (p != NULL && ++p) {
- for (int i = 0; i < SIZEOF(modulesToSkip); i++)
+ for (int i=0; i < SIZEOF(modulesToSkip); i++)
if (lstrcmpi(p, modulesToSkip[i]) == 0)
return 0;
}
@@ -294,6 +294,11 @@ void Plugin_Uninit(pluginEntry* p, bool bDynamic)
KillModuleHotkeys(hLangpack);
KillModuleSounds(hLangpack);
}
+
+ // release default plugin
+ for (int i=0; i < SIZEOF(pluginDefault); i++)
+ if (pluginDefault[i].pImpl == p)
+ pluginDefault[i].pImpl = NULL;
}
FreeLibrary(p->bpi.hInst);
@@ -303,10 +308,24 @@ void Plugin_Uninit(pluginEntry* p, bool bDynamic)
pluginList.remove(p);
}
+int Plugin_UnloadDyn(pluginEntry* p)
+{
+ if (CallPluginEventHook(p->bpi.hInst, hOkToExitEvent, 0, 0) != 0)
+ return FALSE;
+
+ NotifyEventHooks(hevUnloadModule, (WPARAM)p->bpi.InfoEx, (LPARAM)p->bpi.hInst);
+
+ CallPluginEventHook(p->bpi.hInst, hPreShutdownEvent, 0, 0);
+ CallPluginEventHook(p->bpi.hInst, hShutdownEvent, 0, 0);
+
+ Plugin_Uninit(p, true);
+ return TRUE;
+}
+
// returns true if the given file is <anything>.dll exactly
static int valid_library_name(TCHAR *name)
{
- TCHAR * dot = _tcsrchr(name, '.');
+ TCHAR *dot = _tcsrchr(name, '.');
if (dot != NULL && lstrcmpi(dot + 1, _T("dll")) == 0)
if (dot[4] == 0)
return 1;
@@ -315,21 +334,21 @@ static int valid_library_name(TCHAR *name)
}
// returns true if the given file matches dbx_*.dll, which is used to LoadLibrary()
-static int validguess_db_name(TCHAR * name)
+static int validguess_db_name(TCHAR *name)
{
int rc = 0;
// this is ONLY SAFE because name -> ffd.cFileName == MAX_PATH
TCHAR x = name[4];
- name[4]=0;
+ name[4] = 0;
rc = lstrcmpi(name, _T("dbx_")) == 0 || lstrcmpi(name, _T("dbrw")) == 0;
name[4] = x;
return rc;
}
// returns true if the given file matches clist_*.dll
-static int validguess_clist_name(TCHAR * name)
+static int validguess_clist_name(TCHAR *name)
{
- int rc=0;
+ int rc = 0;
// argh evil
TCHAR x = name[6];
name[6] = 0;
@@ -339,12 +358,12 @@ static int validguess_clist_name(TCHAR * name)
}
// returns true if the given file matches svc_*.dll
-static int validguess_servicemode_name(TCHAR * name)
+static int validguess_servicemode_name(TCHAR *name)
{
int rc = 0;
// argh evil
TCHAR x = name[4];
- name[4]=0;
+ name[4] = 0;
rc = lstrcmpi(name, _T("svc_")) == 0;
name[4] = x;
return rc;
@@ -401,15 +420,17 @@ static INT_PTR PluginsEnum(WPARAM, LPARAM lParam)
return pluginListDb != NULL ? 1 : -1;
}
-pluginEntry* OpenPlugin(TCHAR* tszFileName, TCHAR* path)
+pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path)
{
BASIC_PLUGIN_INFO bpi;
pluginEntry* p = (pluginEntry*)HeapAlloc(hPluginListHeap, HEAP_NO_SERIALIZE | HEAP_ZERO_MEMORY, sizeof(pluginEntry));
_tcsncpy(p->pluginname, tszFileName, SIZEOF(p->pluginname));
+
+ TCHAR buf[MAX_PATH];
+ mir_sntprintf(buf, SIZEOF(buf), _T("%s\\%s\\%s"), path, dir, tszFileName);
+
// plugin name suggests its a db module, load it right now
if ( validguess_db_name(tszFileName)) {
- TCHAR buf[MAX_PATH];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s\\Plugins\\%s"), path, tszFileName);
if (checkAPI(buf, &bpi, mirandaVersion, CHECKAPI_DB)) {
// db plugin is valid
p->pclass |= (PCLASS_DB | PCLASS_BASICAPI);
@@ -425,13 +446,11 @@ pluginEntry* OpenPlugin(TCHAR* tszFileName, TCHAR* path)
}
else if ( validguess_clist_name(tszFileName)) {
// keep a note of this plugin for later
- if (pluginListUI != NULL) p->nextclass=pluginListUI;
- pluginListUI=p;
+ if (pluginListUI != NULL) p->nextclass = pluginListUI;
+ pluginListUI = p;
p->pclass |= PCLASS_CLIST;
}
else if ( validguess_servicemode_name(tszFileName)) {
- TCHAR buf[MAX_PATH];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s\\Plugins\\%s"), path, tszFileName);
if (checkAPI(buf, &bpi, mirandaVersion, CHECKAPI_NONE)) {
p->pclass |= (PCLASS_OK | PCLASS_BASICAPI);
p->bpi = bpi;
@@ -455,7 +474,7 @@ pluginEntry* OpenPlugin(TCHAR* tszFileName, TCHAR* path)
// called in the first pass to create pluginEntry* structures and validate database plugins
static BOOL scanPluginsDir(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM)
{
- pluginEntry* p = OpenPlugin(fd->cFileName, path);
+ pluginEntry* p = OpenPlugin(fd->cFileName, _T("Plugins"), path);
if ( !(p->pclass & PCLASS_FAILED)) {
if (pluginList_freeimg == NULL && lstrcmpi(fd->cFileName, _T("advaimg.dll")) == 0)
pluginList_freeimg = p;
@@ -492,7 +511,7 @@ int isPluginOnWhiteList(const TCHAR* pluginname)
return rc == 0;
}
-bool TryLoadPlugin(pluginEntry *p, bool bDynamic)
+bool TryLoadPlugin(pluginEntry *p, TCHAR* dir, bool bDynamic)
{
TCHAR exe[MAX_PATH];
GetModuleFileName(NULL, exe, SIZEOF(exe));
@@ -505,7 +524,7 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic)
return false;
BASIC_PLUGIN_INFO bpi;
- mir_sntprintf(slice, &exe[SIZEOF(exe)] - slice, _T("\\Plugins\\%s"), p->pluginname);
+ mir_sntprintf(slice, &exe[SIZEOF(exe)] - slice, _T("\\%s\\%s"), dir, p->pluginname);
if ( !checkAPI(exe, &bpi, mirandaVersion, CHECKAPI_NONE))
p->pclass |= PCLASS_FAILED;
else {
@@ -517,8 +536,12 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic)
for (int i=0; !equalUUID(miid_last, piface[i]); i++) {
int idx = getDefaultPluginIdx( piface[i] );
if (idx != -1 && pluginDefault[idx].pImpl) {
- SetPluginOnWhiteList(p->pluginname, 0);
- return false;
+ if ( !bDynamic) {
+ SetPluginOnWhiteList(p->pluginname, 0);
+ return false;
+ }
+ Plugin_UnloadDyn(pluginDefault[idx].pImpl);
+ pluginDefault[idx].pImpl = NULL;
}
}
}
@@ -545,7 +568,32 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic)
return true;
}
-static pluginEntry* getCListModule(TCHAR * exe, TCHAR * slice, int useWhiteList)
+bool LoadCorePlugin(MuuidReplacement& mr)
+{
+ TCHAR exe[MAX_PATH], tszPlugName[MAX_PATH];
+ GetModuleFileName(NULL, exe, SIZEOF(exe));
+ TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0;
+
+ mir_sntprintf(tszPlugName, SIZEOF(tszPlugName), _T("%s.dll"), mr.stdplugname);
+ pluginEntry* pPlug = OpenPlugin(tszPlugName, _T("Core"), exe);
+ if (pPlug->pclass & PCLASS_FAILED) {
+LBL_Error:
+ Plugin_Uninit(pPlug, true);
+ return FALSE;
+ }
+
+ if ( !TryLoadPlugin(pPlug, _T("Core"), true))
+ goto LBL_Error;
+
+ if (CallPluginEventHook(pPlug->bpi.hInst, hModulesLoadedEvent, 0, 0) != 0)
+ goto LBL_Error;
+
+ mr.pImpl = pPlug;
+ NotifyEventHooks(hevLoadModule, (WPARAM)pPlug->bpi.InfoEx, (LPARAM)pPlug->bpi.hInst);
+ return TRUE;
+}
+
+static pluginEntry* getCListModule(TCHAR *exe, TCHAR *slice, int useWhiteList)
{
for (pluginEntry *p = pluginListUI; p != NULL; p = p->nextclass) {
mir_sntprintf(slice, &exe[MAX_PATH] - slice, _T("\\Plugins\\%s"), p->pluginname);
@@ -589,7 +637,7 @@ int UnloadPlugin(TCHAR* buf, int bufLen)
char **GetServiceModePluginsList(void)
{
- int i = 0;
+ int i=0;
char **list = NULL;
pluginEntry * p = pluginListSM;
while (p != NULL) {
@@ -599,7 +647,7 @@ char **GetServiceModePluginsList(void)
if (i) {
list = (char**)mir_calloc((i + 1) * sizeof(char*));
p = pluginListSM;
- i = 0;
+ i=0;
while (p != NULL) {
list[i++] = p->bpi.pluginInfo->shortName;
p = p->nextclass;
@@ -615,7 +663,7 @@ void SetServiceModePlugin(int idx)
int LoadServiceModePlugin(void)
{
- int i = 0;
+ int i=0;
pluginEntry* p = pluginListSM;
if (serviceModeIdx < 0)
@@ -671,7 +719,7 @@ int LoadNewPluginsModule(void)
if (slice) *slice = 0;
// remember some useful options
- askAboutIgnoredPlugins=(UINT) GetPrivateProfileInt(_T("PluginLoader"), _T("AskAboutIgnoredPlugins"), 0, mirandabootini);
+ askAboutIgnoredPlugins = (UINT) GetPrivateProfileInt(_T("PluginLoader"), _T("AskAboutIgnoredPlugins"), 0, mirandabootini);
// if Crash Dumper is present, load it to provide Crash Reports
if (pluginList_crshdmp != NULL && isPluginOnWhiteList(pluginList_crshdmp->pluginname))
@@ -718,7 +766,7 @@ int LoadNewPluginsModule(void)
for (i=0; i < pluginList.getCount(); i++) {
p = pluginList[i];
- if ( !TryLoadPlugin(p, false)) {
+ if ( !TryLoadPlugin(p, _T("Plugins"), false)) {
Plugin_Uninit(p);
i--;
}
@@ -788,7 +836,7 @@ void UnloadNewPluginsModule(void)
}
if (hPluginListHeap) HeapDestroy(hPluginListHeap);
- hPluginListHeap=0;
+ hPluginListHeap = 0;
pluginList.destroy();
UninitIni();
diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp
index 69034567f3..b8384ae593 100644
--- a/src/modules/plugins/pluginopts.cpp
+++ b/src/modules/plugins/pluginopts.cpp
@@ -29,8 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define IS_DATABASE (1 << 14)
extern MUUID miid_clist, miid_database;
-extern HANDLE hShutdownEvent, hPreShutdownEvent;
-static HANDLE hevLoadModule, hevUnloadModule;
+HANDLE hevLoadModule, hevUnloadModule;
/////////////////////////////////////////////////////////////////////////////////////////
// Plugins options page dialog
@@ -165,14 +164,14 @@ static int LoadPluginDynamically(PluginListItemData* dat)
GetModuleFileName(NULL, exe, SIZEOF(exe));
TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0;
- pluginEntry* pPlug = OpenPlugin(dat->fileName, exe);
+ pluginEntry* pPlug = OpenPlugin(dat->fileName, _T("Plugins"), exe);
if (pPlug->pclass & PCLASS_FAILED) {
LBL_Error:
Plugin_Uninit(pPlug, true);
return FALSE;
}
- if ( !TryLoadPlugin(pPlug, true))
+ if ( !TryLoadPlugin(pPlug, _T("Plugins"), true))
goto LBL_Error;
if (CallPluginEventHook(pPlug->bpi.hInst, hModulesLoadedEvent, 0, 0) != 0)
@@ -192,17 +191,8 @@ static int UnloadPluginDynamically(PluginListItemData* dat)
if (idx == -1)
return FALSE;
- pluginEntry* pPlug = pluginList[idx];
- if (CallPluginEventHook(pPlug->bpi.hInst, hOkToExitEvent, 0, 0) != 0)
- return FALSE;
-
- NotifyEventHooks(hevUnloadModule, (WPARAM)pPlug->bpi.InfoEx, (LPARAM)pPlug->bpi.hInst);
-
- CallPluginEventHook(pPlug->bpi.hInst, hPreShutdownEvent, 0, 0);
- CallPluginEventHook(pPlug->bpi.hInst, hShutdownEvent, 0, 0);
-
- dat->hInst = NULL;
- Plugin_Uninit(pPlug, true);
+ if ( Plugin_UnloadDyn(pluginList[idx]))
+ dat->hInst = NULL;
return TRUE;
}
@@ -319,7 +309,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
}
// if enabling and replaces, find all other replaces and toggle off
if ((hdr->uNewState & 0x2000) && dat->flags != 0) {
- for (int iRow=0; iRow != -1;) {
+ for (int iRow = 0; iRow != -1;) {
if (iRow != hdr->iItem) {
LVITEM dt;
dt.mask = LVIF_PARAM;
@@ -375,7 +365,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
if (hdr->hdr.code == PSN_APPLY) {
HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST);
TCHAR buf[1024];
- for (int iRow=0; iRow != -1;) {
+ for (int iRow = 0; iRow != -1;) {
ListView_GetItemText(hwndList, iRow, 2, buf, SIZEOF(buf));
int iState = ListView_GetItemState(hwndList, iRow, LVIS_STATEIMAGEMASK);
SetPluginOnWhiteList(buf, (iState & 0x2000) ? 1 : 0);
@@ -397,7 +387,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
break;
}
case IDC_GETMOREPLUGINS:
- CallService(MS_UTILS_OPENURL, 0, (LPARAM) "http://addons.miranda-im.org/index.php?action=display&id=1");
+ CallService(MS_UTILS_OPENURL, 0, (LPARAM) "http://addons.miranda-im.org/index.php?action = display&id = 1");
break;
} }
break;
diff --git a/src/modules/plugins/plugins.h b/src/modules/plugins/plugins.h
index 7a3a082f3e..85922fcae8 100644
--- a/src/modules/plugins/plugins.h
+++ b/src/modules/plugins/plugins.h
@@ -30,7 +30,7 @@ struct BASIC_PLUGIN_INFO
Miranda_Plugin_Interfaces Interfaces;
Database_Plugin_Info DbInfo;
CList_Initialise clistlink;
- PLUGININFOEX * pluginInfo; // must be freed if hInst == NULL then its a copy
+ PLUGININFOEX * pluginInfo; // must be freed if hInst = = NULL then its a copy
DATABASELINK * dblink; // only valid during module being in memory
};
@@ -66,17 +66,23 @@ int getDefaultPluginIdx(const MUUID& muuid);
bool hasMuuid(const BASIC_PLUGIN_INFO&, const MUUID&);
int equalUUID(const MUUID& u1, const MUUID& u2);
int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion, int checkTypeAPI);
-pluginEntry* OpenPlugin(TCHAR* tszFileName, TCHAR* path);
-bool TryLoadPlugin(pluginEntry *p, bool bDynamic);
-void Plugin_Uninit(pluginEntry* p, bool bDynamic=false);
-typedef BOOL (*SCAN_PLUGINS_CALLBACK) (WIN32_FIND_DATA * fd, TCHAR * path, WPARAM wParam, LPARAM lParam);
+pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path);
+
+bool TryLoadPlugin(pluginEntry *p, TCHAR *dir, bool bDynamic);
+void Plugin_Uninit(pluginEntry* p, bool bDynamic = false);
+int Plugin_UnloadDyn(pluginEntry* p);
+
+typedef BOOL (*SCAN_PLUGINS_CALLBACK) (WIN32_FIND_DATA * fd, TCHAR *path, WPARAM wParam, LPARAM lParam);
void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam);
struct MuuidReplacement
{
MUUID uuid; // default interface plugin
+ TCHAR* stdplugname;
pluginEntry* pImpl; // replacement plugin
};
extern MuuidReplacement pluginDefault[];
+
+bool LoadCorePlugin( MuuidReplacement& );
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index 4846d84b87..3fd5aeee6b 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -225,7 +225,7 @@ static int InitializeStaticAccounts(WPARAM, LPARAM)
{
int count = 0;
- for (int i = 0; i < accounts.getCount(); i++) {
+ for (int i=0; i < accounts.getCount(); i++) {
PROTOACCOUNT* pa = accounts[i];
if ( !pa->ppro || !Proto_IsAccountEnabled(pa))
continue;
@@ -247,7 +247,7 @@ static int InitializeStaticAccounts(WPARAM, LPARAM)
static int UninitializeStaticAccounts(WPARAM, LPARAM)
{
- for (int i = 0; i < accounts.getCount(); i++) {
+ for (int i=0; i < accounts.getCount(); i++) {
PROTOACCOUNT* pa = accounts[i];
if ( !pa->ppro || !Proto_IsAccountEnabled(pa))
continue;
@@ -264,7 +264,7 @@ int LoadAccountsModule(void)
bModuleInitialized = TRUE;
- for (i = 0; i < accounts.getCount(); i++) {
+ for (i=0; i < accounts.getCount(); i++) {
PROTOACCOUNT* pa = accounts[i];
pa->bDynDisabled = !Proto_IsProtocolLoaded(pa->szProtoName);
if (pa->ppro)
@@ -604,7 +604,7 @@ void UnloadAccountsModule()
if ( !bModuleInitialized) return;
- for (i=accounts.getCount()-1; i >= 0; i--) {
+ for (i = accounts.getCount()-1; i >= 0; i--) {
PROTOACCOUNT* pa = accounts[ i ];
UnloadAccount(pa, false, false);
accounts.remove(i);
@@ -617,7 +617,7 @@ void UnloadAccountsModule()
void BuildProtoMenus()
{
- for (int i = 0; i < accounts.getCount(); i++) {
+ for (int i=0; i < accounts.getCount(); i++) {
PROTOACCOUNT* pa = accounts[ i ];
if (cli.pfnGetProtocolVisibility(pa->szModuleName) == 0)
continue;
diff --git a/src/modules/protocols/protochains.cpp b/src/modules/protocols/protochains.cpp
index 05d39b07e4..74145d3970 100644
--- a/src/modules/protocols/protochains.cpp
+++ b/src/modules/protocols/protochains.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
INT_PTR Proto_CallContactService(WPARAM wParam, LPARAM lParam)
//note that this is ChainSend() too, due to a quirk of function definitions
{
- CCSDATA *ccs=(CCSDATA*)lParam;
+ CCSDATA *ccs = (CCSDATA*)lParam;
int i;
char str[10];
DBVARIANT dbv;
@@ -70,7 +70,7 @@ INT_PTR Proto_CallContactService(WPARAM wParam, LPARAM lParam)
static INT_PTR CallRecvChain(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *ccs=(CCSDATA*)lParam;
+ CCSDATA *ccs = (CCSDATA*)lParam;
int i;
INT_PTR ret;
char str[10];
@@ -217,7 +217,7 @@ static INT_PTR Proto_AddToContact(WPARAM wParam, LPARAM lParam)
if (pd->type > pdCompare->type) break;
}
//put the new module at position i
- lastProto=mir_strdup((char*)lParam);
+ lastProto = mir_strdup((char*)lParam);
for (;;i++) {
_itoa(i, str, 10);
if (DBGetContactSettingString((HANDLE)wParam, "_Filter", str, &dbv)) {
@@ -227,7 +227,7 @@ static INT_PTR Proto_AddToContact(WPARAM wParam, LPARAM lParam)
}
DBWriteContactSettingString((HANDLE)wParam, "_Filter", str, lastProto);
mir_free(lastProto);
- lastProto=dbv.pszVal;
+ lastProto = dbv.pszVal;
}
}
return 0;
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index 991ebdfe08..8a12239c48 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -329,7 +329,7 @@ char** __fastcall Proto_FilesMatrixA(wchar_t **files)
while (files[ count++ ]);
char** filesA = (char**)mir_alloc(count * sizeof(char*));
- for (int i = 0; i < count; ++i)
+ for (int i=0; i < count; ++i)
filesA[ i ] = mir_u2a(files[ i ]);
return filesA;
@@ -343,7 +343,7 @@ static wchar_t** __fastcall Proto_FilesMatrixU(char **files)
while (files[ count++ ]);
wchar_t** filesU = (wchar_t**)mir_alloc(count * sizeof(wchar_t*));
- for (int i = 0; i < count; ++i)
+ for (int i=0; i < count; ++i)
filesU[ i ] = mir_a2u(files[ i ]);
return filesU;
@@ -419,12 +419,12 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s
return (INT_PTR)ppi->AddToList(wParam, (PROTOSEARCHRESULT*)lParam);
else {
PROTOSEARCHRESULT *psr = (PROTOSEARCHRESULT*)lParam;
- PROTOSEARCHRESULT *psra =(PROTOSEARCHRESULT*)mir_alloc(psr->cbSize);
+ PROTOSEARCHRESULT *psra = (PROTOSEARCHRESULT*)mir_alloc(psr->cbSize);
memcpy(psra, psr, psr->cbSize);
- psra->nick = (PROTOCHAR*)mir_u2a(psr->nick);
+ psra->nick = (PROTOCHAR*)mir_u2a(psr->nick);
psra->firstName = (PROTOCHAR*)mir_u2a(psr->firstName);
- psra->lastName = (PROTOCHAR*)mir_u2a(psr->lastName);
- psra->email = (PROTOCHAR*)mir_u2a(psr->email);
+ psra->lastName = (PROTOCHAR*)mir_u2a(psr->lastName);
+ psra->email = (PROTOCHAR*)mir_u2a(psr->email);
INT_PTR res = (INT_PTR)ppi->AddToList(wParam, psra);
@@ -595,12 +595,12 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s
if ( !strcmp(szService, PS_ADDTOLIST)) {
PROTOSEARCHRESULT *psr = (PROTOSEARCHRESULT*)lParam;
if ( !(psr->flags & PSR_UNICODE)) {
- PROTOSEARCHRESULT *psra =(PROTOSEARCHRESULT*)mir_alloc(psr->cbSize);
+ PROTOSEARCHRESULT *psra = (PROTOSEARCHRESULT*)mir_alloc(psr->cbSize);
memcpy(psra, psr, psr->cbSize);
- psra->nick = (PROTOCHAR*)mir_u2a(psr->nick);
+ psra->nick = (PROTOCHAR*)mir_u2a(psr->nick);
psra->firstName = (PROTOCHAR*)mir_u2a(psr->firstName);
- psra->lastName = (PROTOCHAR*)mir_u2a(psr->lastName);
- psra->email = (PROTOCHAR*)mir_u2a(psr->email);
+ psra->lastName = (PROTOCHAR*)mir_u2a(psr->lastName);
+ psra->email = (PROTOCHAR*)mir_u2a(psr->email);
INT_PTR res = MyCallProtoService(szModule, szService, wParam, (LPARAM)psra);
@@ -668,7 +668,7 @@ INT_PTR CallContactService(HANDLE hContact, const char *szProtoService, WPARAM w
PROTOACCOUNT* pa;
CCSDATA ccs = { hContact, szProtoService, wParam, lParam };
- for (i = 0;; i++) {
+ for (i=0;; i++) {
char str[10];
_itoa(i, str, 10);
if (DBGetContactSettingString(hContact, "_Filter", str, &dbv))
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index 007e827388..2de8275453 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -124,7 +124,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
GetDlgItemTextA(hwndDlg, IDC_ACCINTERNALNAME, buf, SIZEOF(buf));
rtrim(buf);
if (buf[0]) {
- for (int i = 0; i < accounts.getCount(); ++i)
+ for (int i=0; i < accounts.getCount(); ++i)
if (_stricmp(buf, accounts[i]->szModuleName) == 0)
return FALSE;
} }
@@ -587,7 +587,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
hIcon = LoadSkinnedIcon(tmp);
DrawIconEx(lps->hDC, lps->rcItem.left, lps->rcItem.top, hIcon, cxIcon, cyIcon, 0, hbrBack, DI_NORMAL);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
lps->rcItem.left += cxIcon + 2;
@@ -662,7 +662,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
dat->iSelected = -1;
SendMessage(hList, LB_RESETCONTENT, 0, 0);
- for (i = 0; i < accounts.getCount(); ++i) {
+ for (i=0; i < accounts.getCount(); ++i) {
int iItem = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)accounts[i]->tszAccountName);
SendMessage(hList, LB_SETITEMDATA, iItem, (LPARAM)accounts[i]);
@@ -670,7 +670,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
ListBox_SetCurSel(hList, iItem);
}
- dat->iSelected = ListBox_GetCurSel(hList); // -1 if error => nothing selected in our case
+ dat->iSelected = ListBox_GetCurSel(hList); // -1 if error = > nothing selected in our case
if (dat->iSelected >= 0)
sttSelectItem(dat, hList, dat->iSelected);
else if (acc && acc->hwndAccMgrUI)
@@ -696,7 +696,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
}
}
else {
- // menu was activated with mouse => find item under cursor & set focus to our control.
+ // menu was activated with mouse = > find item under cursor & set focus to our control.
POINT ptItem = pt;
ScreenToClient(hwndList, &ptItem);
iItem = (short)LOWORD(SendMessage(hwndList, LB_ITEMFROMPOINT, 0, MAKELPARAM(ptItem.x, ptItem.y)));
@@ -969,7 +969,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
int i;
PSHNOTIFY pshn = {0};
pshn.hdr.code = PSN_APPLY;
- for (i = 0; i < accounts.getCount(); ++i) {
+ for (i=0; i < accounts.getCount(); ++i) {
if (accounts[i]->hwndAccMgrUI && accounts[i]->bAccMgrUIChanged) {
pshn.hdr.hwndFrom = accounts[i]->hwndAccMgrUI;
SendMessage(accounts[i]->hwndAccMgrUI, WM_NOTIFY, 0, (LPARAM)&pshn);
@@ -982,7 +982,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
int i;
PSHNOTIFY pshn = {0};
pshn.hdr.code = PSN_RESET;
- for (i = 0; i < accounts.getCount(); ++i) {
+ for (i=0; i < accounts.getCount(); ++i) {
if (accounts[i]->hwndAccMgrUI && accounts[i]->bAccMgrUIChanged) {
pshn.hdr.hwndFrom = accounts[i]->hwndAccMgrUI;
SendMessage(accounts[i]->hwndAccMgrUI, WM_NOTIFY, 0, (LPARAM)&pshn);
@@ -996,7 +996,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
break;
case WM_DESTROY:
{
- for (int i = 0; i < accounts.getCount(); ++i) {
+ for (int i=0; i < accounts.getCount(); ++i) {
accounts[i]->bAccMgrUIChanged = FALSE;
if (accounts[i]->hwndAccMgrUI) {
DestroyWindow(accounts[i]->hwndAccMgrUI);
diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp
index 6bebcdc273..f23e777604 100644
--- a/src/modules/skin/hotkey_opts.cpp
+++ b/src/modules/skin/hotkey_opts.cpp
@@ -331,7 +331,7 @@ static void sttOptionsSaveItem(THotkeyItem *item)
DBWriteContactSettingByte(NULL, DBMODULENAME "Types", item->pszName, (BYTE)item->type);
item->nSubHotkeys = 0;
- for (i = 0; i < hotkeys.getCount(); i++) {
+ for (i=0; i < hotkeys.getCount(); i++) {
THotkeyItem *subItem = hotkeys[i];
if (subItem->rootHotkey == item) {
subItem->Hotkey = subItem->OptHotkey;
@@ -351,10 +351,10 @@ static void sttOptionsSaveItem(THotkeyItem *item)
static void sttBuildHotkeyList(HWND hwndList)
{
- int i, nItems=0;
+ int i, nItems = 0;
ListView_DeleteAllItems(hwndList);
- for (i = 0; i < hotkeys.getCount(); i++) {
+ for (i=0; i < hotkeys.getCount(); i++) {
LVITEM lvi = {0};
THotkeyItem *item = hotkeys[i];
@@ -469,7 +469,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
lvc.cx = GetSystemMetrics(SM_CXSMICON);
ListView_InsertColumn(hwndHotkey, COL_ADDREMOVE, &lvc);
- for (int i = 0; i < hotkeys.getCount(); i++) {
+ for (int i=0; i < hotkeys.getCount(); i++) {
THotkeyItem *item = hotkeys[i];
item->OptChanged = FALSE;
@@ -728,7 +728,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
UnregisterHotkeys();
- for (i = 0; i < hotkeys.getCount(); i++) {
+ for (i=0; i < hotkeys.getCount(); i++) {
THotkeyItem *item = hotkeys[i];
if (item->OptNew && item->OptDeleted ||
item->rootHotkey && !item->OptHotkey ||
@@ -744,7 +744,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
LVITEM lvi = {0};
int count = ListView_GetItemCount(hwndHotkey);
- for (i = 0; i < hotkeys.getCount(); i++)
+ for (i=0; i < hotkeys.getCount(); i++)
sttOptionsSaveItem(hotkeys[i]);
lvi.mask = LVIF_IMAGE;
@@ -886,7 +886,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
else if (param->uNewState>>12 == 2) {
int i, nItems = ListView_GetItemCount(lpnmhdr->hwndFrom);
initialized = FALSE;
- for (i = 0; i < hotkeys.getCount(); ++i) {
+ for (i=0; i < hotkeys.getCount(); ++i) {
LVITEM lvi = {0};
THotkeyItem *item = hotkeys[i];
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp
index bf939d5716..05297f92b3 100644
--- a/src/modules/skin/hotkeys.cpp
+++ b/src/modules/skin/hotkeys.cpp
@@ -51,7 +51,7 @@ static LRESULT CALLBACK sttKeyboardProc(int code, WPARAM wParam, LPARAM lParam);
WORD GetHotkeyValue(INT_PTR idHotkey)
{
- for (int i = 0; i < hotkeys.getCount(); i++)
+ for (int i=0; i < hotkeys.getCount(); i++)
if (hotkeys[i]->idHotkey == idHotkey)
return hotkeys[i]->Enabled ? hotkeys[i]->Hotkey : 0;
@@ -71,7 +71,7 @@ static void sttWordToModAndVk(WORD w, BYTE *mod, BYTE *vk)
static LRESULT CALLBACK sttHotkeyHostWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_HOTKEY) {
- for (int i = 0; i < hotkeys.getCount(); i++) {
+ for (int i=0; i < hotkeys.getCount(); i++) {
THotkeyItem *item = hotkeys[i];
if (item->type != HKT_GLOBAL || !item->Enabled)
continue;
@@ -91,7 +91,7 @@ static LRESULT CALLBACK sttHotkeyHostWndProc(HWND hwnd, UINT msg, WPARAM wParam,
static LRESULT CALLBACK sttKeyboardProc(int code, WPARAM wParam, LPARAM lParam)
{
if (code == HC_ACTION && !(HIWORD(lParam) & KF_UP)) {
- BYTE mod=0, vk=wParam;
+ BYTE mod = 0, vk = wParam;
if (vk) {
if (GetAsyncKeyState(VK_CONTROL)) mod |= MOD_CONTROL;
@@ -99,7 +99,7 @@ static LRESULT CALLBACK sttKeyboardProc(int code, WPARAM wParam, LPARAM lParam)
if (GetAsyncKeyState(VK_SHIFT)) mod |= MOD_SHIFT;
if (GetAsyncKeyState(VK_LWIN) || GetAsyncKeyState(VK_RWIN)) mod |= MOD_WIN;
- for (int i = 0; i < hotkeys.getCount(); i++) {
+ for (int i=0; i < hotkeys.getCount(); i++) {
THotkeyItem *item = hotkeys[i];
BYTE hkMod, hkVk;
if (item->type != HKT_LOCAL) continue;
@@ -194,7 +194,7 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam)
int count, i;
mir_snprintf(buf, SIZEOF(buf), "%s$count", item->pszName);
count = (int)DBGetContactSettingDword(NULL, DBMODULENAME, buf, -1);
- for (i = 0; i < count; i++) {
+ for (i=0; i < count; i++) {
mir_snprintf(buf, SIZEOF(buf), "%s$%d", item->pszName, i);
if ( !DBGetContactSettingWord(NULL, DBMODULENAME, buf, 0))
continue;
@@ -220,14 +220,14 @@ static INT_PTR svcHotkeyUnregister(WPARAM, LPARAM lParam)
mir_snprintf(pszNamePrefix, SIZEOF(pszNamePrefix), "%s$", pszName);
cbNamePrefix = strlen(pszNamePrefix);
- for (i = 0; i < hotkeys.getCount(); ++i)
+ for (i=0; i < hotkeys.getCount(); ++i)
{
char *pszCurrentName = hotkeys[i]->rootHotkey ?
hotkeys[i]->rootHotkey->pszName :
hotkeys[i]->pszName;
if ( !pszCurrentName) continue;
- hotkeys[i]->UnregisterHotkey =
+ hotkeys[i]->UnregisterHotkey =
!lstrcmpA(pszCurrentName, pszName) ||
!strncmp(pszCurrentName, pszNamePrefix, cbNamePrefix);
}
@@ -235,7 +235,7 @@ static INT_PTR svcHotkeyUnregister(WPARAM, LPARAM lParam)
if (g_hwndHkOptions)
SendMessage(g_hwndHkOptions, WM_HOTKEYUNREGISTERED, 0, 0);
- for (i = 0; i < hotkeys.getCount(); ++i)
+ for (i=0; i < hotkeys.getCount(); ++i)
if (hotkeys[i]->UnregisterHotkey) {
FreeHotkey(hotkeys[i]);
List_Remove((SortedList *)&hotkeys, i);
@@ -252,7 +252,7 @@ static INT_PTR svcHotkeyCheck(WPARAM wParam, LPARAM lParam)
if ((msg->message == WM_KEYDOWN) || (msg->message == WM_SYSKEYDOWN)) {
int i;
- BYTE mod=0, vk=msg->wParam;
+ BYTE mod = 0, vk = msg->wParam;
if (vk) {
if (GetAsyncKeyState(VK_CONTROL)) mod |= MOD_CONTROL;
@@ -260,7 +260,7 @@ static INT_PTR svcHotkeyCheck(WPARAM wParam, LPARAM lParam)
if (GetAsyncKeyState(VK_SHIFT)) mod |= MOD_SHIFT;
if (GetAsyncKeyState(VK_LWIN) || GetAsyncKeyState(VK_RWIN)) mod |= MOD_WIN;
- for (i = 0; i < hotkeys.getCount(); i++) {
+ for (i=0; i < hotkeys.getCount(); i++) {
THotkeyItem *item = hotkeys[i];
BYTE hkMod, hkVk;
if ((item->type != HKT_MANUAL) || lstrcmp(pszSection, item->ptszSection)) continue;
@@ -290,7 +290,7 @@ void FreeHotkey(THotkeyItem *item)
void RegisterHotkeys()
{
- for (int i = 0; i < hotkeys.getCount(); i++) {
+ for (int i=0; i < hotkeys.getCount(); i++) {
THotkeyItem *item = hotkeys[i];
UnregisterHotKey(g_hwndHotkeyHost, item->idHotkey);
if (item->type != HKT_GLOBAL) continue;
@@ -302,7 +302,7 @@ void RegisterHotkeys()
void KillModuleHotkeys(int hLangpack)
{
- for (int i=hotkeys.getCount()-1; i >= 0; i--) {
+ for (int i = hotkeys.getCount()-1; i >= 0; i--) {
THotkeyItem *item = hotkeys[i];
if (item->hLangpack == hLangpack) {
FreeHotkey(item);
@@ -313,7 +313,7 @@ void KillModuleHotkeys(int hLangpack)
void UnregisterHotkeys()
{
- for (int i = 0; i < hotkeys.getCount(); i++) {
+ for (int i=0; i < hotkeys.getCount(); i++) {
THotkeyItem *item = hotkeys[i];
if (item->type == HKT_GLOBAL && item->Enabled)
UnregisterHotKey(g_hwndHotkeyHost, item->idHotkey);
@@ -369,7 +369,7 @@ int LoadSkinHotkeys(void)
HookEvent(ME_SYSTEM_MODULESLOADED, sttModulesLoaded);
- for (int i = 0; i < SIZEOF(oldSettings); i++) {
+ for (int i=0; i < SIZEOF(oldSettings); i++) {
char szSetting[ 100 ];
mir_snprintf(szSetting, SIZEOF(szSetting), "HK%s", oldSettings[i]);
@@ -398,7 +398,7 @@ void UnloadSkinHotkeys(void)
UnhookWindowsHookEx(hhkKeyboard);
UnregisterHotkeys();
DestroyWindow(g_hwndHotkeyHost);
- for (int i = 0; i < hotkeys.getCount(); i++)
+ for (int i=0; i < hotkeys.getCount(); i++)
FreeHotkey(hotkeys[i]);
hotkeys.destroy();
}
diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp
index 509135ae20..796b2033f4 100644
--- a/src/modules/skin/skinicons.cpp
+++ b/src/modules/skin/skinicons.cpp
@@ -32,7 +32,7 @@ struct StandardIconDescription
const char* section;
};
-static const struct StandardIconDescription mainIcons[] =
+static const struct StandardIconDescription mainIcons[] =
{
{ SKINICON_OTHER_MIRANDA, LPGEN("Miranda IM"), -IDI_MIRANDA },
{ SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG },
@@ -85,7 +85,7 @@ static const struct StandardIconDescription mainIcons[] =
HANDLE hMainIcons[SIZEOF(mainIcons)];
-static const struct StandardIconDescription statusIcons[] =
+static const struct StandardIconDescription statusIcons[] =
{
{ ID_STATUS_OFFLINE, LPGEN("Offline"), -IDI_OFFLINE, 0xFFFFFFFF },
{ ID_STATUS_ONLINE, LPGEN("Online"), -IDI_ONLINE, PF2_ONLINE },
@@ -101,9 +101,9 @@ static const struct StandardIconDescription statusIcons[] =
HANDLE hStatusIcons[SIZEOF(statusIcons)];
-const char* mainIconsFmt = "core_main_";
+const char* mainIconsFmt = "core_main_";
const char* statusIconsFmt = "core_status_";
-const char* protoIconsFmt = LPGEN("%s Icons");
+const char* protoIconsFmt = LPGEN("%s Icons");
#define PROTOCOLS_PREFIX "Status Icons/"
#define GLOBAL_PROTO_NAME "*"
@@ -135,7 +135,7 @@ HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared)
{
HICON hResIcon = bShared ? LoadSmallIcon(hInstance, lpIconName) : LoadSmallIconShared(hInstance, lpIconName);
if ( !hResIcon) { //Icon not found in hInstance lets try to load it from core
- HINSTANCE hCoreInstance=hInst;
+ HINSTANCE hCoreInstance = hInst;
if (hCoreInstance != hInstance)
hResIcon = bShared ? LoadSmallIcon(hCoreInstance, lpIconName) : LoadSmallIconShared(hCoreInstance, lpIconName);
}
@@ -144,7 +144,7 @@ HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared)
int ImageList_AddIcon_NotShared(HIMAGELIST hIml, LPCTSTR szResource)
{
- HICON hTempIcon=LoadIconEx(hInst, szResource, 0);
+ HICON hTempIcon = LoadIconEx(hInst, szResource, 0);
int res = ImageList_AddIcon(hIml, hTempIcon);
Safe_DestroyIcon(hTempIcon);
return res;
@@ -154,7 +154,7 @@ int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId)
{
HICON hIcon = LoadSkinIcon(iconId);
int res = ImageList_AddIcon(hIml, hIcon);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
return res;
}
@@ -162,7 +162,7 @@ int ImageList_AddIcon_ProtoIconLibLoaded(HIMAGELIST hIml, const char* szProto, i
{
HICON hIcon = LoadSkinProtoIcon(szProto, iconId);
int res = ImageList_AddIcon(hIml, hIcon);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
return res;
}
@@ -177,7 +177,7 @@ int ImageList_ReplaceIcon_NotShared(HIMAGELIST hIml, int iIndex, HINSTANCE hInst
int ImageList_ReplaceIcon_IconLibLoaded(HIMAGELIST hIml, int nIndex, HICON hIcon)
{
int res = ImageList_ReplaceIcon(hIml, nIndex, hIcon);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
return res;
}
@@ -195,8 +195,8 @@ void Window_SetProtoIcon_IcoLib(HWND hWnd, const char* szProto, int iconId)
void Window_FreeIcon_IcoLib(HWND hWnd)
{
- IconLib_ReleaseIcon((HICON)SendMessage(hWnd, WM_SETICON, ICON_BIG, 0), NULL);
- IconLib_ReleaseIcon((HICON)SendMessage(hWnd, WM_SETICON, ICON_SMALL, 0), NULL);
+ IcoLib_ReleaseIcon((HICON)SendMessage(hWnd, WM_SETICON, ICON_BIG, 0), NULL);
+ IcoLib_ReleaseIcon((HICON)SendMessage(hWnd, WM_SETICON, ICON_SMALL, 0), NULL);
}
void Button_SetIcon_IcoLib(HWND hwndDlg, int itemId, int iconId, const char* tooltip)
@@ -210,7 +210,7 @@ void Button_SetIcon_IcoLib(HWND hwndDlg, int itemId, int iconId, const char* too
void Button_FreeIcon_IcoLib(HWND hwndDlg, int itemId)
{
HICON hIcon = (HICON)SendDlgItemMessage(hwndDlg, itemId, BM_SETIMAGE, IMAGE_ICON, 0);
- IconLib_ReleaseIcon(hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon, 0);
}
//
@@ -229,7 +229,7 @@ HICON LoadSkinProtoIcon(const char* szProto, int status, bool big)
return IcoLib_GetIcon(iconName, big);
}
- for (i = 0; i < SIZEOF(statusIcons); i++) {
+ for (i=0; i < SIZEOF(statusIcons); i++) {
if (statusIcons[i].id == status) {
statusIndx = i;
break;
@@ -335,7 +335,7 @@ HICON LoadSkinProtoIcon(const char* szProto, int status, bool big)
HANDLE GetSkinIconHandle(int idx)
{
int i;
- for (i = 0; i < SIZEOF(mainIcons); i++)
+ for (i=0; i < SIZEOF(mainIcons); i++)
if (idx == mainIcons[i].id)
return hMainIcons[i];
@@ -365,7 +365,7 @@ static void convertOneProtocol(char* moduleName, char* iconName)
char* pm = moduleName + strlen(moduleName);
char* pi = iconName + strlen(iconName);
- for (int i = 0; i < SIZEOF(statusIcons); i++) {
+ for (int i=0; i < SIZEOF(statusIcons); i++) {
_itoa(statusIcons[i].id, pm, 10);
DBVARIANT dbv;
@@ -416,7 +416,7 @@ int LoadSkinIcons(void)
//
// Perform "1st-time running import"
- for (i = 0; i < SIZEOF(mainIcons); i++) {
+ for (i=0; i < SIZEOF(mainIcons); i++) {
_itoa(mainIcons[i].id, moduleName, 10);
if (DBGetContactSettingTString(NULL, "Icons", moduleName, &dbv))
break;
@@ -465,7 +465,7 @@ int LoadSkinIcons(void)
//
// Add main icons to list
//
- for (i = 0; i < SIZEOF(mainIcons); i++) {
+ for (i=0; i < SIZEOF(mainIcons); i++) {
mir_snprintf(iconName, SIZEOF(iconName), "%s%d", mainIconsFmt, i);
sid.pszSection = mainIcons[i].section == NULL ? "Main Icons" : (char*)mainIcons[i].section;
sid.pszDescription = (char*)mainIcons[i].description;
@@ -479,7 +479,7 @@ int LoadSkinIcons(void)
//
// Asterisk is used, to avoid conflict with proto-plugins
// 'coz users can't rename it to name with '*'
- for (i = 0; i < SIZEOF(statusIcons); i++) {
+ for (i=0; i < SIZEOF(statusIcons); i++) {
mir_snprintf(iconName, SIZEOF(iconName), "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, i);
sid.pszName = iconName;
sid.pszDescription = (char*)statusIcons[i].description;
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp
index 05422ffef6..448ff26358 100644
--- a/src/modules/skin/sounds.cpp
+++ b/src/modules/skin/sounds.cpp
@@ -53,7 +53,7 @@ static OBJLIST<SoundItem> arSounds(10, CompareSounds);
void KillModuleSounds(int hLangpack)
{
- for (int i=arSounds.getCount()-1; i >= 0; i--) {
+ for (int i = arSounds.getCount()-1; i >= 0; i--) {
SoundItem& p = arSounds[i];
if (p.hLangpack == hLangpack) {
p.clear();
@@ -192,7 +192,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (tvi.lParam == -1)
TreeView_SetItemState(hwndTree, tvi.hItem, INDEXTOSTATEIMAGEMASK(0), TVIS_STATEIMAGEMASK);
- tvi.hItem=TreeView_GetNextSibling(hwndTree, tvi.hItem);
+ tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
} }
ShowWindow(hwndTree, SW_SHOW);
@@ -316,7 +316,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SetDlgItemText(hwndDlg, IDC_LOCATION, strFull);
}
if (LOWORD(wParam) == IDC_GETMORE) {
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://addons.miranda-im.org/index.php?action=display&id=5");
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://addons.miranda-im.org/index.php?action = display&id = 5");
break;
}
if (LOWORD(wParam) == IDC_LOCATION)
@@ -355,7 +355,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
tvic.hItem = TreeView_GetNextSibling(hwndTree, tvic.hItem);
} }
- tvi.hItem=TreeView_GetNextSibling(hwndTree, tvi.hItem);
+ tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
}
return TRUE;
}
@@ -419,7 +419,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
return FALSE;
}
-static UINT iconsExpertOnlyControls[]={IDC_IMPORT};
+static UINT iconsExpertOnlyControls[] = {IDC_IMPORT};
static int SkinOptionsInit(WPARAM wParam, LPARAM)
{
diff --git a/src/modules/srauth/auth.cpp b/src/modules/srauth/auth.cpp
index 61dedc06be..1baadfaced 100644
--- a/src/modules/srauth/auth.cpp
+++ b/src/modules/srauth/auth.cpp
@@ -61,7 +61,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam)
HANDLE hContact = *(PHANDLE)(dbei.pBlob + sizeof(DWORD));
- CLISTEVENT cli ={0};
+ CLISTEVENT cli = {0};
cli.cbSize = sizeof(cli);
cli.hContact = hContact;
cli.ptszTooltip = szTooltip;
diff --git a/src/modules/srauth/authdialogs.cpp b/src/modules/srauth/authdialogs.cpp
index 7a19f54642..ae75865ab4 100644
--- a/src/modules/srauth/authdialogs.cpp
+++ b/src/modules/srauth/authdialogs.cpp
@@ -42,15 +42,15 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
- dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
+ dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
DWORD uin = *(PDWORD)dbei.pBlob;
HANDLE hContact = *(HANDLE*)(dbei.pBlob + sizeof(DWORD));
- char* nick = (char *)(dbei.pBlob + sizeof(DWORD) + sizeof(HANDLE));
- char* first = nick + strlen(nick) + 1;
- char* last = first + strlen(first) + 1;
- char* email = last + strlen(last) + 1;
+ char* nick = (char *)(dbei.pBlob + sizeof(DWORD) + sizeof(HANDLE));
+ char* first = nick + strlen(nick) + 1;
+ char* last = first + strlen(first) + 1;
+ char* email = last + strlen(last) + 1;
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, CallProtoServiceInt(NULL,dbei.szModule, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0));
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, CallProtoServiceInt(NULL,dbei.szModule, PS_LOADICON, PLI_PROTOCOL | PLIF_LARGE, 0));
@@ -173,16 +173,16 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
//blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
dbei.cbSize = sizeof(dbei);
dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
- dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
+ dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
uin = *(PDWORD)dbei.pBlob;
hContact = *(HANDLE*)(dbei.pBlob + sizeof(DWORD));
- nick = (char *)(dbei.pBlob + sizeof(DWORD) + sizeof(HANDLE));
- first = nick + strlen(nick) + 1;
- last = first + strlen(first) + 1;
- email = last + strlen(last) + 1;
- reason = email + strlen(email) + 1;
+ nick = (char *)(dbei.pBlob + sizeof(DWORD) + sizeof(HANDLE));
+ first = nick + strlen(nick) + 1;
+ last = first + strlen(first) + 1;
+ email = last + strlen(last) + 1;
+ reason = email + strlen(email) + 1;
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, CallProtoServiceInt(NULL,dbei.szModule, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0));
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, CallProtoServiceInt(NULL,dbei.szModule, PS_LOADICON, PLI_PROTOCOL | PLIF_LARGE, 0));
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
TCHAR* emailT = dbei.flags & DBEF_UTF ? Utf8DecodeT(email) : mir_a2t(email);
TCHAR* reasonT = dbei.flags & DBEF_UTF ? Utf8DecodeT(reason) : mir_a2t(reason);
- TCHAR name[128] =_T("");
+ TCHAR name[128] = _T("");
int off = 0;
if (firstT[0] && lastT[0])
off = mir_sntprintf(name, SIZEOF(name), _T("%s %s"), firstT, lastT);
diff --git a/src/modules/srawaymsg/awaymsg.cpp b/src/modules/srawaymsg/awaymsg.cpp
index 82ea8f2121..e9d80789e3 100644
--- a/src/modules/srawaymsg/awaymsg.cpp
+++ b/src/modules/srawaymsg/awaymsg.cpp
@@ -121,7 +121,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
static INT_PTR GetMessageCommand(WPARAM wParam, LPARAM)
{
HWND hwnd;
- if (hwnd=WindowList_Find(hWindowList, (HANDLE)wParam)) {
+ if (hwnd = WindowList_Find(hWindowList, (HANDLE)wParam)) {
SetForegroundWindow(hwnd);
SetFocus(hwnd);
}
@@ -135,7 +135,7 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM)
TCHAR str[128];
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
ZeroMemory(&clmi, sizeof(clmi));
clmi.cbSize = sizeof(clmi);
clmi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN | CMIF_TCHAR;
@@ -153,7 +153,7 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM)
} } } }
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hAwayMsgMenuItem, (LPARAM)&clmi);
- IconLib_ReleaseIcon(clmi.hIcon, 0);
+ IcoLib_ReleaseIcon(clmi.hIcon, 0);
return 0;
}
@@ -170,10 +170,10 @@ int LoadAwayMsgModule(void)
hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG, GetMessageCommand);
- mi.cbSize = sizeof(mi);
- mi.position = -2000005000;
- mi.flags = CMIF_NOTOFFLINE;
- mi.pszName = LPGEN("Re&ad Status Message");
+ mi.cbSize = sizeof(mi);
+ mi.position = -2000005000;
+ mi.flags = CMIF_NOTOFFLINE;
+ mi.pszName = LPGEN("Re&ad Status Message");
mi.pszService = MS_AWAYMSG_SHOWAWAYMSG;
hAwayMsgMenuItem = Menu_AddContactMenuItem(&mi);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, AwayMsgPreBuildMenu);
diff --git a/src/modules/srawaymsg/sendmsg.cpp b/src/modules/srawaymsg/sendmsg.cpp
index 843b43f64f..56649c5297 100644
--- a/src/modules/srawaymsg/sendmsg.cpp
+++ b/src/modules/srawaymsg/sendmsg.cpp
@@ -377,7 +377,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam
HWND hLst = GetDlgItem(hwndDlg, IDC_LST_STATUS);
- dat=(struct AwayMsgDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ dat = (struct AwayMsgDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg)
{
case WM_INITDIALOG:
@@ -386,7 +386,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam
dat = (AwayMsgDlgData*)mir_alloc(sizeof(AwayMsgDlgData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
dat->oldPage = -1;
- for (int i = 0; i < SIZEOF(statusModes); i++)
+ for (int i=0; i < SIZEOF(statusModes); i++)
{
int j;
if ( !(protoModeMsgFlags & Proto_Status2Flag(statusModes[i])))
@@ -562,7 +562,7 @@ static int AwayMsgSendModernOptInit(WPARAM wParam, LPARAM)
if (protoModeMsgFlags == 0)
return 0;
- static const int iBoldControls[] =
+ static const int iBoldControls[] =
{
IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
MODERNOPT_CTRL_LAST
diff --git a/src/modules/sremail/email.cpp b/src/modules/sremail/email.cpp
index 0f7ca69020..3782f132ed 100644
--- a/src/modules/sremail/email.cpp
+++ b/src/modules/sremail/email.cpp
@@ -37,14 +37,14 @@ static INT_PTR SendEMailCommand(WPARAM wParam, LPARAM lParam)
char *szUrl;
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
if (szProto == NULL || DBGetContactSettingString((HANDLE)wParam, szProto, "e-mail", &dbv)) {
if (DBGetContactSettingString((HANDLE)wParam, "UserInfo", "Mye-mail0", &dbv)) {
MessageBox((HWND)lParam, TranslateT("User has not registered an e-mail address"), TranslateT("Send e-mail"), MB_OK);
return 1;
}
}
- szUrl=(char*)mir_alloc(lstrlenA(dbv.pszVal)+8);
+ szUrl = (char*)mir_alloc(lstrlenA(dbv.pszVal)+8);
lstrcpyA(szUrl, "mailto:");
lstrcatA(szUrl, dbv.pszVal);
mir_free(dbv.pszVal);
diff --git a/src/modules/srfile/file.cpp b/src/modules/srfile/file.cpp
index b398294c8d..4e1db5c651 100644
--- a/src/modules/srfile/file.cpp
+++ b/src/modules/srfile/file.cpp
@@ -31,8 +31,8 @@ static HANDLE hSRFileMenuItem;
static INT_PTR SendFileCommand(WPARAM wParam, LPARAM)
{
struct FileSendData fsd;
- fsd.hContact=(HANDLE)wParam;
- fsd.ppFiles=NULL;
+ fsd.hContact = (HANDLE)wParam;
+ fsd.ppFiles = NULL;
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd);
return 0;
}
@@ -40,7 +40,7 @@ static INT_PTR SendFileCommand(WPARAM wParam, LPARAM)
static INT_PTR SendSpecificFiles(WPARAM wParam, LPARAM lParam)
{
FileSendData fsd;
- fsd.hContact=(HANDLE)wParam;
+ fsd.hContact = (HANDLE)wParam;
char** ppFiles = (char**)lParam;
int count = 0;
@@ -53,7 +53,7 @@ static INT_PTR SendSpecificFiles(WPARAM wParam, LPARAM lParam)
fsd.ppFiles[ count ] = NULL;
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd);
- for (int j=0; j < count; j++)
+ for (int j = 0; j < count; j++)
mir_free((void*)fsd.ppFiles[j]);
return 0;
}
@@ -61,8 +61,8 @@ static INT_PTR SendSpecificFiles(WPARAM wParam, LPARAM lParam)
static INT_PTR SendSpecificFilesT(WPARAM wParam, LPARAM lParam)
{
FileSendData fsd;
- fsd.hContact=(HANDLE)wParam;
- fsd.ppFiles=(const TCHAR**)lParam;
+ fsd.hContact = (HANDLE)wParam;
+ fsd.ppFiles = (const TCHAR**)lParam;
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd);
return 0;
}
@@ -85,7 +85,7 @@ static INT_PTR RecvFileCommand(WPARAM, LPARAM lParam)
void PushFileEvent(HANDLE hContact, HANDLE hdbe, LPARAM lParam)
{
- CLISTEVENT cle={0};
+ CLISTEVENT cle = {0};
cle.cbSize = sizeof(cle);
cle.hContact = hContact;
cle.hDbEvent = hdbe;
@@ -110,7 +110,7 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam)
{
DWORD dwSignature;
- DBEVENTINFO dbei={0};
+ DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
dbei.cbBlob = sizeof(DWORD);
dbei.pBlob = (PBYTE)&dwSignature;
@@ -125,7 +125,7 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam)
int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValue, TCHAR *szOutput, int cbOutput)
{
HKEY hKey;
- DWORD cbOut=cbOutput;
+ DWORD cbOut = cbOutput;
if (RegOpenKeyEx(hKeyBase, szSubKey, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
return 0;
@@ -142,13 +142,13 @@ int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValu
void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed)
{
if ( !unitsOverride) {
- if (size<1000) unitsOverride=UNITS_BYTES;
- else if (size<100*1024) unitsOverride=UNITS_KBPOINT1;
- else if (size<1024*1024) unitsOverride=UNITS_KBPOINT0;
- else if (size<1024*1024*1024) unitsOverride=UNITS_MBPOINT2;
- else unitsOverride=UNITS_GBPOINT3;
+ if (size<1000) unitsOverride = UNITS_BYTES;
+ else if (size<100*1024) unitsOverride = UNITS_KBPOINT1;
+ else if (size<1024*1024) unitsOverride = UNITS_KBPOINT0;
+ else if (size<1024*1024*1024) unitsOverride = UNITS_MBPOINT2;
+ else unitsOverride = UNITS_GBPOINT3;
}
- if (unitsUsed) *unitsUsed=unitsOverride;
+ if (unitsUsed) *unitsUsed = unitsOverride;
switch(unitsOverride) {
case UNITS_BYTES: mir_sntprintf(szOut, cchOut, _T("%u%s%s"), (int)size, appendUnits?_T(" "):_T(""), appendUnits?TranslateT("bytes"):_T("")); break;
case UNITS_KBPOINT1: mir_sntprintf(szOut, cchOut, _T("%.1lf%s"), size/1024.0, appendUnits?_T(" KB"):_T("")); break;
@@ -190,7 +190,7 @@ void FreeProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *fts)
void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src)
{
- *dest=*src;
+ *dest = *src;
if (src->tszCurrentFile) dest->tszCurrentFile = PFTS_StringToTchar(src->flags, src->tszCurrentFile);
if (src->ptszFiles) {
dest->ptszFiles = (TCHAR**)mir_alloc(sizeof(TCHAR*)*src->totalFiles);
@@ -258,21 +258,21 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS
static void RemoveUnreadFileEvents(void)
{
- DBEVENTINFO dbei={0};
+ DBEVENTINFO dbei = {0};
HANDLE hDbEvent, hContact;
- dbei.cbSize=sizeof(dbei);
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ dbei.cbSize = sizeof(dbei);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact) {
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM)hContact, 0);
+ hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM)hContact, 0);
while (hDbEvent) {
- dbei.cbBlob=0;
+ dbei.cbBlob = 0;
CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
if ( !(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType == EVENTTYPE_FILE)
CallService(MS_DB_EVENT_MARKREAD, (WPARAM)hContact, (LPARAM)hDbEvent);
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hDbEvent, 0);
+ hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hDbEvent, 0);
}
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}
}
diff --git a/src/modules/srfile/file.h b/src/modules/srfile/file.h
index b152812467..d814e99ab4 100644
--- a/src/modules/srfile/file.h
+++ b/src/modules/srfile/file.h
@@ -66,11 +66,11 @@ struct FileDlgData {
};
//file.c
-#define UNITS_BYTES 1 // 0<=size<1000: "%d bytes"
-#define UNITS_KBPOINT1 2 // 1000<=size<100*1024: "%.1f KB"
-#define UNITS_KBPOINT0 3 // 100*1024<=size<1024*1024: "%d KB"
-#define UNITS_MBPOINT2 4 // 1024*1024<=size: "%.2f MB"
-#define UNITS_GBPOINT3 5 // 1024*1024*1024<=size: "%.3f GB"
+#define UNITS_BYTES 1 // 0 <= size<1000: "%d bytes"
+#define UNITS_KBPOINT1 2 // 1000 <= size<100*1024: "%.1f KB"
+#define UNITS_KBPOINT0 3 // 100*1024 <= size<1024*1024: "%d KB"
+#define UNITS_MBPOINT2 4 // 1024*1024 <= size: "%.2f MB"
+#define UNITS_GBPOINT3 5 // 1024*1024*1024 <= size: "%.3f GB"
void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed);
void FreeFilesMatrix(TCHAR ***files); //loving that triple indirection
diff --git a/src/modules/srfile/fileexistsdlg.cpp b/src/modules/srfile/fileexistsdlg.cpp
index 70ad5613b0..3388b692fb 100644
--- a/src/modules/srfile/fileexistsdlg.cpp
+++ b/src/modules/srfile/fileexistsdlg.cpp
@@ -33,9 +33,9 @@ static void SetControlToUnixTime(HWND hwndDlg, UINT idCtrl, time_t unixTime)
SYSTEMTIME st;
char szTime[64], szDate[64], szOutput[128];
- liFiletime.QuadPart=(BIGI(11644473600)+(__int64)unixTime)*10000000;
- filetime.dwHighDateTime=liFiletime.HighPart;
- filetime.dwLowDateTime=liFiletime.LowPart;
+ liFiletime.QuadPart = (BIGI(11644473600)+(__int64)unixTime)*10000000;
+ filetime.dwHighDateTime = liFiletime.HighPart;
+ filetime.dwLowDateTime = liFiletime.LowPart;
FileTimeToSystemTime(&filetime, &st);
GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, szTime, SIZEOF(szTime));
GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, szDate, SIZEOF(szDate));
@@ -61,41 +61,41 @@ static void DoAnnoyingShellCommand(HWND hwnd, const TCHAR *szFilename, int cmd,
ITEMIDLIST *pidl, *pidlNext, *pidlFilename;
IShellFolder *pFileFolder;
- for (pidl=pCurrentIdl;;) {
- pidlNext=(ITEMIDLIST*)((PBYTE)pidl+pidl->mkid.cb);
+ for (pidl = pCurrentIdl;;) {
+ pidlNext = (ITEMIDLIST*)((PBYTE)pidl+pidl->mkid.cb);
if (pidlNext->mkid.cb == 0) {
pidlFilename = (ITEMIDLIST*)CoTaskMemAlloc(pidl->mkid.cb+sizeof(pidl->mkid.cb));
CopyMemory(pidlFilename, pidl, pidl->mkid.cb+sizeof(pidl->mkid.cb));
- pidl->mkid.cb=0;
+ pidl->mkid.cb = 0;
break;
}
- pidl=pidlNext;
+ pidl = pidlNext;
}
if (pDesktopFolder->BindToObject(pCurrentIdl, NULL, IID_IShellFolder, (void**)&pFileFolder) == NOERROR) {
IContextMenu *pContextMenu;
if (pFileFolder->GetUIObjectOf(NULL, 1, (LPCITEMIDLIST*)&pidlFilename, IID_IContextMenu, NULL, (void**)&pContextMenu) == NOERROR) {
switch(cmd) {
case C_PROPERTIES:
- { CMINVOKECOMMANDINFO ici={0};
- ici.cbSize=sizeof(ici);
- ici.hwnd=hwnd;
- ici.lpVerb="properties";
- ici.nShow=SW_SHOW;
+ { CMINVOKECOMMANDINFO ici = {0};
+ ici.cbSize = sizeof(ici);
+ ici.hwnd = hwnd;
+ ici.lpVerb = "properties";
+ ici.nShow = SW_SHOW;
pContextMenu->InvokeCommand(&ici);
break;
}
case C_CONTEXTMENU:
{ HMENU hMenu;
- hMenu=CreatePopupMenu();
+ hMenu = CreatePopupMenu();
if (SUCCEEDED(pContextMenu->QueryContextMenu(hMenu, 0, 1000, 65535, (GetKeyState(VK_SHIFT)&0x8000?CMF_EXTENDEDVERBS:0)|CMF_NORMAL))) {
int cmd;
- cmd=TrackPopupMenu(hMenu, TPM_RETURNCMD, ptCursor->x, ptCursor->y, 0, hwnd, NULL);
+ cmd = TrackPopupMenu(hMenu, TPM_RETURNCMD, ptCursor->x, ptCursor->y, 0, hwnd, NULL);
if (cmd) {
- CMINVOKECOMMANDINFO ici={0};
- ici.cbSize=sizeof(ici);
- ici.hwnd=hwnd;
- ici.lpVerb=MAKEINTRESOURCEA(cmd-1000);
- ici.nShow=SW_SHOW;
+ CMINVOKECOMMANDINFO ici = {0};
+ ici.cbSize = sizeof(ici);
+ ici.hwnd = hwnd;
+ ici.lpVerb = MAKEINTRESOURCEA(cmd-1000);
+ ici.nShow = SW_SHOW;
pContextMenu->InvokeCommand(&ici);
}
}
@@ -126,7 +126,7 @@ static LRESULT CALLBACK IconCtrlSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
break;
case WM_RBUTTONUP:
{ POINT pt;
- pt.x=(short)LOWORD(lParam); pt.y=(short)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam);
ClientToScreen(hwnd, &pt);
DoAnnoyingShellCommand(hwnd, pft->tszCurrentFile, C_CONTEXTMENU, &pt);
return 0;
@@ -159,7 +159,7 @@ void __cdecl LoadIconsAndTypesThread(void* param)
lstrcpyn(szExtension, pszExtension+1, SIZEOF(szExtension));
else {
pszExtension = _T(".");
- szExtension[0]='\0';
+ szExtension[0] = '\0';
}
CharUpper(szExtension);
if (fileInfo.szTypeName[0] == '\0')
@@ -167,7 +167,7 @@ void __cdecl LoadIconsAndTypesThread(void* param)
SetDlgItemText(info->hwndDlg, IDC_EXISTINGTYPE, fileInfo.szTypeName);
SetDlgItemText(info->hwndDlg, IDC_NEWTYPE, fileInfo.szTypeName);
SendDlgItemMessage(info->hwndDlg, IDC_EXISTINGICON, STM_SETICON, (WPARAM)fileInfo.hIcon, 0);
- szIconFile[0]='\0';
+ szIconFile[0] = '\0';
if ( !lstrcmp(szExtension, _T("EXE")))
SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("2"), szIconFile, SIZEOF(szIconFile));
else {
@@ -177,12 +177,12 @@ void __cdecl LoadIconsAndTypesThread(void* param)
if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, szTypeName, NULL, szIconFile, SIZEOF(szIconFile))) {
if (_tcsstr(szIconFile, _T("%1")))
SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("0"), szIconFile, SIZEOF(szIconFile));
- else szIconFile[0]='\0';
+ else szIconFile[0] = '\0';
} } }
if (szIconFile[0]) {
TCHAR *pszComma = _tcsrchr(szIconFile, ',');
- int iconIndex = (pszComma == NULL) ? 0 :_ttoi(pszComma+1); *pszComma='\0';
+ int iconIndex = (pszComma == NULL) ? 0 :_ttoi(pszComma+1); *pszComma = '\0';
HICON hIcon = ExtractIcon(hInst, szIconFile, iconIndex);
if (hIcon)
fileInfo.hIcon = hIcon;
@@ -197,7 +197,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
{
PROTOFILETRANSFERSTATUS *fts;
- fts=(PROTOFILETRANSFERSTATUS*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ fts = (PROTOFILETRANSFERSTATUS*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch(msg) {
case WM_INITDIALOG:
{
@@ -210,7 +210,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SetPropA(hwndDlg, "Miranda.ParentWnd", dat->hwndParent);
TranslateDialogDefault(hwndDlg);
- fts=(PROTOFILETRANSFERSTATUS*)mir_alloc(sizeof(PROTOFILETRANSFERSTATUS));
+ fts = (PROTOFILETRANSFERSTATUS*)mir_alloc(sizeof(PROTOFILETRANSFERSTATUS));
CopyProtoFileTransferStatus(fts, dat->fts);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)fts);
SetDlgItemText(hwndDlg, IDC_FILENAME, fts->tszCurrentFile);
@@ -218,20 +218,20 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
GetSensiblyFormattedSize(fts->currentFileSize, szSize, SIZEOF(szSize), 0, 1, NULL);
SetDlgItemText(hwndDlg, IDC_NEWSIZE, szSize);
- pfnIconWindowProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_EXISTINGICON), GWLP_WNDPROC, (LONG_PTR)IconCtrlSubclassProc);
+ pfnIconWindowProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_EXISTINGICON), GWLP_WNDPROC, (LONG_PTR)IconCtrlSubclassProc);
- hwndFocus=GetDlgItem(hwndDlg, IDC_RESUME);
+ hwndFocus = GetDlgItem(hwndDlg, IDC_RESUME);
if (_tstati64(fts->tszCurrentFile, &statbuf) == 0) {
SetControlToUnixTime(hwndDlg, IDC_EXISTINGDATE, statbuf.st_mtime);
GetSensiblyFormattedSize(statbuf.st_size, szSize, SIZEOF(szSize), 0, 1, NULL);
SetDlgItemText(hwndDlg, IDC_EXISTINGSIZE, szSize);
if (statbuf.st_size>(int)fts->currentFileSize) {
EnableWindow(GetDlgItem(hwndDlg, IDC_RESUME), FALSE);
- hwndFocus=GetDlgItem(hwndDlg, IDC_OVERWRITE);
+ hwndFocus = GetDlgItem(hwndDlg, IDC_OVERWRITE);
} }
loadiconsstartinfo *lisi = (loadiconsstartinfo*)mir_alloc(sizeof(loadiconsstartinfo));
- lisi->hwndDlg=hwndDlg;
+ lisi->hwndDlg = hwndDlg;
lisi->szFilename = mir_tstrdup(fts->tszCurrentFile);
//can be a little slow, so why not?
forkthread(LoadIconsAndTypesThread, 0, lisi);
@@ -241,7 +241,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
}
case WM_COMMAND:
{
- PROTOFILERESUME pfr={0};
+ PROTOFILERESUME pfr = {0};
switch(LOWORD(wParam)) {
case IDC_OPENFILE:
ShellExecute(hwndDlg, NULL, fts->tszCurrentFile, NULL, NULL, SW_SHOW);
@@ -261,16 +261,16 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
DoAnnoyingShellCommand(hwndDlg, fts->tszCurrentFile, C_PROPERTIES, NULL);
return FALSE;
case IDC_RESUME:
- pfr.action=FILERESUME_RESUME;
+ pfr.action = FILERESUME_RESUME;
break;
case IDC_RESUMEALL:
- pfr.action=FILERESUME_RESUMEALL;
+ pfr.action = FILERESUME_RESUMEALL;
break;
case IDC_OVERWRITE:
- pfr.action=FILERESUME_OVERWRITE;
+ pfr.action = FILERESUME_OVERWRITE;
break;
case IDC_OVERWRITEALL:
- pfr.action=FILERESUME_OVERWRITEALL;
+ pfr.action = FILERESUME_OVERWRITEALL;
break;
case IDC_AUTORENAME:
@@ -279,7 +279,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_SAVEAS:
{
- OPENFILENAME ofn={0};
+ OPENFILENAME ofn = {0};
TCHAR filter[512], *pfilter;
TCHAR str[MAX_PATH];
@@ -292,7 +292,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
pfilter = filter + _tcslen(filter) + 1;
_tcscpy(pfilter, _T("*"));
pfilter = pfilter + _tcslen(pfilter) + 1;
- *pfilter='\0';
+ *pfilter = '\0';
ofn.lpstrFilter = filter;
ofn.lpstrFile = str;
ofn.nMaxFile = SIZEOF(str);
@@ -305,16 +305,16 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
break;
}
case IDC_SKIP:
- pfr.action=FILERESUME_SKIP;
+ pfr.action = FILERESUME_SKIP;
break;
case IDCANCEL:
- pfr.action=FILERESUME_CANCEL;
+ pfr.action = FILERESUME_CANCEL;
break;
default:
return FALSE;
}
{ PROTOFILERESUME *pfrCopy;
- pfrCopy=(PROTOFILERESUME*)mir_alloc(sizeof(pfr));
+ pfrCopy = (PROTOFILERESUME*)mir_alloc(sizeof(pfr));
CopyMemory(pfrCopy, &pfr, sizeof(pfr));
PostMessage((HWND)GetPropA(hwndDlg, "Miranda.ParentWnd"), M_FILEEXISTSDLGREPLY, (WPARAM)mir_tstrdup(fts->tszCurrentFile), (LPARAM)pfrCopy);
DestroyWindow(hwndDlg);
diff --git a/src/modules/srfile/fileopts.cpp b/src/modules/srfile/fileopts.cpp
index b8c8c0133a..2aec9fa5a1 100644
--- a/src/modules/srfile/fileopts.cpp
+++ b/src/modules/srfile/fileopts.cpp
@@ -35,17 +35,17 @@ struct virusscannerinfo {
const TCHAR *szCommandLine;
};
-static const struct virusscannerinfo virusScanners[]={
+static const struct virusscannerinfo virusScanners[] = {
{_T("Network Associates/McAfee VirusScan"), _T("SOFTWARE\\McAfee\\VirusScan"), _T("Scan32EXE"), _T("\"%s\" %%f /nosplash /comp /autoscan /autoexit /noboot")},
{_T("Dr Solomon's VirusScan (Network Associates)"), _T("SOFTWARE\\Network Associates\\TVD\\VirusScan\\AVConsol\\General"), _T("szScannerExe"), _T("\"%s\" %%f /uinone /noboot /comp /prompt /autoexit")},
{_T("Norton AntiVirus"), _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Navw32.exe"), NULL, _T("\"%s\" %%f /b- /m- /s+ /noresults")},
- {_T("Computer Associates/Inoculate IT"), _T("Software\\Antivirus"), _T("ImageFilename"), _T("\"%s\" %%f /display=progress /exit")},
- {_T("Computer Associates eTrust"), _T("SOFTWARE\\ComputerAssociates\\Anti-Virus\\Resident"), _T("VetPath"), _T("\"%s\" %%f /display=progress /exit")},
+ {_T("Computer Associates/Inoculate IT"), _T("Software\\Antivirus"), _T("ImageFilename"), _T("\"%s\" %%f /display = progress /exit")},
+ {_T("Computer Associates eTrust"), _T("SOFTWARE\\ComputerAssociates\\Anti-Virus\\Resident"), _T("VetPath"), _T("\"%s\" %%f /display = progress /exit")},
{_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\Components\\101"), _T("EXEName"), _T("\"%s\" /S /Q %%f")},
{_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\SetupFolders"), _T("KAV8"), _T("\"%savp.exe\" SCAN %%f")},
{_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\SetupFolders"), _T("KAV9"), _T("\"%savp.exe\" SCAN %%f")},
- {_T("AntiVir PersonalEdition Classic"), _T("SOFTWARE\\Avira\\AntiVir PersonalEdition Classic"), _T("Path"), _T("\"%savscan.exe\" /GUIMODE=2 /PATH=\"%%f\"")},
- {_T("ESET NOD32 Antivirus"), _T("SOFTWARE\\ESET\\ESET Security\\CurrentVersion\\Info"), _T("InstallDir"), _T("\"%secls.exe\" /log-all /aind /no-boots /adware /sfx /unsafe /unwanted /heur /adv-heur /action=clean \"%%f\"")},
+ {_T("AntiVir PersonalEdition Classic"), _T("SOFTWARE\\Avira\\AntiVir PersonalEdition Classic"), _T("Path"), _T("\"%savscan.exe\" /GUIMODE = 2 /PATH = \"%%f\"")},
+ {_T("ESET NOD32 Antivirus"), _T("SOFTWARE\\ESET\\ESET Security\\CurrentVersion\\Info"), _T("InstallDir"), _T("\"%secls.exe\" /log-all /aind /no-boots /adware /sfx /unsafe /unwanted /heur /adv-heur /action = clean \"%%f\"")},
};
#define M_UPDATEENABLING (WM_USER+100)
@@ -86,7 +86,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
int i, iItem;
for (i=0; i < SIZEOF(virusScanners); i++) {
if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[i].szExeRegPath, virusScanners[i].szExeRegValue, szScanExe, SIZEOF(szScanExe))) {
- iItem=SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)virusScanners[i].szProductName);
+ iItem = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)virusScanners[i].szProductName);
SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_SETITEMDATA, iItem, i);
}
}
@@ -118,7 +118,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
return TRUE;
}
case M_UPDATEENABLING:
- { int on=!IsDlgButtonChecked(hwndDlg, IDC_NOSCANNER);
+ { int on = !IsDlgButtonChecked(hwndDlg, IDC_NOSCANNER);
EnableWindow(GetDlgItem(hwndDlg, IDC_ST_CMDLINE), on);
EnableWindow(GetDlgItem(hwndDlg, IDC_SCANCMDLINE), on);
EnableWindow(GetDlgItem(hwndDlg, IDC_SCANCMDLINEBROWSE), on);
@@ -129,9 +129,9 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case M_SCANCMDLINESELCHANGE:
{ TCHAR str[512];
TCHAR szScanExe[MAX_PATH];
- int iScanner=SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCURSEL, 0, 0), 0);
+ int iScanner = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCURSEL, 0, 0), 0);
if (iScanner >= SIZEOF(virusScanners) || iScanner<0) break;
- str[0]='\0';
+ str[0] = '\0';
if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[iScanner].szExeRegPath, virusScanners[iScanner].szExeRegValue, szScanExe, SIZEOF(szScanExe)))
mir_sntprintf(str, SIZEOF(str), virusScanners[iScanner].szCommandLine, szScanExe);
SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str);
diff --git a/src/modules/srfile/filerecvdlg.cpp b/src/modules/srfile/filerecvdlg.cpp
index 7249291b6d..93ba691266 100644
--- a/src/modules/srfile/filerecvdlg.cpp
+++ b/src/modules/srfile/filerecvdlg.cpp
@@ -37,10 +37,10 @@ static void GetLowestExistingDirName(const TCHAR *szTestDir, TCHAR *szExistingDi
TCHAR *pszLastBackslash;
lstrcpyn(szExistingDir, szTestDir, cchExistingDir);
- while ((dwAttributes=GetFileAttributes(szExistingDir)) != INVALID_FILE_ATTRIBUTES && !(dwAttributes&FILE_ATTRIBUTE_DIRECTORY)) {
- pszLastBackslash=_tcsrchr(szExistingDir, '\\');
- if (pszLastBackslash == NULL) {*szExistingDir='\0'; break;}
- *pszLastBackslash='\0';
+ while ((dwAttributes = GetFileAttributes(szExistingDir)) != INVALID_FILE_ATTRIBUTES && !(dwAttributes&FILE_ATTRIBUTE_DIRECTORY)) {
+ pszLastBackslash = _tcsrchr(szExistingDir, '\\');
+ if (pszLastBackslash == NULL) {*szExistingDir = '\0'; break;}
+ *pszLastBackslash = '\0';
}
if (szExistingDir[0] == '\0') GetCurrentDirectory(cchExistingDir, szExistingDir);
}
@@ -50,7 +50,7 @@ void RemoveInvalidFilenameChars(TCHAR *tszString)
{
size_t i;
if (tszString) {
- for (i=_tcscspn(tszString, InvalidFilenameChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidFilenameChars)+1)
+ for (i = _tcscspn(tszString, InvalidFilenameChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidFilenameChars)+1)
if (tszString[i] >= 0)
tszString[i] = _T('_');
}
@@ -61,7 +61,7 @@ void RemoveInvalidPathChars(TCHAR *tszString)
{
size_t i;
if (tszString) {
- for (i=_tcscspn(tszString, InvalidPathChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidPathChars)+1)
+ for (i = _tcscspn(tszString, InvalidPathChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidPathChars)+1)
if (tszString[i] >= 0)
tszString[i] = _T('_');
}
@@ -84,17 +84,17 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p
int BrowseForFolder(HWND hwnd, TCHAR *szPath)
{
- BROWSEINFO bi={0};
+ BROWSEINFO bi = {0};
LPITEMIDLIST pidlResult;
- bi.hwndOwner=hwnd;
- bi.pszDisplayName=szPath;
- bi.lpszTitle=TranslateT("Select Folder");
- bi.ulFlags=BIF_NEWDIALOGSTYLE|BIF_EDITBOX|BIF_RETURNONLYFSDIRS; // Use this combo instead of BIF_USENEWUI
- bi.lpfn=BrowseCallbackProc;
- bi.lParam=(LPARAM)szPath;
+ bi.hwndOwner = hwnd;
+ bi.pszDisplayName = szPath;
+ bi.lpszTitle = TranslateT("Select Folder");
+ bi.ulFlags = BIF_NEWDIALOGSTYLE|BIF_EDITBOX|BIF_RETURNONLYFSDIRS; // Use this combo instead of BIF_USENEWUI
+ bi.lpfn = BrowseCallbackProc;
+ bi.lParam = (LPARAM)szPath;
- pidlResult=SHBrowseForFolder(&bi);
+ pidlResult = SHBrowseForFolder(&bi);
if (pidlResult) {
SHGetPathFromIDList(pidlResult, szPath);
lstrcat(szPath, _T("\\"));
@@ -103,7 +103,7 @@ int BrowseForFolder(HWND hwnd, TCHAR *szPath)
return pidlResult != NULL;
}
-static REPLACEVARSARRAY sttVarsToReplace[] =
+static REPLACEVARSARRAY sttVarsToReplace[] =
{
{ (TCHAR*)"///", (TCHAR*)"//" },
{ (TCHAR*)"//", (TCHAR*)"/" },
@@ -149,13 +149,13 @@ void GetContactReceivedFilesDir(HANDLE hContact, TCHAR *szDir, int cchDir, BOOL
if (hContact) {
REPLACEVARSDATA dat = { 0 };
REPLACEVARSARRAY rvaVarsToReplace[4];
- rvaVarsToReplace[0].lptzKey = _T("nick");
+ rvaVarsToReplace[0].lptzKey = _T("nick");
rvaVarsToReplace[0].lptzValue = mir_tstrdup((TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR));
- rvaVarsToReplace[1].lptzKey = _T("userid");
+ rvaVarsToReplace[1].lptzKey = _T("userid");
rvaVarsToReplace[1].lptzValue = GetContactID(hContact);
- rvaVarsToReplace[2].lptzKey = _T("proto");
+ rvaVarsToReplace[2].lptzKey = _T("proto");
rvaVarsToReplace[2].lptzValue = mir_a2t((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
- rvaVarsToReplace[3].lptzKey = NULL;
+ rvaVarsToReplace[3].lptzKey = NULL;
rvaVarsToReplace[3].lptzValue = NULL;
for (int i=0; i < (SIZEOF(rvaVarsToReplace)-1);i++)
RemoveInvalidFilenameChars(rvaVarsToReplace[i].lptzValue);
@@ -204,7 +204,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
{
struct FileDlgData *dat;
- dat=(struct FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ dat = (struct FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG: {
TCHAR *contactName;
@@ -213,7 +213,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
TranslateDialogDefault(hwndDlg);
- dat=(struct FileDlgData*)mir_calloc(sizeof(struct FileDlgData));
+ dat = (struct FileDlgData*)mir_calloc(sizeof(struct FileDlgData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
dat->hContact = cle->hContact;
dat->hDbEvent = cle->hDbEvent;
@@ -250,13 +250,13 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
CallService(MS_DB_EVENT_MARKREAD, (WPARAM)dat->hContact, (LPARAM)dat->hDbEvent);
{
- DBEVENTINFO dbei={0};
+ DBEVENTINFO dbei = {0};
TCHAR datetimestr[64];
char buf[540];
- dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)dat->hDbEvent, 0);
- dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob);
+ dbei.cbSize = sizeof(dbei);
+ dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)dat->hDbEvent, 0);
+ dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
CallService(MS_DB_EVENT_GET, (WPARAM)dat->hDbEvent, (LPARAM)&dbei);
dat->fs = cle->lParam ? (HANDLE)cle->lParam : (HANDLE)*(PDWORD)dbei.pBlob;
lstrcpynA(buf, (char*)dbei.pBlob+4, min(dbei.cbBlob+1, SIZEOF(buf)));
@@ -322,15 +322,15 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
case WM_DRAWITEM:
- { LPDRAWITEMSTRUCT dis=(LPDRAWITEMSTRUCT)lParam;
+ { LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
if (szProto) {
HICON hIcon;
- hIcon=(HICON)CallProtoServiceInt(NULL,szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ hIcon = (HICON)CallProtoServiceInt(NULL,szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (hIcon) {
DrawIconEx(dis->hDC, dis->rcItem.left, dis->rcItem.top, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
DestroyIcon(hIcon);
@@ -363,7 +363,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
char idstr[32];
int i;
DBVARIANT dbv;
- for (i=MAX_MRU_DIRS-2;i>=0;i--) {
+ for (i = MAX_MRU_DIRS-2;i>=0;i--) {
mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i);
if (DBGetContactSettingTString(NULL, "SRFile", idstr, &dbv)) continue;
mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i+1);
@@ -393,16 +393,16 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case IDCANCEL:
if (dat->fs) CallContactService(dat->hContact, PSS_FILEDENYT, (WPARAM)dat->fs, (LPARAM)TranslateT("Cancelled"));
- dat->fs=NULL; /* the protocol will free the handle */
+ dat->fs = NULL; /* the protocol will free the handle */
DestroyWindow(hwndDlg);
break;
case IDC_ADD:
- { ADDCONTACTSTRUCT acs={0};
+ { ADDCONTACTSTRUCT acs = {0};
- acs.handle=dat->hContact;
- acs.handleType=HANDLE_CONTACT;
- acs.szProto="";
+ acs.handle = dat->hContact;
+ acs.handleType = HANDLE_CONTACT;
+ acs.szProto = "";
CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs);
if ( !DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0))
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE);
@@ -411,7 +411,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case IDC_USERMENU:
{ RECT rc;
- HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
+ HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
GetWindowRect((HWND)lParam, &rc);
TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL);
DestroyMenu(hMenu);
diff --git a/src/modules/srfile/filesenddlg.cpp b/src/modules/srfile/filesenddlg.cpp
index 92875ddbdb..7614d38a4e 100644
--- a/src/modules/srfile/filesenddlg.cpp
+++ b/src/modules/srfile/filesenddlg.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static void SetFileListAndSizeControls(HWND hwndDlg, struct FileDlgData *dat)
{
- int fileCount=0, dirCount=0, totalSize=0, i;
+ int fileCount = 0, dirCount = 0, totalSize = 0, i;
struct _stat statbuf;
TCHAR str[64];
@@ -145,7 +145,7 @@ void __cdecl ChooseFilesThread(void* param)
else {
OPENFILENAME ofn = {0};
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- ofn.hwndOwner = hwndDlg;
+ ofn.hwndOwner = hwndDlg;
lstrcpy(filter, TranslateT("All Files"));
lstrcat(filter, _T(" (*)"));
pfilter = filter + lstrlen(filter)+1;
@@ -193,23 +193,23 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
{
struct FileDlgData *dat;
- dat=(struct FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ dat = (struct FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
{
- struct FileSendData *fsd=(struct FileSendData*)lParam;
+ struct FileSendData *fsd = (struct FileSendData*)lParam;
- dat=(struct FileDlgData*)mir_calloc(sizeof(struct FileDlgData));
+ dat = (struct FileDlgData*)mir_calloc(sizeof(struct FileDlgData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- dat->hContact=fsd->hContact;
- dat->send=1;
- dat->hPreshutdownEvent=HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwndDlg, M_PRESHUTDOWN);
- dat->fs=NULL;
- dat->dwTicks=GetTickCount();
+ dat->hContact = fsd->hContact;
+ dat->send = 1;
+ dat->hPreshutdownEvent = HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwndDlg, M_PRESHUTDOWN);
+ dat->fs = NULL;
+ dat->dwTicks = GetTickCount();
TranslateDialogDefault(hwndDlg);
EnumChildWindows(hwndDlg, ClipSiblingsChildEnumProc, 0);
- OldSendEditProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc);
+ OldSendEditProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc);
Window_SetIcon_IcoLib(hwndDlg, SKINICON_EVENT_FILE);
Button_SetIcon_IcoLib(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View User's Details"));
@@ -220,11 +220,11 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (fsd->ppFiles != NULL && fsd->ppFiles[0] != NULL) {
int totalCount, i;
- for (totalCount=0;fsd->ppFiles[totalCount];totalCount++);
+ for (totalCount = 0;fsd->ppFiles[totalCount];totalCount++);
dat->files = (TCHAR**)mir_alloc(sizeof(TCHAR*)*(totalCount+1)); // Leaks
for (i=0;i<totalCount;i++)
dat->files[i] = mir_tstrdup(fsd->ppFiles[i]);
- dat->files[totalCount]=NULL;
+ dat->files[totalCount] = NULL;
SetFileListAndSizeControls(hwndDlg, dat);
}
{
@@ -232,7 +232,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
TCHAR* contactName = cli.pfnGetContactDisplayName(dat->hContact, 0);
SetDlgItemText(hwndDlg, IDC_TO, contactName);
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
if (szProto) {
CONTACTINFO ci;
int hasName = 0;
@@ -264,7 +264,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (fsd->ppFiles == NULL) {
EnableWindow(hwndDlg, FALSE);
- dat->closeIfFileChooseCancelled=1;
+ dat->closeIfFileChooseCancelled = 1;
PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_CHOOSE, BN_CLICKED), (LPARAM)GetDlgItem(hwndDlg, IDC_CHOOSE));
}
return TRUE;
@@ -275,11 +275,11 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_DRAWITEM:
{
- LPDRAWITEMSTRUCT dis=(LPDRAWITEMSTRUCT)lParam;
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
if (szProto) {
HICON hIcon = (HICON)CallProtoServiceInt(NULL,szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (hIcon) {
@@ -327,7 +327,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case IDC_USERMENU:
{ RECT rc;
- HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
+ HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
GetWindowRect((HWND)lParam, &rc);
TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL);
DestroyMenu(hMenu);
diff --git a/src/modules/srfile/filexferdlg.cpp b/src/modules/srfile/filexferdlg.cpp
index 99eed2c3d9..3648e2306e 100644
--- a/src/modules/srfile/filexferdlg.cpp
+++ b/src/modules/srfile/filexferdlg.cpp
@@ -86,8 +86,8 @@ void FillSendData(FileDlgData* dat, DBEVENTINFO& dbei)
dbei.flags |= DBEF_UTF;
dbei.cbBlob = sizeof(DWORD) + lstrlenA(szFileNames)+lstrlenA(szMsg)+2;
- dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob);
- *(PDWORD)dbei.pBlob=0;
+ dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
+ *(PDWORD)dbei.pBlob = 0;
lstrcpyA((char*)dbei.pBlob+sizeof(DWORD), szFileNames);
lstrcpyA((char*)dbei.pBlob+sizeof(DWORD)+lstrlenA(szFileNames)+1, szMsg);
@@ -98,7 +98,7 @@ void FillSendData(FileDlgData* dat, DBEVENTINFO& dbei)
static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info)
{
PROCESS_INFORMATION pi;
- STARTUPINFO si={0};
+ STARTUPINFO si = {0};
DBVARIANT dbv;
TCHAR szCmdLine[768];
@@ -107,7 +107,7 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info)
if (dbv.ptszVal[0])
{
TCHAR *pszReplace;
- si.cb=sizeof(si);
+ si.cb = sizeof(si);
pszReplace = _tcsstr(dbv.ptszVal, _T("%f"));
if (pszReplace)
{
@@ -163,7 +163,7 @@ static void SetFilenameControls(HWND hwndDlg, struct FileDlgData *dat, PROTOFILE
lstrcpyn(msg, cli.pfnGetContactDisplayName(fts->hContact, 0), SIZEOF(msg));
HICON hIcon = LoadSkinIcon(SKINICON_OTHER_DOWNARROW);
dat->hIcon = CopyIcon(hIcon);
- IconLib_ReleaseIcon(hIcon, NULL);
+ IcoLib_ReleaseIcon(hIcon, NULL);
}
mir_free(fnbuf);
@@ -239,38 +239,38 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
TranslateDialogDefault(hwndDlg);
dat = (FileDlgData*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- dat->hNotifyEvent=HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_RECVEVENT);
+ dat->hNotifyEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_RECVEVENT);
dat->transferStatus.currentFileNumber = -1;
if (dat->send) {
- dat->fs=(HANDLE)CallContactService(dat->hContact, PSS_FILET, (WPARAM)dat->szMsg, (LPARAM)dat->files);
+ dat->fs = (HANDLE)CallContactService(dat->hContact, PSS_FILET, (WPARAM)dat->szMsg, (LPARAM)dat->files);
SetFtStatus(hwndDlg, LPGENT("Request sent, waiting for acceptance..."), FTS_TEXT);
SetOpenFileButtonStyle(GetDlgItem(hwndDlg, IDC_OPENFILE), 1);
- dat->waitingForAcceptance=1;
+ dat->waitingForAcceptance = 1;
// hide "open" button since it may cause potential access violations...
ShowWindow(GetDlgItem(hwndDlg, IDC_OPENFILE), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_OPENFOLDER), SW_HIDE);
}
else { //recv
CreateDirectoryTreeT(dat->szSavePath);
- dat->fs=(HANDLE)CallContactService(dat->hContact, PSS_FILEALLOWT, (WPARAM)dat->fs, (LPARAM)dat->szSavePath);
+ dat->fs = (HANDLE)CallContactService(dat->hContact, PSS_FILEALLOWT, (WPARAM)dat->fs, (LPARAM)dat->szSavePath);
dat->transferStatus.tszWorkingDir = mir_tstrdup(dat->szSavePath);
- if (DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0)) dat->resumeBehaviour=FILERESUME_ASK;
- else dat->resumeBehaviour=DBGetContactSettingByte(NULL, "SRFile", "IfExists", FILERESUME_ASK);
+ if (DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0)) dat->resumeBehaviour = FILERESUME_ASK;
+ else dat->resumeBehaviour = DBGetContactSettingByte(NULL, "SRFile", "IfExists", FILERESUME_ASK);
SetFtStatus(hwndDlg, LPGENT("Waiting for connection..."), FTS_TEXT);
}
{
/* check we actually got an fs handle back from the protocol */
if ( !dat->fs) {
SetFtStatus(hwndDlg, LPGENT("Unable to initiate transfer."), FTS_TEXT);
- dat->waitingForAcceptance=0;
+ dat->waitingForAcceptance = 0;
}
}
{ LOGFONT lf;
HFONT hFont;
- hFont=(HFONT)SendDlgItemMessage(hwndDlg, IDC_CONTACTNAME, WM_GETFONT, 0, 0);
+ hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_CONTACTNAME, WM_GETFONT, 0, 0);
GetObject(hFont, sizeof(lf), &lf);
- lf.lfWeight=FW_BOLD;
- hFont=CreateFontIndirect(&lf);
+ lf.lfWeight = FW_BOLD;
+ hFont = CreateFontIndirect(&lf);
SendDlgItemMessage(hwndDlg, IDC_CONTACTNAME, WM_SETFONT, (WPARAM)hFont, 0);
}
@@ -301,7 +301,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
return TRUE;
case WM_TIMER:
MoveMemory(dat->bytesRecvedHistory+1, dat->bytesRecvedHistory, sizeof(dat->bytesRecvedHistory)-sizeof(dat->bytesRecvedHistory[0]));
- dat->bytesRecvedHistory[0]=dat->transferStatus.totalProgress;
+ dat->bytesRecvedHistory[0] = dat->transferStatus.totalProgress;
if (dat->bytesRecvedHistorySize < SIZEOF(dat->bytesRecvedHistory))
dat->bytesRecvedHistorySize++;
@@ -320,7 +320,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT|TIME_NOTIMEMARKER, &st, NULL, szTime, SIZEOF(szTime));
}
if (dat->bytesRecvedHistory[0] != dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]) {
- li.QuadPart=BIGI(10000000)*(dat->transferStatus.totalBytes-dat->transferStatus.totalProgress)*dat->bytesRecvedHistorySize/(dat->bytesRecvedHistory[0]-dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]);
+ li.QuadPart = BIGI(10000000)*(dat->transferStatus.totalBytes-dat->transferStatus.totalProgress)*dat->bytesRecvedHistorySize/(dat->bytesRecvedHistory[0]-dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]);
ft.dwHighDateTime = li.HighPart; ft.dwLowDateTime = li.LowPart;
FileTimeToSystemTime(&ft, &st);
GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT|TIME_NOTIMEMARKER, &st, NULL, szTime, SIZEOF(szTime));
@@ -359,7 +359,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case IDC_CONTACT:
{ RECT rc;
- HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
+ HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
GetWindowRect((HWND)lParam, &rc);
TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL);
DestroyMenu(hMenu);
@@ -400,7 +400,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
else
files = dat->files;
else
- files=dat->files;
+ files = dat->files;
hMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_STRING, 1, TranslateT("Open folder"));
@@ -417,7 +417,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
limit = dat->transferStatus.currentFileNumber;
// Loop over all transfered files and add them to the menu
- for (i = 0; i < limit; i++) {
+ for (i=0; i < limit; i++) {
pszFilename = _tcsrchr(files[i], '\\');
if (pszFilename == NULL)
pszFilename = files[i];
@@ -429,10 +429,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
pszNewFileName = (TCHAR*)mir_alloc(cbFileNameLen*2*sizeof(TCHAR));
TCHAR *p = pszNewFileName;
- for (size_t pszlen=0; pszlen < cbFileNameLen; pszlen++) {
- *p++ = pszFilename[pszlen];
+ for (size_t pszlen = 0; pszlen < cbFileNameLen; pszlen++) {
+ *p++=pszFilename[pszlen];
if (pszFilename[pszlen] == '&')
- *p++ = '&';
+ *p++='&';
}
*p = '\0';
AppendMenu(hMenu, MF_STRING, i+10, pszNewFileName);
@@ -467,33 +467,33 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
break;
case M_FILEEXISTSDLGREPLY:
- { PROTOFILERESUME *pfr=(PROTOFILERESUME*)lParam;
- TCHAR *szOriginalFilename=(TCHAR*)wParam;
- char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ { PROTOFILERESUME *pfr = (PROTOFILERESUME*)lParam;
+ TCHAR *szOriginalFilename = (TCHAR*)wParam;
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
EnableWindow(hwndDlg, TRUE);
switch(pfr->action) {
case FILERESUME_CANCEL:
if (dat->fs) CallContactService(dat->hContact, PSS_FILECANCEL, (WPARAM)dat->fs, 0);
- dat->fs=NULL;
+ dat->fs = NULL;
mir_free(szOriginalFilename);
if (pfr->szFilename) mir_free((char*)pfr->szFilename);
mir_free(pfr);
return 0;
case FILERESUME_RESUMEALL:
case FILERESUME_OVERWRITEALL:
- dat->resumeBehaviour=pfr->action;
+ dat->resumeBehaviour = pfr->action;
pfr->action&=~FILERESUMEF_ALL;
break;
case FILERESUME_RENAMEALL:
- pfr->action=FILERESUME_RENAME;
+ pfr->action = FILERESUME_RENAME;
{ TCHAR *pszExtension, *pszFilename;
int i;
- if ((pszFilename = _tcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename=szOriginalFilename;
- if ((pszExtension = _tcsrchr(pszFilename+1, '.')) == NULL) pszExtension=pszFilename+lstrlen(pszFilename);
+ if ((pszFilename = _tcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename = szOriginalFilename;
+ if ((pszExtension = _tcsrchr(pszFilename+1, '.')) == NULL) pszExtension = pszFilename+lstrlen(pszFilename);
if (pfr->szFilename) mir_free((TCHAR*)pfr->szFilename);
pfr->szFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*((pszExtension-szOriginalFilename)+21+lstrlen(pszExtension)));
- for (i=1;;i++) {
+ for (i = 1;;i++) {
_stprintf((TCHAR*)pfr->szFilename, _T("%.*s (%u)%s"), pszExtension-szOriginalFilename, szOriginalFilename, i, pszExtension);
if (_taccess(pfr->szFilename, 0) != 0)
break;
@@ -508,14 +508,14 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
break;
}
case HM_RECVEVENT:
- { ACKDATA *ack=(ACKDATA*)lParam;
+ { ACKDATA *ack = (ACKDATA*)lParam;
if (ack->hProcess != dat->fs) break; /* icq abuses this sometimes */
if (ack->hContact != dat->hContact) break;
if (ack->type != ACKTYPE_FILE) break;
if (dat->waitingForAcceptance) {
SetTimer(hwndDlg, 1, 1000, NULL);
- dat->waitingForAcceptance=0;
+ dat->waitingForAcceptance = 0;
}
switch(ack->result) {
case ACKRESULT_SENTREQUEST: SetFtStatus(hwndDlg, LPGENT("Decision sent"), FTS_TEXT); break;
@@ -534,7 +534,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
PostMessage(hwndDlg, M_VIRUSSCANDONE, dat->transferStatus.currentFileNumber, 0);
else {
virusscanthreadstartinfo *vstsi;
- vstsi=(struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo));
+ vstsi = (struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo));
vstsi->hwndReply = hwndDlg;
vstsi->szFile = mir_tstrdup(dat->files[dat->transferStatus.currentFileNumber]);
vstsi->returnCode = dat->transferStatus.currentFileNumber;
@@ -561,7 +561,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
else {
PROTOFILERESUME *pfr;
- pfr=(PROTOFILERESUME*)mir_alloc(sizeof(PROTOFILERESUME));
+ pfr = (PROTOFILERESUME*)mir_alloc(sizeof(PROTOFILERESUME));
pfr->action = dat->resumeBehaviour;
pfr->szFilename = NULL;
PostMessage(hwndDlg, M_FILEEXISTSDLGREPLY, (WPARAM)mir_tstrdup(fts->tszCurrentFile), (LPARAM)pfr);
@@ -571,12 +571,12 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
case ACKRESULT_DATA:
{
- PROTOFILETRANSFERSTATUS *fts=(PROTOFILETRANSFERSTATUS*)ack->lParam;
+ PROTOFILETRANSFERSTATUS *fts = (PROTOFILETRANSFERSTATUS*)ack->lParam;
TCHAR str[64], str2[64], szSizeDone[32], szSizeTotal[32];//, *contactName;
int units;
if (dat->fileVirusScanned == NULL)
- dat->fileVirusScanned=(int*)mir_calloc(sizeof(int) * fts->totalFiles);
+ dat->fileVirusScanned = (int*)mir_calloc(sizeof(int) * fts->totalFiles);
// This needs to be here - otherwise we get holes in the files array
if ( !dat->send) {
@@ -632,31 +632,31 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SetDlgItemText(hwndDlg, IDCANCEL, TranslateT("Close"));
if (dat->hNotifyEvent)
UnhookEvent(dat->hNotifyEvent);
- dat->hNotifyEvent=NULL;
+ dat->hNotifyEvent = NULL;
if (ack->result == ACKRESULT_DENIED)
{
- dat->fs=NULL; /* protocol will free structure */
+ dat->fs = NULL; /* protocol will free structure */
SkinPlaySound("FileDenied");
SetFtStatus(hwndDlg, LPGENT("File transfer denied"), FTS_TEXT);
} else if (ack->result == ACKRESULT_FAILED)
{
- dat->fs=NULL; /* protocol will free structure */
+ dat->fs = NULL; /* protocol will free structure */
SkinPlaySound("FileFailed");
SetFtStatus(hwndDlg, LPGENT("File transfer failed"), FTS_TEXT);
} else {
SkinPlaySound("FileDone");
if (dat->send)
{
- dat->fs=NULL; /* protocol will free structure */
+ dat->fs = NULL; /* protocol will free structure */
SetFtStatus(hwndDlg, LPGENT("Transfer completed."), FTS_TEXT);
- DBEVENTINFO dbei={0};
+ DBEVENTINFO dbei = {0};
FillSendData(dat, dbei);
CallService(MS_DB_EVENT_ADD, (WPARAM)dat->hContact, (LPARAM)&dbei);
if (dbei.pBlob)
mir_free(dbei.pBlob);
- dat->files=NULL; //protocol library frees this
+ dat->files = NULL; //protocol library frees this
} else {
SetFtStatus(hwndDlg,
@@ -665,17 +665,17 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
LPGENT("Transfer completed, open folder."),
FTS_OPEN);
- int useScanner=DBGetContactSettingByte(NULL, "SRFile", "UseScanner", VIRUSSCAN_DISABLE);
+ int useScanner = DBGetContactSettingByte(NULL, "SRFile", "UseScanner", VIRUSSCAN_DISABLE);
if (useScanner != VIRUSSCAN_DISABLE) {
struct virusscanthreadstartinfo *vstsi;
- vstsi=(struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo));
- vstsi->hwndReply=hwndDlg;
+ vstsi = (struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo));
+ vstsi->hwndReply = hwndDlg;
if (useScanner == VIRUSSCAN_DURINGDL) {
- vstsi->returnCode=dat->transferStatus.currentFileNumber;
+ vstsi->returnCode = dat->transferStatus.currentFileNumber;
if (GetFileAttributes(dat->files[dat->transferStatus.currentFileNumber])&FILE_ATTRIBUTE_DIRECTORY) {
PostMessage(hwndDlg, M_VIRUSSCANDONE, vstsi->returnCode, 0);
mir_free(vstsi);
- vstsi=NULL;
+ vstsi = NULL;
}
else vstsi->szFile = mir_tstrdup(dat->files[dat->transferStatus.currentFileNumber]);
}
@@ -687,9 +687,9 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (vstsi)
forkthread((void (*)(void*))RunVirusScannerThread, 0, vstsi);
}
- else dat->fs=NULL; /* protocol will free structure */
+ else dat->fs = NULL; /* protocol will free structure */
- dat->transferStatus.currentFileNumber=dat->transferStatus.totalFiles;
+ dat->transferStatus.currentFileNumber = dat->transferStatus.totalFiles;
} // else dat->send
} // else ack->result
@@ -701,29 +701,29 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
} // switch ack->result
} break; // case HM_RECVEVENT
case M_VIRUSSCANDONE:
- { int done=1, i;
+ { int done = 1, i;
if ((int)wParam == -1) {
- for (i=0;i<dat->transferStatus.totalFiles;i++) dat->fileVirusScanned[i]=1;
+ for (i=0;i<dat->transferStatus.totalFiles;i++) dat->fileVirusScanned[i] = 1;
}
else {
- dat->fileVirusScanned[wParam]=1;
- for (i=0;i<dat->transferStatus.totalFiles;i++) if ( !dat->fileVirusScanned[i]) {done=0; break;}
+ dat->fileVirusScanned[wParam] = 1;
+ for (i=0;i<dat->transferStatus.totalFiles;i++) if ( !dat->fileVirusScanned[i]) {done = 0; break;}
}
if (done)
{
- dat->fs=NULL; /* protocol will free structure */
+ dat->fs = NULL; /* protocol will free structure */
SetFtStatus(hwndDlg, LPGENT("Transfer and virus scan complete"), FTS_TEXT);
}
break;
}
case WM_SIZE:
{
- UTILRESIZEDIALOG urd={0};
- urd.cbSize=sizeof(urd);
- urd.hwndDlg=hwndDlg;
- urd.hInstance=hInst;
- urd.lpTemplate=MAKEINTRESOURCEA(IDD_FILETRANSFERINFO);
- urd.pfnResizer=FileTransferDlgResizer;
+ UTILRESIZEDIALOG urd = {0};
+ urd.cbSize = sizeof(urd);
+ urd.hwndDlg = hwndDlg;
+ urd.hInstance = hInst;
+ urd.lpTemplate = MAKEINTRESOURCEA(IDD_FILETRANSFERINFO);
+ urd.pfnResizer = FileTransferDlgResizer;
CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd);
RedrawWindow(GetDlgItem(hwndDlg, IDC_ALLTRANSFERRED), NULL, NULL, RDW_INVALIDATE|RDW_NOERASE);
diff --git a/src/modules/srfile/ftmanager.cpp b/src/modules/srfile/ftmanager.cpp
index 7e0dcfc9cc..567e038fc6 100644
--- a/src/modules/srfile/ftmanager.cpp
+++ b/src/modules/srfile/ftmanager.cpp
@@ -78,7 +78,7 @@ static void LayoutTransfers(HWND hwnd, struct TFtPageData *dat)
hdwp = BeginDeferWindowPos(dat->wnds->realCount);
top -= dat->scrollPos;
- for (i = 0; i < dat->wnds->realCount; ++i)
+ for (i=0; i < dat->wnds->realCount; ++i)
{
int height = dat->wnds->items[i]->rc.bottom - dat->wnds->items[i]->rc.top;
hdwp = DeferWindowPos(hdwp, dat->wnds->items[i]->hwnd, NULL, 0, top, rc.right, height, SWP_NOZORDER);
@@ -138,7 +138,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
case WM_FT_RESIZE:
{
int i;
- for (i = 0; i < dat->wnds->realCount; ++i)
+ for (i=0; i < dat->wnds->realCount; ++i)
if (dat->wnds->items[i]->hwnd == (HWND)lParam)
{
GetWindowRect(dat->wnds->items[i]->hwnd, &dat->wnds->items[i]->rc);
@@ -151,7 +151,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
case WM_FT_REMOVE:
{
int i;
- for (i = 0; i < dat->wnds->realCount; ++i)
+ for (i=0; i < dat->wnds->realCount; ++i)
if (dat->wnds->items[i]->hwnd == (HWND)lParam)
{
mir_free(dat->wnds->items[i]);
@@ -165,7 +165,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
case WM_FT_COMPLETED:
{ //wParam: { ACKRESULT_SUCCESS | ACKRESULT_FAILED | ACKRESULT_DENIED }
dat->runningCount--;
- int i = 0;
+ int i=0;
while (i < dat->wnds->realCount)
{
// no error when canceling (WM_FT_REMOVE is send first, check if hwnd is still registered)
@@ -187,7 +187,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
case WM_FT_CLEANUP:
{
int i;
- for (i = 0; i < dat->wnds->realCount; ++i)
+ for (i=0; i < dat->wnds->realCount; ++i)
SendMessage(dat->wnds->items[i]->hwnd, WM_FT_CLEANUP, wParam, lParam);
break;
}
@@ -205,7 +205,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
{
int i, nScrollLines = 0;
SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, (void*)&nScrollLines, 0);
- for (i = 0; i < (nScrollLines + 1) / 2; i++)
+ for (i=0; i < (nScrollLines + 1) / 2; i++)
SendMessage(hwnd, WM_VSCROLL, (zDelta < 0) ? SB_LINEDOWN : SB_LINEUP, 0);
}
@@ -250,7 +250,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
case M_PRESHUTDOWN:
{
int i;
- for (i = 0; i < dat->wnds->realCount; ++i)
+ for (i=0; i < dat->wnds->realCount; ++i)
PostMessage(dat->wnds->items[i]->hwnd, WM_COMMAND, MAKEWPARAM(IDCANCEL, BN_CLICKED), 0);
break;
}
@@ -258,7 +258,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
case WM_DESTROY:
{
int i;
- for (i = 0; i < dat->wnds->realCount; ++i)
+ for (i=0; i < dat->wnds->realCount; ++i)
mir_free(dat->wnds->items[i]);
List_Destroy((SortedList *)dat->wnds);
mir_free(dat->wnds);
@@ -270,7 +270,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
{
int i;
TFtProgressData * prg = (TFtProgressData *)wParam;
- for (i = 0; i < dat->wnds->realCount; ++i)
+ for (i=0; i < dat->wnds->realCount; ++i)
{
struct FileDlgData *trdat = (struct FileDlgData *)GetWindowLongPtr(dat->wnds->items[i]->hwnd, GWLP_USERDATA);
if (trdat->transferStatus.totalBytes && trdat->fs && !trdat->send && (trdat->transferStatus.totalBytes == trdat->transferStatus.totalProgress))
@@ -327,7 +327,7 @@ static INT_PTR CALLBACK FtMgrDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
// Utils_RestoreWindowPosition(hwnd, NULL, "SRFile", "FtMgrDlg_");
SAVEWINDOWPOS swp;
- swp.hwnd=hwnd; swp.hContact=NULL; swp.szModule="SRFile"; swp.szNamePrefix="FtMgrDlg_";
+ swp.hwnd = hwnd; swp.hContact = NULL; swp.szModule = "SRFile"; swp.szNamePrefix = "FtMgrDlg_";
CallService(MS_UTILS_RESTOREWINDOWPOSITION, RWPF_NOACTIVATE, (LPARAM)&swp);
// Fall through to setup initial placement
diff --git a/src/modules/srurl/url.cpp b/src/modules/srurl/url.cpp
index fe790330c0..ba1b025296 100644
--- a/src/modules/srurl/url.cpp
+++ b/src/modules/srurl/url.cpp
@@ -45,21 +45,21 @@ static int UrlEventAdded(WPARAM wParam, LPARAM lParam)
TCHAR szTooltip[256];
ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=0;
+ dbei.cbSize = sizeof(dbei);
+ dbei.cbBlob = 0;
CallService(MS_DB_EVENT_GET, lParam, (LPARAM)&dbei);
if (dbei.flags&(DBEF_SENT|DBEF_READ) || dbei.eventType != EVENTTYPE_URL) return 0;
SkinPlaySound("RecvUrl");
ZeroMemory(&cle, sizeof(cle));
- cle.cbSize=sizeof(cle);
+ cle.cbSize = sizeof(cle);
cle.flags = CLEF_TCHAR;
- cle.hContact=(HANDLE)wParam;
- cle.hDbEvent=(HANDLE)lParam;
+ cle.hContact = (HANDLE)wParam;
+ cle.hDbEvent = (HANDLE)lParam;
cle.hIcon = LoadSkinIcon(SKINICON_EVENT_URL);
- cle.pszService="SRUrl/ReadUrl";
+ cle.pszService = "SRUrl/ReadUrl";
mir_sntprintf(szTooltip, SIZEOF(szTooltip), TranslateT("URL from %s"), cli.pfnGetContactDisplayName((HANDLE)wParam, 0));
- cle.ptszTooltip=szTooltip;
+ cle.ptszTooltip = szTooltip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
return 0;
}
@@ -72,42 +72,42 @@ static INT_PTR SendUrlCommand(WPARAM wParam, LPARAM)
static void RestoreUnreadUrlAlerts(void)
{
- CLISTEVENT cle={0};
- DBEVENTINFO dbei={0};
+ CLISTEVENT cle = {0};
+ DBEVENTINFO dbei = {0};
TCHAR toolTip[256];
HANDLE hDbEvent, hContact;
- dbei.cbSize=sizeof(dbei);
- cle.cbSize=sizeof(cle);
+ dbei.cbSize = sizeof(dbei);
+ cle.cbSize = sizeof(cle);
cle.hIcon = LoadSkinIcon(SKINICON_EVENT_URL);
- cle.pszService="SRUrl/ReadUrl";
+ cle.pszService = "SRUrl/ReadUrl";
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact) {
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM)hContact, 0);
+ hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM)hContact, 0);
while (hDbEvent) {
- dbei.cbBlob=0;
+ dbei.cbBlob = 0;
CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
if ( !(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType == EVENTTYPE_URL) {
- cle.hContact=hContact;
- cle.hDbEvent=hDbEvent;
+ cle.hContact = hContact;
+ cle.hDbEvent = hDbEvent;
cle.flags = CLEF_TCHAR;
mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("URL from %s"), cli.pfnGetContactDisplayName(hContact, 0));
- cle.ptszTooltip=toolTip;
+ cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hDbEvent, 0);
+ hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hDbEvent, 0);
}
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}
}
static int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
- DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto))) return 0;
WindowList_Broadcast(hUrlWindowList, DM_UPDATETITLE, 0, 0);
return 0;
@@ -168,7 +168,7 @@ int UrlContactDeleted(WPARAM wParam, LPARAM)
int LoadSendRecvUrlModule(void)
{
- hUrlWindowList=(HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hUrlWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
HookEvent(ME_SYSTEM_MODULESLOADED, SRUrlModulesLoaded);
HookEvent(ME_DB_EVENT_ADDED, UrlEventAdded);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, SRUrlPreBuildMenu);
diff --git a/src/modules/srurl/urldialogs.cpp b/src/modules/srurl/urldialogs.cpp
index 6fb5e7f33a..1198b70bef 100644
--- a/src/modules/srurl/urldialogs.cpp
+++ b/src/modules/srurl/urldialogs.cpp
@@ -89,7 +89,7 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
Button_SetIcon_IcoLib(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGEN("View User's History"));
Button_SetIcon_IcoLib(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGEN("User Menu"));
- dat=(struct UrlRcvData*)mir_alloc(sizeof(struct UrlRcvData));
+ dat = (struct UrlRcvData*)mir_alloc(sizeof(struct UrlRcvData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
dat->hContact = ((CLISTEVENT*)lParam)->hContact;
@@ -102,9 +102,9 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
TCHAR msg[128];
ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)dat->hDbEvent, 0);
- dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob);
+ dbei.cbSize = sizeof(dbei);
+ dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)dat->hDbEvent, 0);
+ dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
CallService(MS_DB_EVENT_GET, (WPARAM)dat->hDbEvent, (LPARAM)&dbei);
SetDlgItemTextA(hwndDlg, IDC_URL, (char*)dbei.pBlob);
SetDlgItemTextA(hwndDlg, IDC_MSG, (char*)dbei.pBlob+lstrlenA((char*)dbei.pBlob)+1);
@@ -137,11 +137,11 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case WM_DRAWITEM:
{
- LPDRAWITEMSTRUCT dis=(LPDRAWITEMSTRUCT)lParam;
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
if (szProto) {
HICON hIcon;
@@ -166,8 +166,8 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
RECT rc;
char url[256];
- hMenu=LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
- hSubMenu=GetSubMenu(hMenu, 6);
+ hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
+ hSubMenu = GetSubMenu(hMenu, 6);
TranslateMenu(hSubMenu);
GetWindowRect((HWND)lParam, &rc);
GetDlgItemTextA(hwndDlg, IDC_URL, url, SIZEOF(url));
@@ -182,7 +182,7 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
{ HGLOBAL hData;
if ( !OpenClipboard(hwndDlg)) break;
EmptyClipboard();
- hData=GlobalAlloc(GMEM_MOVEABLE, lstrlenA(url)+1);
+ hData = GlobalAlloc(GMEM_MOVEABLE, lstrlenA(url)+1);
lstrcpyA((char*)GlobalLock(hData), url);
GlobalUnlock(hData);
SetClipboardData(CF_TEXT, hData);
@@ -197,7 +197,7 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case IDC_USERMENU:
{
RECT rc;
- HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
+ HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
GetWindowRect(GetDlgItem(hwndDlg, IDC_USERMENU), &rc);
TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL);
DestroyMenu(hMenu);
@@ -214,11 +214,11 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case IDC_ADD:
{
- ADDCONTACTSTRUCT acs={0};
+ ADDCONTACTSTRUCT acs = {0};
- acs.handle=dat->hContact;
- acs.handleType=HANDLE_CONTACT;
- acs.szProto=0;
+ acs.handle = dat->hContact;
+ acs.handleType = HANDLE_CONTACT;
+ acs.szProto = 0;
CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs);
}
if ( !DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0)) {
@@ -260,8 +260,8 @@ static LRESULT DdeMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
switch(msg) {
case WM_DDE_ACK:
- ddeAcked=1;
- hwndDde=(HWND)wParam;
+ ddeAcked = 1;
+ hwndDde = (HWND)wParam;
break;
case WM_DDE_DATA:
@@ -288,20 +288,20 @@ static HGLOBAL DoDdeRequest(const char *szItemName, HWND hwndDlg)
DWORD timeoutTick, thisTick;
MSG msg;
- hSzItemName=GlobalAddAtomA(szItemName);
+ hSzItemName = GlobalAddAtomA(szItemName);
if ( !PostMessage(hwndDde, WM_DDE_REQUEST, (WPARAM)hwndDlg, MAKELPARAM(CF_TEXT, hSzItemName))) {
GlobalDeleteAtom(hSzItemName);
return NULL;
}
- timeoutTick=GetTickCount()+5000;
- ddeData=0; ddeAcked=0;
+ timeoutTick = GetTickCount()+5000;
+ ddeData = 0; ddeAcked = 0;
do {
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if (ddeData || ddeAcked) break;
- thisTick=GetTickCount();
+ thisTick = GetTickCount();
if (thisTick>timeoutTick) break;
}
while (MsgWaitForMultipleObjects(0, NULL, FALSE, timeoutTick-thisTick, QS_ALLINPUT) == WAIT_OBJECT_0);
@@ -317,7 +317,7 @@ static HGLOBAL DoDdeRequest(const char *szItemName, HWND hwndDlg)
static void FreeDdeRequestData(HGLOBAL hData)
{
DDEDATA *data;
- data=(DDEDATA*)GlobalLock(hData);
+ data = (DDEDATA*)GlobalLock(hData);
if (data->fRelease) {
GlobalUnlock(hData);
GlobalFree(hData);
@@ -331,36 +331,36 @@ static void AddBrowserPageToCombo(char *url, HWND hwndCombo)
if (url[0] != '"') return;
url++;
- title=strchr(url, '"');
+ title = strchr(url, '"');
if (title == NULL) return;
- *title='\0'; title++;
+ *title = '\0'; title++;
if (*title) {
title+=2;
- frame=strchr(title, '"');
+ frame = strchr(title, '"');
if (frame == NULL) return;
- *frame='\0'; frame++;
+ *frame = '\0'; frame++;
if (*frame) {
frame+=2;
- end=strchr(frame, '"');
+ end = strchr(frame, '"');
if (end == NULL) return;
- *end='\0';
+ *end = '\0';
}
- else frame=NULL;
+ else frame = NULL;
}
- else title=frame=NULL;
+ else title = frame = NULL;
if (frame == NULL || *frame == 0) {
char *szItemData;
int i;
char szExistingUrl[1024];
- for (i=SendMessage(hwndCombo, CB_GETCOUNT, 0, 0)-1;i>=0;i--) {
+ for (i = SendMessage(hwndCombo, CB_GETCOUNT, 0, 0)-1;i>=0;i--) {
if (SendMessage(hwndCombo, CB_GETLBTEXTLEN, i, 0) >= SIZEOF(szExistingUrl))
continue;
SendMessageA(hwndCombo, CB_GETLBTEXT, i, (LPARAM)szExistingUrl);
if ( !lstrcmpA(szExistingUrl, url)) return;
}
- i=SendMessageA(hwndCombo, CB_ADDSTRING, 0, (LPARAM)url);
- szItemData=mir_strdup(title);
+ i = SendMessageA(hwndCombo, CB_ADDSTRING, 0, (LPARAM)url);
+ szItemData = mir_strdup(title);
SendMessage(hwndCombo, CB_SETITEMDATA, i, (LPARAM)szItemData);
}
}
@@ -376,34 +376,34 @@ static void GetOpenBrowserUrlsForBrowser(const char *szBrowser, HWND hwndDlg, HW
DDEDATA *data;
int dataLength;
- hSzBrowser=GlobalAddAtomA(szBrowser);
+ hSzBrowser = GlobalAddAtomA(szBrowser);
- hSzTopic=GlobalAddAtomA("WWW_ListWindows");
- ddeAcked=0;
+ hSzTopic = GlobalAddAtomA("WWW_ListWindows");
+ ddeAcked = 0;
if ( !SendMessageTimeout(HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)hwndDlg, MAKELPARAM(hSzBrowser, hSzTopic), SMTO_ABORTIFHUNG|SMTO_NORMAL, DDEMESSAGETIMEOUT, (PDWORD_PTR)&dwResult)
|| !ddeAcked) {
GlobalDeleteAtom(hSzTopic);
GlobalDeleteAtom(hSzBrowser);
return;
}
- hData=DoDdeRequest("WWW_ListWindows", hwndDlg);
+ hData = DoDdeRequest("WWW_ListWindows", hwndDlg);
if (hData == NULL) {
GlobalDeleteAtom(hSzTopic);
GlobalDeleteAtom(hSzBrowser);
return;
}
- dataLength=GlobalSize(hData)-offsetof(DDEDATA, Value);
- data=(DDEDATA*)GlobalLock(hData);
- windowCount=dataLength/sizeof(DWORD);
- windowId=(PDWORD)mir_alloc(sizeof(DWORD)*windowCount);
+ dataLength = GlobalSize(hData)-offsetof(DDEDATA, Value);
+ data = (DDEDATA*)GlobalLock(hData);
+ windowCount = dataLength/sizeof(DWORD);
+ windowId = (PDWORD)mir_alloc(sizeof(DWORD)*windowCount);
memcpy(windowId, data->Value, windowCount*sizeof(DWORD));
GlobalUnlock(hData);
FreeDdeRequestData(hData);
PostMessage(hwndDde, WM_DDE_TERMINATE, (WPARAM)hwndDlg, 0);
GlobalDeleteAtom(hSzTopic);
- hSzTopic=GlobalAddAtomA("WWW_GetWindowInfo");
- ddeAcked=0;
+ hSzTopic = GlobalAddAtomA("WWW_GetWindowInfo");
+ ddeAcked = 0;
if ( !SendMessageTimeout(HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)hwndDlg, MAKELPARAM(hSzBrowser, hSzTopic), SMTO_ABORTIFHUNG|SMTO_NORMAL, DDEMESSAGETIMEOUT, (PDWORD_PTR)&dwResult)
|| !ddeAcked) {
GlobalDeleteAtom(hSzTopic);
@@ -415,11 +415,11 @@ static void GetOpenBrowserUrlsForBrowser(const char *szBrowser, HWND hwndDlg, HW
if (windowId[i] == 0) break;
{ char str[16];
mir_snprintf(str, SIZEOF(str), "%d", windowId[i]);
- hData=DoDdeRequest(str, hwndDlg);
+ hData = DoDdeRequest(str, hwndDlg);
}
if (hData != NULL) {
- dataLength=GlobalSize(hData)-offsetof(DDEDATA, Value);
- data=(DDEDATA*)GlobalLock(hData);
+ dataLength = GlobalSize(hData)-offsetof(DDEDATA, Value);
+ data = (DDEDATA*)GlobalLock(hData);
AddBrowserPageToCombo((char*)data->Value, hwndCombo);
GlobalUnlock(hData);
FreeDdeRequestData(hData);
@@ -471,12 +471,12 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
Button_SetIcon_IcoLib(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGEN("User Menu"));
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_LIMITTEXT, 450, 0);
- dat=(struct UrlSendData*)mir_alloc(sizeof(struct UrlSendData));
+ dat = (struct UrlSendData*)mir_alloc(sizeof(struct UrlSendData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- dat->hContact=(HANDLE)lParam;
- dat->hAckEvent=NULL;
- dat->hSendId=NULL;
- dat->sendBuffer=NULL;
+ dat->hContact = (HANDLE)lParam;
+ dat->hAckEvent = NULL;
+ dat->hSendId = NULL;
+ dat->sendBuffer = NULL;
WindowList_Add(hUrlWindowList, hwndDlg, dat->hContact);
{
@@ -489,8 +489,8 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCOUNT, 0, 0))SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_URLS, CBN_SELCHANGE), 0);
EnableWindow(GetDlgItem(hwndDlg, IDOK), (SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCURSEL, 0, 0) == CB_ERR)?FALSE:TRUE);
Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, "SRUrl", "send");
- OldSendEditProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MESSAGE), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc);
- OldSendEditProc=(WNDPROC)SetWindowLongPtr(GetWindow(GetDlgItem(hwndDlg, IDC_URLS), GW_CHILD), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc);
+ OldSendEditProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MESSAGE), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc);
+ OldSendEditProc = (WNDPROC)SetWindowLongPtr(GetWindow(GetDlgItem(hwndDlg, IDC_URLS), GW_CHILD), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc);
// From message dlg
if ( !DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0))
@@ -545,22 +545,22 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
char *body, *url;
int bodySize, urlSize;
- urlSize=GetWindowTextLength(GetDlgItem(hwndDlg, IDC_URLS))+1;
- url=(char*)mir_alloc(urlSize);
+ urlSize = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_URLS))+1;
+ url = (char*)mir_alloc(urlSize);
GetDlgItemTextA(hwndDlg, IDC_URLS, url, urlSize);
if (url[0] == 0) {
mir_free(url);
break;
}
- bodySize=GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE))+1;
- body=(char*)mir_alloc(bodySize);
+ bodySize = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE))+1;
+ body = (char*)mir_alloc(bodySize);
GetDlgItemTextA(hwndDlg, IDC_MESSAGE, body, bodySize);
- dat->sendBuffer=(char*)mir_realloc(dat->sendBuffer, lstrlenA(url)+lstrlenA(body)+2);
+ dat->sendBuffer = (char*)mir_realloc(dat->sendBuffer, lstrlenA(url)+lstrlenA(body)+2);
lstrcpyA(dat->sendBuffer, url);
lstrcpyA(dat->sendBuffer+lstrlenA(url)+1, body);
- dat->hAckEvent=HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_EVENTSENT);
- dat->hSendId=(HANDLE)CallContactService(dat->hContact, PSS_URL, 0, (LPARAM)dat->sendBuffer);
+ dat->hAckEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_EVENTSENT);
+ dat->hSendId = (HANDLE)CallContactService(dat->hContact, PSS_URL, 0, (LPARAM)dat->sendBuffer);
mir_free(url);
mir_free(body);
@@ -580,10 +580,10 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (HIWORD(wParam) == CBN_SELCHANGE) {
int i, urlSize;
char *title;
- i=SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCURSEL, 0, 0);
- title=(char*)SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETITEMDATA, (WPARAM)i, 0);
+ i = SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCURSEL, 0, 0);
+ title = (char*)SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETITEMDATA, (WPARAM)i, 0);
SetDlgItemTextA(hwndDlg, IDC_MESSAGE, title);
- urlSize=SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETLBTEXTLEN, (WPARAM)i, 0);
+ urlSize = SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETLBTEXTLEN, (WPARAM)i, 0);
EnableWindow(GetDlgItem(hwndDlg, IDOK), (urlSize>0));
}
else if (HIWORD(wParam) == CBN_EDITCHANGE) {
@@ -593,7 +593,7 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
break;
case IDC_USERMENU:
{ RECT rc;
- HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
+ HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
GetWindowRect(GetDlgItem(hwndDlg, IDC_USERMENU), &rc);
TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL);
DestroyMenu(hMenu);
@@ -606,11 +606,11 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)dat->hContact, 0);
break;
case IDC_ADD:
- { ADDCONTACTSTRUCT acs={0};
+ { ADDCONTACTSTRUCT acs = {0};
- acs.handle=dat->hContact;
- acs.handleType=HANDLE_CONTACT;
- acs.szProto=0;
+ acs.handle = dat->hContact;
+ acs.handleType = HANDLE_CONTACT;
+ acs.szProto = 0;
CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs);
}
if ( !DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0)) {
@@ -620,20 +620,20 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
break;
case HM_EVENTSENT:
- { ACKDATA *ack=(ACKDATA*)lParam;
+ { ACKDATA *ack = (ACKDATA*)lParam;
DBEVENTINFO dbei;
if (ack->hProcess != dat->hSendId) break;
if (ack->hContact != dat->hContact) break;
if (ack->type != ACKTYPE_URL || ack->result != ACKRESULT_SUCCESS) break;
ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize=sizeof(dbei);
- dbei.eventType=EVENTTYPE_URL;
- dbei.flags=DBEF_SENT;
- dbei.szModule=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
- dbei.timestamp=time(NULL);
- dbei.cbBlob=(DWORD)(strlen(dat->sendBuffer)+strlen(dat->sendBuffer+strlen(dat->sendBuffer)+1)+2);
- dbei.pBlob=(PBYTE)dat->sendBuffer;
+ dbei.cbSize = sizeof(dbei);
+ dbei.eventType = EVENTTYPE_URL;
+ dbei.flags = DBEF_SENT;
+ dbei.szModule = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ dbei.timestamp = time(NULL);
+ dbei.cbBlob = (DWORD)(strlen(dat->sendBuffer)+strlen(dat->sendBuffer+strlen(dat->sendBuffer)+1)+2);
+ dbei.pBlob = (PBYTE)dat->sendBuffer;
CallService(MS_DB_EVENT_ADD, (WPARAM)dat->hContact, (LPARAM)&dbei);
KillTimer(hwndDlg, 0);
DestroyWindow(hwndDlg);
@@ -654,7 +654,7 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
mir_free(dat);
Utils_SaveWindowPosition(hwndDlg, NULL, "SRUrl", "send");
{ int i;
- for (i=SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCOUNT, 0, 0)-1;i>=0;i--)
+ for (i = SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCOUNT, 0, 0)-1;i>=0;i--)
mir_free((char*)SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETITEMDATA, i, 0));
}
break;
diff --git a/src/modules/updatenotify/updatenotify.cpp b/src/modules/updatenotify/updatenotify.cpp
index 184f46a42b..a223076062 100644
--- a/src/modules/updatenotify/updatenotify.cpp
+++ b/src/modules/updatenotify/updatenotify.cpp
@@ -79,7 +79,7 @@ static int UpdateNotifyModulesLoaded(WPARAM, LPARAM) {
ZeroMemory(&nlu, sizeof(nlu));
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING|NUF_HTTPCONNS;
+ nlu.flags = NUF_OUTGOING|NUF_HTTPCONNS;
nlu.szSettingsModule = UN_MOD;
nlu.szDescriptiveName = Translate("Update notification");
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/src/modules/userinfo/contactinfo.cpp b/src/modules/userinfo/contactinfo.cpp
deleted file mode 100644
index 64c84cf221..0000000000
--- a/src/modules/userinfo/contactinfo.cpp
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
-
-Miranda IM: the free IM client for Microsoft* Windows*
-
-Copyright 2000-2009 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-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; either version 2
-of the License, or (at your option) any later version.
-
-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, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include "..\..\core\commonheaders.h"
-
-static HFONT hEmailFont=NULL;
-static HCURSOR hHandCursor=NULL;
-
-static INT_PTR CALLBACK EditUserEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch(msg) {
- case WM_INITDIALOG:
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
- if (*(char*)lParam) SetWindowText(hwndDlg, TranslateT("Edit E-Mail Address"));
- TranslateDialogDefault(hwndDlg);
- SetDlgItemTextA(hwndDlg, IDC_EMAIL, (char*)lParam);
- EnableWindow(GetDlgItem(hwndDlg, IDOK), *(char*)lParam);
- return TRUE;
- case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case IDOK:
- GetDlgItemTextA(hwndDlg, IDC_EMAIL, (char*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA), 256);
- //fall through
- case IDCANCEL:
- EndDialog(hwndDlg, wParam);
- case IDC_EMAIL:
- if (HIWORD(wParam) == EN_CHANGE)
- EnableWindow(GetDlgItem(hwndDlg, IDOK), GetWindowTextLength(GetDlgItem(hwndDlg, IDC_EMAIL)));
- break;
- }
- break;
- }
- return FALSE;
-}
-
-static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- static int noRecursion=0;
-
- switch(msg) {
- case WM_INITDIALOG:
- { char *szText=(char*)lParam;
- int i, item, countryCount;
- struct CountryListEntry *countries;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
- if (szText[0]) SetWindowText(hwndDlg, TranslateT("Edit Phone Number"));
- TranslateDialogDefault(hwndDlg);
- if (lstrlenA(szText)>4 && !lstrcmpA(szText+lstrlenA(szText)-4, " SMS")) {
- CheckDlgButton(hwndDlg, IDC_SMS, BST_CHECKED);
- szText[lstrlenA(szText)-4]='\0';
- }
- EnableWindow(GetDlgItem(hwndDlg, IDOK), szText[0]);
- SendDlgItemMessage(hwndDlg, IDC_AREA, EM_LIMITTEXT, 31, 0);
- SendDlgItemMessage(hwndDlg, IDC_NUMBER, EM_LIMITTEXT, 63, 0);
- CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&countryCount, (LPARAM)&countries);
- for (i=0;i<countryCount;i++) {
- if (countries[i].id == 0 || countries[i].id == 0xFFFF) continue;
- item=SendDlgItemMessageA(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)Translate(countries[i].szName));
- SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_SETITEMDATA, item, countries[i].id);
- }
- SetDlgItemTextA(hwndDlg, IDC_PHONE, szText);
- return TRUE;
- }
- case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case IDOK:
- { char *szText=(char*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- int isValid=1;
- GetDlgItemTextA(hwndDlg, IDC_PHONE, szText, 252);
- if (lstrlenA(szText)<7 || szText[0] != '+') isValid=0;
- if (isValid) isValid=(lstrlenA(szText+1) == (int)strspn(szText+1, "0123456789 ()-"));
- if ( !isValid) {
- MessageBox(hwndDlg, TranslateT("The phone number should start with a + and consist of numbers, spaces, brackets and hyphens only."), TranslateT("Invalid Phone Number"), MB_OK);
- break;
- }
- if (IsDlgButtonChecked(hwndDlg, IDC_SMS)) lstrcatA(szText, " SMS");
- }
- //fall through
- case IDCANCEL:
- EndDialog(hwndDlg, wParam);
- case IDC_COUNTRY:
- if (HIWORD(wParam) != CBN_SELCHANGE) break;
- case IDC_AREA:
- case IDC_NUMBER:
- if (LOWORD(wParam) != IDC_COUNTRY && HIWORD(wParam) != EN_CHANGE) break;
- if (noRecursion) break;
- EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
- { char szPhone[96], szArea[32], szNumber[64];
- GetDlgItemTextA(hwndDlg, IDC_AREA, szArea, SIZEOF(szArea));
- GetDlgItemTextA(hwndDlg, IDC_NUMBER, szNumber, SIZEOF(szNumber));
- mir_snprintf(szPhone, SIZEOF(szPhone), "+%u (%s) %s", SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0), 0), szArea, szNumber);
- noRecursion=1;
- SetDlgItemTextA(hwndDlg, IDC_PHONE, szPhone);
- noRecursion=0;
- }
- break;
- case IDC_PHONE:
- if (HIWORD(wParam) != EN_UPDATE) break;
- if (noRecursion) break;
- noRecursion=1;
- {
- char szText[256], *pText=NULL, *pArea, *pNumber;
- int isValid=1;
- GetDlgItemTextA(hwndDlg, IDC_PHONE, szText, SIZEOF(szText));
- if (szText[0] != '+')
- isValid=0;
-
- if (isValid) {
- int i, country = strtol(szText+1, &pText, 10);
- if (pText - szText > 4)
- isValid = 0;
- else {
- for (i = SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETCOUNT, 0, 0)-1; i >= 0; i--)
- if (country == SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, i, 0)) {
- SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_SETCURSEL, i, 0);
- break;
- }
- if (i < 0)
- isValid = 0;
- }
- }
- if (isValid) {
- pArea = pText+strcspn(pText, "0123456789");
- pText = pArea+strspn(pArea, "0123456789");
- if (*pText) {
- *pText='\0';
- pNumber = pText+1+strcspn(pText+1, "0123456789");
- SetDlgItemTextA(hwndDlg, IDC_NUMBER, pNumber);
- }
- SetDlgItemTextA(hwndDlg, IDC_AREA, pArea);
- }
- if ( !isValid) {
- SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_SETCURSEL, -1, 0);
- SetDlgItemTextA(hwndDlg, IDC_AREA, "");
- SetDlgItemTextA(hwndDlg, IDC_NUMBER, "");
- }
- }
- noRecursion=0;
- EnableWindow(GetDlgItem(hwndDlg, IDOK), GetWindowTextLength(GetDlgItem(hwndDlg, IDC_PHONE)));
- break;
- }
- break;
- }
- return FALSE;
-}
-
-static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail)
-{
- RECT rc;
- HWND hwndEmails;
- TCHAR szText[256];
- HDC hdc;
- SIZE textSize;
- LVHITTESTINFO hti;
-
- hwndEmails=GetDlgItem(hwndDlg, IDC_EMAILS);
- GetCursorPos(&hti.pt);
- ScreenToClient(hwndEmails, &hti.pt);
- GetClientRect(hwndEmails, &rc);
- if ( !PtInRect(&rc, hti.pt)) return 0;
- if (ListView_SubItemHitTest(hwndEmails, &hti) == -1) return 0;
- if (hti.iSubItem != 1) return 0;
- if ( !(hti.flags&LVHT_ONITEMLABEL)) return 0;
- ListView_GetSubItemRect(hwndEmails, hti.iItem, 1, LVIR_LABEL, &rc);
- szText[0] = 0;
- ListView_GetItemText(hwndEmails, hti.iItem, 1, szText, SIZEOF(szText));
- hdc=GetDC(hwndEmails);
- SelectObject(hdc, hEmailFont);
- GetTextExtentPoint32(hdc, szText, lstrlen(szText), &textSize);
- ReleaseDC(hwndEmails, hdc);
- if (hti.pt.x<rc.left+textSize.cx) {
- if (szEmail && cchEmail) lstrcpyn(szEmail, szText, cchEmail);
- return 1;
- }
- return 0;
-}
-
-#define M_REMAKELISTS (WM_USER+1)
-INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch(msg) {
- case WM_INITDIALOG:
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
- if (hEmailFont) DeleteObject(hEmailFont);
- { LOGFONT lf;
- hEmailFont=(HFONT)SendDlgItemMessage(hwndDlg, IDC_EMAILS, WM_GETFONT, 0, 0);
- GetObject(hEmailFont, sizeof(lf), &lf);
- lf.lfUnderline=1;
- hEmailFont=CreateFontIndirect(&lf);
- }
- if (hHandCursor == NULL) {
- if (IsWinVer2000Plus()) hHandCursor=LoadCursor(NULL, IDC_HAND);
- else hHandCursor=LoadCursor(hInst, MAKEINTRESOURCE(IDC_HYPERLINKHAND));
- }
- TranslateDialogDefault(hwndDlg);
- { LVCOLUMN lvc;
- RECT rc;
- GetClientRect(GetDlgItem(hwndDlg, IDC_EMAILS), &rc);
- rc.right-=GetSystemMetrics(SM_CXVSCROLL);
- lvc.mask=LVCF_WIDTH;
- ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg, IDC_EMAILS), LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
- ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg, IDC_PHONES), LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
- lvc.cx=rc.right/4;
- ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 0, &lvc);
- ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 0, &lvc);
- lvc.cx=rc.right-rc.right/4-40;
- ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 1, &lvc);
- lvc.cx=rc.right-rc.right/4-90;
- ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 1, &lvc);
- lvc.cx=50;
- ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 2, &lvc);
- lvc.cx=20;
- ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 2, &lvc);
- ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 3, &lvc);
- ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 3, &lvc);
- ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 4, &lvc);
- }
- break;
- case M_REMAKELISTS:
- { char *szProto;
- LVITEM lvi;
- int i;
- char idstr[33];
- TCHAR idstr2[33];
- DBVARIANT dbv;
- HANDLE hContact=(HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
- if (hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if (szProto == NULL) break;
- //e-mails
- ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_EMAILS));
- lvi.mask=LVIF_TEXT|LVIF_PARAM;
- lvi.lParam=(LPARAM)(-1);
- lvi.iSubItem=0;
- lvi.iItem=0;
- for (i=-1;;i++) {
- if (i == -1) {
- if (DBGetContactSettingTString(hContact, szProto, "e-mail", &dbv))
- continue;
- lvi.pszText=TranslateT("Primary");
- }
- else {
- mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i);
- if (DBGetContactSettingTString(hContact, szProto, idstr, &dbv))
- break;
- lvi.pszText=idstr2;
- mir_sntprintf(idstr2, SIZEOF(idstr2), _T("%d"), i+2);
- }
- ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
- lvi.iItem++;
- }
- lvi.iSubItem=0;
- for (i=0;;i++) {
- lvi.lParam=i;
- mir_snprintf(idstr, SIZEOF(idstr), "Mye-mail%d", i);
- if (DBGetContactSettingTString(hContact, "UserInfo", idstr, &dbv))
- break;
- lvi.pszText=idstr2;
- mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"), i+1);
- ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
- lvi.iItem++;
- }
- lvi.mask=LVIF_PARAM;
- lvi.lParam=(LPARAM)(-2);
- ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
- //phones
- ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_PHONES));
- lvi.mask=LVIF_TEXT|LVIF_PARAM;
- lvi.lParam=(LPARAM)(-1);
- lvi.iSubItem=0;
- lvi.iItem=0;
- if ( !DBGetContactSettingTString(hContact, szProto, "Phone", &dbv)) {
- lvi.pszText=TranslateT("Primary");
- ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
- lvi.iItem++;
- }
- if ( !DBGetContactSettingTString(hContact, szProto, "Fax", &dbv)) {
- lvi.pszText=TranslateT("Fax");
- ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
- lvi.iItem++;
- }
- if ( !DBGetContactSettingTString(hContact, szProto, "Cellular", &dbv)) {
- lvi.pszText=TranslateT("Mobile");
- ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- if (lstrlenA(dbv.pszVal)>4 && !lstrcmpA(dbv.pszVal+lstrlenA(dbv.pszVal)-4, " SMS")) {
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y"));
- dbv.ptszVal[lstrlen(dbv.ptszVal)-4]='\0';
- }
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
- lvi.iItem++;
- }
- if ( !DBGetContactSettingTString(hContact, szProto, "CompanyPhone", &dbv)) {
- lvi.pszText=TranslateT("Work Phone");
- ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
- lvi.iItem++;
- }
- if ( !DBGetContactSettingTString(hContact, szProto, "CompanyFax", &dbv)) {
- lvi.pszText=TranslateT("Work Fax");
- ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
- lvi.iItem++;
- }
- lvi.iSubItem=0;
- for (i=0;;i++) {
- lvi.lParam=i;
- mir_snprintf(idstr, SIZEOF(idstr), "MyPhone%d", i);
- if (DBGetContactSettingTString(hContact, "UserInfo", idstr, &dbv))
- break;
- lvi.pszText=idstr2;
- mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"), i+1);
- ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- if (lstrlen(dbv.ptszVal)>4 && !lstrcmp(dbv.ptszVal+lstrlen(dbv.ptszVal)-4, _T(" SMS"))) {
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y"));
- dbv.ptszVal[lstrlen(dbv.ptszVal)-4]='\0';
- }
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
- lvi.iItem++;
- }
- lvi.mask=LVIF_PARAM;
- lvi.lParam=(LPARAM)(-2);
- ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- }
- break;
- }
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->idFrom) {
- case 0:
- switch (((LPNMHDR)lParam)->code) {
- case PSN_INFOCHANGED:
- SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
- break;
- }
- break;
- case IDC_EMAILS:
- case IDC_PHONES:
- switch (((LPNMHDR)lParam)->code) {
- case NM_CUSTOMDRAW:
- { NMLVCUSTOMDRAW *nm=(NMLVCUSTOMDRAW*)lParam;
- switch(nm->nmcd.dwDrawStage) {
- case CDDS_PREPAINT:
- case CDDS_ITEMPREPAINT:
- SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_NOTIFYSUBITEMDRAW);
- return TRUE;
- case CDDS_SUBITEM|CDDS_ITEMPREPAINT:
- {
- RECT rc;
- ListView_GetSubItemRect(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc);
- if (nm->iSubItem == 1 && nm->nmcd.hdr.idFrom == IDC_EMAILS) {
- HFONT hoFont;
- TCHAR szText[256] = {0};
- ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, SIZEOF(szText));
- hoFont=(HFONT)SelectObject(nm->nmcd.hdc, hEmailFont);
- SetTextColor(nm->nmcd.hdc, RGB(0, 0, 255));
- DrawText(nm->nmcd.hdc, szText, -1, &rc, DT_END_ELLIPSIS|DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_TOP);
- SelectObject(nm->nmcd.hdc, hoFont);
- SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT);
- return TRUE;
- }
-
- HICON hIcon = NULL;
- if (nm->nmcd.lItemlParam == (LPARAM)(-2) && nm->iSubItem-3 == (nm->nmcd.hdr.idFrom == IDC_PHONES))
- hIcon = LoadSkinIcon(SKINICON_OTHER_ADDCONTACT);
- else if (nm->iSubItem>1 && nm->nmcd.lItemlParam != (LPARAM)(-1) && nm->nmcd.lItemlParam != (LPARAM)(-2)) {
- static int iconResources[3]={SKINICON_OTHER_RENAME, SKINICON_OTHER_DELETE};
- if (nm->iSubItem == 2 && nm->nmcd.hdr.idFrom == IDC_PHONES) {
- TCHAR szText[2];
- ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, SIZEOF(szText));
- if (szText[0]) hIcon = LoadSkinIcon(SKINICON_OTHER_SMS);
- }
- else hIcon = LoadSkinIcon(iconResources[nm->iSubItem-3+(nm->nmcd.hdr.idFrom == IDC_EMAILS)]);
- }
- else break;
- DrawIconEx(nm->nmcd.hdc, (rc.left+rc.right-GetSystemMetrics(SM_CXSMICON))/2, (rc.top+rc.bottom-GetSystemMetrics(SM_CYSMICON))/2, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
- IconLib_ReleaseIcon(hIcon, 0);
- SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT);
- return TRUE;
- }
- }
- break;
- }
- case NM_CLICK:
- { NMLISTVIEW *nm=(NMLISTVIEW*)lParam;
- LVITEM lvi;
- TCHAR szEmail[256];
- HANDLE hContact=(HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- char *szIdTemplate=nm->hdr.idFrom == IDC_PHONES?"MyPhone%d":"Mye-mail%d";
- LVHITTESTINFO hti;
-
- if (IsOverEmail(hwndDlg, szEmail, SIZEOF(szEmail))) {
- TCHAR szExec[264];
- mir_sntprintf(szExec, SIZEOF(szExec), _T("mailto:%s"), szEmail);
- ShellExecute(hwndDlg, _T("open"), szExec, NULL, NULL, SW_SHOW);
- break;
- }
- if (nm->iSubItem<2) break;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(nm->hdr.hwndFrom, &hti.pt);
- if (ListView_SubItemHitTest(nm->hdr.hwndFrom, &hti) == -1) break;
- lvi.mask=LVIF_PARAM;
- lvi.iItem=hti.iItem;
- lvi.iSubItem=0;
- ListView_GetItem(nm->hdr.hwndFrom, &lvi);
- if (lvi.lParam == (LPARAM)(-1)) break;
- if (lvi.lParam == (LPARAM)(-2)) {
- if (hti.iSubItem-3 == (nm->hdr.idFrom == IDC_PHONES)) {
- //add
- char szNewData[256]="", idstr[33];
- int i;
- DBVARIANT dbv;
- if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szNewData))
- break;
- for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
- if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
- DBFreeVariant(&dbv);
- }
- DBWriteContactSettingString(hContact, "UserInfo", idstr, szNewData);
- SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
- }
- }
- else {
- if (hti.iSubItem-3 == (nm->hdr.idFrom == IDC_PHONES)) {
- //delete
- int i;
- char idstr[33];
- DBVARIANT dbv;
- for (i=lvi.lParam;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i+1);
- if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
- DBWriteContactSettingString(hContact, "UserInfo", idstr, dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
- DBDeleteContactSetting(hContact, "UserInfo", idstr);
- SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
- }
- else if (hti.iSubItem-2 == (nm->hdr.idFrom == IDC_PHONES)) {
- //edit
- char szText[256], idstr[33];
- DBVARIANT dbv;
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, lvi.lParam);
- if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
- lstrcpynA(szText, dbv.pszVal, SIZEOF(szText));
- DBFreeVariant(&dbv);
- if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szText))
- break;
- DBWriteContactSettingString(hContact, "UserInfo", idstr, szText);
- SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
- }
- }
- break;
- }
- }
- break;
- }
- break;
- case WM_SETCURSOR:
- if (LOWORD(lParam) != HTCLIENT) break;
- if (GetForegroundWindow() == GetParent(hwndDlg)) {
- POINT pt;
- GetCursorPos(&pt);
- ScreenToClient(hwndDlg, &pt);
-// SetFocus(ChildWindowFromPoint(hwndDlg, pt)); //ugly hack because listviews ignore their first click
- }
- if (IsOverEmail(hwndDlg, NULL, 0)) {
- SetCursor(hHandCursor);
- SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, TRUE);
- return TRUE;
- }
- break;
- case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case IDCANCEL:
- SendMessage(GetParent(hwndDlg), msg, wParam, lParam);
- break;
- }
- break;
- }
- return FALSE;
-}
diff --git a/src/modules/useronline/useronline.cpp b/src/modules/useronline/useronline.cpp
index 3097db834a..e6f5148f50 100644
--- a/src/modules/useronline/useronline.cpp
+++ b/src/modules/useronline/useronline.cpp
@@ -22,16 +22,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "..\..\core\commonheaders.h"
-static int uniqueEventId=0;
+static int uniqueEventId = 0;
static int UserOnlineSettingChanged(WPARAM wParam, LPARAM lParam)
{
- DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
int newStatus, oldStatus;
if ((HANDLE)wParam == NULL || strcmp(cws->szSetting, "Status")) return 0;
- newStatus=cws->value.wVal;
- oldStatus=DBGetContactSettingWord((HANDLE)wParam, "UserOnline", "OldStatus", ID_STATUS_OFFLINE);
+ newStatus = cws->value.wVal;
+ oldStatus = DBGetContactSettingWord((HANDLE)wParam, "UserOnline", "OldStatus", ID_STATUS_OFFLINE);
DBWriteContactSettingWord((HANDLE)wParam, "UserOnline", "OldStatus", (WORD)newStatus);
if (CallService(MS_IGNORE_ISIGNORED, wParam, IGNOREEVENT_USERONLINE)) return 0;
if (DBGetContactSettingByte((HANDLE)wParam, "CList", "Hidden", 0)) return 0;
@@ -54,16 +54,16 @@ static int UserOnlineSettingChanged(WPARAM wParam, LPARAM lParam)
TCHAR tooltip[256];
ZeroMemory(&cle, sizeof(cle));
- cle.cbSize=sizeof(cle);
- cle.flags=CLEF_ONLYAFEW | CLEF_TCHAR;
- cle.hContact=(HANDLE)wParam;
- cle.hDbEvent=(HANDLE)(uniqueEventId++);
+ cle.cbSize = sizeof(cle);
+ cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
+ cle.hContact = (HANDLE)wParam;
+ cle.hDbEvent = (HANDLE)(uniqueEventId++);
cle.hIcon = LoadSkinIcon(SKINICON_OTHER_USERONLINE, false);
- cle.pszService="UserOnline/Description";
+ cle.pszService = "UserOnline/Description";
mir_sntprintf(tooltip, SIZEOF(tooltip), TranslateT("%s is Online"), cli.pfnGetContactDisplayName((HANDLE)wParam, 0));
- cle.ptszTooltip=tooltip;
+ cle.ptszTooltip = tooltip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
- IconLib_ReleaseIcon(cle.hIcon, 0);
+ IcoLib_ReleaseIcon(cle.hIcon, 0);
DBWriteContactSettingDword(cle.hContact, "UserOnline", "LastEvent", (DWORD)cle.hDbEvent);
SkinPlaySound("UserOnline");
}
diff --git a/src/modules/utils/bmpfilter.cpp b/src/modules/utils/bmpfilter.cpp
index 46db86baaf..442c75996a 100644
--- a/src/modules/utils/bmpfilter.cpp
+++ b/src/modules/utils/bmpfilter.cpp
@@ -106,12 +106,12 @@ static INT_PTR sttBitmapLoader(const TCHAR* ptszFileName)
GetObject(hBmp, sizeof(bmpInfo), &bmpInfo);
//need to copy bitmap so we can free the IPicture
- hdc=GetDC(NULL);
- hdcMem1=CreateCompatibleDC(hdc);
- hdcMem2=CreateCompatibleDC(hdc);
- hOldBitmap=(HBITMAP)SelectObject(hdcMem1, hBmp);
- hBmpCopy=CreateCompatibleBitmap(hdcMem1, bmpInfo.bmWidth, bmpInfo.bmHeight);
- hOldBitmap2=(HBITMAP)SelectObject(hdcMem2, hBmpCopy);
+ hdc = GetDC(NULL);
+ hdcMem1 = CreateCompatibleDC(hdc);
+ hdcMem2 = CreateCompatibleDC(hdc);
+ hOldBitmap = (HBITMAP)SelectObject(hdcMem1, hBmp);
+ hBmpCopy = CreateCompatibleBitmap(hdcMem1, bmpInfo.bmWidth, bmpInfo.bmHeight);
+ hOldBitmap2 = (HBITMAP)SelectObject(hdcMem2, hBmpCopy);
BitBlt(hdcMem2, 0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, hdcMem1, 0, 0, SRCCOPY);
SelectObject(hdcMem1, hOldBitmap);
SelectObject(hdcMem2, hOldBitmap2);
@@ -138,91 +138,91 @@ static INT_PTR BmpFilterLoadBitmapW(WPARAM, LPARAM lParam)
static INT_PTR BmpFilterGetStrings(WPARAM wParam, LPARAM lParam)
{
- int bytesLeft=wParam;
- char *filter=(char*)lParam, *pfilter;
+ int bytesLeft = wParam;
+ char *filter = (char*)lParam, *pfilter;
lstrcpynA(filter, Translate("All Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(filter);
strncat(filter, " (*.bmp;*.jpg;*.gif;*.png)", bytesLeft);
- pfilter=filter+lstrlenA(filter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter = filter+lstrlenA(filter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpynA(pfilter, "*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpynA(pfilter, Translate("Windows Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
strncat(pfilter, " (*.bmp;*.rle)", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpynA(pfilter, "*.BMP;*.RLE", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpynA(pfilter, Translate("JPEG Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
strncat(pfilter, " (*.jpg;*.jpeg)", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpynA(pfilter, "*.JPG;*.JPEG", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpynA(pfilter, Translate("GIF Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
strncat(pfilter, " (*.gif)", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpynA(pfilter, "*.GIF", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpynA(pfilter, Translate("PNG Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
strncat(pfilter, " (*.png)", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpynA(pfilter, "*.PNG", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpynA(pfilter, Translate("All Files"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
strncat(pfilter, " (*)", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpynA(pfilter, "*", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- if (bytesLeft) *pfilter='\0';
+ if (bytesLeft) *pfilter = '\0';
return 0;
}
static INT_PTR BmpFilterGetStringsW(WPARAM wParam, LPARAM lParam)
{
- int bytesLeft=wParam;
- TCHAR *filter=(TCHAR*)lParam, *pfilter;
+ int bytesLeft = wParam;
+ TCHAR *filter = (TCHAR*)lParam, *pfilter;
lstrcpyn(filter, TranslateT("All Bitmaps"), bytesLeft); bytesLeft-=lstrlen(filter);
_tcsncat(filter, _T(" (*.bmp;*.jpg;*.gif;*.png)"), bytesLeft);
- pfilter=filter+lstrlen(filter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter = filter+lstrlen(filter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpyn(pfilter, _T("*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpyn(pfilter, TranslateT("Windows Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
_tcsncat(pfilter, _T(" (*.bmp;*.rle)"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpyn(pfilter, _T("*.BMP;*.RLE"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpyn(pfilter, TranslateT("JPEG Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
_tcsncat(pfilter, _T(" (*.jpg;*.jpeg)"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpyn(pfilter, _T("*.JPG;*.JPEG"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpyn(pfilter, TranslateT("GIF Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
_tcsncat(pfilter, _T(" (*.gif)"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpyn(pfilter, _T("*.GIF"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpyn(pfilter, TranslateT("PNG Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
_tcsncat(pfilter, _T(" (*.png)"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpyn(pfilter, _T("*.PNG"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpyn(pfilter, TranslateT("All Files"), bytesLeft); bytesLeft-=lstrlen(pfilter);
_tcsncat(pfilter, _T(" (*)"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
lstrcpyn(pfilter, _T("*"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
+ pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- if (bytesLeft) *pfilter='\0';
+ if (bytesLeft) *pfilter = '\0';
return 0;
}
diff --git a/src/modules/utils/colourpicker.cpp b/src/modules/utils/colourpicker.cpp
index dd31bf7155..badfcb712e 100644
--- a/src/modules/utils/colourpicker.cpp
+++ b/src/modules/utils/colourpicker.cpp
@@ -42,15 +42,15 @@ static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd, UINT message, WPARAM wPar
return GetWindowLongPtr(hwnd, 0);
case WM_LBUTTONUP:
{
- CHOOSECOLOR cc={0};
- COLORREF custColours[16]={0};
- custColours[0]=GetWindowLongPtr(hwnd, sizeof(COLORREF));
- cc.lStructSize=sizeof(CHOOSECOLOR);
- cc.hwndOwner=hwnd;
- cc.hInstance=(HWND)hInst;
- cc.rgbResult=GetWindowLongPtr(hwnd, 0);
- cc.lpCustColors=custColours;
- cc.Flags=CC_ANYCOLOR|CC_FULLOPEN|CC_RGBINIT;
+ CHOOSECOLOR cc = {0};
+ COLORREF custColours[16] = {0};
+ custColours[0] = GetWindowLongPtr(hwnd, sizeof(COLORREF));
+ cc.lStructSize = sizeof(CHOOSECOLOR);
+ cc.hwndOwner = hwnd;
+ cc.hInstance = (HWND)hInst;
+ cc.rgbResult = GetWindowLongPtr(hwnd, 0);
+ cc.lpCustColors = custColours;
+ cc.Flags = CC_ANYCOLOR|CC_FULLOPEN|CC_RGBINIT;
if (ChooseColor(&cc)) {
SetWindowLongPtr(hwnd, 0, cc.rgbResult);
SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), CPN_COLOURCHANGED), (LPARAM)hwnd);
@@ -68,14 +68,14 @@ static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd, UINT message, WPARAM wPar
RECT rc;
HBRUSH hBrush;
- hdc1=BeginPaint(hwnd, &ps);
+ hdc1 = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rc);
DrawEdge(hdc1, &rc, EDGE_ETCHED, BF_RECT);
InflateRect(&rc, -2, -2);
if (IsWindowEnabled(hwnd))
- hBrush=CreateSolidBrush(GetWindowLongPtr(hwnd, 0));
+ hBrush = CreateSolidBrush(GetWindowLongPtr(hwnd, 0));
else
- hBrush=CreateHatchBrush(HS_BDIAGONAL, GetSysColor(COLOR_GRAYTEXT));
+ hBrush = CreateHatchBrush(HS_BDIAGONAL, GetSysColor(COLOR_GRAYTEXT));
SetBkColor(hdc1, GetSysColor(COLOR_BTNFACE));
FillRect(hdc1, &rc, hBrush);
DeleteObject(hBrush);
@@ -92,16 +92,16 @@ int InitColourPicker(void)
{
WNDCLASS wcl;
- wcl.lpfnWndProc=ColourPickerWndProc;
- wcl.cbClsExtra=0;
- wcl.cbWndExtra=sizeof(COLORREF)*2;
- wcl.hInstance=hInst;
- wcl.hCursor=NULL;
- wcl.lpszClassName=WNDCLASS_COLOURPICKER;
- wcl.hbrBackground=(HBRUSH)(COLOR_BTNFACE+1);
- wcl.hIcon=NULL;
- wcl.lpszMenuName=NULL;
- wcl.style=CS_HREDRAW|CS_VREDRAW|CS_GLOBALCLASS;
+ wcl.lpfnWndProc = ColourPickerWndProc;
+ wcl.cbClsExtra = 0;
+ wcl.cbWndExtra = sizeof(COLORREF)*2;
+ wcl.hInstance = hInst;
+ wcl.hCursor = NULL;
+ wcl.lpszClassName = WNDCLASS_COLOURPICKER;
+ wcl.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
+ wcl.hIcon = NULL;
+ wcl.lpszMenuName = NULL;
+ wcl.style = CS_HREDRAW|CS_VREDRAW|CS_GLOBALCLASS;
RegisterClass(&wcl);
return 0;
}
diff --git a/src/modules/utils/hyperlink.cpp b/src/modules/utils/hyperlink.cpp
index ae372a9017..dceff9dd11 100644
--- a/src/modules/utils/hyperlink.cpp
+++ b/src/modules/utils/hyperlink.cpp
@@ -39,21 +39,21 @@ struct HyperlinkWndData {
static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct HyperlinkWndData *dat=(struct HyperlinkWndData*)GetWindowLongPtr(hwnd, 0);
+ struct HyperlinkWndData *dat = (struct HyperlinkWndData*)GetWindowLongPtr(hwnd, 0);
switch(msg) {
case WM_NCCREATE:
- dat=(struct HyperlinkWndData*)mir_calloc(sizeof(struct HyperlinkWndData));
+ dat = (struct HyperlinkWndData*)mir_calloc(sizeof(struct HyperlinkWndData));
if (dat == NULL) return FALSE; /* fail creation */
SetWindowLongPtr(hwnd, 0, (LONG_PTR)dat); /* always succeeds */
/* fall thru */
case WM_SYSCOLORCHANGE:
if ( !(dat->flags&HLKF_HASENABLECOLOR)) {
- if (GetSysColorBrush(COLOR_HOTLIGHT) == NULL) dat->enableColor=RGB(0, 0, 255);
- else dat->enableColor=GetSysColor(COLOR_HOTLIGHT);
+ if (GetSysColorBrush(COLOR_HOTLIGHT) == NULL) dat->enableColor = RGB(0, 0, 255);
+ else dat->enableColor = GetSysColor(COLOR_HOTLIGHT);
dat->focusColor = RGB(GetRValue(dat->enableColor) / 2, GetGValue(dat->enableColor) / 2, GetBValue(dat->enableColor) / 2);
}
if ( !(dat->flags&HLKF_HASDISABLECOLOR))
- dat->disableColor=GetSysColor(COLOR_GRAYTEXT);
+ dat->disableColor = GetSysColor(COLOR_GRAYTEXT);
break;
case WM_SETFOCUS:
@@ -109,15 +109,15 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
{ LOGFONT lf;
HFONT hFont;
if ((HFONT)wParam == NULL) { /* use default system color */
- dat->hEnableFont=dat->hDisableFont=NULL;
+ dat->hEnableFont = dat->hDisableFont = NULL;
return 0;
}
if (GetObject((HFONT)wParam, sizeof(lf), &lf)) {
- lf.lfUnderline=1;
- hFont=CreateFontIndirect(&lf);
+ lf.lfUnderline = 1;
+ hFont = CreateFontIndirect(&lf);
if (hFont != NULL) {
- dat->hEnableFont=hFont;
- dat->hDisableFont=(HFONT)wParam;
+ dat->hEnableFont = hFont;
+ dat->hDisableFont = (HFONT)wParam;
if (LOWORD(lParam)) SendMessage(hwnd, HLK_INVALIDATE, 0, 0);
SendMessage(hwnd, HLK_MEASURETEXT, 0, 0);
}
@@ -132,15 +132,15 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
POINT pt;
HWND hwndParent;
if ( !GetWindowRect(hwnd, &rcWnd)) break;
- pt.x=rcWnd.left;
- pt.y=rcWnd.top;
- hwndParent=GetParent(hwnd);
- if (hwndParent == NULL) hwndParent=hwnd;
+ pt.x = rcWnd.left;
+ pt.y = rcWnd.top;
+ hwndParent = GetParent(hwnd);
+ if (hwndParent == NULL) hwndParent = hwnd;
if ( !ScreenToClient(hwndParent, &pt)) break;
- rcWnd.right=pt.x+(rcWnd.right-rcWnd.left);
- rcWnd.bottom=pt.y+(rcWnd.bottom-rcWnd.top);
- rcWnd.left=pt.x;
- rcWnd.top=pt.y;
+ rcWnd.right = pt.x+(rcWnd.right-rcWnd.left);
+ rcWnd.bottom = pt.y+(rcWnd.bottom-rcWnd.top);
+ rcWnd.left = pt.x;
+ rcWnd.top = pt.y;
InvalidateRect(hwndParent, &rcWnd, TRUE);
return 0;
}
@@ -150,7 +150,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
case HLK_MEASURETEXT:
{ TCHAR szText[256];
if ( !GetWindowText(hwnd, szText, SIZEOF(szText))) return 0;
- lParam=(LPARAM)szText;
+ lParam = (LPARAM)szText;
/* fall thru */
case WM_SETTEXT:
{ HFONT hPrevFont = NULL;
@@ -158,21 +158,21 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
RECT rc;
HDC hdc;
LONG style;
- BOOL fMeasured=FALSE;
- hdc=GetDC(hwnd);
+ BOOL fMeasured = FALSE;
+ hdc = GetDC(hwnd);
if (hdc == NULL) return 0; /* text change failed */
- if (dat->hEnableFont != NULL) hPrevFont=(HFONT)SelectObject(hdc, dat->hEnableFont);
+ if (dat->hEnableFont != NULL) hPrevFont = (HFONT)SelectObject(hdc, dat->hEnableFont);
if (dat->hEnableFont == NULL || hPrevFont != NULL) /* select failed? */
if (GetTextExtentPoint32(hdc, (TCHAR*)lParam, lstrlen((TCHAR*)lParam), &textSize))
if (GetClientRect(hwnd, &rc)) {
- dat->rcText.top=0;
- dat->rcText.bottom=dat->rcText.top+textSize.cy;
- style=GetWindowLongPtr(hwnd, GWL_STYLE);
- if (style&SS_CENTER) dat->rcText.left=(rc.right-textSize.cx)/2;
- else if (style&SS_RIGHT) dat->rcText.left=rc.right-textSize.cx;
- else dat->rcText.left=0;
- dat->rcText.right=dat->rcText.left+textSize.cx;
- fMeasured=TRUE;
+ dat->rcText.top = 0;
+ dat->rcText.bottom = dat->rcText.top+textSize.cy;
+ style = GetWindowLongPtr(hwnd, GWL_STYLE);
+ if (style&SS_CENTER) dat->rcText.left = (rc.right-textSize.cx)/2;
+ else if (style&SS_RIGHT) dat->rcText.left = rc.right-textSize.cx;
+ else dat->rcText.left = 0;
+ dat->rcText.right = dat->rcText.left+textSize.cx;
+ fMeasured = TRUE;
}
if (dat->hEnableFont != NULL && hPrevFont != NULL) SelectObject(hdc, hPrevFont);
ReleaseDC(hwnd, hdc);
@@ -186,23 +186,23 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
if ( !GetCursorPos(&pt)) return FALSE;
if ( !ScreenToClient(hwnd, &pt)) return FALSE;
if (PtInRect(&dat->rcText, pt)) {
- hCursor=(HCURSOR)GetClassLongPtr(hwnd, GCLP_HCURSOR);
- if (hCursor == NULL) hCursor=LoadCursor(NULL, IDC_HAND); /* Win2000+ */
+ hCursor = (HCURSOR)GetClassLongPtr(hwnd, GCLP_HCURSOR);
+ if (hCursor == NULL) hCursor = LoadCursor(NULL, IDC_HAND); /* Win2000+ */
}
- else hCursor=LoadCursor(NULL, IDC_ARROW);
+ else hCursor = LoadCursor(NULL, IDC_ARROW);
SetCursor(hCursor);
return TRUE;
}
case HLK_SETENABLECOLOUR:
- { COLORREF prevColor=dat->enableColor;
- dat->enableColor=(COLORREF)wParam;
+ { COLORREF prevColor = dat->enableColor;
+ dat->enableColor = (COLORREF)wParam;
dat->focusColor = RGB(GetRValue(dat->enableColor) / 2, GetGValue(dat->enableColor) / 2, GetBValue(dat->enableColor) / 2);
dat->flags|=HLKF_HASENABLECOLOR;
return (LRESULT)prevColor;
}
case HLK_SETDISABLECOLOUR:
- { COLORREF prevColor=dat->disableColor;
- dat->disableColor=(COLORREF)wParam;
+ { COLORREF prevColor = dat->disableColor;
+ dat->disableColor = (COLORREF)wParam;
dat->flags|=HLKF_HASDISABLECOLOR;
return (LRESULT)prevColor;
}
@@ -217,14 +217,14 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
PAINTSTRUCT ps;
HDC hdc;
- hdc=BeginPaint(hwnd, &ps);
+ hdc = BeginPaint(hwnd, &ps);
if (hdc != NULL) {
if (IsWindowEnabled(hwnd)) {
- hPrevFont=(HFONT)SelectObject(hdc, dat->hEnableFont);
+ hPrevFont = (HFONT)SelectObject(hdc, dat->hEnableFont);
textColor = (GetFocus() == hwnd) ? dat->focusColor : dat->enableColor;
} else {
- hPrevFont=(HFONT)SelectObject(hdc, dat->hDisableFont);
- textColor=dat->disableColor;
+ hPrevFont = (HFONT)SelectObject(hdc, dat->hDisableFont);
+ textColor = dat->disableColor;
}
if (GetClientRect(hwnd, &rc) && GetWindowText(hwnd, szText, SIZEOF(szText))) {
if (drawThemeParentBackground && IsWinVerXPPlus())
@@ -238,7 +238,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
}
SetBkMode(hdc, TRANSPARENT);
SetTextColor(hdc, textColor);
- alignFlag=(GetWindowLongPtr(hwnd, GWL_STYLE)&(SS_CENTER|SS_RIGHT|SS_LEFT));
+ alignFlag = (GetWindowLongPtr(hwnd, GWL_STYLE)&(SS_CENTER|SS_RIGHT|SS_LEFT));
DrawText(hdc, szText, -1, &rc, alignFlag|DT_NOPREFIX|DT_SINGLELINE|DT_TOP);
}
if (hPrevFont != NULL) SelectObject(hdc, hPrevFont);
@@ -258,17 +258,17 @@ int InitHyperlink(void)
{
WNDCLASS wcl;
- wcl.lpfnWndProc=HyperlinkWndProc;
- wcl.cbClsExtra=0;
- wcl.cbWndExtra=sizeof(struct HyperlinkWndData*);
- wcl.hInstance=hInst;
- if (IsWinVer2000Plus()) wcl.hCursor=NULL;
- else wcl.hCursor=LoadCursor(wcl.hInstance, MAKEINTRESOURCE(IDC_HYPERLINKHAND));
- wcl.lpszClassName=WNDCLASS_HYPERLINK;
- wcl.hbrBackground=NULL;
- wcl.hIcon=NULL;
- wcl.lpszMenuName=NULL;
- wcl.style=CS_HREDRAW|CS_VREDRAW|CS_GLOBALCLASS|CS_PARENTDC;
+ wcl.lpfnWndProc = HyperlinkWndProc;
+ wcl.cbClsExtra = 0;
+ wcl.cbWndExtra = sizeof(struct HyperlinkWndData*);
+ wcl.hInstance = hInst;
+ if (IsWinVer2000Plus()) wcl.hCursor = NULL;
+ else wcl.hCursor = LoadCursor(wcl.hInstance, MAKEINTRESOURCE(IDC_HYPERLINKHAND));
+ wcl.lpszClassName = WNDCLASS_HYPERLINK;
+ wcl.hbrBackground = NULL;
+ wcl.hIcon = NULL;
+ wcl.lpszMenuName = NULL;
+ wcl.style = CS_HREDRAW|CS_VREDRAW|CS_GLOBALCLASS|CS_PARENTDC;
RegisterClass(&wcl); /* automatically unregistered on exit */
return 0;
}
diff --git a/src/modules/utils/imgconv.cpp b/src/modules/utils/imgconv.cpp
index d4d72f066e..216167316b 100644
--- a/src/modules/utils/imgconv.cpp
+++ b/src/modules/utils/imgconv.cpp
@@ -53,7 +53,7 @@ void ConvertToPARGB32(HDC hdc, ARGB *pargb, HBITMAP hbmp, SIZE& sizImage, int cx
if (*pargbMask++)
{
// transparent pixel
- *pargb++ = 0;
+ *pargb++=0;
}
else
{
diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp
index bf875f9d74..7ce014725d 100644
--- a/src/modules/utils/path.cpp
+++ b/src/modules/utils/path.cpp
@@ -361,7 +361,7 @@ XCHAR *ReplaceVariables(XCHAR *str, REPLACEVARSDATA *data)
if (*p == '%') {
if (varStart) {
if (p == varStart)
- *q++ = '%';
+ *q++='%';
else if (XCHAR *value = GetVariableFromArray(data->variables, varStart, p-varStart, data->hContact, &bFree)) {
_xcscpy(q, value);
q += _xcslen(value);
@@ -377,7 +377,7 @@ XCHAR *ReplaceVariables(XCHAR *str, REPLACEVARSDATA *data)
else varStart = p+1;
}
else if ( !varStart)
- *q++ = *p;
+ *q++=*p;
}
*q = 0;
diff --git a/src/modules/utils/resizer.cpp b/src/modules/utils/resizer.cpp
index a443fef0ae..0f9b0b418f 100644
--- a/src/modules/utils/resizer.cpp
+++ b/src/modules/utils/resizer.cpp
@@ -48,7 +48,7 @@ typedef struct {
INT_PTR ResizeDialog(WPARAM, LPARAM lParam)
{
- UTILRESIZEDIALOG *urd=(UTILRESIZEDIALOG*)lParam;
+ UTILRESIZEDIALOG *urd = (UTILRESIZEDIALOG*)lParam;
HDWP hDwp;
int i;
DLGITEMTEMPLATE *pItem = NULL;
@@ -62,14 +62,14 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam)
int extendedDlg, itemCount;
if (urd == NULL || urd->cbSize != sizeof(UTILRESIZEDIALOG)) return 1;
- pTemplate=(DLGTEMPLATE*)LockResource(LoadResource(urd->hInstance, FindResourceA(urd->hInstance, urd->lpTemplate, MAKEINTRESOURCEA(5))));
- pTemplateEx=(START_OF_DLGTEMPLATEEX*)pTemplate;
- extendedDlg=pTemplateEx->signature == 0xFFFF;
+ pTemplate = (DLGTEMPLATE*)LockResource(LoadResource(urd->hInstance, FindResourceA(urd->hInstance, urd->lpTemplate, MAKEINTRESOURCEA(5))));
+ pTemplateEx = (START_OF_DLGTEMPLATEEX*)pTemplate;
+ extendedDlg = pTemplateEx->signature == 0xFFFF;
if (extendedDlg && pTemplateEx->dlgVer != 1)
return 1;
- if (extendedDlg) pWord=(PWORD)(pTemplateEx+1);
- else pWord=(PWORD)(pTemplate+1);
+ if (extendedDlg) pWord = (PWORD)(pTemplateEx+1);
+ else pWord = (PWORD)(pTemplate+1);
if (*pWord == 0xFFFF) pWord+=2; else while (*pWord++); //menu
if (*pWord == 0xFFFF) pWord+=2; else while (*pWord++); //class
while (*pWord++); //title
@@ -86,36 +86,36 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam)
}
}
- urc.cbSize=sizeof(UTILRESIZECONTROL);
- rc.left=0; rc.top=0;
- if (extendedDlg) {rc.right=pTemplateEx->cx; rc.bottom=pTemplateEx->cy;}
- else {rc.right=pTemplate->cx; rc.bottom=pTemplate->cy;}
+ urc.cbSize = sizeof(UTILRESIZECONTROL);
+ rc.left = 0; rc.top = 0;
+ if (extendedDlg) {rc.right = pTemplateEx->cx; rc.bottom = pTemplateEx->cy;}
+ else {rc.right = pTemplate->cx; rc.bottom = pTemplate->cy;}
MapDialogRect(urd->hwndDlg, &rc);
- urc.dlgOriginalSize.cx=rc.right; urc.dlgOriginalSize.cy=rc.bottom;
+ urc.dlgOriginalSize.cx = rc.right; urc.dlgOriginalSize.cy = rc.bottom;
GetClientRect(urd->hwndDlg, &rc);
- urc.dlgNewSize.cx=rc.right; urc.dlgNewSize.cy=rc.bottom;
+ urc.dlgNewSize.cx = rc.right; urc.dlgNewSize.cy = rc.bottom;
- if (extendedDlg) itemCount=pTemplateEx->cDlgItems;
- else itemCount=pTemplate->cdit;
- hDwp=BeginDeferWindowPos(itemCount);
+ if (extendedDlg) itemCount = pTemplateEx->cDlgItems;
+ else itemCount = pTemplate->cdit;
+ hDwp = BeginDeferWindowPos(itemCount);
for (i=0;i<itemCount;i++) {
if ((UINT_PTR)pWord&2) pWord++; //dword align
if (extendedDlg) {
- pItemEx=(START_OF_DLGITEMTEMPLATEEX*)pWord;
- pWord=(PWORD)(pItemEx+1);
+ pItemEx = (START_OF_DLGITEMTEMPLATEEX*)pWord;
+ pWord = (PWORD)(pItemEx+1);
- urc.wId=pItemEx->id;
- urc.rcItem.left=pItemEx->x; urc.rcItem.top=pItemEx->y;
- urc.rcItem.right=urc.rcItem.left+pItemEx->cx; urc.rcItem.bottom=urc.rcItem.top+pItemEx->cy;
+ urc.wId = pItemEx->id;
+ urc.rcItem.left = pItemEx->x; urc.rcItem.top = pItemEx->y;
+ urc.rcItem.right = urc.rcItem.left+pItemEx->cx; urc.rcItem.bottom = urc.rcItem.top+pItemEx->cy;
}
else {
- pItem=(DLGITEMTEMPLATE*)pWord;
- pWord=(PWORD)(pItem+1);
+ pItem = (DLGITEMTEMPLATE*)pWord;
+ pWord = (PWORD)(pItem+1);
- urc.wId=pItem->id;
- urc.rcItem.left=pItem->x; urc.rcItem.top=pItem->y;
- urc.rcItem.right=urc.rcItem.left+pItem->cx; urc.rcItem.bottom=urc.rcItem.top+pItem->cy;
+ urc.wId = pItem->id;
+ urc.rcItem.left = pItem->x; urc.rcItem.top = pItem->y;
+ urc.rcItem.right = urc.rcItem.left+pItem->cx; urc.rcItem.bottom = urc.rcItem.top+pItem->cy;
}
if (*pWord == 0xFFFF) pWord+=2; else while (*pWord++); //menu
if (*pWord == 0xFFFF) pWord+=2; else while (*pWord++); //class
@@ -124,7 +124,7 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam)
if (urc.wId == 65535) continue; //using this breaks the dwp, so just ignore it
MapDialogRect(urd->hwndDlg, &urc.rcItem);
- procResult=(urd->pfnResizer)(urd->hwndDlg, urd->lParam, &urc);
+ procResult = (urd->pfnResizer)(urd->hwndDlg, urd->lParam, &urc);
if (procResult&RD_ANCHORX_RIGHT) {
urc.rcItem.left+=urc.dlgNewSize.cx-urc.dlgOriginalSize.cx;
urc.rcItem.right+=urc.dlgNewSize.cx-urc.dlgOriginalSize.cx;
diff --git a/src/modules/utils/timeutils.cpp b/src/modules/utils/timeutils.cpp
index 5e921566d5..205457e76d 100644
--- a/src/modules/utils/timeutils.cpp
+++ b/src/modules/utils/timeutils.cpp
@@ -84,7 +84,7 @@ void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, int
default:
if (destCharsLeft--)
- *pDest++ = *pFormat;
+ *pDest++=*pFormat;
continue;
}
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp
index bf83dfeb75..f22b18829c 100644
--- a/src/modules/utils/timezones.cpp
+++ b/src/modules/utils/timezones.cpp
@@ -341,10 +341,10 @@ typedef struct
UINT addStr, getSel, setSel, getData, setData;
} ListMessages;
-static const ListMessages lbMessages =
+static const ListMessages lbMessages =
{ LB_ADDSTRING, LB_GETCURSEL, LB_SETCURSEL, LB_GETITEMDATA, LB_SETITEMDATA };
-static const ListMessages cbMessages =
+static const ListMessages cbMessages =
{ CB_ADDSTRING, CB_GETCURSEL, CB_SETCURSEL, CB_GETITEMDATA, CB_SETITEMDATA };
static const ListMessages *GetListMessages(HWND hWnd, DWORD dwFlags)
@@ -382,7 +382,7 @@ static int timeapiSelectListItem(HANDLE hContact, HWND hWnd, DWORD dwFlags)
if ( !DBGetContactSettingTString(hContact, "UserInfo", "TzName", &dbv))
{
unsigned hash = mir_hashstrT(dbv.ptszVal);
- for (int i = 0; i < g_timezonesBias.getCount(); ++i)
+ for (int i=0; i < g_timezonesBias.getCount(); ++i)
{
if (hash == g_timezonesBias[i]->hash)
{
@@ -409,7 +409,7 @@ static int timeapiPrepareList(HANDLE hContact, HWND hWnd, DWORD dwFlags)
SendMessage(hWnd, lstMsg->addStr, 0, (LPARAM)TranslateT("<unspecified>"));
- for (int i = 0; i < g_timezonesBias.getCount(); ++i)
+ for (int i=0; i < g_timezonesBias.getCount(); ++i)
{
MIM_TIMEZONE *tz = g_timezonesBias[i];
@@ -451,21 +451,21 @@ static INT_PTR GetTimeApi(WPARAM, LPARAM lParam)
if (tmi->cbSize != sizeof(TIME_API))
return FALSE;
- tmi->createByName = timeapiGetInfoByName;
- tmi->createByContact = timeapiGetInfoByContact;
- tmi->storeByContact = timeapiSetInfoByContact;
+ tmi->createByName = timeapiGetInfoByName;
+ tmi->createByContact = timeapiGetInfoByContact;
+ tmi->storeByContact = timeapiSetInfoByContact;
- tmi->printDateTime = timeapiPrintDateTime;
- tmi->printTimeStamp = timeapiPrintTimeStamp;
+ tmi->printDateTime = timeapiPrintDateTime;
+ tmi->printTimeStamp = timeapiPrintTimeStamp;
- tmi->prepareList = timeapiPrepareList;
- tmi->selectListItem = timeapiSelectListItem;
- tmi->storeListResults = timeapiStoreListResult;
+ tmi->prepareList = timeapiPrepareList;
+ tmi->selectListItem = timeapiSelectListItem;
+ tmi->storeListResults = timeapiStoreListResult;
- tmi->getTimeZoneTime = timeapiGetTimeZoneTime;
- tmi->timeStampToTimeZoneTimeStamp = timeapiTimeStampToTimeZoneTimeStamp;
- tmi->getTzi = timeapiGetTzi;
- tmi->getTzName = timeapiGetTzName;
+ tmi->getTimeZoneTime = timeapiGetTimeZoneTime;
+ tmi->timeStampToTimeZoneTimeStamp = timeapiTimeStampToTimeZoneTimeStamp;
+ tmi->getTzi = timeapiGetTzi;
+ tmi->getTzName = timeapiGetTzName;
return TRUE;
}
@@ -537,7 +537,7 @@ extern "C" __declspec(dllexport) void RecalculateTime(void)
found = true;
}
- for (int i = 0; i < g_timezones.getCount(); ++i)
+ for (int i=0; i < g_timezones.getCount(); ++i)
{
MIM_TIMEZONE &tz = g_timezones[i];
if (tz.offset != INT_MIN) tz.offset = INT_MIN;
diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp
index 4af0230071..64941a9b85 100644
--- a/src/modules/utils/utils.cpp
+++ b/src/modules/utils/utils.cpp
@@ -39,7 +39,7 @@ void UninitTimeZones(void);
static BOOL bModuleInitialized = FALSE;
-static struct CountryListEntry countries[]={
+static struct CountryListEntry countries[] = {
{0 , "Unspecified"},
{9999, "Other"},
{0xFFFF, "Unknown"},
@@ -310,7 +310,7 @@ static INT_PTR GetCountryByNumber(WPARAM wParam, LPARAM)
static INT_PTR GetCountryList(WPARAM wParam, LPARAM lParam)
{
*(int*)wParam = SIZEOF(countries);
- *(struct CountryListEntry**)lParam=countries;
+ *(struct CountryListEntry**)lParam = countries;
return 0;
}
@@ -318,11 +318,11 @@ static INT_PTR GetCountryList(WPARAM wParam, LPARAM lParam)
static INT_PTR SaveWindowPosition(WPARAM, LPARAM lParam)
{
- SAVEWINDOWPOS *swp=(SAVEWINDOWPOS*)lParam;
+ SAVEWINDOWPOS *swp = (SAVEWINDOWPOS*)lParam;
WINDOWPLACEMENT wp;
char szSettingName[64];
- wp.length=sizeof(wp);
+ wp.length = sizeof(wp);
GetWindowPlacement(swp->hwnd, &wp);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sx", swp->szNamePrefix);
DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.left);
@@ -377,30 +377,30 @@ static INT_PTR AssertInsideScreen(WPARAM wParam, LPARAM lParam)
static INT_PTR RestoreWindowPosition(WPARAM wParam, LPARAM lParam)
{
- SAVEWINDOWPOS *swp=(SAVEWINDOWPOS*)lParam;
+ SAVEWINDOWPOS *swp = (SAVEWINDOWPOS*)lParam;
WINDOWPLACEMENT wp;
char szSettingName[64];
int x, y;
- wp.length=sizeof(wp);
+ wp.length = sizeof(wp);
GetWindowPlacement(swp->hwnd, &wp);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sx", swp->szNamePrefix);
- x=DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
+ x = DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sy", swp->szNamePrefix);
- y=(int)DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
+ y = (int)DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
if (x == -1) return 1;
if (wParam&RWPF_NOSIZE) {
OffsetRect(&wp.rcNormalPosition, x-wp.rcNormalPosition.left, y-wp.rcNormalPosition.top);
}
else {
- wp.rcNormalPosition.left=x;
- wp.rcNormalPosition.top=y;
+ wp.rcNormalPosition.left = x;
+ wp.rcNormalPosition.top = y;
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%swidth", swp->szNamePrefix);
- wp.rcNormalPosition.right=wp.rcNormalPosition.left+DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
+ wp.rcNormalPosition.right = wp.rcNormalPosition.left+DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sheight", swp->szNamePrefix);
- wp.rcNormalPosition.bottom=wp.rcNormalPosition.top+DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
+ wp.rcNormalPosition.bottom = wp.rcNormalPosition.top+DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
}
- wp.flags=0;
+ wp.flags = 0;
if (wParam & RWPF_HIDDEN)
wp.showCmd = SW_HIDE;
if (wParam & RWPF_NOACTIVATE)
diff --git a/src/modules/utils/windowlist.cpp b/src/modules/utils/windowlist.cpp
index f1ccff236b..7230ab4a23 100644
--- a/src/modules/utils/windowlist.cpp
+++ b/src/modules/utils/windowlist.cpp
@@ -22,9 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "..\..\core\commonheaders.h"
-static WINDOWLISTENTRY *windowList=NULL;
-static int windowListCount=0;
-static int nextWindowListId=1;
+static WINDOWLISTENTRY *windowList = NULL;
+static int windowListCount = 0;
+static int nextWindowListId = 1;
static INT_PTR AllocWindowList(WPARAM, LPARAM)
{
@@ -33,8 +33,8 @@ static INT_PTR AllocWindowList(WPARAM, LPARAM)
static INT_PTR AddToWindowList(WPARAM, LPARAM lParam)
{
- windowList=(WINDOWLISTENTRY*)mir_realloc(windowList, sizeof(WINDOWLISTENTRY)*(windowListCount+1));
- windowList[windowListCount++]=*(WINDOWLISTENTRY*)lParam;
+ windowList = (WINDOWLISTENTRY*)mir_realloc(windowList, sizeof(WINDOWLISTENTRY)*(windowListCount+1));
+ windowList[windowListCount++] = *(WINDOWLISTENTRY*)lParam;
return 0;
}
@@ -62,7 +62,7 @@ static INT_PTR FindInWindowList(WPARAM wParam, LPARAM lParam)
static INT_PTR BroadcastToWindowList(WPARAM wParam, LPARAM lParam)
{
int i;
- MSG *msg=(MSG*)lParam;
+ MSG *msg = (MSG*)lParam;
for (i=0;i<windowListCount;i++)
if (windowList[i].hList == (HANDLE)wParam)
SendMessage(windowList[i].hwnd, msg->message, msg->wParam, msg->lParam);
@@ -72,7 +72,7 @@ static INT_PTR BroadcastToWindowList(WPARAM wParam, LPARAM lParam)
static INT_PTR BroadcastToWindowListAsync(WPARAM wParam, LPARAM lParam)
{
int i;
- MSG *msg=(MSG*)lParam;
+ MSG *msg = (MSG*)lParam;
for (i=0;i<windowListCount;i++)
if (windowList[i].hList == (HANDLE)wParam)
PostMessage(windowList[i].hwnd, msg->message, msg->wParam, msg->lParam);
@@ -96,6 +96,6 @@ void FreeWindowList(void)
mir_free(windowList);
windowList = NULL;
}
- windowListCount=0;
- nextWindowListId=1;
+ windowListCount = 0;
+ nextWindowListId = 1;
}
diff --git a/src/modules/visibility/visibility.cpp b/src/modules/visibility/visibility.cpp
index b7e67a2cd4..0de68fe01a 100644
--- a/src/modules/visibility/visibility.cpp
+++ b/src/modules/visibility/visibility.cpp
@@ -25,32 +25,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentItem, int *groupChildCount)
{
int typeOfFirst;
- int iconOn[2]={1, 1};
- int childCount[2]={0, 0}, i;
+ int iconOn[2] = {1, 1};
+ int childCount[2] = {0, 0}, i;
int iImage;
HANDLE hItem, hChildItem;
- typeOfFirst=SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
+ typeOfFirst = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
//check groups
- if (typeOfFirst == CLCIT_GROUP) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_GROUP) hItem = hFirstItem;
+ else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
while (hItem) {
- hChildItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ hChildItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hChildItem) SetListGroupIcons(hwndList, hChildItem, hItem, childCount);
for (i=0; i < SIZEOF(iconOn); i++)
- if (iconOn[i] && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i) == 0) iconOn[i]=0;
- hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
+ if (iconOn[i] && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i) == 0) iconOn[i] = 0;
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
//check contacts
- if (typeOfFirst == CLCIT_CONTACT) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_CONTACT) hItem = hFirstItem;
+ else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
for (i=0; i < SIZEOF(iconOn); i++) {
- iImage=SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i);
- if (iconOn[i] && iImage == 0) iconOn[i]=0;
+ iImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i);
+ if (iconOn[i] && iImage == 0) iconOn[i] = 0;
if (iImage != 0xFF) childCount[i]++;
}
- hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
//set icons
for (i=0; i < SIZEOF(iconOn); i++) {
@@ -64,22 +64,22 @@ static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int
int typeOfFirst, iOldIcon;
HANDLE hItem, hChildItem;
- typeOfFirst=SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
+ typeOfFirst = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
//check groups
- if (typeOfFirst == CLCIT_GROUP) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_GROUP) hItem = hFirstItem;
+ else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
while (hItem) {
- hChildItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ hChildItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hChildItem) SetAllChildIcons(hwndList, hChildItem, iColumn, iImage);
- hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
//check contacts
- if (typeOfFirst == CLCIT_CONTACT) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_CONTACT) hItem = hFirstItem;
+ else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
- iOldIcon=SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
+ iOldIcon = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
if (iOldIcon != 0xFF && iOldIcon != iImage) SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
- hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
}
@@ -92,7 +92,7 @@ static void ResetListOptions(HWND hwndList)
SendMessage(hwndList, CLM_SETGREYOUTFLAGS, 0, 0);
SendMessage(hwndList, CLM_SETLEFTMARGIN, 2, 0);
SendMessage(hwndList, CLM_SETINDENT, 10, 0);
- for (i=0;i<=FONTID_MAX;i++)
+ for (i=0;i <= FONTID_MAX;i++)
SendMessage(hwndList, CLM_SETTEXTCOLOR, i, GetSysColor(COLOR_WINDOWTEXT));
SetWindowLongPtr(hwndList, GWL_STYLE, GetWindowLongPtr(hwndList, GWL_STYLE)|CLS_SHOWHIDDEN);
}
@@ -104,15 +104,15 @@ static void SetAllContactIcons(HWND hwndList)
DWORD flags;
WORD status;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
do {
- hItem=(HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if (szProto == NULL) {flags=0; status=0;}
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (szProto == NULL) {flags = 0; status = 0;}
else {
- flags=CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
- status=DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
+ flags = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
+ status = DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
}
if (flags&PF1_INVISLIST) {
if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, 0)) == 0xFF)
@@ -123,7 +123,7 @@ static void SetAllContactIcons(HWND hwndList)
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, status == ID_STATUS_OFFLINE?2:0));
}
}
- } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ } while (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
}
static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
@@ -136,25 +136,25 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{ HIMAGELIST hIml;
- hIml=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, 3, 3);
+ hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, 3, 3);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_STATUS_INVISIBLE);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_STATUS_OFFLINE);
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
- hVisibleIcon=ImageList_GetIcon(hIml, 1, ILD_NORMAL);
+ hVisibleIcon = ImageList_GetIcon(hIml, 1, ILD_NORMAL);
SendDlgItemMessage(hwndDlg, IDC_VISIBLEICON, STM_SETICON, (WPARAM)hVisibleIcon, 0);
- hInvisibleIcon=ImageList_GetIcon(hIml, 2, ILD_NORMAL);
+ hInvisibleIcon = ImageList_GetIcon(hIml, 2, ILD_NORMAL);
SendDlgItemMessage(hwndDlg, IDC_INVISIBLEICON, STM_SETICON, (WPARAM)hInvisibleIcon, 0);
}
ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST));
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRACOLUMNS, 2, 0);
- { CLCINFOITEM cii={0};
- cii.cbSize=sizeof(cii);
- cii.flags=CLCIIF_GROUPFONT;
- cii.pszText=TranslateT("** All contacts **");
- hItemAll=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
+ { CLCINFOITEM cii = {0};
+ cii.cbSize = sizeof(cii);
+ cii.flags = CLCIIF_GROUPFONT;
+ cii.pszText = TranslateT("** All contacts **");
+ hItemAll = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
}
SetAllContactIcons(GetDlgItem(hwndDlg, IDC_LIST));
@@ -180,7 +180,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP
break;
case NM_CLICK:
{ HANDLE hItem;
- NMCLISTCONTROL *nm=(NMCLISTCONTROL*)lParam;
+ NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam;
DWORD hitFlags;
int iImage;
int itemType;
@@ -196,10 +196,10 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP
// It was not a visbility icon
if ( !(hitFlags & CLCHT_ONITEMEXTRA)) break;
- // Get image in clicked column (0=none, 1=visible, 2=invisible)
+ // Get image in clicked column (0 = none, 1 = visible, 2 = invisible)
iImage = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0));
if (iImage == 0)
- iImage=nm->iColumn + 1;
+ iImage = nm->iColumn + 1;
else
if (iImage == 1 || iImage == 2)
iImage = 0;
@@ -242,22 +242,22 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP
{ HANDLE hContact, hItem;
int set, i, iImage;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
do {
- hItem=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
- set=0;
+ set = 0;
for (i=0;i<2;i++) {
- iImage=SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0));
+ iImage = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0));
if (iImage == i+1) {
CallContactService(hContact, PSS_SETAPPARENTMODE, iImage == 1?ID_STATUS_ONLINE:ID_STATUS_OFFLINE, 0);
- set=1;
+ set = 1;
break;
}
}
if ( !set) CallContactService(hContact, PSS_SETAPPARENTMODE, 0, 0);
}
- } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ } while (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
return TRUE;
}
}
@@ -267,7 +267,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP
case WM_DESTROY:
DestroyIcon(hVisibleIcon);
DestroyIcon(hInvisibleIcon);
- { HIMAGELIST hIml=(HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0);
+ { HIMAGELIST hIml = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0);
ImageList_Destroy(hIml);
}
break;
diff --git a/src/modules/xml/xmlApi.cpp b/src/modules/xml/xmlApi.cpp
index dc6387b80a..6d2a09390f 100644
--- a/src/modules/xml/xmlApi.cpp
+++ b/src/modules/xml/xmlApi.cpp
@@ -376,66 +376,66 @@ static INT_PTR GetXmlApi(WPARAM, LPARAM lParam)
if (xi->cbSize != XML_API_SIZEOF_V1 && xi->cbSize != sizeof(XML_API))
return FALSE;
- xi->createNode = xmlapiCreateNode;
- xi->destroyNode = xmlapiDestroyNode;
+ xi->createNode = xmlapiCreateNode;
+ xi->destroyNode = xmlapiDestroyNode;
- xi->parseString = xmlapiParseString;
- xi->toString = xmlapiToString;
- xi->freeMem = xmlapiFree;
+ xi->parseString = xmlapiParseString;
+ xi->toString = xmlapiToString;
+ xi->freeMem = xmlapiFree;
- xi->addChild = xmlapiAddChild;
- xi->addChild2 = xmlapiAddChild2;
- xi->copyNode = xmlapiCopyNode;
- xi->getChild = xmlapiGetChild;
+ xi->addChild = xmlapiAddChild;
+ xi->addChild2 = xmlapiAddChild2;
+ xi->copyNode = xmlapiCopyNode;
+ xi->getChild = xmlapiGetChild;
xi->getChildByAttrValue = xmlapiGetChildByAttrValue;
- xi->getChildCount = xmlapiGetChildCount;
- xi->getFirstChild = xmlapiGetFirstChild;
- xi->getNthChild = xmlapiGetNthChild;
- xi->getNextChild = xmlapiGetNextChild;
- xi->getNextNode = xmlapiGetNextNode;
- xi->getChildByPath = xmlapiGetChildByPath;
- xi->getName = xmlapiGetName;
- xi->getParent = xmlapiGetParent;
- xi->getText = xmlapiGetText;
- xi->setText = xmlapiSetText;
-
- xi->getAttr = xmlapiGetAttr;
- xi->getAttrCount = xmlapiGetAttrCount;
- xi->getAttrName = xmlapiGetAttrName;
- xi->getAttrValue = xmlapiGetAttrValue;
- xi->addAttr = xmlapiAddAttr;
- xi->addAttrInt = xmlapiAddAttrInt;
+ xi->getChildCount = xmlapiGetChildCount;
+ xi->getFirstChild = xmlapiGetFirstChild;
+ xi->getNthChild = xmlapiGetNthChild;
+ xi->getNextChild = xmlapiGetNextChild;
+ xi->getNextNode = xmlapiGetNextNode;
+ xi->getChildByPath = xmlapiGetChildByPath;
+ xi->getName = xmlapiGetName;
+ xi->getParent = xmlapiGetParent;
+ xi->getText = xmlapiGetText;
+ xi->setText = xmlapiSetText;
+
+ xi->getAttr = xmlapiGetAttr;
+ xi->getAttrCount = xmlapiGetAttrCount;
+ xi->getAttrName = xmlapiGetAttrName;
+ xi->getAttrValue = xmlapiGetAttrValue;
+ xi->addAttr = xmlapiAddAttr;
+ xi->addAttrInt = xmlapiAddAttrInt;
if (xi->cbSize > XML_API_SIZEOF_V1) {
- xi->isDeclaration = xmlapiIsDeclaration;
+ xi->isDeclaration = xmlapiIsDeclaration;
xi->toStringWithFormatting = xmlapiToStringWithFormatting;
- xi->deepCopy = xmlapiDeepCopy;
- xi->setAttrByIndex = xmlapiSetAttrByIndex;
- xi->setAttrByName = xmlapiSetAttrByName;
- xi->addChildEx = xmlapiAddChildEx;
- xi->addChildEx2 = xmlapiAddChildEx2;
- xi->getTextCount = xmlapiGetTextCount;
- xi->getTextByIndex = xmlapiGetTextByIndex;
- xi->addText = xmlapiAddText;
- xi->setTextByIndex = xmlapiSetTextByIndex;
- xi->getClearCount = xmlapiGetClearCount;
- xi->getClear = xmlapiGetClear;
- xi->addClear = xmlapiAddClear;
- xi->setClear = xmlapiSetClear;
- xi->getElementCount = xmlapiGetElementCount;
- xi->getElement = xmlapiGetElement;
-
- xi->deleteNodeContent = xmlapiDeleteNodeContent;
- xi->deleteAttrByIndex = xmlapiDeleteAttrByIndex;
- xi->deleteAttrByName = xmlapiDeleteAttrByName;
- xi->deleteText = xmlapiDeleteText;
- xi->deleteClear = xmlapiDeleteClear;
+ xi->deepCopy = xmlapiDeepCopy;
+ xi->setAttrByIndex = xmlapiSetAttrByIndex;
+ xi->setAttrByName = xmlapiSetAttrByName;
+ xi->addChildEx = xmlapiAddChildEx;
+ xi->addChildEx2 = xmlapiAddChildEx2;
+ xi->getTextCount = xmlapiGetTextCount;
+ xi->getTextByIndex = xmlapiGetTextByIndex;
+ xi->addText = xmlapiAddText;
+ xi->setTextByIndex = xmlapiSetTextByIndex;
+ xi->getClearCount = xmlapiGetClearCount;
+ xi->getClear = xmlapiGetClear;
+ xi->addClear = xmlapiAddClear;
+ xi->setClear = xmlapiSetClear;
+ xi->getElementCount = xmlapiGetElementCount;
+ xi->getElement = xmlapiGetElement;
+
+ xi->deleteNodeContent = xmlapiDeleteNodeContent;
+ xi->deleteAttrByIndex = xmlapiDeleteAttrByIndex;
+ xi->deleteAttrByName = xmlapiDeleteAttrByName;
+ xi->deleteText = xmlapiDeleteText;
+ xi->deleteClear = xmlapiDeleteClear;
xi->positionOfChildByIndex = xmlapiPositionOfChildByIndex;
- xi->positionOfChildByNode = xmlapiPositionOfChildByNode;
- xi->positionOfChildByName = xmlapiPositionOfChildByName;
- xi->positionOfText = xmlapiPositionOfText;
- xi->positionOfClear = xmlapiPositionOfClear;
+ xi->positionOfChildByNode = xmlapiPositionOfChildByNode;
+ xi->positionOfChildByName = xmlapiPositionOfChildByName;
+ xi->positionOfText = xmlapiPositionOfText;
+ xi->positionOfClear = xmlapiPositionOfClear;
}
return TRUE;
}
diff --git a/src/modules/xml/xmlParser.cpp b/src/modules/xml/xmlParser.cpp
index 32c81c88c8..a473c9b194 100644
--- a/src/modules/xml/xmlParser.cpp
+++ b/src/modules/xml/xmlParser.cpp
@@ -19,19 +19,19 @@
*
* If you add "#define APPROXIMATE_PARSING" on the first line of this file
* the parser will see the following XML-stream:
-* <data name="n1">
-* <data name="n2">
-* <data name="n3" />
+* <data name = "n1">
+* <data name = "n2">
+* <data name = "n3" />
* as equivalent to the following XML-stream:
-* <data name="n1" />
-* <data name="n2" />
-* <data name="n3" />
+* <data name = "n1" />
+* <data name = "n2" />
+* <data name = "n3" />
* This can be useful for badly-formed XML-streams but prevent the use
* of the following XML-stream (problem is: tags at contiguous levels
* have the same names):
-* <data name="n1">
-* <data name="n2">
-* <data name="n3" />
+* <data name = "n1">
+* <data name = "n2">
+* <data name = "n3" />
* </data>
* </data>
*
@@ -43,7 +43,7 @@
* available on windows 9x/NT/2000/XP/Vista only.
*
* Copyright (c) 2002, Business-Insight
-* <a href="http://www.Business-Insight.com">Business-Insight</a>
+* <a href = "http://www.Business-Insight.com">Business-Insight</a>
* All rights reserved.
* See the file "AFPL-license.txt" about the licensing terms
*
@@ -62,8 +62,8 @@
XMLCSTR XMLNode::getVersion() { return _CXML("v2.43"); }
void freeXMLString(XMLSTR t) {if(t)free(t);}
-static XMLNode::XMLCharEncoding characterEncoding=XMLNode::char_encoding_UTF8;
-static char guessWideCharChars=1, dropWhiteSpace=1, removeCommentsInMiddleOfText=1;
+static XMLNode::XMLCharEncoding characterEncoding = XMLNode::char_encoding_UTF8;
+static char guessWideCharChars = 1, dropWhiteSpace = 1, removeCommentsInMiddleOfText = 1;
inline int mmin(const int t1, const int t2) { return t1 < t2 ? t1 : t2; }
@@ -75,7 +75,7 @@ inline int mmin(const int t1, const int t2) { return t1 < t2 ? t1 : t2; }
// The "<!--" declaration must be the third in the list.
// All ClearTag Strings must start with the '<' character.
typedef struct { XMLCSTR lpszOpen; int openTagLen; XMLCSTR lpszClose;} ALLXMLClearTag;
-static ALLXMLClearTag XMLClearTags[] =
+static ALLXMLClearTag XMLClearTags[] =
{
{ _CXML("<![CDATA["), 9, _CXML("]]>") },
{ _CXML("<!DOCTYPE"), 9, _CXML(">") },
@@ -90,7 +90,7 @@ static ALLXMLClearTag XMLClearTags[] =
// The number on the second columns is the length of the string inside the
// first column. Additionally, the syntaxes "&#xA0;" and "&#160;" are recognized.
typedef struct { XMLCSTR s; int l; XMLCHAR c;} XMLCharacterEntity;
-static XMLCharacterEntity XMLEntities[] =
+static XMLCharacterEntity XMLEntities[] =
{
{ _CXML("&amp;"), 5, _CXML('&')},
{ _CXML("&lt;"), 4, _CXML('<')},
@@ -156,7 +156,7 @@ char myIsTextWideChar(const void *b, int len) // inspired by the Wine API: RtlIs
// for SPARC processors: wchar_t* buffers must always be alligned, otherwise it's a char* buffer.
if ((((unsigned long)b)%sizeof(wchar_t)) != 0) return FALSE;
#endif
- const wchar_t *s=(const wchar_t*)b;
+ const wchar_t *s = (const wchar_t*)b;
// buffer too small:
if (len<(int)sizeof(wchar_t)) return FALSE;
@@ -165,15 +165,15 @@ char myIsTextWideChar(const void *b, int len) // inspired by the Wine API: RtlIs
if (len&1) return FALSE;
/* only checks the first 256 characters */
- len=mmin(256, len/sizeof(wchar_t));
+ len = mmin(256, len/sizeof(wchar_t));
// Check for the special byte order:
if (*((unsigned short*)s) == 0xFFFE) return TRUE; // IS_TEXT_UNICODE_REVERSE_SIGNATURE;
if (*((unsigned short*)s) == 0xFEFF) return TRUE; // IS_TEXT_UNICODE_SIGNATURE
// checks for ASCII characters in the UNICODE stream
- int i, stats=0;
- for (i=0; i<len; i++) if (s[i]<=(unsigned short)255) stats++;
+ int i, stats = 0;
+ for (i=0; i<len; i++) if (s[i] <= (unsigned short)255) stats++;
if (stats>len/2) return TRUE;
// Check for UNICODE NULL chars
@@ -192,13 +192,13 @@ char myIsTextWideChar(const void *b, int l) { return (char)IsTextUnicode((CONST
wchar_t *myMultiByteToWideChar(const char *s, XMLNode::XMLCharEncoding ce)
{
int i;
- if (ce == XMLNode::char_encoding_UTF8) i=(int)MultiByteToWideChar(CP_UTF8, 0 , s, -1, NULL, 0);
- else i=(int)MultiByteToWideChar(CP_ACP , MB_PRECOMPOSED, s, -1, NULL, 0);
+ if (ce == XMLNode::char_encoding_UTF8) i = (int)MultiByteToWideChar(CP_UTF8, 0 , s, -1, NULL, 0);
+ else i = (int)MultiByteToWideChar(CP_ACP , MB_PRECOMPOSED, s, -1, NULL, 0);
if (i<0) return NULL;
- wchar_t *d=(wchar_t *)malloc((i+1)*sizeof(XMLCHAR));
- if (ce == XMLNode::char_encoding_UTF8) i=(int)MultiByteToWideChar(CP_UTF8, 0 , s, -1, d, i);
- else i=(int)MultiByteToWideChar(CP_ACP , MB_PRECOMPOSED, s, -1, d, i);
- d[i]=0;
+ wchar_t *d = (wchar_t *)malloc((i+1)*sizeof(XMLCHAR));
+ if (ce == XMLNode::char_encoding_UTF8) i = (int)MultiByteToWideChar(CP_UTF8, 0 , s, -1, d, i);
+ else i = (int)MultiByteToWideChar(CP_ACP , MB_PRECOMPOSED, s, -1, d, i);
+ d[i] = 0;
return d;
}
static inline FILE *xfopen(XMLCSTR filename, XMLCSTR mode) { return _wfopen(filename, mode); }
@@ -211,8 +211,8 @@ static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)wcscpy(c1,
#else
char *myWideCharToMultiByte(const wchar_t *s)
{
- UINT codePage=CP_ACP; if (characterEncoding == XMLNode::char_encoding_UTF8) codePage=CP_UTF8;
- int i=(int)WideCharToMultiByte(codePage, // code page
+ UINT codePage = CP_ACP; if (characterEncoding == XMLNode::char_encoding_UTF8) codePage = CP_UTF8;
+ int i = (int)WideCharToMultiByte(codePage, // code page
0, // performance and mapping flags
s, // wide-character string
-1, // number of chars in string
@@ -222,7 +222,7 @@ char *myWideCharToMultiByte(const wchar_t *s)
NULL // set when default char used
);
if (i<0) return NULL;
- char *d=(char*)malloc(i+1);
+ char *d = (char*)malloc(i+1);
WideCharToMultiByte(codePage, // code page
0, // performance and mapping flags
s, // wide-character string
@@ -232,7 +232,7 @@ char *myWideCharToMultiByte(const wchar_t *s)
NULL, // default for unmappable chars
NULL // set when default char used
);
- d[i]=0;
+ d[i] = 0;
return d;
}
static inline FILE *xfopen(XMLCSTR filename, XMLCSTR mode) { return fopen(filename, mode); }
@@ -255,24 +255,24 @@ char *myWideCharToMultiByte(const wchar_t *s) { return NULL; }
#else
char *myWideCharToMultiByte(const wchar_t *s)
{
- const wchar_t *ss=s;
- int i=(int)wcsrtombs(NULL, &ss, 0, NULL);
+ const wchar_t *ss = s;
+ int i = (int)wcsrtombs(NULL, &ss, 0, NULL);
if (i<0) return NULL;
- char *d=(char *)malloc(i+1);
+ char *d = (char *)malloc(i+1);
wcsrtombs(d, &s, i, NULL);
- d[i]=0;
+ d[i] = 0;
return d;
}
#endif
#ifdef _XMLWIDECHAR
wchar_t *myMultiByteToWideChar(const char *s, XMLNode::XMLCharEncoding ce)
{
- const char *ss=s;
- int i=(int)mbsrtowcs(NULL, &ss, 0, NULL);
+ const char *ss = s;
+ int i = (int)mbsrtowcs(NULL, &ss, 0, NULL);
if (i<0) return NULL;
- wchar_t *d=(wchar_t *)malloc((i+1)*sizeof(wchar_t));
+ wchar_t *d = (wchar_t *)malloc((i+1)*sizeof(wchar_t));
mbsrtowcs(d, &s, i, NULL);
- d[i]=0;
+ d[i] = 0;
return d;
}
int xstrlen(XMLCSTR c) { return wcslen(c); }
@@ -296,7 +296,7 @@ static inline int xstricmp(XMLCSTR c1, XMLCSTR c2)
wchar_t left, right;
do
{
- left=towlower(*c1++); right=towlower(*c2++);
+ left = towlower(*c1++); right = towlower(*c2++);
} while (left&&(left == right));
return (int)left-(int)right;
}
@@ -305,7 +305,7 @@ static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l)
wchar_t left, right;
while (l--)
{
- left=towlower(*c1++); right=towlower(*c2++);
+ left = towlower(*c1++); right = towlower(*c2++);
if (( !left) || (left != right)) return (int)left-(int)right;
}
return 0;
@@ -316,10 +316,10 @@ static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)wcsstr(c1,
static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)wcscpy(c1, c2); }
static inline FILE *xfopen(XMLCSTR filename, XMLCSTR mode)
{
- char *filenameAscii=myWideCharToMultiByte(filename);
+ char *filenameAscii = myWideCharToMultiByte(filename);
FILE *f;
- if (mode[0] == _CXML('r')) f=fopen(filenameAscii, "rb");
- else f=fopen(filenameAscii, "wb");
+ if (mode[0] == _CXML('r')) f = fopen(filenameAscii, "rb");
+ else f = fopen(filenameAscii, "wb");
free(filenameAscii);
return f;
}
@@ -348,7 +348,7 @@ static inline int _strnicmp(const char *c1, const char *c2, int l) { return strn
char xmltob(XMLCSTR t, char v) { if (t&&(*t)) return (char)_wtoi(t); return v; }
int xmltoi(XMLCSTR t, int v) { if (t&&(*t)) return _wtoi(t); return v; }
long xmltol(XMLCSTR t, long v) { if (t&&(*t)) return _wtol(t); return v; }
-double xmltof(XMLCSTR t, double v) { if (t&&(*t)) swscanf(t, L"%lf", &v); /*v=_wtof(t);*/ return v; }
+double xmltof(XMLCSTR t, double v) { if (t&&(*t)) swscanf(t, L"%lf", &v); /*v = _wtof(t);*/ return v; }
#else
#ifdef sun
// for CC
@@ -362,7 +362,7 @@ char xmltob(XMLCSTR t, char v) { if (t) return (char)wcstol(t, NULL, 10);
int xmltoi(XMLCSTR t, int v) { if (t) return (int)wcstol(t, NULL, 10); return v; }
long xmltol(XMLCSTR t, long v) { if (t) return wcstol(t, NULL, 10); return v; }
#endif
-double xmltof(XMLCSTR t, double v) { if (t&&(*t)) swscanf(t, L"%lf", &v); /*v=_wtof(t);*/ return v; }
+double xmltof(XMLCSTR t, double v) { if (t&&(*t)) swscanf(t, L"%lf", &v); /*v = _wtof(t);*/ return v; }
#endif
#else
char xmltob(XMLCSTR t, char v) { if (t&&(*t)) return (char)atoi(t); return v; }
@@ -383,25 +383,25 @@ XMLNode XMLNode::openFileHelper(XMLCSTR filename, XMLCSTR tag)
{
// guess the value of the global parameter "characterEncoding"
// (the guess is based on the first 200 bytes of the file).
- FILE *f=xfopen(filename, _CXML("rb"));
+ FILE *f = xfopen(filename, _CXML("rb"));
if (f)
{
char bb[205];
- int l=(int)fread(bb, 1, 200, f);
+ int l = (int)fread(bb, 1, 200, f);
setGlobalOptions(guessCharEncoding(bb, l), guessWideCharChars, dropWhiteSpace, removeCommentsInMiddleOfText);
fclose(f);
}
// parse the file
XMLResults pResults;
- XMLNode xnode=XMLNode::parseFile(filename, tag, &pResults);
+ XMLNode xnode = XMLNode::parseFile(filename, tag, &pResults);
// display error message (if any)
if (pResults.error != eXMLErrorNone)
{
// create message
- char message[2000], *s1=(char*)"", *s3=(char*)""; XMLCSTR s2=_CXML("");
- if (pResults.error == eXMLErrorFirstTagNotFound) { s1=(char*)"First Tag should be '"; s2=tag; s3=(char*)"'.\n"; }
+ char message[2000], *s1 = (char*)"", *s3 = (char*)""; XMLCSTR s2 = _CXML("");
+ if (pResults.error == eXMLErrorFirstTagNotFound) { s1 = (char*)"First Tag should be '"; s2 = tag; s3 = (char*)"'.\n"; }
sprintf(message,
#ifdef _XMLWIDECHAR
"XML Parsing error inside file '%S'.\n%S\nAt line %i, column %i.\n%s%S%s"
@@ -428,13 +428,13 @@ XMLNode XMLNode::openFileHelper(XMLCSTR filename, XMLCSTR tag)
// You should normally not change anything below this point.
#ifndef _XMLWIDECHAR
-// If "characterEncoding=ascii" then we assume that all characters have the same length of 1 byte.
-// If "characterEncoding=UTF8" then the characters have different lengths (from 1 byte to 4 bytes).
-// If "characterEncoding=ShiftJIS" then the characters have different lengths (from 1 byte to 2 bytes).
+// If "characterEncoding = ascii" then we assume that all characters have the same length of 1 byte.
+// If "characterEncoding = UTF8" then the characters have different lengths (from 1 byte to 4 bytes).
+// If "characterEncoding = ShiftJIS" then the characters have different lengths (from 1 byte to 2 bytes).
// This table is used as lookup-table to know the length of a character (in byte) based on the
// content of the first byte of the character.
-// (note: if you modify this, you must always have XML_utf8ByteTable[0]=0).
-static const char XML_utf8ByteTable[256] =
+// (note: if you modify this, you must always have XML_utf8ByteTable[0] = 0).
+static const char XML_utf8ByteTable[256] =
{
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00
@@ -454,7 +454,7 @@ static const char XML_utf8ByteTable[256] =
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xe0 0xe0 to 0xef 3 byte
4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid
};
-static const char XML_legacyByteTable[256] =
+static const char XML_legacyByteTable[256] =
{
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -463,7 +463,7 @@ static const char XML_legacyByteTable[256] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};
-static const char XML_sjisByteTable[256] =
+static const char XML_sjisByteTable[256] =
{
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00
@@ -483,7 +483,7 @@ static const char XML_sjisByteTable[256] =
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xe0 0xe0 to 0xef 2 bytes
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0
};
-static const char XML_gb2312ByteTable[256] =
+static const char XML_gb2312ByteTable[256] =
{
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00
@@ -503,7 +503,7 @@ static const char XML_gb2312ByteTable[256] =
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xe0
2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0
};
-static const char XML_gbk_big5_ByteTable[256] =
+static const char XML_gbk_big5_ByteTable[256] =
{
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00
@@ -523,13 +523,13 @@ static const char XML_gbk_big5_ByteTable[256] =
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xe0
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 // 0xf0
};
-static const char *XML_ByteTable=(const char *)XML_utf8ByteTable; // the default is "characterEncoding=XMLNode::encoding_UTF8"
+static const char *XML_ByteTable = (const char *)XML_utf8ByteTable; // the default is "characterEncoding = XMLNode::encoding_UTF8"
#endif
XMLNode XMLNode::emptyXMLNode;
-XMLClear XMLNode::emptyXMLClear={ NULL, NULL, NULL};
-XMLAttribute XMLNode::emptyXMLAttribute={ NULL, NULL};
+XMLClear XMLNode::emptyXMLClear = { NULL, NULL, NULL};
+XMLAttribute XMLNode::emptyXMLAttribute = { NULL, NULL};
// Enumeration used to decipher what type a token is
typedef enum XMLTokenTypeTag
@@ -539,7 +539,7 @@ typedef enum XMLTokenTypeTag
eTokenTagStart, /* "<" */
eTokenTagEnd, /* "</" */
eTokenCloseTag, /* ">" */
- eTokenEquals, /* "=" */
+ eTokenEquals, /* " = " */
eTokenDeclaration, /* "<?" */
eTokenShortHandClose, /* "/>" */
eTokenClear,
@@ -585,10 +585,10 @@ typedef enum XMLStatus
XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nFormat) const
{
if ( !d) return eXMLErrorNone;
- FILE *f=xfopen(filename, _CXML("wb"));
+ FILE *f = xfopen(filename, _CXML("wb"));
if ( !f) return eXMLErrorCannotOpenWriteFile;
#ifdef _XMLWIDECHAR
- unsigned char h[2]={ 0xFF, 0xFE };
+ unsigned char h[2] = { 0xFF, 0xFE };
if ( !fwrite(h, 2, 1, f))
{
fclose(f);
@@ -596,7 +596,7 @@ XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nForm
}
if (( !isDeclaration())&&((d->lpszName) || ( !getChildNode().isDeclaration())))
{
- if ( !fwrite(L"<?xml version=\"1.0\" encoding=\"utf-16\"?>\n", sizeof(wchar_t)*40, 1, f))
+ if ( !fwrite(L"<?xml version = \"1.0\" encoding = \"utf-16\"?>\n", sizeof(wchar_t)*40, 1, f))
{
fclose(f);
return eXMLErrorCannotWriteFile;
@@ -608,17 +608,17 @@ XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nForm
if (characterEncoding == char_encoding_UTF8)
{
// header so that windows recognize the file as UTF-8:
- unsigned char h[3]={0xEF, 0xBB, 0xBF};
+ unsigned char h[3] = {0xEF, 0xBB, 0xBF};
if ( !fwrite(h, 3, 1, f))
{
fclose(f);
return eXMLErrorCannotWriteFile;
}
- encoding="utf-8";
- } else if (characterEncoding == char_encoding_ShiftJIS) encoding="SHIFT-JIS";
+ encoding = "utf-8";
+ } else if (characterEncoding == char_encoding_ShiftJIS) encoding = "SHIFT-JIS";
- if ( !encoding) encoding="ISO-8859-1";
- if (fprintf(f, "<?xml version=\"1.0\" encoding=\"%s\"?>\n", encoding)<0)
+ if ( !encoding) encoding = "ISO-8859-1";
+ if (fprintf(f, "<?xml version = \"1.0\" encoding = \"%s\"?>\n", encoding)<0)
{
fclose(f);
return eXMLErrorCannotWriteFile;
@@ -627,7 +627,7 @@ XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nForm
{
if (characterEncoding == char_encoding_UTF8)
{
- unsigned char h[3]={0xEF, 0xBB, 0xBF};
+ unsigned char h[3] = {0xEF, 0xBB, 0xBF};
if ( !fwrite(h, 3, 1, f))
{
fclose(f);
@@ -637,7 +637,7 @@ XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nForm
}
#endif
int i;
- XMLSTR t=createXMLString(nFormat, &i);
+ XMLSTR t = createXMLString(nFormat, &i);
if ( !fwrite(t, sizeof(XMLCHAR)*i, 1, f))
{
free(t);
@@ -659,7 +659,7 @@ XMLSTR stringDup(XMLCSTR lpszData, int cbData)
if (lpszData == NULL) return NULL;
XMLSTR lpszNew;
- if (cbData == -1) cbData=(int)xstrlen(lpszData);
+ if (cbData == -1) cbData = (int)xstrlen(lpszData);
lpszNew = (XMLSTR)malloc((cbData+1) * sizeof(XMLCHAR));
if (lpszNew)
{
@@ -671,44 +671,44 @@ XMLSTR stringDup(XMLCSTR lpszData, int cbData)
XMLSTR ToXMLStringTool::toXMLUnSafe(XMLSTR dest, XMLCSTR source)
{
- XMLSTR dd=dest;
+ XMLSTR dd = dest;
XMLCHAR ch;
XMLCharacterEntity *entity;
- while ((ch=*source))
+ while ((ch = *source))
{
- entity=XMLEntities;
+ entity = XMLEntities;
do
{
if (ch == entity->c) {xstrcpy(dest, entity->s); dest+=entity->l; source++; goto out_of_loop1; }
entity++;
} while (entity->s);
#ifdef _XMLWIDECHAR
- *(dest++)=*(source++);
+ *(dest++) = *(source++);
#else
switch(XML_ByteTable[(unsigned char)ch])
{
- case 4: *(dest++)=*(source++);
- case 3: *(dest++)=*(source++);
- case 2: *(dest++)=*(source++);
- case 1: *(dest++)=*(source++);
+ case 4: *(dest++) = *(source++);
+ case 3: *(dest++) = *(source++);
+ case 2: *(dest++) = *(source++);
+ case 1: *(dest++) = *(source++);
}
#endif
out_of_loop1:
;
}
- *dest=0;
+ *dest = 0;
return dd;
}
// private (used while rendering):
int ToXMLStringTool::lengthXMLString(XMLCSTR source)
{
- int r=0;
+ int r = 0;
XMLCharacterEntity *entity;
XMLCHAR ch;
- while ((ch=*source))
+ while ((ch = *source))
{
- entity=XMLEntities;
+ entity = XMLEntities;
do
{
if (ch == entity->c) { r+=entity->l; source++; goto out_of_loop1; }
@@ -717,7 +717,7 @@ int ToXMLStringTool::lengthXMLString(XMLCSTR source)
#ifdef _XMLWIDECHAR
r++; source++;
#else
- ch=XML_ByteTable[(unsigned char)ch]; r+=ch; source+=ch;
+ ch = XML_ByteTable[(unsigned char)ch]; r+=ch; source+=ch;
#endif
out_of_loop1:
;
@@ -726,17 +726,17 @@ out_of_loop1:
}
ToXMLStringTool::~ToXMLStringTool() { freeBuffer(); }
-void ToXMLStringTool::freeBuffer() { if (buf) free(buf); buf=NULL; buflen=0; }
+void ToXMLStringTool::freeBuffer() { if (buf) free(buf); buf = NULL; buflen = 0; }
XMLSTR ToXMLStringTool::toXML(XMLCSTR source)
{
if ( !source)
{
- if (buflen<1) { buflen=1; buf=(XMLSTR)malloc(sizeof(XMLCHAR)); }
- *buf=0;
+ if (buflen<1) { buflen = 1; buf = (XMLSTR)malloc(sizeof(XMLCHAR)); }
+ *buf = 0;
return buf;
}
- int l=lengthXMLString(source)+1;
- if (l>buflen) { freeBuffer(); buflen=l; buf=(XMLSTR)malloc(l*sizeof(XMLCHAR)); }
+ int l = lengthXMLString(source)+1;
+ if (l>buflen) { freeBuffer(); buflen = l; buf = (XMLSTR)malloc(l*sizeof(XMLCHAR)); }
return toXMLUnSafe(buf, source);
}
@@ -752,9 +752,9 @@ XMLSTR fromXMLString(XMLCSTR s, int lo, XML *pXML)
// out: new allocated string converted from xml
if ( !s) return NULL;
- int ll=0, j;
+ int ll = 0, j;
XMLSTR d;
- XMLCSTR ss=s;
+ XMLCSTR ss = s;
XMLCharacterEntity *entity;
while ((lo>0)&&(*s))
{
@@ -767,13 +767,13 @@ XMLSTR fromXMLString(XMLCSTR s, int lo, XML *pXML)
while ((*s)&&(*s != _CXML(';'))&&((lo--)>0)) s++;
if (*s != _CXML(';'))
{
- pXML->error=eXMLErrorUnknownCharacterEntity;
+ pXML->error = eXMLErrorUnknownCharacterEntity;
return NULL;
}
s++; lo--;
} else
{
- entity=XMLEntities;
+ entity = XMLEntities;
do
{
if ((lo>=entity->l)&&(xstrnicmp(s, entity->s, entity->l) == 0)) { s+=entity->l; lo-=entity->l; break; }
@@ -781,7 +781,7 @@ XMLSTR fromXMLString(XMLCSTR s, int lo, XML *pXML)
} while (entity->s);
if ( !entity->s)
{
- pXML->error=eXMLErrorUnknownCharacterEntity;
+ pXML->error = eXMLErrorUnknownCharacterEntity;
return NULL;
}
}
@@ -790,70 +790,70 @@ XMLSTR fromXMLString(XMLCSTR s, int lo, XML *pXML)
#ifdef _XMLWIDECHAR
s++; lo--;
#else
- j=XML_ByteTable[(unsigned char)*s]; s+=j; lo-=j; ll+=j-1;
+ j = XML_ByteTable[(unsigned char)*s]; s+=j; lo-=j; ll+=j-1;
#endif
}
ll++;
}
- d=(XMLSTR)malloc((ll+1)*sizeof(XMLCHAR));
- s=d;
+ d = (XMLSTR)malloc((ll+1)*sizeof(XMLCHAR));
+ s = d;
while (ll-->0)
{
if (*ss == _CXML('&'))
{
if (ss[1] == _CXML('#'))
{
- ss+=2; j=0;
+ ss+=2; j = 0;
if ((*ss == _CXML('X')) || (*ss == _CXML('x')))
{
ss++;
while (*ss != _CXML(';'))
{
- if ((*ss>=_CXML('0'))&&(*ss<=_CXML('9'))) j=(j<<4)+*ss-_CXML('0');
- else if ((*ss>=_CXML('A'))&&(*ss<=_CXML('F'))) j=(j<<4)+*ss-_CXML('A')+10;
- else if ((*ss>=_CXML('a'))&&(*ss<=_CXML('f'))) j=(j<<4)+*ss-_CXML('a')+10;
- else { free((void*)s); pXML->error=eXMLErrorUnknownCharacterEntity;return NULL;}
+ if ((*ss>=_CXML('0'))&&(*ss <= _CXML('9'))) j = (j<<4)+*ss-_CXML('0');
+ else if ((*ss>=_CXML('A'))&&(*ss <= _CXML('F'))) j = (j<<4)+*ss-_CXML('A')+10;
+ else if ((*ss>=_CXML('a'))&&(*ss <= _CXML('f'))) j = (j<<4)+*ss-_CXML('a')+10;
+ else { free((void*)s); pXML->error = eXMLErrorUnknownCharacterEntity;return NULL;}
ss++;
}
} else
{
while (*ss != _CXML(';'))
{
- if ((*ss>=_CXML('0'))&&(*ss<=_CXML('9'))) j=(j*10)+*ss-_CXML('0');
- else { free((void*)s); pXML->error=eXMLErrorUnknownCharacterEntity;return NULL;}
+ if ((*ss>=_CXML('0'))&&(*ss <= _CXML('9'))) j = (j*10)+*ss-_CXML('0');
+ else { free((void*)s); pXML->error = eXMLErrorUnknownCharacterEntity;return NULL;}
ss++;
}
}
#ifndef _XMLWIDECHAR
- if (j>255) { free((void*)s); pXML->error=eXMLErrorCharacterCodeAbove255;return NULL;}
+ if (j>255) { free((void*)s); pXML->error = eXMLErrorCharacterCodeAbove255;return NULL;}
#endif
- (*d++)=(XMLCHAR)j; ss++;
+ (*d++) = (XMLCHAR)j; ss++;
} else
{
- entity=XMLEntities;
+ entity = XMLEntities;
do
{
- if (xstrnicmp(ss, entity->s, entity->l) == 0) { *(d++)=entity->c; ss+=entity->l; break; }
+ if (xstrnicmp(ss, entity->s, entity->l) == 0) { *(d++) = entity->c; ss+=entity->l; break; }
entity++;
} while (entity->s);
}
} else
{
#ifdef _XMLWIDECHAR
- *(d++)=*(ss++);
+ *(d++) = *(ss++);
#else
switch(XML_ByteTable[(unsigned char)*ss])
{
- case 4: *(d++)=*(ss++); ll--;
- case 3: *(d++)=*(ss++); ll--;
- case 2: *(d++)=*(ss++); ll--;
- case 1: *(d++)=*(ss++);
+ case 4: *(d++) = *(ss++); ll--;
+ case 3: *(d++) = *(ss++); ll--;
+ case 2: *(d++) = *(ss++); ll--;
+ case 1: *(d++) = *(ss++);
}
#endif
}
}
- *d=0;
+ *d = 0;
#ifndef _XMLWIDECHAR
if (characterEncoding != XMLNode::char_encoding_legacy)
@@ -863,7 +863,7 @@ XMLSTR fromXMLString(XMLCSTR s, int lo, XML *pXML)
return (XMLSTR)s;
}
-#define XML_isSPACECHAR(ch) ((ch == _CXML('\n')) || (ch == _CXML(' ')) || (ch == _CXML('\t')) || (ch == _CXML('\r')))
+#define XML_isSPACECHAR(ch) ((ch == _CXML('\n')) || (ch == _CXML(' ')) || (ch == _CXML('\t')) || (ch == _CXML('\r')))
// private:
char myTagCompare(XMLCSTR cclose, XMLCSTR copen)
@@ -872,9 +872,9 @@ char myTagCompare(XMLCSTR cclose, XMLCSTR copen)
// return 1 if different
{
if ( !cclose) return 1;
- int l=(int)xstrlen(cclose);
+ int l = (int)xstrlen(cclose);
if (xstrnicmp(cclose, copen, l) != 0) return 1;
- const XMLCHAR c=copen[l];
+ const XMLCHAR c = copen[l];
if (XML_isSPACECHAR(c) ||
(c == _CXML('/')) ||
(c == _CXML('<')) ||
@@ -902,11 +902,11 @@ static NextToken GetNextToken(XML *pXML, int *pcbToken, enum XMLTokenTypeTag *pT
NextToken result;
XMLCHAR ch;
XMLCHAR chTemp;
- int indexStart, nFoundMatch, nIsText=FALSE;
- result.pClr=NULL; // prevent warning
+ int indexStart, nFoundMatch, nIsText = FALSE;
+ result.pClr = NULL; // prevent warning
// Find next non-white space character
- do { indexStart=pXML->nIndex; ch=getNextChar(pXML); } while XML_isSPACECHAR(ch);
+ do { indexStart = pXML->nIndex; ch = getNextChar(pXML); } while XML_isSPACECHAR(ch);
if (ch)
{
@@ -936,8 +936,8 @@ static NextToken GetNextToken(XML *pXML, int *pcbToken, enum XMLTokenTypeTag *pT
// If we failed to find a matching quote
if (nFoundMatch == FALSE)
{
- pXML->nIndex=indexStart+1;
- nIsText=TRUE;
+ pXML->nIndex = indexStart+1;
+ nIsText = TRUE;
break;
}
@@ -962,14 +962,14 @@ static NextToken GetNextToken(XML *pXML, int *pcbToken, enum XMLTokenTypeTag *pT
{
// First check whether the token is in the clear tag list (meaning it
// does not need formatting).
- ALLXMLClearTag *ctag=XMLClearTags;
+ ALLXMLClearTag *ctag = XMLClearTags;
do
{
if ( !xstrncmp(ctag->lpszOpen, result.pStr, ctag->openTagLen))
{
- result.pClr=ctag;
+ result.pClr = ctag;
pXML->nIndex+=ctag->openTagLen-1;
- *pType=eTokenClear;
+ *pType = eTokenClear;
return result;
}
ctag++;
@@ -1042,7 +1042,7 @@ static NextToken GetNextToken(XML *pXML, int *pcbToken, enum XMLTokenTypeTag *pT
{
// If we find a slash then this maybe text or a short hand end tag
// Peek at the next character to see it we have short hand end tag
- ch=pXML->lpXML[pXML->nIndex];
+ ch = pXML->lpXML[pXML->nIndex];
// If we found a short hand end tag then we need to exit the loop
if (ch == _CXML('>')) { pXML->nIndex--; break; }
@@ -1058,7 +1058,7 @@ static NextToken GetNextToken(XML *pXML, int *pcbToken, enum XMLTokenTypeTag *pT
// If we failed to obtain a valid character
*pcbToken = 0;
*pType = eTokenError;
- result.pStr=NULL;
+ result.pStr = NULL;
}
return result;
@@ -1068,19 +1068,19 @@ XMLCSTR XMLNode::updateName_WOSD(XMLSTR lpszName)
{
if ( !d) { free(lpszName); return NULL; }
if (d->lpszName&&(lpszName != d->lpszName)) free((void*)d->lpszName);
- d->lpszName=lpszName;
+ d->lpszName = lpszName;
return lpszName;
}
// private:
-XMLNode::XMLNode(struct XMLNodeDataTag *p) { d=p; (p->ref_count)++; }
+XMLNode::XMLNode(struct XMLNodeDataTag *p) { d = p; (p->ref_count)++; }
XMLNode::XMLNode(XMLNodeData *pParent, XMLSTR lpszName, char isDeclaration)
{
- d=(XMLNodeData*)malloc(sizeof(XMLNodeData));
- d->ref_count=1;
+ d = (XMLNodeData*)malloc(sizeof(XMLNodeData));
+ d->ref_count = 1;
- d->lpszName=NULL;
- d->nChild= 0;
+ d->lpszName = NULL;
+ d->nChild = 0;
d->nText = 0;
d->nClear = 0;
d->nAttribute = 0;
@@ -1088,13 +1088,13 @@ XMLNode::XMLNode(XMLNodeData *pParent, XMLSTR lpszName, char isDeclaration)
d->isDeclaration = isDeclaration;
d->pParent = pParent;
- d->pChild= NULL;
- d->pText= NULL;
- d->pClear= NULL;
- d->pAttribute= NULL;
- d->pOrder= NULL;
+ d->pChild = NULL;
+ d->pText = NULL;
+ d->pClear = NULL;
+ d->pAttribute = NULL;
+ d->pOrder = NULL;
- d->pInnerText= NULL;
+ d->pInnerText = NULL;
updateName_WOSD(lpszName);
@@ -1118,7 +1118,7 @@ static inline void myFree(void *p) { if (p) free(p); }
static inline void *myRealloc(void *p, int newsize, int memInc, int sizeofElem)
{
if (p == NULL) { if (memInc) return malloc(memInc*sizeofElem); return malloc(sizeofElem); }
- if ((memInc == 0) || ((newsize%memInc) == 0)) p=realloc(p, (newsize+memInc)*sizeofElem);
+ if ((memInc == 0) || ((newsize%memInc) == 0)) p = realloc(p, (newsize+memInc)*sizeofElem);
// if ( !p)
// {
// printf("XMLParser Error: Not enough memory! Aborting...\n"); exit(220);
@@ -1130,19 +1130,19 @@ static inline void *myRealloc(void *p, int newsize, int memInc, int sizeofElem)
XMLElementPosition XMLNode::findPosition(XMLNodeData *d, int index, XMLElementType xxtype)
{
if (index<0) return -1;
- int i=0, j=(int)((index<<2)+xxtype), *o=d->pOrder; while (o[i] != j) i++; return i;
+ int i=0, j = (int)((index<<2)+xxtype), *o = d->pOrder; while (o[i] != j) i++; return i;
}
// private:
// update "order" information when deleting a content of a XMLNode
int XMLNode::removeOrderElement(XMLNodeData *d, XMLElementType t, int index)
{
- int n=d->nChild+d->nText+d->nClear, *o=d->pOrder, i=findPosition(d, index, t);
+ int n = d->nChild+d->nText+d->nClear, *o = d->pOrder, i = findPosition(d, index, t);
memmove(o+i, o+i+1, (n-i)*sizeof(int));
for (;i<n;i++)
if ((o[i]&3) == (int)t) o[i]-=4;
// We should normally do:
- // d->pOrder=(int)realloc(d->pOrder, n*sizeof(int));
+ // d->pOrder = (int)realloc(d->pOrder, n*sizeof(int));
// but we skip reallocation because it's too time consuming.
// Anyway, at the end, it will be free'd completely at once.
return i;
@@ -1152,23 +1152,23 @@ void *XMLNode::addToOrder(int memoryIncrease, int *_pos, int nc, void *p, int si
{
// in: *_pos is the position inside d->pOrder ("-1" means "EndOf")
// out: *_pos is the index inside p
- p=myRealloc(p, (nc+1), memoryIncrease, size);
- int n=d->nChild+d->nText+d->nClear;
- d->pOrder=(int*)myRealloc(d->pOrder, n+1, memoryIncrease*3, sizeof(int));
- int pos=*_pos, *o=d->pOrder;
+ p = myRealloc(p, (nc+1), memoryIncrease, size);
+ int n = d->nChild+d->nText+d->nClear;
+ d->pOrder = (int*)myRealloc(d->pOrder, n+1, memoryIncrease*3, sizeof(int));
+ int pos = *_pos, *o = d->pOrder;
- if ((pos<0) || (pos>=n)) { *_pos=nc; o[n]=(int)((nc<<2)+xtype); return p; }
+ if ((pos<0) || (pos>=n)) { *_pos = nc; o[n] = (int)((nc<<2)+xtype); return p; }
- int i=pos;
+ int i = pos;
memmove(o+i+1, o+i, (n-i)*sizeof(int));
while ((pos<n)&&((o[pos]&3) != (int)xtype)) pos++;
- if (pos == n) { *_pos=nc; o[n]=(int)((nc<<2)+xtype); return p; }
+ if (pos == n) { *_pos = nc; o[n] = (int)((nc<<2)+xtype); return p; }
- o[i]=o[pos];
- for (i=pos+1;i<=n;i++) if ((o[i]&3) == (int)xtype) o[i]+=4;
+ o[i] = o[pos];
+ for (i = pos+1;i <= n;i++) if ((o[i]&3) == (int)xtype) o[i]+=4;
- *_pos=pos=o[pos]>>2;
+ *_pos = pos = o[pos]>>2;
memmove(((char*)p)+(pos+1)*size, ((char*)p)+pos*size, (nc-pos)*size);
return p;
@@ -1178,9 +1178,9 @@ void *XMLNode::addToOrder(int memoryIncrease, int *_pos, int nc, void *p, int si
XMLNode XMLNode::addChild_priv(int memoryIncrease, XMLSTR lpszName, char isDeclaration, int pos)
{
if ( !lpszName) return emptyXMLNode;
- d->pChild=(XMLNode*)addToOrder(memoryIncrease, &pos, d->nChild, d->pChild, sizeof(XMLNode), eNodeChild);
- d->pChild[pos].d=NULL;
- d->pChild[pos]=XMLNode(d, lpszName, isDeclaration);
+ d->pChild = (XMLNode*)addToOrder(memoryIncrease, &pos, d->nChild, d->pChild, sizeof(XMLNode), eNodeChild);
+ d->pChild[pos].d = NULL;
+ d->pChild[pos] = XMLNode(d, lpszName, isDeclaration);
d->nChild++;
return d->pChild[pos];
}
@@ -1190,9 +1190,9 @@ XMLAttribute *XMLNode::addAttribute_priv(int memoryIncrease, XMLSTR lpszName, XM
{
if ( !lpszName) return &emptyXMLAttribute;
if ( !d) { myFree(lpszName); myFree(lpszValuev); return &emptyXMLAttribute; }
- int nc=d->nAttribute;
- d->pAttribute=(XMLAttribute*)myRealloc(d->pAttribute, (nc+1), memoryIncrease, sizeof(XMLAttribute));
- XMLAttribute *pAttr=d->pAttribute+nc;
+ int nc = d->nAttribute;
+ d->pAttribute = (XMLAttribute*)myRealloc(d->pAttribute, (nc+1), memoryIncrease, sizeof(XMLAttribute));
+ XMLAttribute *pAttr = d->pAttribute+nc;
pAttr->lpszName = lpszName;
pAttr->lpszValue = lpszValuev;
d->nAttribute++;
@@ -1211,8 +1211,8 @@ XMLCSTR XMLNode::addText_priv(int memoryIncrease, XMLSTR lpszValue, int pos)
if ( !lpszValue) return NULL;
if ( !d) { myFree(lpszValue); return NULL; }
invalidateInnerText();
- d->pText=(XMLCSTR*)addToOrder(memoryIncrease, &pos, d->nText, d->pText, sizeof(XMLSTR), eNodeText);
- d->pText[pos]=lpszValue;
+ d->pText = (XMLCSTR*)addToOrder(memoryIncrease, &pos, d->nText, d->pText, sizeof(XMLSTR), eNodeText);
+ d->pText[pos] = lpszValue;
d->nText++;
return lpszValue;
}
@@ -1223,11 +1223,11 @@ XMLClear *XMLNode::addClear_priv(int memoryIncrease, XMLSTR lpszValue, XMLCSTR l
if ( !lpszValue) return &emptyXMLClear;
if ( !d) { myFree(lpszValue); return &emptyXMLClear; }
invalidateInnerText();
- d->pClear=(XMLClear *)addToOrder(memoryIncrease, &pos, d->nClear, d->pClear, sizeof(XMLClear), eNodeClear);
- XMLClear *pNewClear=d->pClear+pos;
+ d->pClear = (XMLClear *)addToOrder(memoryIncrease, &pos, d->nClear, d->pClear, sizeof(XMLClear), eNodeClear);
+ XMLClear *pNewClear = d->pClear+pos;
pNewClear->lpszValue = lpszValue;
- if ( !lpszOpen) lpszOpen=XMLClearTags->lpszOpen;
- if ( !lpszClose) lpszClose=XMLClearTags->lpszClose;
+ if ( !lpszOpen) lpszOpen = XMLClearTags->lpszOpen;
+ if ( !lpszClose) lpszClose = XMLClearTags->lpszClose;
pNewClear->lpszOpenTag = lpszOpen;
pNewClear->lpszCloseTag = lpszClose;
d->nClear++;
@@ -1238,29 +1238,29 @@ XMLClear *XMLNode::addClear_priv(int memoryIncrease, XMLSTR lpszValue, XMLCSTR l
// Parse a clear (unformatted) type node.
char XMLNode::parseClearTag(void *px, void *_pClear)
{
- XML *pXML=(XML *)px;
- ALLXMLClearTag pClear=*((ALLXMLClearTag*)_pClear);
- int cbTemp=0;
- XMLCSTR lpszTemp=NULL;
- XMLCSTR lpXML=&pXML->lpXML[pXML->nIndex];
- static XMLCSTR docTypeEnd=_CXML("]>");
+ XML *pXML = (XML *)px;
+ ALLXMLClearTag pClear = *((ALLXMLClearTag*)_pClear);
+ int cbTemp = 0;
+ XMLCSTR lpszTemp = NULL;
+ XMLCSTR lpXML = &pXML->lpXML[pXML->nIndex];
+ static XMLCSTR docTypeEnd = _CXML("]>");
// Find the closing tag
// Seems the <!DOCTYPE need a better treatment so lets handle it
if (pClear.lpszOpen == XMLClearTags[1].lpszOpen)
{
- XMLCSTR pCh=lpXML;
+ XMLCSTR pCh = lpXML;
while (*pCh)
{
- if (*pCh == _CXML('<')) { pClear.lpszClose=docTypeEnd; lpszTemp=xstrstr(lpXML, docTypeEnd); break; }
- else if (*pCh == _CXML('>')) { lpszTemp=pCh; break; }
+ if (*pCh == _CXML('<')) { pClear.lpszClose = docTypeEnd; lpszTemp = xstrstr(lpXML, docTypeEnd); break; }
+ else if (*pCh == _CXML('>')) { lpszTemp = pCh; break; }
#ifdef _XMLWIDECHAR
pCh++;
#else
pCh+=XML_ByteTable[(unsigned char)(*pCh)];
#endif
}
- } else lpszTemp=xstrstr(lpXML, pClear.lpszClose);
+ } else lpszTemp = xstrstr(lpXML, pClear.lpszClose);
if (lpszTemp)
{
@@ -1281,41 +1281,41 @@ char XMLNode::parseClearTag(void *px, void *_pClear)
void XMLNode::exactMemory(XMLNodeData *d)
{
- if (d->pOrder) d->pOrder=(int*)realloc(d->pOrder, (d->nChild+d->nText+d->nClear)*sizeof(int));
- if (d->pChild) d->pChild=(XMLNode*)realloc(d->pChild, d->nChild*sizeof(XMLNode));
- if (d->pAttribute) d->pAttribute=(XMLAttribute*)realloc(d->pAttribute, d->nAttribute*sizeof(XMLAttribute));
- if (d->pText) d->pText=(XMLCSTR*)realloc(d->pText, d->nText*sizeof(XMLSTR));
- if (d->pClear) d->pClear=(XMLClear *)realloc(d->pClear, d->nClear*sizeof(XMLClear));
+ if (d->pOrder) d->pOrder = (int*)realloc(d->pOrder, (d->nChild+d->nText+d->nClear)*sizeof(int));
+ if (d->pChild) d->pChild = (XMLNode*)realloc(d->pChild, d->nChild*sizeof(XMLNode));
+ if (d->pAttribute) d->pAttribute = (XMLAttribute*)realloc(d->pAttribute, d->nAttribute*sizeof(XMLAttribute));
+ if (d->pText) d->pText = (XMLCSTR*)realloc(d->pText, d->nText*sizeof(XMLSTR));
+ if (d->pClear) d->pClear = (XMLClear *)realloc(d->pClear, d->nClear*sizeof(XMLClear));
}
char XMLNode::maybeAddTxT(void *pa, XMLCSTR tokenPStr)
{
- XML *pXML=(XML *)pa;
- XMLCSTR lpszText=pXML->lpszText;
+ XML *pXML = (XML *)pa;
+ XMLCSTR lpszText = pXML->lpszText;
if ( !lpszText) return 0;
if (dropWhiteSpace) while (XML_isSPACECHAR(*lpszText)&&(lpszText != tokenPStr)) lpszText++;
int cbText = (int)(tokenPStr - lpszText);
- if ( !cbText) { pXML->lpszText=NULL; return 0; }
+ if ( !cbText) { pXML->lpszText = NULL; return 0; }
if (dropWhiteSpace) { cbText--; while ((cbText)&&XML_isSPACECHAR(lpszText[cbText])) cbText--; cbText++; }
- if ( !cbText) { pXML->lpszText=NULL; return 0; }
- XMLSTR lpt=fromXMLString(lpszText, cbText, pXML);
+ if ( !cbText) { pXML->lpszText = NULL; return 0; }
+ XMLSTR lpt = fromXMLString(lpszText, cbText, pXML);
if ( !lpt) return 1;
- pXML->lpszText=NULL;
+ pXML->lpszText = NULL;
if (removeCommentsInMiddleOfText && d->nText && d->nClear)
{
// if the previous insertion was a comment (<!-- -->) AND
// if the previous previous insertion was a text then, delete the comment and append the text
- int n=d->nChild+d->nText+d->nClear-1, *o=d->pOrder;
+ int n = d->nChild+d->nText+d->nClear-1, *o = d->pOrder;
if (((o[n]&3) == eNodeClear)&&((o[n-1]&3) == eNodeText))
{
- int i=o[n]>>2;
+ int i = o[n]>>2;
if (d->pClear[i].lpszOpenTag == XMLClearTags[2].lpszOpen)
{
deleteClear(i);
- i=o[n-1]>>2;
- n=xstrlen(d->pText[i]);
- int n2=xstrlen(lpt)+1;
- d->pText[i]=(XMLSTR)realloc((void*)d->pText[i], (n+n2)*sizeof(XMLCHAR));
+ i = o[n-1]>>2;
+ n = xstrlen(d->pText[i]);
+ int n2 = xstrlen(lpt)+1;
+ d->pText[i] = (XMLSTR)realloc((void*)d->pText[i], (n+n2)*sizeof(XMLCHAR));
if ( !d->pText[i]) return 1;
memcpy((void*)(d->pText[i]+n), lpt, n2*sizeof(XMLCHAR));
free(lpt);
@@ -1330,12 +1330,12 @@ char XMLNode::maybeAddTxT(void *pa, XMLCSTR tokenPStr)
// Recursively parse an XML element.
int XMLNode::ParseXMLElement(void *pa)
{
- XML *pXML=(XML *)pa;
+ XML *pXML = (XML *)pa;
int cbToken;
enum XMLTokenTypeTag xtype;
NextToken token;
- XMLCSTR lpszTemp=NULL;
- int cbTemp=0;
+ XMLCSTR lpszTemp = NULL;
+ int cbTemp = 0;
char nDeclaration;
XMLNode pNew;
enum XMLStatus status; // inside or outside a tag
@@ -1443,7 +1443,7 @@ int XMLNode::ParseXMLElement(void *pa)
// have an unmatched end tag
if ( !d->lpszName)
{
- pXML->error=eXMLErrorUnmatchedEndTag;
+ pXML->error = eXMLErrorUnmatchedEndTag;
return FALSE;
}
@@ -1512,7 +1512,7 @@ int XMLNode::ParseXMLElement(void *pa)
pXML->error = eXMLErrorMissingEndTagName;
return FALSE;
}
- pXML->lpszText=pXML->lpXML+pXML->nIndex;
+ pXML->lpszText = pXML->lpXML+pXML->nIndex;
// We need to return to the previous caller. If the name
// of the tag cannot be found we need to keep returning to
@@ -1522,15 +1522,15 @@ int XMLNode::ParseXMLElement(void *pa)
#ifdef STRICT_PARSING
{
LBL_Error:
- pXML->error=eXMLErrorUnmatchedEndTag;
- pXML->nIndexMissigEndTag=pXML->nIndex;
+ pXML->error = eXMLErrorUnmatchedEndTag;
+ pXML->nIndexMissigEndTag = pXML->nIndex;
return FALSE;
}
#else
{
LBL_Error:
- pXML->error=eXMLErrorMissingEndTag;
- pXML->nIndexMissigEndTag=pXML->nIndex;
+ pXML->error = eXMLErrorMissingEndTag;
+ pXML->nIndexMissigEndTag = pXML->nIndex;
pXML->lpEndTag = lpszTemp;
pXML->cbEndTag = cbTemp;
}
@@ -1554,7 +1554,7 @@ LBL_Error:
// If we have node text then add this to the element
if (maybeAddTxT(pXML, token.pStr)) return FALSE;
if (parseClearTag(pXML, token.pClr)) return FALSE;
- pXML->lpszText=pXML->lpXML+pXML->nIndex;
+ pXML->lpszText = pXML->lpXML+pXML->nIndex;
break;
default:
@@ -1590,14 +1590,14 @@ LBL_Error:
case eTokenCloseTag:
// We are now outside the tag
status = eOutsideTag;
- pXML->lpszText=pXML->lpXML+pXML->nIndex;
+ pXML->lpszText = pXML->lpXML+pXML->nIndex;
break;
// If we found a short hand '/>' closing tag then we can
// return to the caller
case eTokenShortHandClose:
exactMemory(d);
- pXML->lpszText=pXML->lpXML+pXML->nIndex;
+ pXML->lpszText = pXML->lpXML+pXML->nIndex;
return TRUE;
// Errors...
@@ -1635,7 +1635,7 @@ LBL_Error:
case eTokenCloseTag:
// If we are a declaration element '<?' then we need
// to remove extra closing '?' if it exists
- pXML->lpszText=pXML->lpXML+pXML->nIndex;
+ pXML->lpszText = pXML->lpXML+pXML->nIndex;
if (d->isDeclaration &&
(lpszTemp[cbTemp-1]) == _CXML('?'))
@@ -1662,7 +1662,7 @@ LBL_Error:
break;
// If we found the equals token...
- // Eg. 'Attribute ='
+ // Eg. 'Attribute = '
case eTokenEquals:
// Indicate that we next need to search for the value
// for the attribute
@@ -1703,10 +1703,10 @@ LBL_Error:
{
// Add the valued attribute to the list
if (xtype == eTokenQuotedText) { token.pStr++; cbToken-=2; }
- XMLSTR attrVal=(XMLSTR)token.pStr;
+ XMLSTR attrVal = (XMLSTR)token.pStr;
if (attrVal)
{
- attrVal=fromXMLString(attrVal, cbToken, pXML);
+ attrVal = fromXMLString(attrVal, cbToken, pXML);
if ( !attrVal) return FALSE;
}
addAttribute_priv(MEMORYINCREASE, stringDup(lpszTemp, cbTemp), attrVal);
@@ -1721,7 +1721,7 @@ LBL_Error:
case eTokenTagEnd: /* 'Attr = </' */
case eTokenCloseTag: /* 'Attr = >' */
case eTokenShortHandClose: /* "Attr = />" */
- case eTokenEquals: /* 'Attr = =' */
+ case eTokenEquals: /* 'Attr = = ' */
case eTokenDeclaration: /* 'Attr = <?' */
case eTokenClear:
pXML->error = eXMLErrorUnexpectedToken;
@@ -1738,11 +1738,11 @@ LBL_Error:
if (( !d->isDeclaration)&&(d->pParent))
{
#ifdef STRICT_PARSING
- pXML->error=eXMLErrorUnmatchedEndTag;
+ pXML->error = eXMLErrorUnmatchedEndTag;
#else
- pXML->error=eXMLErrorMissingEndTag;
+ pXML->error = eXMLErrorMissingEndTag;
#endif
- pXML->nIndexMissigEndTag=pXML->nIndex;
+ pXML->nIndexMissigEndTag = pXML->nIndex;
}
maybeAddTxT(pXML, pXML->lpXML+pXML->nIndex);
return FALSE;
@@ -1757,7 +1757,7 @@ static void CountLinesAndColumns(XMLCSTR lpXML, int nUpto, XMLResults *pResults)
assert(lpXML);
assert(pResults);
- struct XML xml={ lpXML, lpXML, 0, 0, eXMLErrorNone, NULL, 0, NULL, 0, TRUE };
+ struct XML xml = { lpXML, lpXML, 0, 0, eXMLErrorNone, NULL, 0, NULL, 0, TRUE };
pResults->nLine = 1;
pResults->nColumn = 1;
@@ -1768,7 +1768,7 @@ static void CountLinesAndColumns(XMLCSTR lpXML, int nUpto, XMLResults *pResults)
else
{
pResults->nLine++;
- pResults->nColumn=1;
+ pResults->nColumn = 1;
}
}
}
@@ -1780,37 +1780,37 @@ XMLNode XMLNode::parseString(XMLCSTR lpszXML, XMLCSTR tag, XMLResults *pResults)
{
if (pResults)
{
- pResults->error=eXMLErrorNoElements;
- pResults->nLine=0;
- pResults->nColumn=0;
+ pResults->error = eXMLErrorNoElements;
+ pResults->nLine = 0;
+ pResults->nColumn = 0;
}
return emptyXMLNode;
}
XMLNode xnode(NULL, NULL, FALSE);
- struct XML xml={ lpszXML, lpszXML, 0, 0, eXMLErrorNone, NULL, 0, NULL, 0, TRUE };
+ struct XML xml = { lpszXML, lpszXML, 0, 0, eXMLErrorNone, NULL, 0, NULL, 0, TRUE };
// Create header element
xnode.ParseXMLElement(&xml);
enum XMLError error = xml.error;
- if ( !xnode.nChildNode()) error=eXMLErrorNoXMLTagFound;
- if ((xnode.nChildNode() == 1)&&(xnode.nElement() == 1)) xnode=xnode.getChildNode(); // skip the empty node
+ if ( !xnode.nChildNode()) error = eXMLErrorNoXMLTagFound;
+ if ((xnode.nChildNode() == 1)&&(xnode.nElement() == 1)) xnode = xnode.getChildNode(); // skip the empty node
// If no error occurred
if ((error == eXMLErrorNone) || (error == eXMLErrorMissingEndTag) || (error == eXMLErrorNoXMLTagFound))
{
- XMLCSTR name=xnode.getName();
+ XMLCSTR name = xnode.getName();
if (tag&&(*tag)&&(( !name) || (xstricmp(name, tag))))
{
- xnode=xnode.getChildNode(tag);
+ xnode = xnode.getChildNode(tag);
if (xnode.isEmpty())
{
if (pResults)
{
- pResults->error=eXMLErrorFirstTagNotFound;
- pResults->nLine=0;
- pResults->nColumn=0;
- pResults->nChars=xml.nIndex;
+ pResults->error = eXMLErrorFirstTagNotFound;
+ pResults->nLine = 0;
+ pResults->nColumn = 0;
+ pResults->nChars = xml.nIndex;
}
return emptyXMLNode;
}
@@ -1830,7 +1830,7 @@ XMLNode XMLNode::parseString(XMLCSTR lpszXML, XMLCSTR tag, XMLResults *pResults)
// If we have an error
if (error != eXMLErrorNone)
{
- if (error == eXMLErrorMissingEndTag) xml.nIndex=xml.nIndexMissigEndTag;
+ if (error == eXMLErrorMissingEndTag) xml.nIndex = xml.nIndexMissigEndTag;
// Find which line and column it starts on.
CountLinesAndColumns(xml.lpXML, xml.nIndex, pResults);
}
@@ -1842,69 +1842,69 @@ XMLNode XMLNode::parseString(XMLCSTR lpszXML, XMLCSTR tag, XMLResults *pResults)
XMLNode XMLNode::parseFile(XMLCSTR filename, XMLCSTR tag, XMLResults *pResults)
{
- if (pResults) { pResults->nLine=0; pResults->nColumn=0; }
- FILE *f=xfopen(filename, _CXML("rb"));
- if (f == NULL) { if (pResults) pResults->error=eXMLErrorFileNotFound; return emptyXMLNode; }
+ if (pResults) { pResults->nLine = 0; pResults->nColumn = 0; }
+ FILE *f = xfopen(filename, _CXML("rb"));
+ if (f == NULL) { if (pResults) pResults->error = eXMLErrorFileNotFound; return emptyXMLNode; }
fseek(f, 0, SEEK_END);
- int l=(int)ftell(f), headerSz=0;
- if ( !l) { if (pResults) pResults->error=eXMLErrorEmpty; fclose(f); return emptyXMLNode; }
+ int l = (int)ftell(f), headerSz = 0;
+ if ( !l) { if (pResults) pResults->error = eXMLErrorEmpty; fclose(f); return emptyXMLNode; }
fseek(f, 0, SEEK_SET);
- unsigned char *buf=(unsigned char*)malloc(l+4);
- l=(int)fread(buf, 1, l, f);
+ unsigned char *buf = (unsigned char*)malloc(l+4);
+ l = (int)fread(buf, 1, l, f);
fclose(f);
- buf[l]=0;buf[l+1]=0;buf[l+2]=0;buf[l+3]=0;
+ buf[l] = 0;buf[l+1] = 0;buf[l+2] = 0;buf[l+3] = 0;
#ifdef _XMLWIDECHAR
if (guessWideCharChars)
{
if ( !myIsTextWideChar(buf, l))
{
- XMLNode::XMLCharEncoding ce=XMLNode::char_encoding_legacy;
- if ((buf[0] == 0xef)&&(buf[1] == 0xbb)&&(buf[2] == 0xbf)) { headerSz=3; ce=XMLNode::char_encoding_UTF8; }
- XMLSTR b2=myMultiByteToWideChar((const char*)(buf+headerSz), ce);
+ XMLNode::XMLCharEncoding ce = XMLNode::char_encoding_legacy;
+ if ((buf[0] == 0xef)&&(buf[1] == 0xbb)&&(buf[2] == 0xbf)) { headerSz = 3; ce = XMLNode::char_encoding_UTF8; }
+ XMLSTR b2 = myMultiByteToWideChar((const char*)(buf+headerSz), ce);
if ( !b2)
{
// todo: unable to convert
}
- free(buf); buf=(unsigned char*)b2; headerSz=0;
+ free(buf); buf = (unsigned char*)b2; headerSz = 0;
} else
{
- if ((buf[0] == 0xef)&&(buf[1] == 0xff)) headerSz=2;
- if ((buf[0] == 0xff)&&(buf[1] == 0xfe)) headerSz=2;
+ if ((buf[0] == 0xef)&&(buf[1] == 0xff)) headerSz = 2;
+ if ((buf[0] == 0xff)&&(buf[1] == 0xfe)) headerSz = 2;
}
} else
{
- if ((buf[0] == 0xef)&&(buf[1] == 0xff)) headerSz=2;
- if ((buf[0] == 0xff)&&(buf[1] == 0xfe)) headerSz=2;
- if ((buf[0] == 0xef)&&(buf[1] == 0xbb)&&(buf[2] == 0xbf)) headerSz=3;
+ if ((buf[0] == 0xef)&&(buf[1] == 0xff)) headerSz = 2;
+ if ((buf[0] == 0xff)&&(buf[1] == 0xfe)) headerSz = 2;
+ if ((buf[0] == 0xef)&&(buf[1] == 0xbb)&&(buf[2] == 0xbf)) headerSz = 3;
}
#else
if (guessWideCharChars)
{
if (myIsTextWideChar(buf, l))
{
- if ((buf[0] == 0xef)&&(buf[1] == 0xff)) headerSz=2;
- if ((buf[0] == 0xff)&&(buf[1] == 0xfe)) headerSz=2;
- char *b2=myWideCharToMultiByte((const wchar_t*)(buf+headerSz));
- free(buf); buf=(unsigned char*)b2; headerSz=0;
+ if ((buf[0] == 0xef)&&(buf[1] == 0xff)) headerSz = 2;
+ if ((buf[0] == 0xff)&&(buf[1] == 0xfe)) headerSz = 2;
+ char *b2 = myWideCharToMultiByte((const wchar_t*)(buf+headerSz));
+ free(buf); buf = (unsigned char*)b2; headerSz = 0;
} else
{
- if ((buf[0] == 0xef)&&(buf[1] == 0xbb)&&(buf[2] == 0xbf)) headerSz=3;
+ if ((buf[0] == 0xef)&&(buf[1] == 0xbb)&&(buf[2] == 0xbf)) headerSz = 3;
}
} else
{
- if ((buf[0] == 0xef)&&(buf[1] == 0xff)) headerSz=2;
- if ((buf[0] == 0xff)&&(buf[1] == 0xfe)) headerSz=2;
- if ((buf[0] == 0xef)&&(buf[1] == 0xbb)&&(buf[2] == 0xbf)) headerSz=3;
+ if ((buf[0] == 0xef)&&(buf[1] == 0xff)) headerSz = 2;
+ if ((buf[0] == 0xff)&&(buf[1] == 0xfe)) headerSz = 2;
+ if ((buf[0] == 0xef)&&(buf[1] == 0xbb)&&(buf[2] == 0xbf)) headerSz = 3;
}
#endif
- if ( !buf) { if (pResults) pResults->error=eXMLErrorCharConversionError; return emptyXMLNode; }
- XMLNode x=parseString((XMLSTR)(buf+headerSz), tag, pResults);
+ if ( !buf) { if (pResults) pResults->error = eXMLErrorCharConversionError; return emptyXMLNode; }
+ XMLNode x = parseString((XMLSTR)(buf+headerSz), tag, pResults);
free(buf);
return x;
}
-static inline void charmemset(XMLSTR dest, XMLCHAR c, int l) { while (l--) *(dest++)=c; }
+static inline void charmemset(XMLSTR dest, XMLCHAR c, int l) { while (l--) *(dest++) = c; }
// private:
// Creates an user friendly XML string from a given element with
// appropriate white space and carriage returns.
@@ -1914,12 +1914,12 @@ static inline void charmemset(XMLSTR dest, XMLCHAR c, int l) { while (l--) *(des
int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nFormat)
{
int nResult = 0;
- int cb=nFormat<0?0:nFormat;
+ int cb = nFormat<0?0:nFormat;
int cbElement;
- int nChildFormat=-1;
- int nElementI=pEntry->nChild+pEntry->nText+pEntry->nClear;
+ int nChildFormat = -1;
+ int nElementI = pEntry->nChild+pEntry->nText+pEntry->nClear;
int i, j;
- if ((nFormat>=0)&&(nElementI == 1)&&(pEntry->nText == 1)&&( !pEntry->isDeclaration)) nFormat=-2;
+ if ((nFormat>=0)&&(nElementI == 1)&&(pEntry->nText == 1)&&( !pEntry->isDeclaration)) nFormat = -2;
assert(pEntry);
@@ -1935,11 +1935,11 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma
{
if (cb) charmemset(lpszMarker, INDENTCHAR, cb);
nResult = cb;
- lpszMarker[nResult++]=_CXML('<');
- if (pEntry->isDeclaration) lpszMarker[nResult++]=_CXML('?');
+ lpszMarker[nResult++] = _CXML('<');
+ if (pEntry->isDeclaration) lpszMarker[nResult++] = _CXML('?');
xstrcpy(&lpszMarker[nResult], pEntry->lpszName);
nResult+=cbElement;
- lpszMarker[nResult++]=_CXML(' ');
+ lpszMarker[nResult++] = _CXML(' ');
} else
{
@@ -1948,7 +1948,7 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma
}
// Enumerate attributes and add them to the string
- XMLAttribute *pAttr=pEntry->pAttribute;
+ XMLAttribute *pAttr = pEntry->pAttribute;
for (i=0; i<pEntry->nAttribute; i++)
{
// "Attrib
@@ -1957,16 +1957,16 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma
{
if (lpszMarker) xstrcpy(&lpszMarker[nResult], pAttr->lpszName);
nResult += cb;
- // "Attrib=Value "
+ // "Attrib = Value "
if (pAttr->lpszValue)
{
- cb=(int)ToXMLStringTool::lengthXMLString(pAttr->lpszValue);
+ cb = (int)ToXMLStringTool::lengthXMLString(pAttr->lpszValue);
if (lpszMarker)
{
- lpszMarker[nResult]=_CXML('=');
- lpszMarker[nResult+1]=_CXML('"');
+ lpszMarker[nResult] = _CXML('=');
+ lpszMarker[nResult+1] = _CXML('"');
if (cb) ToXMLStringTool::toXMLUnSafe(&lpszMarker[nResult+2], pAttr->lpszValue);
- lpszMarker[nResult+cb+2]=_CXML('"');
+ lpszMarker[nResult+cb+2] = _CXML('"');
}
nResult+=cb+3;
}
@@ -1980,23 +1980,23 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma
{
if (lpszMarker)
{
- lpszMarker[nResult-1]=_CXML('?');
- lpszMarker[nResult]=_CXML('>');
+ lpszMarker[nResult-1] = _CXML('?');
+ lpszMarker[nResult] = _CXML('>');
}
nResult++;
if (nFormat != -1)
{
- if (lpszMarker) lpszMarker[nResult]=_CXML('\n');
+ if (lpszMarker) lpszMarker[nResult] = _CXML('\n');
nResult++;
}
} else
// If there are child nodes we need to terminate the start tag
if (nElementI)
{
- if (lpszMarker) lpszMarker[nResult-1]=_CXML('>');
+ if (lpszMarker) lpszMarker[nResult-1] = _CXML('>');
if (nFormat>=0)
{
- if (lpszMarker) lpszMarker[nResult]=_CXML('\n');
+ if (lpszMarker) lpszMarker[nResult] = _CXML('\n');
nResult++;
}
} else nResult--;
@@ -2006,21 +2006,21 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma
// determine the number of spaces used for prefixes.
if (nFormat != -1)
{
- if (cbElement&&( !pEntry->isDeclaration)) nChildFormat=nFormat+1;
- else nChildFormat=nFormat;
+ if (cbElement&&( !pEntry->isDeclaration)) nChildFormat = nFormat+1;
+ else nChildFormat = nFormat;
}
// Enumerate through remaining children
for (i=0; i<nElementI; i++)
{
- j=pEntry->pOrder[i];
+ j = pEntry->pOrder[i];
switch((XMLElementType)(j&3))
{
// Text nodes
case eNodeText:
{
// "Text"
- XMLCSTR pChild=pEntry->pText[j>>2];
+ XMLCSTR pChild = pEntry->pText[j>>2];
cb = (int)ToXMLStringTool::lengthXMLString(pChild);
if (cb)
{
@@ -2030,7 +2030,7 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma
{
charmemset(&lpszMarker[nResult], INDENTCHAR, nFormat+1);
ToXMLStringTool::toXMLUnSafe(&lpszMarker[nResult+nFormat+1], pChild);
- lpszMarker[nResult+nFormat+1+cb]=_CXML('\n');
+ lpszMarker[nResult+nFormat+1+cb] = _CXML('\n');
}
nResult+=cb+nFormat+2;
} else
@@ -2045,7 +2045,7 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma
// Clear type nodes
case eNodeClear:
{
- XMLClear *pChild=pEntry->pClear+(j>>2);
+ XMLClear *pChild = pEntry->pClear+(j>>2);
// "OpenTag"
cb = (int)LENSTR(pChild->lpszOpenTag);
if (cb)
@@ -2116,16 +2116,16 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma
nResult+=nFormat;
}
- lpszMarker[nResult]=_CXML('<'); lpszMarker[nResult+1]=_CXML('/');
+ lpszMarker[nResult] = _CXML('<'); lpszMarker[nResult+1] = _CXML('/');
nResult += 2;
xstrcpy(&lpszMarker[nResult], pEntry->lpszName);
nResult += cbElement;
- lpszMarker[nResult]=_CXML('>');
+ lpszMarker[nResult] = _CXML('>');
if (nFormat == -1) nResult++;
else
{
- lpszMarker[nResult+1]=_CXML('\n');
+ lpszMarker[nResult+1] = _CXML('\n');
nResult+=2;
}
} else
@@ -2141,8 +2141,8 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma
// "/>\0"
if (lpszMarker)
{
- lpszMarker[nResult]=_CXML('/'); lpszMarker[nResult+1]=_CXML('>');
- if (nFormat != -1) lpszMarker[nResult+2]=_CXML('\n');
+ lpszMarker[nResult] = _CXML('/'); lpszMarker[nResult+1] = _CXML('>');
+ if (nFormat != -1) lpszMarker[nResult+2] = _CXML('\n');
}
nResult += nFormat == -1 ? 2 : 3;
}
@@ -2164,32 +2164,32 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma
// this with free().
XMLSTR XMLNode::createXMLString(int nFormat, int *pnSize) const
{
- if ( !d) { if (pnSize) *pnSize=0; return NULL; }
+ if ( !d) { if (pnSize) *pnSize = 0; return NULL; }
XMLSTR lpszResult = NULL;
int cbStr;
// Recursively Calculate the size of the XML string
- if ( !dropWhiteSpace) nFormat=0;
+ if ( !dropWhiteSpace) nFormat = 0;
nFormat = nFormat ? 0 : -1;
cbStr = CreateXMLStringR(d, 0, nFormat);
// Alllocate memory for the XML string + the NULL terminator and
// create the recursively XML string.
- lpszResult=(XMLSTR)malloc((cbStr+1)*sizeof(XMLCHAR));
+ lpszResult = (XMLSTR)malloc((cbStr+1)*sizeof(XMLCHAR));
CreateXMLStringR(d, lpszResult, nFormat);
- lpszResult[cbStr]=_CXML('\0');
+ lpszResult[cbStr] = _CXML('\0');
if (pnSize) *pnSize = cbStr;
return lpszResult;
}
int XMLNode::detachFromParent(XMLNodeData *d)
{
- XMLNode *pa=d->pParent->pChild;
+ XMLNode *pa = d->pParent->pChild;
int i=0;
while (((void*)(pa[i].d)) != ((void*)d)) i++;
d->pParent->nChild--;
if (d->pParent->nChild) memmove(pa+i, pa+i+1, (d->pParent->nChild-i)*sizeof(XMLNode));
- else { free(pa); d->pParent->pChild=NULL; }
+ else { free(pa); d->pParent->pChild = NULL; }
return removeOrderElement(d->pParent, eNodeChild, i);
}
@@ -2202,12 +2202,12 @@ XMLNode::~XMLNode()
void XMLNode::deleteNodeContent()
{
if ( !d) return;
- if (d->pParent) { detachFromParent(d); d->pParent=NULL; d->ref_count--; }
+ if (d->pParent) { detachFromParent(d); d->pParent = NULL; d->ref_count--; }
emptyTheNode(1);
}
void XMLNode::emptyTheNode(char force)
{
- XMLNodeData *dd=d; // warning: must stay this way!
+ XMLNodeData *dd = d; // warning: must stay this way!
if ((dd->ref_count == 0) || force)
{
if (d->pParent) detachFromParent(d);
@@ -2215,8 +2215,8 @@ void XMLNode::emptyTheNode(char force)
XMLNode *pc;
for (i=0; i<dd->nChild; i++)
{
- pc=dd->pChild+i;
- pc->d->pParent=NULL;
+ pc = dd->pChild+i;
+ pc->d->pParent = NULL;
pc->d->ref_count--;
pc->emptyTheNode(force);
}
@@ -2237,30 +2237,30 @@ void XMLNode::emptyTheNode(char force)
myFree((void*)dd->lpszNS);
else
myFree((void*)dd->lpszName);
- dd->nChild=0; dd->nText=0; dd->nClear=0; dd->nAttribute=0;
- dd->pChild=NULL; dd->pText=NULL; dd->pClear=NULL; dd->pAttribute=NULL;
- dd->pOrder=NULL; dd->pInnerText=NULL; dd->lpszNS=dd->lpszName=NULL; dd->pParent=NULL;
+ dd->nChild = 0; dd->nText = 0; dd->nClear = 0; dd->nAttribute = 0;
+ dd->pChild = NULL; dd->pText = NULL; dd->pClear = NULL; dd->pAttribute = NULL;
+ dd->pOrder = NULL; dd->pInnerText = NULL; dd->lpszNS = dd->lpszName = NULL; dd->pParent = NULL;
}
if (dd->ref_count == 0)
{
free(dd);
- d=NULL;
+ d = NULL;
}
}
void XMLNode::invalidateInnerText()
{
if ( !d) return;
myFree(d->pInnerText);
- d->pInnerText= NULL;
+ d->pInnerText = NULL;
}
-XMLNode& XMLNode::operator=(const XMLNode& A)
+XMLNode& XMLNode::operator = (const XMLNode& A)
{
// shallow copy
if (this != &A)
{
if (d) { d->ref_count--; emptyTheNode(0); }
- d=A.d;
+ d = A.d;
if (d) (d->ref_count) ++;
}
return *this;
@@ -2269,7 +2269,7 @@ XMLNode& XMLNode::operator=(const XMLNode& A)
XMLNode::XMLNode(const XMLNode &A)
{
// shallow copy
- d=A.d;
+ d = A.d;
if (d) (d->ref_count)++;
}
@@ -2277,47 +2277,47 @@ XMLNode XMLNode::deepCopy() const
{
if ( !d) return XMLNode::emptyXMLNode;
XMLNode x(NULL, stringDup(d->lpszName), d->isDeclaration);
- XMLNodeData *p=x.d;
- int n=d->nAttribute;
+ XMLNodeData *p = x.d;
+ int n = d->nAttribute;
if (n)
{
- p->nAttribute=n; p->pAttribute=(XMLAttribute*)malloc(n*sizeof(XMLAttribute));
+ p->nAttribute = n; p->pAttribute = (XMLAttribute*)malloc(n*sizeof(XMLAttribute));
while (n--)
{
- p->pAttribute[n].lpszName=stringDup(d->pAttribute[n].lpszName);
- p->pAttribute[n].lpszValue=stringDup(d->pAttribute[n].lpszValue);
+ p->pAttribute[n].lpszName = stringDup(d->pAttribute[n].lpszName);
+ p->pAttribute[n].lpszValue = stringDup(d->pAttribute[n].lpszValue);
}
}
if (d->pOrder)
{
- n=(d->nChild+d->nText+d->nClear)*sizeof(int); p->pOrder=(int*)malloc(n); memcpy(p->pOrder, d->pOrder, n);
+ n = (d->nChild+d->nText+d->nClear)*sizeof(int); p->pOrder = (int*)malloc(n); memcpy(p->pOrder, d->pOrder, n);
}
- n=d->nText;
+ n = d->nText;
if (n)
{
- p->nText=n; p->pText=(XMLCSTR*)malloc(n*sizeof(XMLCSTR));
- while (n--) p->pText[n]=stringDup(d->pText[n]);
+ p->nText = n; p->pText = (XMLCSTR*)malloc(n*sizeof(XMLCSTR));
+ while (n--) p->pText[n] = stringDup(d->pText[n]);
}
- n=d->nClear;
+ n = d->nClear;
if (n)
{
- p->nClear=n; p->pClear=(XMLClear*)malloc(n*sizeof(XMLClear));
+ p->nClear = n; p->pClear = (XMLClear*)malloc(n*sizeof(XMLClear));
while (n--)
{
- p->pClear[n].lpszCloseTag=d->pClear[n].lpszCloseTag;
- p->pClear[n].lpszOpenTag=d->pClear[n].lpszOpenTag;
- p->pClear[n].lpszValue=stringDup(d->pClear[n].lpszValue);
+ p->pClear[n].lpszCloseTag = d->pClear[n].lpszCloseTag;
+ p->pClear[n].lpszOpenTag = d->pClear[n].lpszOpenTag;
+ p->pClear[n].lpszValue = stringDup(d->pClear[n].lpszValue);
}
}
- n=d->nChild;
+ n = d->nChild;
if (n)
{
- p->nChild=n; p->pChild=(XMLNode*)malloc(n*sizeof(XMLNode));
+ p->nChild = n; p->pChild = (XMLNode*)malloc(n*sizeof(XMLNode));
while (n--)
{
- p->pChild[n].d=NULL;
- p->pChild[n]=d->pChild[n].deepCopy();
- p->pChild[n].d->pParent=p;
+ p->pChild[n].d = NULL;
+ p->pChild[n] = d->pChild[n].deepCopy();
+ p->pChild[n].d->pParent = p;
}
}
return x;
@@ -2325,12 +2325,12 @@ XMLNode XMLNode::deepCopy() const
XMLNode XMLNode::addChild(XMLNode childNode, int pos)
{
- XMLNodeData *dc=childNode.d;
+ XMLNodeData *dc = childNode.d;
if (( !dc) || ( !d)) return childNode;
if ( !dc->lpszName)
{
// this is a root node: todo: correct fix
- int j=pos;
+ int j = pos;
while (dc->nChild)
{
addChild(dc->pChild[0], j);
@@ -2338,12 +2338,12 @@ XMLNode XMLNode::addChild(XMLNode childNode, int pos)
}
return childNode;
}
- if (dc->pParent) { if ((detachFromParent(dc)<=pos)&&(dc->pParent == d)) pos--; } else dc->ref_count++;
- dc->pParent=d;
- // int nc=d->nChild;
- // d->pChild=(XMLNode*)myRealloc(d->pChild, (nc+1), memoryIncrease, sizeof(XMLNode));
- d->pChild=(XMLNode*)addToOrder(0, &pos, d->nChild, d->pChild, sizeof(XMLNode), eNodeChild);
- d->pChild[pos].d=dc;
+ if (dc->pParent) { if ((detachFromParent(dc) <= pos)&&(dc->pParent == d)) pos--; } else dc->ref_count++;
+ dc->pParent = d;
+ // int nc = d->nChild;
+ // d->pChild = (XMLNode*)myRealloc(d->pChild, (nc+1), memoryIncrease, sizeof(XMLNode));
+ d->pChild = (XMLNode*)addToOrder(0, &pos, d->nChild, d->pChild, sizeof(XMLNode), eNodeChild);
+ d->pChild[pos].d = dc;
d->nChild++;
return childNode;
}
@@ -2352,16 +2352,16 @@ void XMLNode::deleteAttribute(int i)
{
if (( !d) || (i<0) || (i>=d->nAttribute)) return;
d->nAttribute--;
- XMLAttribute *p=d->pAttribute+i;
+ XMLAttribute *p = d->pAttribute+i;
free((void*)p->lpszName);
if (p->lpszValue) free((void*)p->lpszValue);
- if (d->nAttribute) memmove(p, p+1, (d->nAttribute-i)*sizeof(XMLAttribute)); else { free(p); d->pAttribute=NULL; }
+ if (d->nAttribute) memmove(p, p+1, (d->nAttribute-i)*sizeof(XMLAttribute)); else { free(p); d->pAttribute = NULL; }
}
void XMLNode::deleteAttribute(XMLAttribute *a) { if (a) deleteAttribute(a->lpszName); }
void XMLNode::deleteAttribute(XMLCSTR lpszName)
{
- int j=0;
+ int j = 0;
getAttribute(lpszName, &j);
if (j) deleteAttribute(j-1);
}
@@ -2374,10 +2374,10 @@ XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewN
if (lpszNewName) return addAttribute_WOSD(lpszNewName, lpszNewValue);
return NULL;
}
- XMLAttribute *p=d->pAttribute+i;
+ XMLAttribute *p = d->pAttribute+i;
if (p->lpszValue&&p->lpszValue != lpszNewValue) free((void*)p->lpszValue);
- p->lpszValue=lpszNewValue;
- if (lpszNewName&&p->lpszName != lpszNewName) { free((void*)p->lpszName); p->lpszName=lpszNewName; };
+ p->lpszValue = lpszNewValue;
+ if (lpszNewName&&p->lpszName != lpszNewName) { free((void*)p->lpszName); p->lpszName = lpszNewName; };
return p;
}
@@ -2389,7 +2389,7 @@ XMLAttribute *XMLNode::updateAttribute_WOSD(XMLAttribute *newAttribute, XMLAttri
XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName, XMLCSTR lpszOldName)
{
- int j=0;
+ int j = 0;
getAttribute(lpszOldName, &j);
if (j) return updateAttribute_WOSD(lpszNewValue, lpszNewName, j-1);
else
@@ -2402,9 +2402,9 @@ XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewN
int XMLNode::indexText(XMLCSTR lpszValue) const
{
if ( !d) return -1;
- int i, l=d->nText;
+ int i, l = d->nText;
if ( !lpszValue) { if (l) return 0; return -1; }
- XMLCSTR *p=d->pText;
+ XMLCSTR *p = d->pText;
for (i=0; i<l; i++) if (lpszValue == p[i]) return i;
return -1;
}
@@ -2414,9 +2414,9 @@ void XMLNode::deleteText(int i)
if (( !d) || (i<0) || (i>=d->nText)) return;
invalidateInnerText();
d->nText--;
- XMLCSTR *p=d->pText+i;
+ XMLCSTR *p = d->pText+i;
free((void*)*p);
- if (d->nText) memmove(p, p+1, (d->nText-i)*sizeof(XMLCSTR)); else { free(p); d->pText=NULL; }
+ if (d->nText) memmove(p, p+1, (d->nText-i)*sizeof(XMLCSTR)); else { free(p); d->pText = NULL; }
removeOrderElement(d, eNodeText, i);
}
@@ -2427,15 +2427,15 @@ XMLCSTR XMLNode::updateText_WOSD(XMLSTR lpszNewValue, int i)
if ( !d) { if (lpszNewValue) free(lpszNewValue); return NULL; }
if (i>=d->nText) return addText_WOSD(lpszNewValue);
invalidateInnerText();
- XMLCSTR *p=d->pText+i;
- if (*p != lpszNewValue) { free((void*)*p); *p=lpszNewValue; }
+ XMLCSTR *p = d->pText+i;
+ if (*p != lpszNewValue) { free((void*)*p); *p = lpszNewValue; }
return lpszNewValue;
}
XMLCSTR XMLNode::updateText_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue)
{
if ( !d) { if (lpszNewValue) free(lpszNewValue); return NULL; }
- int i=indexText(lpszOldValue);
+ int i = indexText(lpszOldValue);
if (i>=0) return updateText_WOSD(lpszNewValue, i);
return addText_WOSD(lpszNewValue);
}
@@ -2445,18 +2445,18 @@ void XMLNode::deleteClear(int i)
if (( !d) || (i<0) || (i>=d->nClear)) return;
invalidateInnerText();
d->nClear--;
- XMLClear *p=d->pClear+i;
+ XMLClear *p = d->pClear+i;
free((void*)p->lpszValue);
- if (d->nClear) memmove(p, p+1, (d->nClear-i)*sizeof(XMLClear)); else { free(p); d->pClear=NULL; }
+ if (d->nClear) memmove(p, p+1, (d->nClear-i)*sizeof(XMLClear)); else { free(p); d->pClear = NULL; }
removeOrderElement(d, eNodeClear, i);
}
int XMLNode::indexClear(XMLCSTR lpszValue) const
{
if ( !d) return -1;
- int i, l=d->nClear;
+ int i, l = d->nClear;
if ( !lpszValue) { if (l) return 0; return -1; }
- XMLClear *p=d->pClear;
+ XMLClear *p = d->pClear;
for (i=0; i<l; i++) if (lpszValue == p[i].lpszValue) return i;
return -1;
}
@@ -2469,15 +2469,15 @@ XMLClear *XMLNode::updateClear_WOSD(XMLSTR lpszNewContent, int i)
if ( !d) { if (lpszNewContent) free(lpszNewContent); return NULL; }
if (i>=d->nClear) return addClear_WOSD(lpszNewContent);
invalidateInnerText();
- XMLClear *p=d->pClear+i;
- if (lpszNewContent != p->lpszValue) { free((void*)p->lpszValue); p->lpszValue=lpszNewContent; }
+ XMLClear *p = d->pClear+i;
+ if (lpszNewContent != p->lpszValue) { free((void*)p->lpszValue); p->lpszValue = lpszNewContent; }
return p;
}
XMLClear *XMLNode::updateClear_WOSD(XMLSTR lpszNewContent, XMLCSTR lpszOldValue)
{
if ( !d) { if (lpszNewContent) free(lpszNewContent); return NULL; }
- int i=indexClear(lpszOldValue);
+ int i = indexClear(lpszOldValue);
if (i>=0) return updateClear_WOSD(lpszNewContent, i);
return addClear_WOSD(lpszNewContent);
}
@@ -2491,8 +2491,8 @@ XMLClear *XMLNode::updateClear_WOSD(XMLClear *newP, XMLClear *oldP)
int XMLNode::nChildNode(XMLCSTR name) const
{
if ( !d) return 0;
- int i, j=0, n=d->nChild;
- XMLNode *pc=d->pChild;
+ int i, j = 0, n = d->nChild;
+ XMLNode *pc = d->pChild;
for (i=0; i<n; i++)
{
if (xstricmp(pc->d->lpszName, name) == 0) j++;
@@ -2504,14 +2504,14 @@ int XMLNode::nChildNode(XMLCSTR name) const
XMLNode XMLNode::getChildNode(XMLCSTR name, int *j) const
{
if ( !d) return emptyXMLNode;
- int i=0, n=d->nChild;
- if (j) i=*j;
- XMLNode *pc=d->pChild+i;
+ int i=0, n = d->nChild;
+ if (j) i = *j;
+ XMLNode *pc = d->pChild+i;
for (; i<n; i++)
{
if ( !xstricmp(pc->d->lpszName, name))
{
- if (j) *j=i+1;
+ if (j) *j = i+1;
return *pc;
}
pc++;
@@ -2528,7 +2528,7 @@ XMLNode XMLNode::getChildNode(XMLCSTR name, int j) const
while (j-->0) getChildNode(name, &i);
return getChildNode(name, &i);
}
- int i=d->nChild;
+ int i = d->nChild;
while (i--) if ( !xstricmp(name, d->pChild[i].d->lpszName)) break;
if (i<0) return emptyXMLNode;
return getChildNode(i);
@@ -2537,9 +2537,9 @@ XMLNode XMLNode::getChildNode(XMLCSTR name, int j) const
XMLNode XMLNode::getNextNode() const
{
if ( !d) return emptyXMLNode;
- XMLNodeDataTag *par=d->pParent;
+ XMLNodeDataTag *par = d->pParent;
if ( !par) return emptyXMLNode;
- int i, n=par->nChild;
+ int i, n = par->nChild;
for (i=0; i<n; ++i)
{
if (par->pChild[i].d == d) break;
@@ -2549,8 +2549,8 @@ XMLNode XMLNode::getNextNode() const
XMLNode XMLNode::getChildNodeByPath(XMLCSTR _path, char createMissing, XMLCHAR sep)
{
- XMLSTR path=stringDup(_path);
- XMLNode x=getChildNodeByPathNonConst(path, createMissing, sep);
+ XMLSTR path = stringDup(_path);
+ XMLNode x = getChildNodeByPathNonConst(path, createMissing, sep);
if (path) free(path);
return x;
}
@@ -2558,47 +2558,47 @@ XMLNode XMLNode::getChildNodeByPath(XMLCSTR _path, char createMissing, XMLCHAR s
XMLNode XMLNode::getChildNodeByPathNonConst(XMLSTR path, char createIfMissing, XMLCHAR sep)
{
if (( !path) || ( !(*path))) return *this;
- XMLNode xn, xbase=*this;
- XMLCHAR *tend1, sepString[2]; sepString[0]=sep; sepString[1]=0;
- tend1=xstrstr(path, sepString);
+ XMLNode xn, xbase = *this;
+ XMLCHAR *tend1, sepString[2]; sepString[0] = sep; sepString[1] = 0;
+ tend1 = xstrstr(path, sepString);
while (tend1)
{
- *tend1=0;
- xn=xbase.getChildNode(path);
+ *tend1 = 0;
+ xn = xbase.getChildNode(path);
if (xn.isEmpty())
{
- if (createIfMissing) xn=xbase.addChild(path);
- else { *tend1=sep; return XMLNode::emptyXMLNode; }
+ if (createIfMissing) xn = xbase.addChild(path);
+ else { *tend1 = sep; return XMLNode::emptyXMLNode; }
}
- *tend1=sep;
- xbase=xn;
- path=tend1+1;
- tend1=xstrstr(path, sepString);
+ *tend1 = sep;
+ xbase = xn;
+ path = tend1+1;
+ tend1 = xstrstr(path, sepString);
}
- xn=xbase.getChildNode(path);
- if (xn.isEmpty()&&createIfMissing) xn=xbase.addChild(path);
+ xn = xbase.getChildNode(path);
+ if (xn.isEmpty()&&createIfMissing) xn = xbase.addChild(path);
return xn;
}
-XMLElementPosition XMLNode::positionOfText (int i) const { if (i>=d->nText) i=d->nText-1; return findPosition(d, i, eNodeText); }
-XMLElementPosition XMLNode::positionOfClear (int i) const { if (i>=d->nClear) i=d->nClear-1; return findPosition(d, i, eNodeClear); }
-XMLElementPosition XMLNode::positionOfChildNode(int i) const { if (i>=d->nChild) i=d->nChild-1; return findPosition(d, i, eNodeChild); }
+XMLElementPosition XMLNode::positionOfText (int i) const { if (i>=d->nText) i = d->nText-1; return findPosition(d, i, eNodeText); }
+XMLElementPosition XMLNode::positionOfClear (int i) const { if (i>=d->nClear) i = d->nClear-1; return findPosition(d, i, eNodeClear); }
+XMLElementPosition XMLNode::positionOfChildNode(int i) const { if (i>=d->nChild) i = d->nChild-1; return findPosition(d, i, eNodeChild); }
XMLElementPosition XMLNode::positionOfText (XMLCSTR lpszValue) const { return positionOfText (indexText (lpszValue)); }
XMLElementPosition XMLNode::positionOfClear(XMLCSTR lpszValue) const { return positionOfClear(indexClear(lpszValue)); }
XMLElementPosition XMLNode::positionOfClear(XMLClear *a) const { if (a) return positionOfClear(a->lpszValue); return positionOfClear(); }
XMLElementPosition XMLNode::positionOfChildNode(XMLNode x) const
{
if (( !d) || ( !x.d)) return -1;
- XMLNodeData *dd=x.d;
- XMLNode *pc=d->pChild;
- int i=d->nChild;
+ XMLNodeData *dd = x.d;
+ XMLNode *pc = d->pChild;
+ int i = d->nChild;
while (i--) if (pc[i].d == dd) return findPosition(d, i, eNodeChild);
return -1;
}
XMLElementPosition XMLNode::positionOfChildNode(XMLCSTR name, int count) const
{
if ( !name) return positionOfChildNode(count);
- int j=0;
+ int j = 0;
do { getChildNode(name, &j); if (j<0) return -1; } while (count--);
return findPosition(d, j-1, eNodeChild);
}
@@ -2606,25 +2606,25 @@ XMLElementPosition XMLNode::positionOfChildNode(XMLCSTR name, int count) const
XMLNode XMLNode::getChildNodeWithAttribute(XMLCSTR name, XMLCSTR attributeName, XMLCSTR attributeValue, int *k) const
{
int i=0, j;
- if (k) i=*k;
+ if (k) i = *k;
XMLNode x;
XMLCSTR t;
do
{
- x=getChildNode(name, &i);
+ x = getChildNode(name, &i);
if ( !x.isEmpty())
{
if (attributeValue)
{
- j=0;
+ j = 0;
do
{
- t=x.getAttribute(attributeName, &j);
- if (t&&(xstricmp(attributeValue, t) == 0)) { if (k) *k=i; return x; }
+ t = x.getAttribute(attributeName, &j);
+ if (t&&(xstricmp(attributeValue, t) == 0)) { if (k) *k = i; return x; }
} while (t);
} else
{
- if (x.isAttributeSet(attributeName)) { if (k) *k=i; return x; }
+ if (x.isAttributeSet(attributeName)) { if (k) *k = i; return x; }
}
}
} while ( !x.isEmpty());
@@ -2635,14 +2635,14 @@ XMLNode XMLNode::getChildNodeWithAttribute(XMLCSTR name, XMLCSTR attributeName,
XMLCSTR XMLNode::getAttribute(XMLCSTR lpszAttrib, int *j) const
{
if ( !d) return NULL;
- int i=0, n=d->nAttribute;
- if (j) i=*j;
- XMLAttribute *pAttr=d->pAttribute+i;
+ int i=0, n = d->nAttribute;
+ if (j) i = *j;
+ XMLAttribute *pAttr = d->pAttribute+i;
for (; i<n; i++)
{
if (xstricmp(pAttr->lpszName, lpszAttrib) == 0)
{
- if (j) *j=i+1;
+ if (j) *j = i+1;
return pAttr->lpszValue;
}
pAttr++;
@@ -2653,8 +2653,8 @@ XMLCSTR XMLNode::getAttribute(XMLCSTR lpszAttrib, int *j) const
char XMLNode::isAttributeSet(XMLCSTR lpszAttrib) const
{
if ( !d) return FALSE;
- int i, n=d->nAttribute;
- XMLAttribute *pAttr=d->pAttribute;
+ int i, n = d->nAttribute;
+ XMLAttribute *pAttr = d->pAttribute;
for (i=0; i<n; i++)
{
if (xstricmp(pAttr->lpszName, lpszAttrib) == 0)
@@ -2677,20 +2677,20 @@ XMLCSTR XMLNode::getAttribute(XMLCSTR name, int j) const
XMLNodeContents XMLNode::enumContents(int i) const
{
XMLNodeContents c;
- if ( !d) { c.etype=eNodeNULL; return c; }
+ if ( !d) { c.etype = eNodeNULL; return c; }
if (i<d->nAttribute)
{
- c.etype=eNodeAttribute;
- c.attrib=d->pAttribute[i];
+ c.etype = eNodeAttribute;
+ c.attrib = d->pAttribute[i];
return c;
}
i-=d->nAttribute;
- c.etype=(XMLElementType)(d->pOrder[i]&3);
- i=(d->pOrder[i])>>2;
+ c.etype = (XMLElementType)(d->pOrder[i]&3);
+ i = (d->pOrder[i])>>2;
switch (c.etype)
{
case eNodeChild: c.child = d->pChild[i]; break;
- case eNodeText: c.text = d->pText[i]; break;
+ case eNodeText: c.text = d->pText[i]; break;
case eNodeClear: c.clear = d->pClear[i]; break;
default: break;
}
@@ -2705,7 +2705,7 @@ XMLCSTR XMLNode::getInnerText() const
int count = nElement();
int i, length = 1;
- for (i = 0; i < count; ++i)
+ for (i=0; i < count; ++i)
{
XMLNodeContents c = enumContents(i);
switch (c.etype)
@@ -2720,7 +2720,7 @@ XMLCSTR XMLNode::getInnerText() const
}
XMLCHAR *buf = (XMLCHAR *)malloc(sizeof(XMLCHAR) * length);
XMLCHAR *pos = buf;
- for (i = 0; i < count; ++i)
+ for (i=0; i < count; ++i)
{
XMLNodeContents c = enumContents(i);
switch (c.etype)
@@ -2793,18 +2793,18 @@ XMLClear *XMLNode::updateClear(XMLClear *newP, XMLClear *oldP)
char XMLNode::setGlobalOptions(XMLCharEncoding _characterEncoding, char _guessWideCharChars,
char _dropWhiteSpace, char _removeCommentsInMiddleOfText)
{
- guessWideCharChars=_guessWideCharChars; dropWhiteSpace=_dropWhiteSpace; removeCommentsInMiddleOfText=_removeCommentsInMiddleOfText;
+ guessWideCharChars = _guessWideCharChars; dropWhiteSpace = _dropWhiteSpace; removeCommentsInMiddleOfText = _removeCommentsInMiddleOfText;
#ifdef _XMLWIDECHAR
- if (_characterEncoding) characterEncoding=_characterEncoding;
+ if (_characterEncoding) characterEncoding = _characterEncoding;
#else
switch(_characterEncoding)
{
- case char_encoding_UTF8: characterEncoding=_characterEncoding; XML_ByteTable=XML_utf8ByteTable; break;
- case char_encoding_legacy: characterEncoding=_characterEncoding; XML_ByteTable=XML_legacyByteTable; break;
- case char_encoding_ShiftJIS: characterEncoding=_characterEncoding; XML_ByteTable=XML_sjisByteTable; break;
- case char_encoding_GB2312: characterEncoding=_characterEncoding; XML_ByteTable=XML_gb2312ByteTable; break;
+ case char_encoding_UTF8: characterEncoding = _characterEncoding; XML_ByteTable = XML_utf8ByteTable; break;
+ case char_encoding_legacy: characterEncoding = _characterEncoding; XML_ByteTable = XML_legacyByteTable; break;
+ case char_encoding_ShiftJIS: characterEncoding = _characterEncoding; XML_ByteTable = XML_sjisByteTable; break;
+ case char_encoding_GB2312: characterEncoding = _characterEncoding; XML_ByteTable = XML_gb2312ByteTable; break;
case char_encoding_Big5:
- case char_encoding_GBK: characterEncoding=_characterEncoding; XML_ByteTable=XML_gbk_big5_ByteTable; break;
+ case char_encoding_GBK: characterEncoding = _characterEncoding; XML_ByteTable = XML_gbk_big5_ByteTable; break;
default: return 1;
}
#endif
@@ -2818,29 +2818,29 @@ XMLNode::XMLCharEncoding XMLNode::guessCharEncoding(void *buf, int l, char useXM
#else
if (l<25) return (XMLCharEncoding)0;
if (guessWideCharChars&&(myIsTextWideChar(buf, l))) return (XMLCharEncoding)0;
- unsigned char *b=(unsigned char*)buf;
+ unsigned char *b = (unsigned char*)buf;
if ((b[0] == 0xef)&&(b[1] == 0xbb)&&(b[2] == 0xbf)) return char_encoding_UTF8;
// Match utf-8 model ?
- XMLCharEncoding bestGuess=char_encoding_UTF8;
+ XMLCharEncoding bestGuess = char_encoding_UTF8;
int i=0;
while (i<l)
switch (XML_utf8ByteTable[b[i]])
{
- case 4: i++; if ((i<l)&&(b[i]& 0xC0) != 0x80) { bestGuess=char_encoding_legacy; i=l; } // 10bbbbbb ?
- case 3: i++; if ((i<l)&&(b[i]& 0xC0) != 0x80) { bestGuess=char_encoding_legacy; i=l; } // 10bbbbbb ?
- case 2: i++; if ((i<l)&&(b[i]& 0xC0) != 0x80) { bestGuess=char_encoding_legacy; i=l; } // 10bbbbbb ?
+ case 4: i++; if ((i<l)&&(b[i]& 0xC0) != 0x80) { bestGuess = char_encoding_legacy; i = l; } // 10bbbbbb ?
+ case 3: i++; if ((i<l)&&(b[i]& 0xC0) != 0x80) { bestGuess = char_encoding_legacy; i = l; } // 10bbbbbb ?
+ case 2: i++; if ((i<l)&&(b[i]& 0xC0) != 0x80) { bestGuess = char_encoding_legacy; i = l; } // 10bbbbbb ?
case 1: i++; break;
- case 0: i=l;
+ case 0: i = l;
}
if ( !useXMLEncodingAttribute) return bestGuess;
// if encoding is specified and different from utf-8 than it's non-utf8
// otherwise it's utf-8
char bb[201];
- l=mmin(l, 200);
- memcpy(bb, buf, l); // copy buf into bb to be able to do "bb[l]=0"
- bb[l]=0;
- b=(unsigned char*)strstr(bb, "encoding");
+ l = mmin(l, 200);
+ memcpy(bb, buf, l); // copy buf into bb to be able to do "bb[l] = 0"
+ bb[l] = 0;
+ b = (unsigned char*)strstr(bb, "encoding");
if ( !b) return bestGuess;
b+=8; while XML_isSPACECHAR(*b) b++; if (*b != '=') return bestGuess;
b++; while XML_isSPACECHAR(*b) b++; if ((*b != '\'')&&(*b != '"')) return bestGuess;
@@ -2873,7 +2873,7 @@ XMLNode::XMLCharEncoding XMLNode::guessCharEncoding(void *buf, int l, char useXM
static const char base64Fillchar = _CXML('='); // used to mark partial words at the end
// this lookup table defines the base64 encoding
-XMLCSTR base64EncodeTable=_CXML("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
+XMLCSTR base64EncodeTable = _CXML("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
// Decode Table gives the index of any valid base64 character in the Base64 table]
// 96: '=' - 97: space char - 98: illegal char - 99: end of string
@@ -2891,68 +2891,68 @@ const unsigned char base64DecodeTable[] = {
XMLParserBase64Tool::~XMLParserBase64Tool() { freeBuffer(); }
-void XMLParserBase64Tool::freeBuffer() { if (buf) free(buf); buf=NULL; buflen=0; }
+void XMLParserBase64Tool::freeBuffer() { if (buf) free(buf); buf = NULL; buflen = 0; }
int XMLParserBase64Tool::encodeLength(int inlen, char formatted)
{
- unsigned int i=((inlen-1)/3*4+4+1);
+ unsigned int i = ((inlen-1)/3*4+4+1);
if (formatted) i+=inlen/54;
return i;
}
XMLSTR XMLParserBase64Tool::encode(unsigned char *inbuf, unsigned int inlen, char formatted)
{
- int i=encodeLength(inlen, formatted), k=17, eLen=inlen/3, j;
+ int i = encodeLength(inlen, formatted), k = 17, eLen = inlen/3, j;
alloc(i*sizeof(XMLCHAR));
- XMLSTR curr=(XMLSTR)buf;
+ XMLSTR curr = (XMLSTR)buf;
for (i=0;i<eLen;i++)
{
// Copy next three bytes into lower 24 bits of int, paying attention to sign.
- j=(inbuf[0]<<16)|(inbuf[1]<<8)|inbuf[2]; inbuf+=3;
+ j = (inbuf[0]<<16)|(inbuf[1]<<8)|inbuf[2]; inbuf+=3;
// Encode the int into four chars
- *(curr++)=base64EncodeTable[ j>>18 ];
- *(curr++)=base64EncodeTable[(j>>12)&0x3f];
- *(curr++)=base64EncodeTable[(j>> 6)&0x3f];
- *(curr++)=base64EncodeTable[(j)&0x3f];
- if (formatted) { if ( !k) { *(curr++)=_CXML('\n'); k=18; } k--; }
+ *(curr++) = base64EncodeTable[ j>>18 ];
+ *(curr++) = base64EncodeTable[(j>>12)&0x3f];
+ *(curr++) = base64EncodeTable[(j>> 6)&0x3f];
+ *(curr++) = base64EncodeTable[(j)&0x3f];
+ if (formatted) { if ( !k) { *(curr++) = _CXML('\n'); k = 18; } k--; }
}
- eLen=inlen-eLen*3; // 0 - 2.
+ eLen = inlen-eLen*3; // 0 - 2.
if (eLen == 1)
{
- *(curr++)=base64EncodeTable[ inbuf[0]>>2 ];
- *(curr++)=base64EncodeTable[(inbuf[0]<<4)&0x3F];
- *(curr++)=base64Fillchar;
- *(curr++)=base64Fillchar;
+ *(curr++) = base64EncodeTable[ inbuf[0]>>2 ];
+ *(curr++) = base64EncodeTable[(inbuf[0]<<4)&0x3F];
+ *(curr++) = base64Fillchar;
+ *(curr++) = base64Fillchar;
} else if (eLen == 2)
{
- j=(inbuf[0]<<8)|inbuf[1];
- *(curr++)=base64EncodeTable[ j>>10 ];
- *(curr++)=base64EncodeTable[(j>> 4)&0x3f];
- *(curr++)=base64EncodeTable[(j<< 2)&0x3f];
- *(curr++)=base64Fillchar;
+ j = (inbuf[0]<<8)|inbuf[1];
+ *(curr++) = base64EncodeTable[ j>>10 ];
+ *(curr++) = base64EncodeTable[(j>> 4)&0x3f];
+ *(curr++) = base64EncodeTable[(j<< 2)&0x3f];
+ *(curr++) = base64Fillchar;
}
- *(curr++)=0;
+ *(curr++) = 0;
return (XMLSTR)buf;
}
unsigned int XMLParserBase64Tool::decodeSize(XMLCSTR data, XMLError *xe)
{
if ( !data) return 0;
- if (xe) *xe=eXMLErrorNone;
- int size=0;
+ if (xe) *xe = eXMLErrorNone;
+ int size = 0;
unsigned char c;
//skip any extra characters (e.g. newlines or spaces)
while (*data)
{
#ifdef _XMLWIDECHAR
- if (*data>255) { if (xe) *xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; }
+ if (*data>255) { if (xe) *xe = eXMLErrorBase64DecodeIllegalCharacter; return 0; }
#endif
- c=base64DecodeTable[(unsigned char)(*data)];
+ c = base64DecodeTable[(unsigned char)(*data)];
if (c<97) size++;
- else if (c == 98) { if (xe) *xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; }
+ else if (c == 98) { if (xe) *xe = eXMLErrorBase64DecodeIllegalCharacter; return 0; }
data++;
}
- if (xe&&(size%4 != 0)) *xe=eXMLErrorBase64DataSizeIsNotMultipleOf4;
+ if (xe&&(size%4 != 0)) *xe = eXMLErrorBase64DataSizeIsNotMultipleOf4;
if (size == 0) return 0;
do { data--; size--; } while (*data == base64Fillchar); size++;
return (unsigned int)((size*3)/4);
@@ -2961,8 +2961,8 @@ unsigned int XMLParserBase64Tool::decodeSize(XMLCSTR data, XMLError *xe)
unsigned char XMLParserBase64Tool::decode(XMLCSTR data, unsigned char *buf, int len, XMLError *xe)
{
if ( !data) return 0;
- if (xe) *xe=eXMLErrorNone;
- int i=0, p=0;
+ if (xe) *xe = eXMLErrorNone;
+ int i=0, p = 0;
unsigned char d, c;
for (;;)
{
@@ -2970,14 +2970,14 @@ unsigned char XMLParserBase64Tool::decode(XMLCSTR data, unsigned char *buf, int
#ifdef _XMLWIDECHAR
#define BASE64DECODE_READ_NEXT_CHAR(c) \
do { \
- if (data[i]>255) { c=98; break; } \
- c=base64DecodeTable[(unsigned char)data[i++]]; \
+ if (data[i]>255) { c = 98; break; } \
+ c = base64DecodeTable[(unsigned char)data[i++]]; \
}while (c == 97); \
- if(c == 98) { if(xe)*xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; }
+ if(c == 98) { if(xe)*xe = eXMLErrorBase64DecodeIllegalCharacter; return 0; }
#else
#define BASE64DECODE_READ_NEXT_CHAR(c) \
- do { c=base64DecodeTable[(unsigned char)data[i++]]; }while (c == 97); \
- if(c == 98) { if(xe)*xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; }
+ do { c = base64DecodeTable[(unsigned char)data[i++]]; }while (c == 97); \
+ if(c == 98) { if(xe)*xe = eXMLErrorBase64DecodeIllegalCharacter; return 0; }
#endif
BASE64DECODE_READ_NEXT_CHAR(c)
@@ -2985,52 +2985,52 @@ unsigned char XMLParserBase64Tool::decode(XMLCSTR data, unsigned char *buf, int
if (c == 96)
{
if (p == (int)len) return 2;
- if (xe) *xe=eXMLErrorBase64DecodeTruncatedData;
+ if (xe) *xe = eXMLErrorBase64DecodeTruncatedData;
return 1;
}
BASE64DECODE_READ_NEXT_CHAR(d)
- if ((d == 99) || (d == 96)) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData; return 1; }
- if (p == (int)len) { if (xe) *xe=eXMLErrorBase64DecodeBufferTooSmall; return 0; }
- buf[p++]=(unsigned char)((c<<2)|((d>>4)&0x3));
+ if ((d == 99) || (d == 96)) { if (xe) *xe = eXMLErrorBase64DecodeTruncatedData; return 1; }
+ if (p == (int)len) { if (xe) *xe = eXMLErrorBase64DecodeBufferTooSmall; return 0; }
+ buf[p++] = (unsigned char)((c<<2)|((d>>4)&0x3));
BASE64DECODE_READ_NEXT_CHAR(c)
- if (c == 99) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData; return 1; }
+ if (c == 99) { if (xe) *xe = eXMLErrorBase64DecodeTruncatedData; return 1; }
if (p == (int)len)
{
if (c == 96) return 2;
- if (xe) *xe=eXMLErrorBase64DecodeBufferTooSmall;
+ if (xe) *xe = eXMLErrorBase64DecodeBufferTooSmall;
return 0;
}
- if (c == 96) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData; return 1; }
- buf[p++]=(unsigned char)(((d<<4)&0xf0)|((c>>2)&0xf));
+ if (c == 96) { if (xe) *xe = eXMLErrorBase64DecodeTruncatedData; return 1; }
+ buf[p++] = (unsigned char)(((d<<4)&0xf0)|((c>>2)&0xf));
BASE64DECODE_READ_NEXT_CHAR(d)
- if (d == 99) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData; return 1; }
+ if (d == 99) { if (xe) *xe = eXMLErrorBase64DecodeTruncatedData; return 1; }
if (p == (int)len)
{
if (d == 96) return 2;
- if (xe) *xe=eXMLErrorBase64DecodeBufferTooSmall;
+ if (xe) *xe = eXMLErrorBase64DecodeBufferTooSmall;
return 0;
}
- if (d == 96) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData; return 1; }
- buf[p++]=(unsigned char)(((c<<6)&0xc0)|d);
+ if (d == 96) { if (xe) *xe = eXMLErrorBase64DecodeTruncatedData; return 1; }
+ buf[p++] = (unsigned char)(((c<<6)&0xc0)|d);
}
}
#undef BASE64DECODE_READ_NEXT_CHAR
void XMLParserBase64Tool::alloc(int newsize)
{
- if (( !buf)&&(newsize)) { buf=malloc(newsize); buflen=newsize; return; }
- if (newsize>buflen) { buf=realloc(buf, newsize); buflen=newsize; }
+ if (( !buf)&&(newsize)) { buf = malloc(newsize); buflen = newsize; return; }
+ if (newsize>buflen) { buf = realloc(buf, newsize); buflen = newsize; }
}
unsigned char *XMLParserBase64Tool::decode(XMLCSTR data, int *outlen, XMLError *xe)
{
- if (xe) *xe=eXMLErrorNone;
- if ( !data) { *outlen=0; return (unsigned char*)""; }
- unsigned int len=decodeSize(data, xe);
- if (outlen) *outlen=len;
+ if (xe) *xe = eXMLErrorNone;
+ if ( !data) { *outlen = 0; return (unsigned char*)""; }
+ unsigned int len = decodeSize(data, xe);
+ if (outlen) *outlen = len;
if ( !len) return NULL;
alloc(len+1);
if( !decode(data, (unsigned char*)buf, len, xe)) { return NULL; }
diff --git a/src/modules/xml/xmlParser.h b/src/modules/xml/xmlParser.h
index a166801d7c..3b91c62e5c 100644
--- a/src/modules/xml/xmlParser.h
+++ b/src/modules/xml/xmlParser.h
@@ -10,21 +10,21 @@
* @author Frank Vanden Berghen
*
* Copyright (c) 2002, Business-Insight
- * <a href="http://www.Business-Insight.com">Business-Insight</a>
+ * <a href = "http://www.Business-Insight.com">Business-Insight</a>
* All rights reserved.
- * See the file <a href="../../AFPL-license.txt">AFPL-license.txt</a> about the licensing terms
+ * See the file <a href = "../../AFPL-license.txt">AFPL-license.txt</a> about the licensing terms
*
* \section tutorial First Tutorial
- * You can follow a simple <a href="../../xmlParser.html">Tutorial</a> to know the basics...
+ * You can follow a simple <a href = "../../xmlParser.html">Tutorial</a> to know the basics...
*
* \section usage General usage: How to include the XMLParser library inside your project.
*
- * The library is composed of two files: <a href="../../xmlParser.cpp">xmlParser.cpp</a> and
- * <a href="../../xmlParser.h">xmlParser.h</a>. These are the ONLY 2 files that you need when
+ * The library is composed of two files: <a href = "../../xmlParser.cpp">xmlParser.cpp</a> and
+ * <a href = "../../xmlParser.h">xmlParser.h</a>. These are the ONLY 2 files that you need when
* using the library inside your own projects.
*
* All the functions of the library are documented inside the comments of the file
- * <a href="../../xmlParser.h">xmlParser.h</a>. These comments can be transformed in
+ * <a href = "../../xmlParser.h">xmlParser.h</a>. These comments can be transformed in
* full-fledged HTML documentation using the DOXYGEN software: simply type: "doxygen doxy.cfg"
*
* By default, the XMLParser library uses (char*) for string representation.To use the (wchar_t*)
@@ -35,11 +35,11 @@
* \section example Advanced Tutorial and Many Examples of usage.
*
* Some very small introductory examples are described inside the Tutorial file
- * <a href="../../xmlParser.html">xmlParser.html</a>
+ * <a href = "../../xmlParser.html">xmlParser.html</a>
*
- * Some additional small examples are also inside the file <a href="../../xmlTest.cpp">xmlTest.cpp</a>
+ * Some additional small examples are also inside the file <a href = "../../xmlTest.cpp">xmlTest.cpp</a>
* (for the "char*" version of the library) and inside the file
- * <a href="../../xmlTestUnicode.cpp">xmlTestUnicode.cpp</a> (for the "wchar_t*"
+ * <a href = "../../xmlTestUnicode.cpp">xmlTestUnicode.cpp</a> (for the "wchar_t*"
* version of the library). If you have a question, please review these additionnal examples
* before sending an e-mail to the author.
*
@@ -68,10 +68,10 @@
* the XMLParser Library allows me to have lightening XML parsing speed even in debug!
* Other than that, the DLL version is useless: In the release version of my tool,
* I always use the normal, ".cpp"-based, XMLParser Library (I simply include the
- * <a href="../../xmlParser.cpp">xmlParser.cpp</a> and
- * <a href="../../xmlParser.h">xmlParser.h</a> files into the project).
+ * <a href = "../../xmlParser.cpp">xmlParser.cpp</a> and
+ * <a href = "../../xmlParser.h">xmlParser.h</a> files into the project).
*
- * The file <a href="../../XMLNodeAutoexp.txt">XMLNodeAutoexp.txt</a> contains some
+ * The file <a href = "../../XMLNodeAutoexp.txt">XMLNodeAutoexp.txt</a> contains some
* "tweaks" that improve substancially the display of the content of the XMLNode objects
* inside the Visual Studio Debugger. Believe me, once you have seen inside the debugger
* the "smooth" display of the XMLNode objects, you cannot live without it anymore!
@@ -182,11 +182,11 @@ typedef enum XMLError
/// Enumeration used to manage type of data. Use in conjunction with structure XMLNodeContents
typedef enum XMLElementType
{
- eNodeChild=0,
- eNodeAttribute=1,
- eNodeText=2,
- eNodeClear=3,
- eNodeNULL=4
+ eNodeChild = 0,
+ eNodeAttribute = 1,
+ eNodeText = 2,
+ eNodeClear = 3,
+ eNodeNULL = 4
} XMLElementType;
/// Structure used to obtain error details if the parse fails.
@@ -242,7 +242,7 @@ public:
* @{ */
/// Parse an XML string and return the root of a XMLNode tree representing the string.
- static XMLNode parseString (XMLCSTR lpXMLString, XMLCSTR tag=NULL, XMLResults *pResults=NULL);
+ static XMLNode parseString (XMLCSTR lpXMLString, XMLCSTR tag = NULL, XMLResults *pResults = NULL);
/**< The "parseString" function parse an XML string and return the root of a XMLNode tree. The "opposite" of this function is
* the function "createXMLString" that re-creates an XML string from an XMLNode tree. If the XML document is corrupted, the
* "parseString" method will initialize the "pResults" variable with some information that can be used to trace the error.
@@ -255,7 +255,7 @@ public:
*/
/// Parse an XML file and return the root of a XMLNode tree representing the file.
- static XMLNode parseFile (XMLCSTR filename, XMLCSTR tag=NULL, XMLResults *pResults=NULL);
+ static XMLNode parseFile (XMLCSTR filename, XMLCSTR tag = NULL, XMLResults *pResults = NULL);
/**< The "parseFile" function parse an XML file and return the root of a XMLNode tree. The "opposite" of this function is
* the function "writeToFile" that re-creates an XML file from an XMLNode tree. If the XML document is corrupted, the
* "parseFile" method will initialize the "pResults" variable with some information that can be used to trace the error.
@@ -268,7 +268,7 @@ public:
*/
/// Parse an XML file and return the root of a XMLNode tree representing the file. A very crude error checking is made. An attempt to guess the Char Encoding used in the file is made.
- static XMLNode openFileHelper(XMLCSTR filename, XMLCSTR tag=NULL);
+ static XMLNode openFileHelper(XMLCSTR filename, XMLCSTR tag = NULL);
/**< The "openFileHelper" function reports to the screen all the warnings and errors that occurred during parsing of the XML file.
* This function also tries to guess char Encoding (UTF-8, ASCII or SHIT-JIS) based on the first 200 bytes of the file. Since each
* application has its own way to report and deal with errors, you should rather use the "parseFile" function to parse XML files
@@ -289,7 +289,7 @@ public:
static XMLCSTR getError(XMLError error); ///< this gives you a user-friendly explanation of the parsing error
/// Create an XML string starting from the current XMLNode.
- XMLSTR createXMLString(int nFormat=1, int *pnSize=NULL) const;
+ XMLSTR createXMLString(int nFormat = 1, int *pnSize = NULL) const;
/**< The returned string should be free'd using the "freeXMLString" function.
*
* If nFormat == 0, no formatting is required otherwise this returns an user friendly XML string from a given element
@@ -297,12 +297,12 @@ public:
/// Save the content of an xmlNode inside a file
XMLError writeToFile(XMLCSTR filename,
- const char *encoding=NULL,
- char nFormat=1) const;
+ const char *encoding = NULL,
+ char nFormat = 1) const;
/**< If nFormat == 0, no formatting is required otherwise this returns an user friendly XML string from a given element with appropriate white spaces and carriage returns.
* If the global parameter "characterEncoding == encoding_UTF8", then the "encoding" parameter is ignored and always set to "utf-8".
* If the global parameter "characterEncoding == encoding_ShiftJIS", then the "encoding" parameter is ignored and always set to "SHIFT-JIS".
- * If "_XMLWIDECHAR=1", then the "encoding" parameter is ignored and always set to "utf-16".
+ * If "_XMLWIDECHAR = 1", then the "encoding" parameter is ignored and always set to "utf-16".
* If no "encoding" parameter is given the "ISO-8859-1" encoding is used. */
/** @} */
@@ -316,16 +316,16 @@ public:
XMLNode getParentNode() const; ///< return the parent node
XMLNode getChildNode(int i=0) const; ///< return ith child node
XMLNode getChildNode(XMLCSTR name, int i) const; ///< return ith child node with specific name (return an empty node if failing). If i == -1, this returns the last XMLNode with the given name.
- XMLNode getChildNode(XMLCSTR name, int *i=NULL) const; ///< return next child node with specific name (return an empty node if failing)
+ XMLNode getChildNode(XMLCSTR name, int *i = NULL) const; ///< return next child node with specific name (return an empty node if failing)
XMLNode getChildNodeWithAttribute(XMLCSTR tagName,
XMLCSTR attributeName,
- XMLCSTR attributeValue=NULL,
- int *i=NULL) const; ///< return child node with specific name/attribute (return an empty node if failing)
- XMLNode getChildNodeByPath(XMLSTR path, char createNodeIfMissing=0, XMLCHAR sep='/');
+ XMLCSTR attributeValue = NULL,
+ int *i = NULL) const; ///< return child node with specific name/attribute (return an empty node if failing)
+ XMLNode getChildNodeByPath(XMLSTR path, char createNodeIfMissing = 0, XMLCHAR sep = '/');
///< return the first child node with specific path. WARNING: the value of the parameter "path" is destroyed!
- XMLNode getChildNodeByPath(XMLCSTR path, char createNodeIfMissing=0, XMLCHAR sep='/');
+ XMLNode getChildNodeByPath(XMLCSTR path, char createNodeIfMissing = 0, XMLCHAR sep = '/');
///< return the first child node with specific path
- XMLNode getChildNodeByPathNonConst(XMLSTR path, char createNodeIfMissing=0, XMLCHAR sep='/');
+ XMLNode getChildNodeByPathNonConst(XMLSTR path, char createNodeIfMissing = 0, XMLCHAR sep = '/');
///< return the first child node with specific path.
XMLNode getNextNode() const;
@@ -336,7 +336,7 @@ public:
XMLCSTR getAttributeValue(int i=0) const; ///< return ith attribute value
char isAttributeSet(XMLCSTR name) const; ///< test if an attribute with a specific name is given
XMLCSTR getAttribute(XMLCSTR name, int i) const; ///< return ith attribute content with specific name (return a NULL if failing)
- XMLCSTR getAttribute(XMLCSTR name, int *i=NULL) const; ///< return next attribute content with specific name (return a NULL if failing)
+ XMLCSTR getAttribute(XMLCSTR name, int *i = NULL) const; ///< return next attribute content with specific name (return a NULL if failing)
int nAttribute() const; ///< nbr of attribute
XMLClear getClear(int i=0) const; ///< return ith clear field (comments)
int nClear() const; ///< nbr of clear field
@@ -350,7 +350,7 @@ public:
~XMLNode();
XMLNode(const XMLNode &A); ///< to allow shallow/fast copy:
- XMLNode& operator=(const XMLNode& A); ///< to allow shallow/fast copy:
+ XMLNode& operator = (const XMLNode& A); ///< to allow shallow/fast copy:
XMLNode(): d(NULL) {};
static XMLNode emptyXMLNode;
@@ -367,8 +367,8 @@ public:
* @ingroup XMLParserGeneral
* The functions in this group allows you to create from scratch (or update) a XMLNode structure. Start by creating your top
* node with the "createXMLTopNode" function and then add new nodes with the "addChild" function. The parameter 'pos' gives
- * the position where the childNode, the text or the XMLClearTag will be inserted. The default value (pos=-1) inserts at the
- * end. The value (pos=0) insert at the beginning (Insertion at the beginning is slower than at the end). <br>
+ * the position where the childNode, the text or the XMLClearTag will be inserted. The default value (pos = -1) inserts at the
+ * end. The value (pos = 0) insert at the beginning (Insertion at the beginning is slower than at the end). <br>
*
* REMARK: 0 <= pos < nChild()+nText()+nClear() <br>
*/
@@ -376,12 +376,12 @@ public:
/** @defgroup creation Creating from scratch a XMLNode structure
* @ingroup xmlModify
* @{ */
- static XMLNode createXMLTopNode(XMLCSTR lpszName, char isDeclaration=FALSE); ///< Create the top node of an XMLNode structure
- XMLNode addChild(XMLCSTR lpszName, char isDeclaration=FALSE, XMLElementPosition pos=-1); ///< Add a new child node
- XMLNode addChild(XMLNode nodeToAdd, XMLElementPosition pos=-1); ///< If the "nodeToAdd" has some parents, it will be detached from it's parents before being attached to the current XMLNode
+ static XMLNode createXMLTopNode(XMLCSTR lpszName, char isDeclaration = FALSE); ///< Create the top node of an XMLNode structure
+ XMLNode addChild(XMLCSTR lpszName, char isDeclaration = FALSE, XMLElementPosition pos = -1); ///< Add a new child node
+ XMLNode addChild(XMLNode nodeToAdd, XMLElementPosition pos = -1); ///< If the "nodeToAdd" has some parents, it will be detached from it's parents before being attached to the current XMLNode
XMLAttribute *addAttribute(XMLCSTR lpszName, XMLCSTR lpszValuev); ///< Add a new attribute
- XMLCSTR addText(XMLCSTR lpszValue, XMLElementPosition pos=-1); ///< Add a new text content
- XMLClear *addClear(XMLCSTR lpszValue, XMLCSTR lpszOpen=NULL, XMLCSTR lpszClose=NULL, XMLElementPosition pos=-1);
+ XMLCSTR addText(XMLCSTR lpszValue, XMLElementPosition pos = -1); ///< Add a new text content
+ XMLClear *addClear(XMLCSTR lpszValue, XMLCSTR lpszOpen = NULL, XMLCSTR lpszClose = NULL, XMLElementPosition pos = -1);
/**< Add a new clear tag
* @param lpszOpen default value "<![CDATA["
* @param lpszClose default value "]]>"
@@ -395,8 +395,8 @@ public:
*/
XMLCSTR updateName(XMLCSTR lpszName); ///< change node's name
XMLAttribute *updateAttribute(XMLAttribute *newAttribute, XMLAttribute *oldAttribute); ///< if the attribute to update is missing, a new one will be added
- XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName=NULL, int i=0); ///< if the attribute to update is missing, a new one will be added
- XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName, XMLCSTR lpszOldName);///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
+ XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName = NULL, int i=0); ///< if the attribute to update is missing, a new one will be added
+ XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName, XMLCSTR lpszOldName);///< set lpszNewName = NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
XMLCSTR updateText(XMLCSTR lpszNewValue, int i=0); ///< if the text to update is missing, a new one will be added
XMLCSTR updateText(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the text to update is missing, a new one will be added
XMLClear *updateClear(XMLCSTR lpszNewContent, int i=0); ///< if the clearTag to update is missing, a new one will be added
@@ -440,27 +440,27 @@ public:
* \endcode
* Typically, you will never do:
* \code
- * char *b=(char*)malloc(...);
+ * char *b = (char*)malloc(...);
* xNode.addText(b);
* free(b);
* \endcode
* ... but rather:
* \code
- * char *b=(char*)malloc(...);
+ * char *b = (char*)malloc(...);
* xNode.addText_WOSD(b);
* \endcode
* ('free(b)' is performed by the XMLNode class)
* @{ */
- static XMLNode createXMLTopNode_WOSD(XMLSTR lpszName, char isDeclaration=FALSE); ///< Create the top node of an XMLNode structure
- XMLNode addChild_WOSD(XMLSTR lpszName, char isDeclaration=FALSE, XMLElementPosition pos=-1); ///< Add a new child node
+ static XMLNode createXMLTopNode_WOSD(XMLSTR lpszName, char isDeclaration = FALSE); ///< Create the top node of an XMLNode structure
+ XMLNode addChild_WOSD(XMLSTR lpszName, char isDeclaration = FALSE, XMLElementPosition pos = -1); ///< Add a new child node
XMLAttribute *addAttribute_WOSD(XMLSTR lpszName, XMLSTR lpszValue); ///< Add a new attribute
- XMLCSTR addText_WOSD(XMLSTR lpszValue, XMLElementPosition pos=-1); ///< Add a new text content
- XMLClear *addClear_WOSD(XMLSTR lpszValue, XMLCSTR lpszOpen=NULL, XMLCSTR lpszClose=NULL, XMLElementPosition pos=-1); ///< Add a new clear Tag
+ XMLCSTR addText_WOSD(XMLSTR lpszValue, XMLElementPosition pos = -1); ///< Add a new text content
+ XMLClear *addClear_WOSD(XMLSTR lpszValue, XMLCSTR lpszOpen = NULL, XMLCSTR lpszClose = NULL, XMLElementPosition pos = -1); ///< Add a new clear Tag
XMLCSTR updateName_WOSD(XMLSTR lpszName); ///< change node's name
XMLAttribute *updateAttribute_WOSD(XMLAttribute *newAttribute, XMLAttribute *oldAttribute); ///< if the attribute to update is missing, a new one will be added
- XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName=NULL, int i=0); ///< if the attribute to update is missing, a new one will be added
- XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName, XMLCSTR lpszOldName); ///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
+ XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName = NULL, int i=0); ///< if the attribute to update is missing, a new one will be added
+ XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName, XMLCSTR lpszOldName); ///< set lpszNewName = NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
XMLCSTR updateText_WOSD(XMLSTR lpszNewValue, int i=0); ///< if the text to update is missing, a new one will be added
XMLCSTR updateText_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the text to update is missing, a new one will be added
XMLClear *updateClear_WOSD(XMLSTR lpszNewContent, int i=0); ///< if the clearTag to update is missing, a new one will be added
@@ -487,30 +487,30 @@ public:
/// Enumeration for XML character encoding.
typedef enum XMLCharEncoding
{
- char_encoding_error=0,
- char_encoding_UTF8=1,
- char_encoding_legacy=2,
- char_encoding_ShiftJIS=3,
- char_encoding_GB2312=4,
- char_encoding_Big5=5,
- char_encoding_GBK=6 // this is actually the same as Big5
+ char_encoding_error = 0,
+ char_encoding_UTF8 = 1,
+ char_encoding_legacy = 2,
+ char_encoding_ShiftJIS = 3,
+ char_encoding_GB2312 = 4,
+ char_encoding_Big5 = 5,
+ char_encoding_GBK = 6 // this is actually the same as Big5
} XMLCharEncoding;
/** \addtogroup conversions
* @{ */
/// Sets the global options for the conversions
- static char setGlobalOptions(XMLCharEncoding characterEncoding=XMLNode::char_encoding_UTF8, char guessWideCharChars=1,
- char dropWhiteSpace=1, char removeCommentsInMiddleOfText=1);
+ static char setGlobalOptions(XMLCharEncoding characterEncoding = XMLNode::char_encoding_UTF8, char guessWideCharChars = 1,
+ char dropWhiteSpace = 1, char removeCommentsInMiddleOfText = 1);
/**< The "setGlobalOptions" function allows you to change four global parameters that affect string & file
* parsing. First of all, you most-probably will never have to change these 3 global parameters.
*
- * @param guessWideCharChars If "guessWideCharChars"=1 and if this library is compiled in WideChar mode, then the
+ * @param guessWideCharChars If "guessWideCharChars" = 1 and if this library is compiled in WideChar mode, then the
* XMLNode::parseFile and XMLNode::openFileHelper functions will test if the file contains ASCII
* characters. If this is the case, then the file will be loaded and converted in memory to
* WideChar before being parsed. If 0, no conversion will be performed.
*
- * @param guessWideCharChars If "guessWideCharChars"=1 and if this library is compiled in ASCII/UTF8/char* mode, then the
+ * @param guessWideCharChars If "guessWideCharChars" = 1 and if this library is compiled in ASCII/UTF8/char* mode, then the
* XMLNode::parseFile and XMLNode::openFileHelper functions will test if the file contains WideChar
* characters. If this is the case, then the file will be loaded and converted in memory to
* ASCII/UTF8/char* before being parsed. If 0, no conversion will be performed.
@@ -525,14 +525,14 @@ public:
* complexity of the user's code for parsing. So, 99% of the time, it's better to drop
* the "empty" text fields. However The XML specification indicates that no white spaces
* should be lost when parsing the file. So to be perfectly XML-compliant, you should set
- * dropWhiteSpace=0. A note of caution: if you set "dropWhiteSpace=0", the parser will be
+ * dropWhiteSpace = 0. A note of caution: if you set "dropWhiteSpace = 0", the parser will be
* slower and your code will be more complex.
*
* @param removeCommentsInMiddleOfText To explain this parameter, let's consider this code:
* \code
- * XMLNode x=XMLNode::parseString("<a>foo<!-- hello -->bar<!DOCTYPE world >chu</a>", "a");
+ * XMLNode x = XMLNode::parseString("<a>foo<!-- hello -->bar<!DOCTYPE world >chu</a>", "a");
* \endcode
- * If removeCommentsInMiddleOfText=0, then we will have:
+ * If removeCommentsInMiddleOfText = 0, then we will have:
* \code
* x.getText(0) -> "foo"
* x.getText(1) -> "bar"
@@ -540,7 +540,7 @@ public:
* x.getClear(0) --> "<!-- hello -->"
* x.getClear(1) --> "<!DOCTYPE world >"
* \endcode
- * If removeCommentsInMiddleOfText=1, then we will have:
+ * If removeCommentsInMiddleOfText = 1, then we will have:
* \code
* x.getText(0) -> "foobar"
* x.getText(1) -> "chu"
@@ -549,11 +549,11 @@ public:
*
* \return "0" when there are no errors. If you try to set an unrecognized encoding then the return value will be "1" to signal an error.
*
- * \note Sometime, it's useful to set "guessWideCharChars=0" to disable any conversion
+ * \note Sometime, it's useful to set "guessWideCharChars = 0" to disable any conversion
* because the test to detect the file-type (ASCII/UTF8/char* or WideChar) may fail (rarely). */
/// Guess the character encoding of the string (ascii, utf8 or shift-JIS)
- static XMLCharEncoding guessCharEncoding(void *buffer, int bufLen, char useXMLEncodingAttribute=1);
+ static XMLCharEncoding guessCharEncoding(void *buffer, int bufLen, char useXMLEncodingAttribute = 1);
/**< The "guessCharEncoding" function try to guess the character encoding. You most-probably will never
* have to use this function. It then returns the appropriate value of the global parameter
* "characterEncoding" described in the XMLNode::setGlobalOptions. The guess is based on the content of a buffer of length
@@ -571,14 +571,14 @@ private:
typedef struct XMLNodeDataTag // to allow shallow copy and "intelligent/smart" pointers (automatic delete):
{
- XMLCSTR lpszName; // Element name (=NULL if root)
+ XMLCSTR lpszName; // Element name ( = NULL if root)
XMLCSTR lpszNS; // Namespace
int nChild, // Number of child nodes
nText, // Number of text fields
nClear, // Number of Clear fields (comments)
nAttribute; // Number of attributes
char isDeclaration; // Whether node is an XML declaration - '<?xml ?>'
- struct XMLNodeDataTag *pParent; // Pointer to parent element (=NULL if root)
+ struct XMLNodeDataTag *pParent; // Pointer to parent element ( = NULL if root)
XMLNode *pChild; // Array of child nodes
XMLCSTR *pText; // Array of text fields
XMLClear *pClear; // Array of clear fields
@@ -625,7 +625,7 @@ typedef struct XMLNodeContents
* @ingroup xmlModify
* @{ */
/// Duplicate (copy in a new allocated buffer) the source string.
-XMLDLLENTRY XMLSTR stringDup(XMLCSTR source, int cbData=-1);
+XMLDLLENTRY XMLSTR stringDup(XMLCSTR source, int cbData = -1);
/**< This is
* a very handy function when used with all the "XMLNode::*_WOSD" functions (\link xmlWOSD \endlink).
* @param cbData If != 0 then cbData is the number of chars to duplicate. New strings allocated with
@@ -644,12 +644,12 @@ XMLDLLENTRY void freeXMLString(XMLSTR t); // {free(t);}
* delete them without any trouble.
*
* @{ */
-XMLDLLENTRY char xmltob(XMLCSTR xmlString, char defautValue=0);
-XMLDLLENTRY int xmltoi(XMLCSTR xmlString, int defautValue=0);
-XMLDLLENTRY long xmltol(XMLCSTR xmlString, long defautValue=0);
-XMLDLLENTRY double xmltof(XMLCSTR xmlString, double defautValue=.0);
-XMLDLLENTRY XMLCSTR xmltoa(XMLCSTR xmlString, XMLCSTR defautValue=_CXML(""));
-XMLDLLENTRY XMLCHAR xmltoc(XMLCSTR xmlString, const XMLCHAR defautValue=_CXML('\0'));
+XMLDLLENTRY char xmltob(XMLCSTR xmlString, char defautValue = 0);
+XMLDLLENTRY int xmltoi(XMLCSTR xmlString, int defautValue = 0);
+XMLDLLENTRY long xmltol(XMLCSTR xmlString, long defautValue = 0);
+XMLDLLENTRY double xmltof(XMLCSTR xmlString, double defautValue = .0);
+XMLDLLENTRY XMLCSTR xmltoa(XMLCSTR xmlString, XMLCSTR defautValue = _CXML(""));
+XMLDLLENTRY XMLCHAR xmltoc(XMLCSTR xmlString, const XMLCHAR defautValue = _CXML('\0'));
/** @} */
/** @defgroup ToXMLStringTool Helper class to create XML files using "printf", "fprintf", "cout", ... functions.
@@ -706,31 +706,31 @@ public:
void freeBuffer();///< Call this function when you have finished using this object to release memory used by the internal buffer.
/**
- * @param formatted If "formatted"=true, some space will be reserved for a carriage-return every 72 chars. */
- static int encodeLength(int inBufLen, char formatted=0); ///< return the length of the base64 string that encodes a data buffer of size inBufLen bytes.
+ * @param formatted If "formatted" = true, some space will be reserved for a carriage-return every 72 chars. */
+ static int encodeLength(int inBufLen, char formatted = 0); ///< return the length of the base64 string that encodes a data buffer of size inBufLen bytes.
/**
* The "base64Encode" function returns a string containing the base64 encoding of "inByteLen" bytes
* from "inByteBuf". If "formatted" parameter is true, then there will be a carriage-return every 72 chars.
* The string will be free'd when the XMLParserBase64Tool object is deleted.
* All returned strings are sharing the same memory space. */
- XMLSTR encode(unsigned char *inByteBuf, unsigned int inByteLen, char formatted=0); ///< returns a pointer to an internal buffer containing the base64 string containing the binary data encoded from "inByteBuf"
+ XMLSTR encode(unsigned char *inByteBuf, unsigned int inByteLen, char formatted = 0); ///< returns a pointer to an internal buffer containing the base64 string containing the binary data encoded from "inByteBuf"
/// returns the number of bytes which will be decoded from "inString".
- static unsigned int decodeSize(XMLCSTR inString, XMLError *xe=NULL);
+ static unsigned int decodeSize(XMLCSTR inString, XMLError *xe = NULL);
/**
* The "decode" function returns a pointer to a buffer containing the binary data decoded from "inString"
* The output buffer will be free'd when the XMLParserBase64Tool object is deleted.
* All output buffer are sharing the same memory space.
* @param inString If "instring" is malformed, NULL will be returned */
- unsigned char* decode(XMLCSTR inString, int *outByteLen=NULL, XMLError *xe=NULL); ///< returns a pointer to an internal buffer containing the binary data decoded from "inString"
+ unsigned char* decode(XMLCSTR inString, int *outByteLen = NULL, XMLError *xe = NULL); ///< returns a pointer to an internal buffer containing the binary data decoded from "inString"
/**
* decodes data from "inString" to "outByteBuf". You need to provide the size (in byte) of "outByteBuf"
* in "inMaxByteOutBuflen". If "outByteBuf" is not large enough or if data is malformed, then "FALSE"
* will be returned; otherwise "TRUE". */
- static unsigned char decode(XMLCSTR inString, unsigned char *outByteBuf, int inMaxByteOutBuflen, XMLError *xe=NULL); ///< deprecated.
+ static unsigned char decode(XMLCSTR inString, unsigned char *outByteBuf, int inMaxByteOutBuflen, XMLError *xe = NULL); ///< deprecated.
private:
void *buf;
diff --git a/src/resource.rc b/src/resource.rc
index 36ad9de944..7e0ae1b3c2 100644
--- a/src/resource.rc
+++ b/src/resource.rc
@@ -236,161 +236,6 @@ BEGIN
EDITTEXT IDC_MSG,5,5,177,43,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
END
-IDD_DETAILS DIALOGEX 0, 0, 318, 210
-STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_CONTROLPARENT
-CAPTION "%s: User Details"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- CONTROL "%s\nView personal user details and more",IDC_HEADERBAR,
- "MHeaderbarCtrl",0x0,0,0,318,25
- CONTROL "",IDC_PAGETREE,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_NOTOOLTIPS | TVS_TRACKSELECT | TVS_FULLROWSELECT | TVS_NONEVENHEIGHT | WS_HSCROLL | WS_TABSTOP,3,30,76,176,WS_EX_STATICEDGE
- CONTROL "Tab1",IDC_TABS,"SysTabControl32",TCS_HOTTRACK | TCS_MULTILINE | WS_TABSTOP,85,29,228,158
- PUSHBUTTON "Update Now",IDC_UPDATE,85,191,55,14,WS_DISABLED
- CTEXT "Updating",IDC_UPDATING,145,194,113,8,SS_NOPREFIX | SS_CENTERIMAGE
- DEFPUSHBUTTON "OK",IDOK,263,191,50,14
-END
-
-IDD_INFO_SUMMARY DIALOGEX 0, 0, 222, 132
-STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- LTEXT "Nickname:",IDC_STATIC,5,5,46,8
- EDITTEXT IDC_NICK,51,5,166,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "First name:",IDC_STATIC,5,18,46,8
- EDITTEXT IDC_FIRSTNAME,51,18,74,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Gender:",IDC_STATIC,126,18,44,8
- EDITTEXT IDC_GENDER,170,18,47,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Last name:",IDC_STATIC,5,31,46,8
- EDITTEXT IDC_LASTNAME,51,31,74,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Age:",IDC_STATIC,126,31,44,8
- EDITTEXT IDC_AGE,170,31,47,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "E-mail:",IDC_STATIC,5,44,46,8
- CONTROL "",IDC_EMAIL,"Hyperlink",WS_TABSTOP,51,44,166,8
- LTEXT "Date of birth:",IDC_STATIC,5,58,59,8
- EDITTEXT IDC_DOBDAY,66,58,8,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- EDITTEXT IDC_DOBMONTH,76,58,16,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- EDITTEXT IDC_DOBYEAR,94,58,20,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Marital status:",IDC_STATIC,5,71,76,8
- EDITTEXT IDC_MARITAL,83,71,87,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
-END
-
-IDD_INFO_CONTACT DIALOGEX 0, 0, 222, 132
-STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- LTEXT "E-mail:",IDC_STATIC,5,5,212,8
- CONTROL "List1",IDC_EMAILS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,14,212,50
- LTEXT "Phone:",IDC_STATIC,5,68,212,8
- CONTROL "List1",IDC_PHONES,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,77,212,50
-END
-
-IDD_INFO_BACKGROUND DIALOGEX 0, 0, 222, 132
-STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- LTEXT "Web page:",IDC_STATIC,5,5,44,8
- CONTROL "",IDC_WEBPAGE,"Hyperlink",WS_TABSTOP,49,5,168,8
- LTEXT "Past background:",IDC_STATIC,5,18,212,8
- CONTROL "List1",IDC_PAST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,27,212,44
- LTEXT "Interests:",IDC_STATIC,5,74,212,8
- CONTROL "List1",IDC_INTERESTS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,83,212,44
-END
-
-IDD_INFO_NOTES DIALOGEX 0, 0, 222, 132
-STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- LTEXT "About:",IDC_STATIC,5,5,212,8
- EDITTEXT IDC_ABOUT,5,13,212,45,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
- LTEXT "My notes:",IDC_STATIC,5,61,212,8
- EDITTEXT IDC_MYNOTES,5,69,212,58,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
-END
-
-IDD_INFO_LOCATION DIALOGEX 0, 0, 222, 147
-STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- LTEXT "Street:",IDC_STATIC,5,5,51,8
- EDITTEXT IDC_STREET,56,5,161,16,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "City:",IDC_STATIC,5,22,51,8
- EDITTEXT IDC_CITY,56,22,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "State:",IDC_STATIC,5,33,51,8
- EDITTEXT IDC_STATE,56,33,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Postal code:",IDC_STATIC,5,44,51,8
- EDITTEXT IDC_ZIP,56,44,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Country:",IDC_STATIC,5,55,51,8
- EDITTEXT IDC_COUNTRY,56,55,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Spoken languages:",IDC_STATIC,5,70,51,16
- EDITTEXT IDC_LANGUAGE1,56,70,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- EDITTEXT IDC_LANGUAGE2,56,78,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- EDITTEXT IDC_LANGUAGE3,56,86,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Timezone:",IDC_STATIC,5,97,51,8
- EDITTEXT IDC_TIMEZONE,56,97,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Local time:",IDC_STATIC,5,108,51,8
- EDITTEXT IDC_LOCALTIME,56,108,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- COMBOBOX IDC_TIMEZONESELECT,4,132,214,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Set custom time zone",IDC_STATIC,5,121,212,8
-END
-
-IDD_INFO_WORK DIALOGEX 0, 0, 222, 132
-STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- LTEXT "Company:",IDC_STATIC,5,5,51,8
- EDITTEXT IDC_COMPANY,56,5,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Department:",IDC_STATIC,5,17,51,8
- EDITTEXT IDC_DEPARTMENT,56,17,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Position:",IDC_STATIC,5,28,51,8
- EDITTEXT IDC_POSITION,56,28,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Street:",IDC_STATIC,5,48,51,8
- EDITTEXT IDC_STREET,56,48,161,16,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "City:",IDC_STATIC,5,65,51,8
- EDITTEXT IDC_CITY,56,65,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "State:",IDC_STATIC,5,76,51,8
- EDITTEXT IDC_STATE,56,76,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Postal code:",IDC_STATIC,5,87,51,8
- EDITTEXT IDC_ZIP,56,87,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Country:",IDC_STATIC,5,98,51,8
- EDITTEXT IDC_COUNTRY,56,98,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Website:",IDC_STATIC,5,109,51,8
- CONTROL "",IDC_WEBPAGE,"Hyperlink",WS_TABSTOP,57,109,160,8
-END
-
-IDD_ADDEMAIL DIALOGEX 0, 0, 187, 42
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_CONTROLPARENT
-CAPTION "Add E-Mail Address"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- EDITTEXT IDC_EMAIL,5,5,177,12,ES_AUTOHSCROLL
- DEFPUSHBUTTON "OK",IDOK,36,23,50,14
- PUSHBUTTON "Cancel",IDCANCEL,102,23,50,14
-END
-
-IDD_ADDPHONE DIALOGEX 0, 0, 210, 91
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_CONTROLPARENT
-CAPTION "Add Phone Number"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- LTEXT "Enter country, area code and phone number:",IDC_STATIC,5,5,200,8
- COMBOBOX IDC_COUNTRY,21,15,66,120,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- EDITTEXT IDC_AREA,91,15,36,12,ES_AUTOHSCROLL | ES_NUMBER
- EDITTEXT IDC_NUMBER,131,15,74,12,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "Or enter a full international number:",IDC_STATIC,5,30,200,8
- EDITTEXT IDC_PHONE,21,40,184,12,ES_AUTOHSCROLL
- CONTROL "Phone can receive SMS text messages",IDC_SMS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,56,200,10
- DEFPUSHBUTTON "OK",IDOK,47,72,50,14
- PUSHBUTTON "Cancel",IDCANCEL,113,72,50,14
-END
-
IDD_INSTALLINI DIALOGEX 0, 0, 213, 103
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTROLPARENT
@@ -1422,82 +1267,6 @@ BEGIN
HORZGUIDE, 62
END
- IDD_INFO_CONTACT, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 217
- TOPMARGIN, 5
- BOTTOMMARGIN, 127
- END
-
- IDD_INFO_BACKGROUND, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 217
- VERTGUIDE, 49
- TOPMARGIN, 5
- BOTTOMMARGIN, 127
- END
-
- IDD_INFO_NOTES, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 217
- TOPMARGIN, 5
- BOTTOMMARGIN, 127
- END
-
- IDD_INFO_LOCATION, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 217
- VERTGUIDE, 56
- TOPMARGIN, 5
- BOTTOMMARGIN, 142
- HORZGUIDE, 22
- HORZGUIDE, 33
- HORZGUIDE, 45
- HORZGUIDE, 56
- HORZGUIDE, 70
- HORZGUIDE, 95
- HORZGUIDE, 106
- END
-
- IDD_INFO_WORK, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 217
- VERTGUIDE, 56
- VERTGUIDE, 126
- VERTGUIDE, 170
- TOPMARGIN, 5
- BOTTOMMARGIN, 127
- HORZGUIDE, 16
- HORZGUIDE, 27
- HORZGUIDE, 44
- HORZGUIDE, 61
- HORZGUIDE, 72
- HORZGUIDE, 83
- HORZGUIDE, 94
- HORZGUIDE, 105
- END
-
- IDD_ADDEMAIL, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 182
- TOPMARGIN, 5
- BOTTOMMARGIN, 37
- END
-
- IDD_ADDPHONE, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 205
- TOPMARGIN, 5
- BOTTOMMARGIN, 86
- END
-
IDD_INSTALLINI, DIALOG
BEGIN
LEFTMARGIN, 5
@@ -1836,12 +1605,12 @@ END
// TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include <windows.h>\r\n"
"#include <winres.h>\r\n"
@@ -1849,7 +1618,7 @@ BEGIN
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -2034,4 +1803,3 @@ IDB_SORTCOLDOWN BITMAP "res/arrow_sort_column_down.bmp"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-