[Haiku-commits] r30977 - haiku/trunk/src/preferences/mouse

stpere at mail.berlios.de stpere at mail.berlios.de
Fri Jun 5 23:23:22 CEST 2009


Author: stpere
Date: 2009-06-05 23:21:06 +0200 (Fri, 05 Jun 2009)
New Revision: 30977
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=30977&view=rev

Removed:
   haiku/trunk/src/preferences/mouse/MouseBitmap.h
Modified:
   haiku/trunk/src/preferences/mouse/Mouse.rdef
   haiku/trunk/src/preferences/mouse/MouseView.cpp
Log:
Load the bitmaps from resources rather than from a byte array in a 
header. Fixing a TODO in MouseView.cpp

This patch was in ticket #3754. (Thanks to Axel for the reminder and 
thanks to Brecht for your help extracting the images from the header!)


Modified: haiku/trunk/src/preferences/mouse/Mouse.rdef
===================================================================
--- haiku/trunk/src/preferences/mouse/Mouse.rdef	2009-06-05 15:59:21 UTC (rev 30976)
+++ haiku/trunk/src/preferences/mouse/Mouse.rdef	2009-06-05 21:21:06 UTC (rev 30977)
@@ -302,3 +302,92 @@
 	$"8C420000984100008C4200000842430000FF00008C4200000C4200008C420000"
 	$"484200"
 };
+
+resource(604, "mouse_bmap") #'bits' array {
+	$"89504E470D0A1A0A0000000D4948445200000039000000520806000000EE2B7C"
+	$"1C000000017352474200AECE1CE900000006624B474400FF00FF00FFA0BDA793"
+	$"000000097048597300000B1300000B1301009A9C180000000774494D4507D904"
+	$"0B17142E3075A9E9000007474944415478DAE55CA176E34A0CD5FA0484C59F10"
+	$"1858D67E46685960616160580B0B0BFD09FD84C2C2C0941926CC6561FBC03BE3"
+	$"A328F74AB2B3D9D79E6792C68EC7A3917475258DFB6BB7DBFD962B1F4DD3C86A"
+	$"B5121191CD66D3FF3D9FCFE56F1C95FC0F8E5FD7D464D334F07CDBB6BD36FF86"
+	$"4627D714F0E9E9895EBFBFBFEF056DDBF6AA825E45934DD3C8CDCD4DF8BBB7B7"
+	$"371191AB6BF58F0B196930D2EA35047585643EF59D0EBD38837CB208B75C2EBF"
+	$"BD909BCDE6E433D4A4156EB1585C6D72C7E351A6D3E9E87BBAAE93BAAEA5EB3A"
+	$"111159AFD7BD66ADB9F742364D7315E13C61D8357BBEEB3A994EA7723C1EE938"
+	$"E5DAF3F3F319D9383357BD0AB3D9EC6221BD31D8357B3E9AC7E7E7672FEC6AB5"
+	$"EA1956094D13ADC5F97CDEAFE06C3693AFAFAF9469653582BE1F8F47A9EB1A9E"
+	$"2BA668EF2F5AB39F45E32EAD2B03CC6633391C0E67E7B30296DF96F3E83B9A50"
+	$"D7752713F64CD3CEA7FCBEEB3A592E973DBEB46D2B95D6A29E48C6D790206851"
+	$"EC8A6BF0289F4C284F30FB5C36864BD0F54DD3E9F464A53DAD14EDA28716818A"
+	$"89B289DB85B1CFD4BF29CFAFEBBA9F0F8C937A80E2E8DA57CA40560BCC67B4AF"
+	$"216D9705B38BA32D412F1E7397F29BFD7E1F9381F240BB5A7A1122F0B1F7E885"
+	$"40E6CB0460DFED18FA7CD1E27EBF3FBBBFCA808B36CBF2A9B5AC1FE4F9AF5D04"
+	$"F45D9F4748EAC5D23207AB8C6A2803F1D08F397EB4801E60A1FBEC73F4770462"
+	$"D5D08978E8C6263666DC31085F2C8C6A32130FB3146E8845448B63E754B48400"
+	$"4B447C9FB4AB12810BF2270B24DEC26440C71390B90D5AE4AB953F1822226BC9"
+	$"98774640661155163CB2020DA17F11C0447342088F9E31413716627E0968D8C0"
+	$"EEF15C3431E47B568BF63E4D444273B5748E05733BB89D10FADB9A2C03109685"
+	$"308191BFA78BCB2C605B0767BE8678288A8508603C7231240A8442B2958ED8CA"
+	$"1870B15A8C7C35EBF7833539368646F14F53330FFCBC6BCC27CF184F1944F347"
+	$"ED735E9E38445BE81A334FFB1B86092CD69F7157941E6901F5805E29023D4CDF"
+	$"97D15294246779F7043D68B7DBFD2735545495CB70EABAAE219D83427E7C7CFC"
+	$"98CAB93D4A19152D4A2FE476BBED857B7D7DFD71423E3C3CD09AF14444E4E5E5"
+	$"E5443816DF5828F17C8C8189364D66922831463EBC582CFA8232B2C28988C8E3"
+	$"E3A3DCDEDECAE170804082268180C822A4CDF3509D55331BE48F5EF5BC8CB9DD"
+	$"6EFBB920617B733D1C0E7DB8B0AB6C611A71C83271DDA32863E9CA9C46EF4C7C"
+	$"D5F7B2D44B8F57040EC98015C6C620CB31112DB3953D2FF78C2A725E7E9AC95D"
+	$"27CC571821462C8569C59A21ABC5322D659A3C8C76A668DD9FACD3583291A900"
+	$"6866C3DA09D6D2422123CE9869ECB0872066E46940FB34BB6EC14DD34F2AA406"
+	$"8F6C26C2BA48993093613143AB85A92CC4EB243161232D4642793136AA1AB0B0"
+	$"E60A995D3D1D3658963FB66E8BC24286607873A8BC1562E0A3BB470C4C6C553B"
+	$"6ADA6404B4097536FFADBC5C8D998A662ED92CC1D37499785DD730EEB21A4FD4"
+	$"FC3D8B9388CDB0029345E3284EA289977B34AD8BAA102856A3D0E45606B42699"
+	$"4659239615A150F3B63C27E2ADCC95180086D53A8F41204D46250C1617757375"
+	$"4821DB03C588DAD1AE96573745B68F80E6129445E18351C2E8A8221AE7D55D51"
+	$"31D8D3A007221E4BF2B4A9018801DB2422E0ACDB8B5670487DC6EB2267CA90F6"
+	$"7E6F6EB475E7B507B2DBC88694243DDA57428B87071E11A9B24EEC858B28948C"
+	$"69CA226D7A69DA45BD10869A8C85B02C652C2869E16CBCCDF2E6CACB34221FCC"
+	$"80855784F23638E805D41506D6646280E8A22BAB162058CF6AC726C3688CF277"
+	$"B429902134B2A6CA737C2D1822D943DAE088FD20ADD95D6088E0B3189E46D708"
+	$"E2197A46E062358834A5358AC64685B50C25A48CC74BB7F4EEA7085C8AF68600"
+	$"8EC77E50B9236AF8545E29839996AEB17A486C4B932CA388EA3E085133254CAA"
+	$"49560D1F0A34DA9F581DC66E588CF6BCA27662C675AAA184389B287B714D27DE"
+	$"1E2563355EA4758F69550CF9A2EDD1511CD4ED864C59F392FA6F1A78BC7D715A"
+	$"7034982E2ED938171596B38B1891F014F0B02CC46332DA7791EF0DE957A0A01E"
+	$"9532B35611321E5676C830996833A297B722D28DC031B39D26DC91C59A2FF635"
+	$"22AB49B4A38A8580689361761B6A6AF7078A732CFBB042587F8E6AA3515E9A49"
+	$"C33239F0992651AC625A1C92BDB38A41A6B560F7118D39AA4CF269C34AB40533"
+	$"33F98C4F458BC198142D2E479B65CBB1DFEF21C8B0B4C78B6D430B5DD1BB5FEC"
+	$"591364AACC3C6DB778A8063D7061C22253CD6C4B3D31D7F57ADDBF401D4D96F5"
+	$"4A86EC66646126EA7F64626DB9A65FF19FCFE75295D77F501E87B274E453C8DF"
+	$"B29B0B87D67CC6B09E4AE4DF5764DFDFDF4FCC96B5F1582D05759C325AC8D45F"
+	$"F5C2D97EA85DD4DD6E17BF095BCC52BFE0C5B4C538E9252FD1780529AF5AE1B9"
+	$"CCC98BDBE50DEFBBBB3BB8D533B33D2CF382E8986A5FF4BBB66DA558A5D6E299"
+	$"905A586FD761C43E2E6D210C39AC7056402AA4D6EA773FEC3F5340FF6DC2FD8F"
+	$"1165957EC2E1FD2B8D6AEC8DDF49B8689EFF005C55DCD2263C579C0000000049"
+	$"454E44AE426082"
+};
+
+resource(605, "pressed_mouse_bmap") #'bits' array {
+	$"89504E470D0A1A0A0000000D49484452000000380000001D0802000000708538"
+	$"CC000000017352474200AECE1CE9000000097048597300000B1300000B130100"
+	$"9A9C180000000774494D4507D9040B162E2CFA107C8B000001E54944415458C3"
+	$"CD58BBB583300C557C285452B241283382BB64848C4049999211283342CA9494"
+	$"E9B242CA8CE0D2E52BF4A2A3671BE30789830A8EB1FCB95C5D19C1E6F1788067"
+	$"4DD320A2B536FFF57C3EFB78B6DB6D118478381CE04B763C1E01E072B938FD1B"
+	$"6694206AAD01A02C4B7F097AE2F4FEB8CBF71A63CAB234C630D0BEEFABAA2246"
+	$"7F81364D432C12C420D06CF67C3EA971BD5EBBAE0380FD7EFF27F48C921E2B83"
+	$"C537D25A775D475815D319448988EF8542B7E665E91395C3A8E31E13E53C888C"
+	$"3271AE3166B7DB9D4E27005092CE441BCB0F1F81E46F6128D4E4A0B1ED27C99B"
+	$"9D91B41A4D67528AE050DE43EE1764452E4A571E362F237D7990D28A389D1156"
+	$"E2AC2F4C3BCA16FBB2D1D0073340825E12D974D088C889ABE685E35D2CC6E3C3"
+	$"74A602FD8A51993291F5996D2C38B25FAD0DE5D87B51AD16256B94E0AA55455C"
+	$"9E248E468BCF25F2124572B5CA35ABFA57DDF5169B3C80E5A9F4B5D0CB57EE24"
+	$"4192D12233D0F4AA5C7EF465051AC1177421A23126ACD18F0A34224DDF25651A"
+	$"AEF0F3336AADF55D14EED8F124E73827D9C2FEF470C9C1018DD247EA300C2C0B"
+	$"A791B3BFAA2AE7990B4649106FB7DB1ACA14FA0F52D735A3DF68AD29B9866160"
+	$"01904FCA99DBC19239D8C909E11016F9C22124F4770411DBB6A5C6FD7EFF01F7"
+	$"2616EDC24D58E30000000049454E44AE426082"
+};
+

Deleted: haiku/trunk/src/preferences/mouse/MouseBitmap.h

Modified: haiku/trunk/src/preferences/mouse/MouseView.cpp
===================================================================
--- haiku/trunk/src/preferences/mouse/MouseView.cpp	2009-06-05 15:59:21 UTC (rev 30976)
+++ haiku/trunk/src/preferences/mouse/MouseView.cpp	2009-06-05 21:21:06 UTC (rev 30977)
@@ -6,6 +6,7 @@
  *		Jérôme Duval,
  *		Andrew McCall (mccall at digitalparadise.co.uk)
  *		Axel Dörfler (axeld at pinc-software.de)
+ *		Philippe Saint-Pierre stpere at gmail.com
  */
 
 #include "MouseView.h"
@@ -21,9 +22,9 @@
 #include <Slider.h>
 #include <TextControl.h>
 #include <TranslationUtils.h>
+#include <TranslatorFormats.h>
 #include <Window.h>
 
-#include "MouseBitmap.h"
 #include "MouseConstants.h"
 #include "MouseSettings.h"
 #include "MouseWindow.h"
@@ -83,16 +84,9 @@
 	fButtons(0),
 	fOldButtons(0)
 {
-	fMouseBitmap = new BBitmap(BRect(0, 0, kMouseWidth - 1, kMouseHeight - 1), B_CMAP8);
-	fMouseBitmap->SetBits(kMouseBits, sizeof(kMouseBits), 0, kMouseColorSpace);
+	fMouseBitmap = BTranslationUtils::GetBitmap("mouse_bmap");
+	fMouseDownBitmap = BTranslationUtils::GetBitmap("pressed_mouse_bmap");
 
-	fMouseDownBitmap = new BBitmap(BRect(0, 0, kMouseDownWidth - 1, kMouseDownHeight - 1), B_CMAP8);
-	fMouseDownBitmap->SetBits(kMouseDownBits, sizeof(kMouseDownBits), 0, kMouseDownColorSpace);
-
-	// ToDo: move these images to the resources as well
-	//fMouseBitmap = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "mouse_bmap");
-	//fMouseDownBitmap = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "pressed_mouse_bmap");
-
 	fMouseDownBounds = fMouseDownBitmap->Bounds();
 	SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
 }




More information about the Haiku-commits mailing list