From: <arn...@us...> - 2008-04-24 13:09:00
|
Revision: 1180 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1180&view=rev Author: arnetheduck Date: 2008-04-24 06:08:55 -0700 (Thu, 24 Apr 2008) Log Message: ----------- Some header cleanup, prefer unordered_map, fix libraryloader Modified Paths: -------------- dcplusplus/trunk/dwt/include/dwt/Application.h dcplusplus/trunk/dwt/include/dwt/LibraryLoader.h dcplusplus/trunk/dwt/include/dwt/resources/Accelerator.h dcplusplus/trunk/dwt/include/dwt/widgets/Menu.h dcplusplus/trunk/dwt/src/Application.cpp dcplusplus/trunk/dwt/src/Bitmap.cpp dcplusplus/trunk/dwt/src/Icon.cpp dcplusplus/trunk/dwt/src/ImageList.cpp dcplusplus/trunk/dwt/src/LibraryLoader.cpp dcplusplus/trunk/dwt/src/Widget.cpp dcplusplus/trunk/dwt/src/WindowClass.cpp dcplusplus/trunk/dwt/src/widgets/MDIChild.cpp dcplusplus/trunk/dwt/src/widgets/MDIParent.cpp dcplusplus/trunk/dwt/src/widgets/ModalDialog.cpp dcplusplus/trunk/dwt/src/widgets/ModelessDialog.cpp dcplusplus/trunk/win32/WidgetPaned.h dcplusplus/trunk/win32/stdafx.h Property Changed: ---------------- dcplusplus/trunk/ Property changes on: dcplusplus/trunk ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-04-15 16:30:18.937000036 +0200 committer: poy <po...@12...> properties: branch-nick: repo + timestamp: 2008-04-15 19:49:58.423000097 +0200 committer: Jacek Sieka <arn...@gm...> properties: branch-nick: dcplusplus Name: bzr:revision-id:v3-trunk1 - 1027 arn...@gm...-20080323183926-schknwnkgeo7ivdn 1028 zouzou123gen-20080323220411-r8usuc3qxwuh7zsn 1029 zouzou123gen-20080323221249-0su72zaj13e706mk 1030 arn...@gm...-20080324140623-muba1dl46m000o8c 1031 zouzou123gen-20080324141933-qbgr93ugpe0297m6 1032 arn...@gm...-20080324153706-siidja05n84i00b1 1033 arn...@gm...-20080324153823-lhn3awurnu77riln 1034 arn...@gm...-20080324165650-zapppziji67yf5a2 1035 zouzou123gen-20080324175936-4mqc2kh0lo5wtdu2 1036 zouzou123gen-20080325004602-6wdsoym95mjuhwd3 1037 arn...@gm...-20080325100659-8fqy6q65itmghlep 1038 zouzou123gen-20080325175216-s297sdiucukfvijh 1039 arn...@gm...-20080325210137-3dfqyoi8ykosy087 1040 arn...@gm...-20080325211747-nwwy1eb33r071sca 1041 arn...@gm...-20080326084110-qbselrjckku275xi 1042 zouzou123gen-20080326123631-35642mgbk2i4ty32 1043 zouzou123gen-20080326124345-f4xwn2d3ty8ubd6r 1044 arn...@gm...-20080326162031-il0nyms30w0mky43 1045 arn...@gm...-20080326164801-8dru8mjc06xgzjpv 1046 arn...@gm...-20080326170438-uzl2rx8fqnohak7g 1047 zouzou123gen-20080326172821-d6uqcbmfb0c6rwlv 1048 arn...@gm...-20080326213257-qlgdh7m2712p2l0q 1049 arn...@gm...-20080326214313-ktnoekgk3s0wmatz 1050 arn...@gm...-20080326215256-0j1iqrf286b9g7zf 1051 arn...@gm...-20080327082121-hoi22wh1gwjdfbyd 1052 arn...@gm...-20080327120639-um3tukdt374rwvgm 1053 zouzou123gen-20080327130703-6vtek6uxy3vua543 1054 arn...@gm...-20080327215831-dmg5mkufskabwkro 1055 arn...@gm...-20080327231459-cdztcv25alsuyqmf 1056 arn...@gm...-20080328085925-gceybsr53oml1p24 1057 arn...@gm...-20080328200512-1sjuu6bcnl2dyd2a 1058 arn...@gm...-20080328210347-bussqjrm5mfswh7o 1059 arn...@gm...-20080329055630-braiir1dskv7a4qm 1060 arn...@gm...-20080329061558-rck8dz60wpj3c5ja 1061 arn...@gm...-20080329081253-if6o5jn329mbzfpl 1062 arn...@gm...-20080329081619-cb4x930j8sp55cs0 1063 arn...@gm...-20080329103216-hgjzo7ra2zixbztd 1064 arn...@gm...-20080329124042-q3aw4iodmo5kafyp 1065 arn...@gm...-20080329124926-2je1z18p0272zpua 1066 arn...@gm...-20080329150901-ehj9t32en7eps2dp 1067 zouzou123gen-20080329153653-36xlvpik2ns9r84r 1068 zouzou123gen-20080329162703-51xr8hg073pg7wq5 1069 zouzou123gen-20080329234706-8ddipdqu0xeudkql 1070 arn...@gm...-20080330081232-ubqr1171ewalrd4q 1071 zouzou123gen-20080330131607-yppbs3mgyjef1cux 1072 zouzou123gen-20080330134835-yv1nogy77ib1uehd 1073 zouzou123gen-20080331124549-alyw7vugdn30piqy 1074 zouzou123gen-20080331135108-q8frtqsin5bosfzm 1075 zouzou123gen-20080331140757-u94q52yccl5lsifk 1076 zouzou123gen-20080331152513-ue1x5qhigcw51348 1077 arn...@gm...-20080331184436-a8g6chibmg8nswls 1078 arn...@gm...-20080331220648-81485k28qmwruwz6 1079 zouzou123gen-20080401081001-2yjn07cf8s5sxr3a 1080 zouzou123gen-20080401081247-f3p4hdjojnd460jw 1081 zouzou123gen-20080401084117-24a454g8o0x656kg 1082 zouzou123gen-20080401133146-jabb5i8870fg6f66 1083 zouzou123gen-20080401154610-mxdqoo5bksru93e6 1084 arn...@gm...-20080401185530-lqj4tflt5ldmx46f 1085 arn...@gm...-20080401212616-ffl7m0xm8gt15knk 1086 arn...@gm...-20080402084515-ofmnwihzv159jton 1087 arn...@gm...-20080402133105-y70soi38owzl76i9 1088 arn...@gm...-20080402142417-rn2dbkx19wfz3vae 1089 arn...@gm...-20080402144459-u3z3hqvl8aqjc4a0 1090 zouzou123gen-20080402145051-zi8tmvy8u3r2mzu8 1091 arn...@gm...-20080402152137-f397uz1yp9qjvfwh 1092 zouzou123gen-20080402170355-29wda40wk3cy7lu5 1093 arn...@gm...-20080402180628-ipos9li0c4bsmq1h 1094 arn...@gm...-20080402181235-s2a6f4ww4lzayl46 1095 arn...@gm...-20080402193851-6mu64vgep6tijith 1096 arn...@gm...-20080402203810-86zpxsx69q83zf3r 1097 arn...@gm...-20080402204331-so2e8n892o23pejr 1098 poy-20080402224153-225qylr2cfwhqrg7 1099 mrmikejj-20080403125112-o8polh8rkn62umyh 1100 arn...@gm...-20080403125139-8xub76j1xazhfxna 1101 po...@12...-20080403140544-13kockkjho883nb4 1102 po...@12...-20080403143012-bxghtoodiolugpbs 1103 arn...@gm...-20080403190809-bbi4bz5rfcvjnt20 1104 arn...@gm...-20080403205410-czxru1vcg1s4wcws 1105 arn...@gm...-20080403213124-54spdrwszgyimd90 1106 po...@12...-20080404002406-aj74x5tngi6mmmj1 1107 arn...@gm...-20080404122415-mjy07qzbaxyhagra 1108 po...@12...-20080404145445-84lyk5tyy3b3br14 1109 po...@12...-20080404231417-v4v8x7u3f0hm0ejc 1110 po...@12...-20080405001107-14d1ojjof8xhvcj8 1111 arn...@gm...-20080405071929-jmnrul21sxx04kky 1112 arn...@gm...-20080405080105-9qbda7be0pi7y1ai 1113 po...@12...-20080405154555-yuj2n5kyndfjlpsf 1114 po...@12...-20080405220250-8y09d0samsj8ja94 1115 po...@12...-20080406134101-4860ytb61sbu3yhg 1116 po...@12...-20080406155849-2wzxzuzs5m8zpk0g 1117 po...@12...-20080406164835-bv5dydhm3qqydsty 1118 arn...@gm...-20080406210237-c7tyfgiz2sjgv044 1119 po...@12...-20080407114423-4yajg1rffidq76bj 1120 arn...@gm...-20080407194826-c42t4bjzw4vflejn 1121 po...@12...-20080407214303-o7ul1bvcn6gvaoc9 1122 po...@12...-20080407220647-r7f3em92til5j67s 1123 po...@12...-20080408212439-54t3bqlhvw1nu4xc 1124 arn...@gm...-20080409193708-y6erfzwrcb1seet3 1125 arn...@gm...-20080409195827-ub6t2s3wdf28nfpz 1126 po...@12...-20080409215055-1zmqhhm2859878c1 1127 arn...@gm...-20080410102447-l4es4cbukkqwcnpc 1128 arn...@gm...-20080410214118-b70g50tl27cq9q29 1129 arn...@gm...-20080411074730-w1pu78qigtx87lx3 1130 arn...@gm...-20080411090724-kwdj9pg9hrv1xhwb 1131 po...@12...-20080411153057-tn7zhxqk0z7ceref 1132 arn...@gm...-20080411200946-ierqlg8v9vzj18n2 1133 arn...@gm...-20080411201718-ecshulwd7ic0wdci 1134 arn...@gm...-20080411204047-jc9vzcsf32j38dvc 1135 arn...@gm...-20080411205445-ojuz2a29yq8ww37j 1136 arn...@gm...-20080411214746-r420xmdgo35pkweb 1137 po...@12...-20080412010723-cibh8r0itlzqyt3f 1138 arn...@gm...-20080412200504-6qfeqnsghxgrk775 1139 arn...@gm...-20080413095435-2pkfb407hk8j54te 1140 arn...@gm...-20080413133927-zw2tpz8o8p3izyix 1141 arn...@gm...-20080413165025-ug342rxtq4blxck5 1142 arn...@gm...-20080413182618-6ihabn0tii6gb2m2 1143 arn...@gm...-20080413184517-9p08tedakta1h762 1144 arn...@gm...-20080413193655-kc98lx7kpzo42q43 1145 arn...@gm...-20080414132947-pguvkuzvyadukssc 1146 arn...@gm...-20080414133544-pxwxm9kcvw0k0vf3 1147 po...@12...-20080414174341-hw1im7ysymscpiq0 1148 arn...@gm...-20080414181459-5gu852lneflgf5d6 1149 po...@12...-20080414205719-d80e75fsl8zzi6je 1150 arn...@gm...-20080414211616-835ve71r1qdlbhb4 1151 arn...@gm...-20080415080409-4cid9q7opng8ijav 1152 arn...@gm...-20080415124540-roduj23x442jeefn 1153 arn...@gm...-20080415141450-cld2ym4s50uu31q7 1154 po...@12...-20080415143018-4emcs3u1fquzsu1f + 1027 arn...@gm...-20080323183926-schknwnkgeo7ivdn 1028 zouzou123gen-20080323220411-r8usuc3qxwuh7zsn 1029 zouzou123gen-20080323221249-0su72zaj13e706mk 1030 arn...@gm...-20080324140623-muba1dl46m000o8c 1031 zouzou123gen-20080324141933-qbgr93ugpe0297m6 1032 arn...@gm...-20080324153706-siidja05n84i00b1 1033 arn...@gm...-20080324153823-lhn3awurnu77riln 1034 arn...@gm...-20080324165650-zapppziji67yf5a2 1035 zouzou123gen-20080324175936-4mqc2kh0lo5wtdu2 1036 zouzou123gen-20080325004602-6wdsoym95mjuhwd3 1037 arn...@gm...-20080325100659-8fqy6q65itmghlep 1038 zouzou123gen-20080325175216-s297sdiucukfvijh 1039 arn...@gm...-20080325210137-3dfqyoi8ykosy087 1040 arn...@gm...-20080325211747-nwwy1eb33r071sca 1041 arn...@gm...-20080326084110-qbselrjckku275xi 1042 zouzou123gen-20080326123631-35642mgbk2i4ty32 1043 zouzou123gen-20080326124345-f4xwn2d3ty8ubd6r 1044 arn...@gm...-20080326162031-il0nyms30w0mky43 1045 arn...@gm...-20080326164801-8dru8mjc06xgzjpv 1046 arn...@gm...-20080326170438-uzl2rx8fqnohak7g 1047 zouzou123gen-20080326172821-d6uqcbmfb0c6rwlv 1048 arn...@gm...-20080326213257-qlgdh7m2712p2l0q 1049 arn...@gm...-20080326214313-ktnoekgk3s0wmatz 1050 arn...@gm...-20080326215256-0j1iqrf286b9g7zf 1051 arn...@gm...-20080327082121-hoi22wh1gwjdfbyd 1052 arn...@gm...-20080327120639-um3tukdt374rwvgm 1053 zouzou123gen-20080327130703-6vtek6uxy3vua543 1054 arn...@gm...-20080327215831-dmg5mkufskabwkro 1055 arn...@gm...-20080327231459-cdztcv25alsuyqmf 1056 arn...@gm...-20080328085925-gceybsr53oml1p24 1057 arn...@gm...-20080328200512-1sjuu6bcnl2dyd2a 1058 arn...@gm...-20080328210347-bussqjrm5mfswh7o 1059 arn...@gm...-20080329055630-braiir1dskv7a4qm 1060 arn...@gm...-20080329061558-rck8dz60wpj3c5ja 1061 arn...@gm...-20080329081253-if6o5jn329mbzfpl 1062 arn...@gm...-20080329081619-cb4x930j8sp55cs0 1063 arn...@gm...-20080329103216-hgjzo7ra2zixbztd 1064 arn...@gm...-20080329124042-q3aw4iodmo5kafyp 1065 arn...@gm...-20080329124926-2je1z18p0272zpua 1066 arn...@gm...-20080329150901-ehj9t32en7eps2dp 1067 zouzou123gen-20080329153653-36xlvpik2ns9r84r 1068 zouzou123gen-20080329162703-51xr8hg073pg7wq5 1069 zouzou123gen-20080329234706-8ddipdqu0xeudkql 1070 arn...@gm...-20080330081232-ubqr1171ewalrd4q 1071 zouzou123gen-20080330131607-yppbs3mgyjef1cux 1072 zouzou123gen-20080330134835-yv1nogy77ib1uehd 1073 zouzou123gen-20080331124549-alyw7vugdn30piqy 1074 zouzou123gen-20080331135108-q8frtqsin5bosfzm 1075 zouzou123gen-20080331140757-u94q52yccl5lsifk 1076 zouzou123gen-20080331152513-ue1x5qhigcw51348 1077 arn...@gm...-20080331184436-a8g6chibmg8nswls 1078 arn...@gm...-20080331220648-81485k28qmwruwz6 1079 zouzou123gen-20080401081001-2yjn07cf8s5sxr3a 1080 zouzou123gen-20080401081247-f3p4hdjojnd460jw 1081 zouzou123gen-20080401084117-24a454g8o0x656kg 1082 zouzou123gen-20080401133146-jabb5i8870fg6f66 1083 zouzou123gen-20080401154610-mxdqoo5bksru93e6 1084 arn...@gm...-20080401185530-lqj4tflt5ldmx46f 1085 arn...@gm...-20080401212616-ffl7m0xm8gt15knk 1086 arn...@gm...-20080402084515-ofmnwihzv159jton 1087 arn...@gm...-20080402133105-y70soi38owzl76i9 1088 arn...@gm...-20080402142417-rn2dbkx19wfz3vae 1089 arn...@gm...-20080402144459-u3z3hqvl8aqjc4a0 1090 zouzou123gen-20080402145051-zi8tmvy8u3r2mzu8 1091 arn...@gm...-20080402152137-f397uz1yp9qjvfwh 1092 zouzou123gen-20080402170355-29wda40wk3cy7lu5 1093 arn...@gm...-20080402180628-ipos9li0c4bsmq1h 1094 arn...@gm...-20080402181235-s2a6f4ww4lzayl46 1095 arn...@gm...-20080402193851-6mu64vgep6tijith 1096 arn...@gm...-20080402203810-86zpxsx69q83zf3r 1097 arn...@gm...-20080402204331-so2e8n892o23pejr 1098 poy-20080402224153-225qylr2cfwhqrg7 1099 mrmikejj-20080403125112-o8polh8rkn62umyh 1100 arn...@gm...-20080403125139-8xub76j1xazhfxna 1101 po...@12...-20080403140544-13kockkjho883nb4 1102 po...@12...-20080403143012-bxghtoodiolugpbs 1103 arn...@gm...-20080403190809-bbi4bz5rfcvjnt20 1104 arn...@gm...-20080403205410-czxru1vcg1s4wcws 1105 arn...@gm...-20080403213124-54spdrwszgyimd90 1106 po...@12...-20080404002406-aj74x5tngi6mmmj1 1107 arn...@gm...-20080404122415-mjy07qzbaxyhagra 1108 po...@12...-20080404145445-84lyk5tyy3b3br14 1109 po...@12...-20080404231417-v4v8x7u3f0hm0ejc 1110 po...@12...-20080405001107-14d1ojjof8xhvcj8 1111 arn...@gm...-20080405071929-jmnrul21sxx04kky 1112 arn...@gm...-20080405080105-9qbda7be0pi7y1ai 1113 po...@12...-20080405154555-yuj2n5kyndfjlpsf 1114 po...@12...-20080405220250-8y09d0samsj8ja94 1115 po...@12...-20080406134101-4860ytb61sbu3yhg 1116 po...@12...-20080406155849-2wzxzuzs5m8zpk0g 1117 po...@12...-20080406164835-bv5dydhm3qqydsty 1118 arn...@gm...-20080406210237-c7tyfgiz2sjgv044 1119 po...@12...-20080407114423-4yajg1rffidq76bj 1120 arn...@gm...-20080407194826-c42t4bjzw4vflejn 1121 po...@12...-20080407214303-o7ul1bvcn6gvaoc9 1122 po...@12...-20080407220647-r7f3em92til5j67s 1123 po...@12...-20080408212439-54t3bqlhvw1nu4xc 1124 arn...@gm...-20080409193708-y6erfzwrcb1seet3 1125 arn...@gm...-20080409195827-ub6t2s3wdf28nfpz 1126 po...@12...-20080409215055-1zmqhhm2859878c1 1127 arn...@gm...-20080410102447-l4es4cbukkqwcnpc 1128 arn...@gm...-20080410214118-b70g50tl27cq9q29 1129 arn...@gm...-20080411074730-w1pu78qigtx87lx3 1130 arn...@gm...-20080411090724-kwdj9pg9hrv1xhwb 1131 po...@12...-20080411153057-tn7zhxqk0z7ceref 1132 arn...@gm...-20080411200946-ierqlg8v9vzj18n2 1133 arn...@gm...-20080411201718-ecshulwd7ic0wdci 1134 arn...@gm...-20080411204047-jc9vzcsf32j38dvc 1135 arn...@gm...-20080411205445-ojuz2a29yq8ww37j 1136 arn...@gm...-20080411214746-r420xmdgo35pkweb 1137 po...@12...-20080412010723-cibh8r0itlzqyt3f 1138 arn...@gm...-20080412200504-6qfeqnsghxgrk775 1139 arn...@gm...-20080413095435-2pkfb407hk8j54te 1140 arn...@gm...-20080413133927-zw2tpz8o8p3izyix 1141 arn...@gm...-20080413165025-ug342rxtq4blxck5 1142 arn...@gm...-20080413182618-6ihabn0tii6gb2m2 1143 arn...@gm...-20080413184517-9p08tedakta1h762 1144 arn...@gm...-20080413193655-kc98lx7kpzo42q43 1145 arn...@gm...-20080414132947-pguvkuzvyadukssc 1146 arn...@gm...-20080414133544-pxwxm9kcvw0k0vf3 1147 po...@12...-20080414174341-hw1im7ysymscpiq0 1148 arn...@gm...-20080414181459-5gu852lneflgf5d6 1149 po...@12...-20080414205719-d80e75fsl8zzi6je 1150 arn...@gm...-20080414211616-835ve71r1qdlbhb4 1151 arn...@gm...-20080415080409-4cid9q7opng8ijav 1152 arn...@gm...-20080415124540-roduj23x442jeefn 1153 arn...@gm...-20080415141450-cld2ym4s50uu31q7 1154 po...@12...-20080415143018-4emcs3u1fquzsu1f 1155 arn...@gm...-20080415174958-wfqu5kga5pe39xvc Modified: dcplusplus/trunk/dwt/include/dwt/Application.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/Application.h 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/include/dwt/Application.h 2008-04-24 13:08:55 UTC (rev 1180) @@ -43,9 +43,8 @@ #include "xCeption.h" #include <vector> #include <list> -#include <map> +#include <functional> #include <boost/noncopyable.hpp> -#include "Message.h" #ifdef _MSC_VER #ifndef WINCE @@ -106,11 +105,6 @@ */ static Application & instance(); - /// Returns the HINSTANCE to the process - /** Returns the handle to the process. - */ - HINSTANCE getAppHandle(); - /// Returns the path to the process /** NOTE! <br> * This function returns the PATH to the application WITHOUT the process image @@ -147,7 +141,7 @@ /// The initialization that must be done first. /** Used internally by the WinMain function, and externally for DLL initialization. */ - static void init( HINSTANCE hInstance, int nCmdShow ); + static void init( int nCmdShow ); /// Shut down operations static void uninit(); @@ -201,9 +195,6 @@ // The "one and only" object of type Application... static Application * itsInstance; - // The global HINSTANCE given in the WinMain function - const HINSTANCE itsHInstance; - int itsCmdShow; // Command line parameters @@ -219,7 +210,7 @@ FilterList filters; // Private Constructor to ensure Singleton Implementation - Application( HINSTANCE hInst, int nCmdShow ); + Application( int nCmdShow ); }; } Modified: dcplusplus/trunk/dwt/include/dwt/LibraryLoader.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/LibraryLoader.h 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/include/dwt/LibraryLoader.h 2008-04-24 13:08:55 UTC (rev 1180) @@ -38,11 +38,10 @@ #include "WindowsHeaders.h" #include "tstring.h" -#include "Threads.h" #include "xCeption.h" -#include <map> -#include <utility> +#include <boost/noncopyable.hpp> + namespace dwt { /// Class for helping loading of libraries or dlls @@ -67,8 +66,7 @@ * EXACT SAME arguments! <br> * See example usage in RichTextBox.h */ -class LibraryLoader -{ +class LibraryLoader : private boost::noncopyable { public: /// Constructor loading the given library /** Constructor loading the given library unless library is loaded from before. @@ -94,8 +92,6 @@ */ void load( const tstring & libraryName ); - - /// Get procedure address from loaded library by name /** Allows you get a procedure address from the dll. * Example: <br> @@ -122,13 +118,7 @@ static DWORD getCommonControlsVersion(); private: - LibraryLoader( const LibraryLoader & ); // DENY COPY - LibraryLoader & operator =( const LibraryLoader & ); // DENY ASSIGNMENT - tstring itsLibraryName; HMODULE itsHMod; - static Utilities::CriticalSection itsCs; - static std::map< tstring, std::pair< int, HMODULE > > itsLibrariesLoaded; - bool hasCalledLoad; }; } Modified: dcplusplus/trunk/dwt/include/dwt/resources/Accelerator.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/resources/Accelerator.h 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/include/dwt/resources/Accelerator.h 2008-04-24 13:08:55 UTC (rev 1180) @@ -32,7 +32,6 @@ #ifndef DWT_ACCELERATOR_H_ #define DWT_ACCELERATOR_H_ -#include "../Application.h" #include "Handle.h" #include <boost/intrusive_ptr.hpp> @@ -54,7 +53,7 @@ typedef boost::intrusive_ptr< Accelerator > AcceleratorPtr; inline Accelerator::Accelerator(Widget* widget_, unsigned id) : - ResourceType(::LoadAccelerators(Application::instance().getAppHandle(), MAKEINTRESOURCE(id))), + ResourceType(::LoadAccelerators(::GetModuleHandle(NULL), MAKEINTRESOURCE(id))), widget(widget_) { Modified: dcplusplus/trunk/dwt/include/dwt/widgets/Menu.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/widgets/Menu.h 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/include/dwt/widgets/Menu.h 2008-04-24 13:08:55 UTC (rev 1180) @@ -44,7 +44,7 @@ #include <memory> #include <vector> -#include <map> +#include <tr1/unordered_map> namespace dwt { @@ -462,7 +462,7 @@ // if true title is drawn as sidebar bool drawSidebar; - typedef std::map<unsigned, Widget::CallbackType> CallbackMap; + typedef std::tr1::unordered_map<unsigned, Widget::CallbackType> CallbackMap; CallbackMap callbacks; void createHelper(const Seed& cs); Modified: dcplusplus/trunk/dwt/src/Application.cpp =================================================================== --- dcplusplus/trunk/dwt/src/Application.cpp 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/src/Application.cpp 2008-04-24 13:08:55 UTC (rev 1180) @@ -59,9 +59,9 @@ /** Initializes the runtime for SmartWin++ Typically only called by WinMain or DllMain. */ -void Application::init( HINSTANCE hInstance, int nCmdShow ) +void Application::init( int nCmdShow ) { - itsInstance = new Application( hInstance, nCmdShow ); + itsInstance = new Application(nCmdShow ); #ifndef WINCE BOOL enable; @@ -128,16 +128,11 @@ return retVal; } -HINSTANCE Application::getAppHandle() +Application::Application( int nCmdShow ) + : itsCmdShow(nCmdShow) { - return itsHInstance; } -Application::Application( HINSTANCE hInst, int nCmdShow ) - : itsHInstance( hInst ), itsCmdShow(nCmdShow) -{ -} - const CommandLine & Application::getCommandLine() const { return itsCmdLine; @@ -208,7 +203,7 @@ { if ( 0 == itsInstance ) { - init( ::GetModuleHandle( NULL ), 0 ); + init(0); } return * itsInstance; } @@ -355,7 +350,7 @@ unsigned int retVal = 0; bool corruptMemMemLeak = false; - dwt::Application::init( hInstance, nCmdShow ); + dwt::Application::init( nCmdShow ); try { retVal = SmartWinMain( dwt::Application::instance() ); // Call library user's startup function. dwt::Application::uninit(); Modified: dcplusplus/trunk/dwt/src/Bitmap.cpp =================================================================== --- dcplusplus/trunk/dwt/src/Bitmap.cpp 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/src/Bitmap.cpp 2008-04-24 13:08:55 UTC (rev 1180) @@ -35,7 +35,6 @@ #include <dwt/resources/Bitmap.h> #include <dwt/Point.h> -#include <dwt/Application.h> namespace dwt { @@ -44,14 +43,14 @@ {} Bitmap::Bitmap( unsigned resourceId, unsigned flags ) - : ResourceType( ( HBITMAP )::LoadImage( Application::instance().getAppHandle(), MAKEINTRESOURCE( resourceId ), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION ) ) + : ResourceType( ( HBITMAP )::LoadImage( ::GetModuleHandle(NULL), MAKEINTRESOURCE( resourceId ), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION ) ) {} Bitmap::Bitmap( const tstring & filePath, unsigned flags ) #ifdef WINCE : itsBitmap( ::SHLoadImageFile( filePath.c_str() ) ) #else - : ResourceType( ( HBITMAP )::LoadImage( Application::instance().getAppHandle(), filePath.c_str(), IMAGE_BITMAP, 0, 0, flags | LR_LOADFROMFILE ) ) + : ResourceType( ( HBITMAP )::LoadImage( ::GetModuleHandle(NULL), filePath.c_str(), IMAGE_BITMAP, 0, 0, flags | LR_LOADFROMFILE ) ) #endif {} Modified: dcplusplus/trunk/dwt/src/Icon.cpp =================================================================== --- dcplusplus/trunk/dwt/src/Icon.cpp 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/src/Icon.cpp 2008-04-24 13:08:55 UTC (rev 1180) @@ -34,7 +34,6 @@ */ #include <dwt/resources/Icon.h> -#include <dwt/Application.h> namespace dwt { @@ -43,14 +42,14 @@ {} Icon::Icon( unsigned resourceId ) - : ResourceType(::LoadIcon( Application::instance().getAppHandle(), MAKEINTRESOURCE( resourceId ) ) ) + : ResourceType(::LoadIcon(::GetModuleHandle(NULL), MAKEINTRESOURCE( resourceId ) ) ) {} Icon::Icon( const tstring & filePath ) #ifdef WINCE - : itsIcon( ::LoadIcon( Application::instance().getAppHandle(), filePath.c_str() ) ) + : itsIcon( ::LoadIcon(::GetModuleHandle(NULL), filePath.c_str() ) ) #else - : ResourceType( (HICON)::LoadImage( Application::instance().getAppHandle(), filePath.c_str(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE ) ) + : ResourceType( (HICON)::LoadImage(::GetModuleHandle(NULL), filePath.c_str(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE ) ) #endif {} Modified: dcplusplus/trunk/dwt/src/ImageList.cpp =================================================================== --- dcplusplus/trunk/dwt/src/ImageList.cpp 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/src/ImageList.cpp 2008-04-24 13:08:55 UTC (rev 1180) @@ -34,7 +34,6 @@ */ #include <dwt/resources/ImageList.h> -#include <dwt/Application.h> #include <dwt/xCeption.h> namespace dwt { Modified: dcplusplus/trunk/dwt/src/LibraryLoader.cpp =================================================================== --- dcplusplus/trunk/dwt/src/LibraryLoader.cpp 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/src/LibraryLoader.cpp 2008-04-24 13:08:55 UTC (rev 1180) @@ -33,103 +33,69 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <dwt/WindowsHeaders.h> #include <dwt/LibraryLoader.h> -#include <utility> namespace dwt { -// Static members definitions! -Utilities::CriticalSection LibraryLoader::itsCs; -std::map< tstring, std::pair< int, HMODULE > > LibraryLoader::itsLibrariesLoaded; +LibraryLoader::LibraryLoader( const tstring & libraryName ) : + itsHMod(NULL) +{ + load(libraryName); +} -LibraryLoader::~LibraryLoader() +LibraryLoader::LibraryLoader() : + itsHMod(NULL) { - // Need a lock here since we're accessing the shared static version of its map! - Utilities::ThreadLock lock( LibraryLoader::itsCs ); +} - if ( !hasCalledLoad ) - return; - - // Decreasing reference count - LibraryLoader::itsLibrariesLoaded[itsLibraryName].first -= 1; - - // Checking to see if last instance and if so freeing library and removing map entry - if ( 0 == LibraryLoader::itsLibrariesLoaded[itsLibraryName].first ) - { - ::FreeLibrary( LibraryLoader::itsLibrariesLoaded[itsLibraryName].second ); - LibraryLoader::itsLibrariesLoaded.erase( itsLibraryName ); +LibraryLoader::~LibraryLoader() { + if(itsHMod != NULL) { + ::FreeLibrary(itsHMod); } } void LibraryLoader::load( const tstring & libraryName ) { - // Need a lock here since we're accessing the shared static version of its map! - Utilities::ThreadLock lock( LibraryLoader::itsCs ); - // VERY important we DON'T increase refcount or anything like that - if ( hasCalledLoad ) - { + if ( itsHMod != NULL ) { xCeption x( _T( "Already called load on LibraryLoader object" ) ); throw x; } - itsLibraryName = libraryName; + // Loading library + itsHMod = ::LoadLibrary( libraryName.c_str() ); - hasCalledLoad = true; - - std::map< tstring, std::pair< int, HMODULE > >::const_iterator exists = LibraryLoader::itsLibrariesLoaded.find( libraryName ); - if ( LibraryLoader::itsLibrariesLoaded.end() == exists ) - { - // Loading library - itsHMod = ::LoadLibrary( libraryName.c_str() ); - - // TODO: Rewrite xAssert to get support for submitting tstrings (could show library name) - xAssert( itsHMod != 0, _T( "Error while trying to load library or dll!" ) ); - - // SUCCESS! - itsLibrariesLoaded[libraryName].second = itsHMod; - itsLibrariesLoaded[libraryName].first = 1; - } - else - { - itsLibrariesLoaded[libraryName].first += 1; - } + // TODO: Rewrite xAssert to get support for submitting tstrings (could show library name) + xAssert( itsHMod != 0, _T( "Error while trying to load library or dll!" ) ); } -LibraryLoader::LibraryLoader( const tstring & libraryName ) - : itsLibraryName( libraryName ), - hasCalledLoad( false ) -{ - load( libraryName ); -} - -LibraryLoader::LibraryLoader() - : hasCalledLoad( false ) -{ -} - // Get procedure address from loaded library by name -FARPROC LibraryLoader::getProcAddress( const tstring & procedureName ) -{ +FARPROC LibraryLoader::getProcAddress( const tstring & procedureName ) { return ::GetProcAddress( itsHMod, util::AsciiGuaranteed::doConvert( procedureName, util::ConversionCodepage::ANSI ).c_str() ); } // Get procedure address from loaded library by ordinal value -FARPROC LibraryLoader::getProcAddress( long procedureOrdinal ) -{ +FARPROC LibraryLoader::getProcAddress( long procedureOrdinal ) { return ::GetProcAddress( itsHMod, (LPCSTR)0 + procedureOrdinal ); } DWORD LibraryLoader::getCommonControlsVersion() { - LibraryLoader lib(_T("comctl32.dll")); - DLLGETVERSIONPROC pDllGetVersion = (DLLGETVERSIONPROC)lib.getProcAddress(_T("DllGetVersion")); - if(pDllGetVersion) { - DLLVERSIONINFO dvi = { sizeof(dvi) }; - if(SUCCEEDED((*pDllGetVersion)(&dvi))) - return PACK_COMCTL_VERSION(dvi.dwMajorVersion, dvi.dwMinorVersion); + static DWORD version = 0; + if(version == 0) { + try { + LibraryLoader lib(_T("comctl32.dll")); + DLLGETVERSIONPROC pDllGetVersion = (DLLGETVERSIONPROC)lib.getProcAddress(_T("DllGetVersion")); + if(pDllGetVersion) { + DLLVERSIONINFO dvi = { sizeof(dvi) }; + if(SUCCEEDED((*pDllGetVersion)(&dvi))) { + version = PACK_COMCTL_VERSION(dvi.dwMajorVersion, dvi.dwMinorVersion); + } + } + } catch(...) { + // Ignore loading exceptions... + } } - return 0; + return version; } } Modified: dcplusplus/trunk/dwt/src/Widget.cpp =================================================================== --- dcplusplus/trunk/dwt/src/Widget.cpp 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/src/Widget.cpp 2008-04-24 13:08:55 UTC (rev 1180) @@ -47,8 +47,6 @@ #include <dwt/Widget.h> -#include <dwt/Threads.h> -#include <dwt/Application.h> #include <dwt/xCeption.h> namespace dwt { @@ -79,7 +77,7 @@ cs.location.x(), cs.location.y(), cs.location.width(), cs.location.height(), itsParent ? itsParent->handle() : 0, cs.menuHandle, - Application::instance().getAppHandle(), + ::GetModuleHandle(NULL), reinterpret_cast< LPVOID >( this ) ); if (!hWnd) { Modified: dcplusplus/trunk/dwt/src/WindowClass.cpp =================================================================== --- dcplusplus/trunk/dwt/src/WindowClass.cpp 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/src/WindowClass.cpp 2008-04-24 13:08:55 UTC (rev 1180) @@ -30,7 +30,6 @@ */ #include <dwt/WindowClass.h> -#include <dwt/Application.h> #include <dwt/xCeption.h> #include <dwt/Widget.h> @@ -49,7 +48,7 @@ wc.hIcon = icon ? icon->handle() : NULL; wc.hIconSm = smallIcon ? icon->handle() : NULL; wc.hCursor = cursor; - wc.hInstance = Application::instance().getAppHandle(); + wc.hInstance = ::GetModuleHandle(NULL); wc.lpszClassName = className.c_str(); atom = ::RegisterClassEx(&wc); @@ -62,7 +61,7 @@ WindowClass::~WindowClass() { if(atom != 0) { - ::UnregisterClass(getClassName(), Application::instance().getAppHandle()); + ::UnregisterClass(getClassName(), ::GetModuleHandle(NULL)); } } Modified: dcplusplus/trunk/dwt/src/widgets/MDIChild.cpp =================================================================== --- dcplusplus/trunk/dwt/src/widgets/MDIChild.cpp 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/src/widgets/MDIChild.cpp 2008-04-24 13:08:55 UTC (rev 1180) @@ -31,8 +31,6 @@ #include <dwt/widgets/MDIChild.h> -#include <dwt/Application.h> - namespace dwt { MDIChild::Seed::Seed(const tstring& caption) : @@ -51,7 +49,7 @@ cs.style, cs.location.x(), cs.location.y(), cs.location.width(), cs.location.height(), getParent()->handle(), - Application::instance().getAppHandle(), + ::GetModuleHandle(NULL), reinterpret_cast< LPARAM >( static_cast< Widget * >( this ) ) ); if(active) { Modified: dcplusplus/trunk/dwt/src/widgets/MDIParent.cpp =================================================================== --- dcplusplus/trunk/dwt/src/widgets/MDIParent.cpp 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/src/widgets/MDIParent.cpp 2008-04-24 13:08:55 UTC (rev 1180) @@ -30,7 +30,6 @@ */ #include <dwt/widgets/MDIParent.h> -#include <dwt/Application.h> namespace dwt { @@ -54,7 +53,7 @@ cs.location.x(), cs.location.y(), cs.location.width(), cs.location.height(), this->getParent() ? this->getParent()->handle() : 0, NULL, - Application::instance().getAppHandle(), + ::GetModuleHandle(NULL), reinterpret_cast< LPVOID >( &ccs ) ); if ( !wnd ) { Modified: dcplusplus/trunk/dwt/src/widgets/ModalDialog.cpp =================================================================== --- dcplusplus/trunk/dwt/src/widgets/ModalDialog.cpp 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/src/widgets/ModalDialog.cpp 2008-04-24 13:08:55 UTC (rev 1180) @@ -30,7 +30,6 @@ */ #include <dwt/widgets/ModalDialog.h> -#include <dwt/Application.h> namespace dwt { @@ -38,16 +37,10 @@ { // this will not return until the dialog is closed by calling endDialog() with // a retv - // - INT_PTR retv = ::DialogBoxParam - ( ( Application::instance().getAppHandle() ) - , ( MAKEINTRESOURCE( resourceId ) ) - , ( this->getParent() ? this->getParent()->handle() : 0 ) - , ( (DLGPROC)&ThisType::wndProc ) - , ( reinterpret_cast< LPARAM >( dynamic_cast< Widget * >( this ) ) ) - ); - if ( retv == - 1 ) - { + INT_PTR retv = ::DialogBoxParam(::GetModuleHandle(NULL), MAKEINTRESOURCE( resourceId ), + this->getParent() ? this->getParent()->handle() : 0, (DLGPROC)&ThisType::wndProc, + reinterpret_cast< LPARAM >(static_cast< Widget * >( this )) ); + if ( retv == - 1 ) { throw xCeption( _T( "Couldn't create modal dialog" ) ); } return static_cast< int >( retv ); @@ -64,8 +57,7 @@ // a retv // INT_PTR retv = ::DialogBoxIndirectParam - ( Application::instance().getAppHandle() // HINSTANCE hInstance - , ( DLGTEMPLATE * ) dlg_menu_winclass_title // LPCDLGTEMPLATE hDialogTemplate + ( ::GetModuleHandle(NULL), ( DLGTEMPLATE * ) dlg_menu_winclass_title , this->getParent() ? this->getParent()->handle() : 0 // HWND hWndParent , (DLGPROC)&ThisType::wndProc // DLGPROC lpDialogFunc , reinterpret_cast< LPARAM >( dynamic_cast< Widget * >( this ) ) Modified: dcplusplus/trunk/dwt/src/widgets/ModelessDialog.cpp =================================================================== --- dcplusplus/trunk/dwt/src/widgets/ModelessDialog.cpp 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/dwt/src/widgets/ModelessDialog.cpp 2008-04-24 13:08:55 UTC (rev 1180) @@ -31,13 +31,11 @@ #include <dwt/widgets/ModelessDialog.h> -#include <dwt/Application.h> - namespace dwt { void ModelessDialog::createDialog( unsigned resourceId ) { - HWND wnd = ::CreateDialogParam( Application::instance().getAppHandle(), + HWND wnd = ::CreateDialogParam( ::GetModuleHandle(NULL), MAKEINTRESOURCE( resourceId ), ( this->getParent() ? this->getParent()->handle() : 0 ), ( (DLGPROC)&ThisType::wndProc ), Modified: dcplusplus/trunk/win32/WidgetPaned.h =================================================================== --- dcplusplus/trunk/win32/WidgetPaned.h 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/win32/WidgetPaned.h 2008-04-24 13:08:55 UTC (rev 1180) @@ -215,6 +215,7 @@ ::MoveWindow(children.second->handle(), right.x(), right.y(), right.width(), right.height(), TRUE); this->setBounds(rcSplit); + this->redraw(rcSplit); } #endif Modified: dcplusplus/trunk/win32/stdafx.h =================================================================== --- dcplusplus/trunk/win32/stdafx.h 2008-04-24 13:06:52 UTC (rev 1179) +++ dcplusplus/trunk/win32/stdafx.h 2008-04-24 13:08:55 UTC (rev 1180) @@ -28,6 +28,7 @@ #include <libintl.h> #include <dwt/WidgetFactory.h> +#include <dwt/Application.h> #include <dwt/resources/Accelerator.h> #include <dwt/resources/Pen.h> #include <dwt/widgets/Button.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |