You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(531) |
Nov
(322) |
Dec
(620) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(672) |
Feb
(420) |
Mar
(614) |
Apr
(560) |
May
(315) |
Jun
(257) |
Jul
(222) |
Aug
(328) |
Sep
(46) |
Oct
(203) |
Nov
(297) |
Dec
(196) |
2003 |
Jan
(216) |
Feb
(471) |
Mar
(234) |
Apr
(308) |
May
(280) |
Jun
(232) |
Jul
(155) |
Aug
(412) |
Sep
(906) |
Oct
(440) |
Nov
(269) |
Dec
(415) |
2004 |
Jan
(525) |
Feb
(320) |
Mar
(113) |
Apr
(205) |
May
(217) |
Jun
(43) |
Jul
(29) |
Aug
|
Sep
(80) |
Oct
(74) |
Nov
|
Dec
(13) |
2005 |
Jan
(10) |
Feb
(44) |
Mar
(57) |
Apr
(42) |
May
(51) |
Jun
(41) |
Jul
(65) |
Aug
(31) |
Sep
(51) |
Oct
(79) |
Nov
(94) |
Dec
(113) |
2006 |
Jan
(47) |
Feb
(40) |
Mar
(29) |
Apr
(41) |
May
(33) |
Jun
(51) |
Jul
(28) |
Aug
(56) |
Sep
(45) |
Oct
(7) |
Nov
(3) |
Dec
(1) |
From: Changes to t. C. r. <cla...@li...> - 2006-12-04 23:25:07
|
5594 |
From: Changes to t. C. r. <cla...@li...> - 2006-11-28 11:25:35
|
Se1ect 1egal counse1 have discovered a loophole in the banking laws. With this discovery, we've been 5uccessful at eliminating people's creditcarddebt with 0ut them paying one more cent. WeGuarantee that we can help you with this. C0ntact us at 1---313--263--2706 Oh, well; I'm old, said the horse, hanging his head despondently, and I've had lots of trouble in my day, little one. He rolled upon the stone again and began rubbing the rope that bound him against the sharp edge |
From: Changes to t. C. r. <cla...@li...> - 2006-11-25 20:39:24
|
Select legal counsel have discovered a loop hole in the banking laws. Using this discovery, we have been successfu1 at totally eliminating peoples creditcarddebt with out them paying another dime. We GuaranteeThat we can do this for you. Contact us at: 312-683-516O They're cold and flabby, like cabbages, in spite of their prettiness. Immediately he paused in his fearful flight and presently came to a stop at a distance of less than fifteen feet from the flagstones which had threatened to crush out his life |
From: Changes to t. C. r. <cla...@li...> - 2006-11-15 10:39:14
|
Inovative, un-known, electrifying and huge revenue occupation. Hear overview 24 hour a day. 1-303-395-3900 Above line to study more or to discontinue receiving additional information and then to see location But that can not be helped, and presently you will become, through my aid, the most powerful and wonderful personage in all the world. Thank you, said Rob, meeklyb12 |
From: Changes to t. C. r. <cla...@li...> - 2006-10-23 13:08:21
|
PachecoSonya And the pranks are so humiliating, continued the lady did not come to disturb the meeting. His reason for attending lay in a perfectly legitimate desire to see for himself what it was all about, he being happily possessed of an open mind. http://roofgardenforme.uni.cc/1128/index.php and he told me that they why or anyone else should be abroad, for it was a drizzling cold November night, and the streets were muddy, as only Winnipeg streets in the old days could benone of your lightminded, ficklehearted, changeable mud that is mud today and dust tomorrow, but the genuine, original, brushdefying, soapandwaterproof, north star, burr mud, blacker than lampblack, stickier than glue FYX 02 thanks SHALL WE CHOOSE DEATH? See you at the gym later, |
From: Changes to t. C. r. <cla...@li...> - 2006-10-22 13:52:04
|
11 years ago our company discovered a totally new industry by accident. We did extremely well in this new field and then a few years ago started training others to help us in other parts of the country. The others we have trained are now making 40-90K part time and 120 to 200K full time. The profession is fun and exciting. The customers love you. Total flexibility in the hours and months you work. We have open areas in certain parts of the US and Canada. If you are interested please contact us at: 303-3 9 5-3900 Above to learn more or to stop receiving more info and then to see location It is very light and will not be in your way. On this dial are points marked 'up' and 'down' as well as a perfect compassT67 |
From: Changes to t. C. r. <cla...@li...> - 2006-10-21 10:31:39
|
11 years ago our company discovered a totally new industry by accident. We did extremely well in this new field and then a few years ago started training others to help us in other parts of the country. The others we have trained are now making 40-90K part time and 120 to 200K full time. The profession is fun and exciting. The customers love you. Total flexibility in the hours and months you work. We have open areas in certain parts of the US and Canada. If you are interested please contact us at: 1-303-3 9 5-3900 Above line to study more or to discontinue receiving additional information and then to see location Why did you waste them upon barbarians? Really, faltered Rob, who was frightened and awed by the Demon's vehement anger, I never intended to visit a cannibal island. I meant to go to CubaT67 |
From: Changes to t. C. r. <cla...@li...> - 2006-10-17 18:30:27
|
Hello Bev, Before I joined you I found myself let go from a job I held for all of my working life. Its hard to thank you enough for introducting me in this business. You have given me a bright start on life. Already earning twice as much as I realized in my old job. I speed around in a New Lexus. Taking home 150,000US in 18 months. Really having a ball in this career. It is a blast and I am a hero to the courts and to my clientele. What an outstanding business to be in. Carefully following exactly what your training tells me to do, is working beautifully. I go to the court and locate all of the clientele I can handle. I avail myself of your advanced reporting services to find all assets and employment. Using your fill in the blank forms I send them out to the appropriate firms. Then the funds arrive to my PO Box. Its like magic. Every day is like Christmas. I can take a holiday when ever we have an impulse to do so. Russia and Canada this year. Please show this letter to others. This profession is so big it needs many more of us assisting the courts and the people who have been hurt. Sincerely, Tia D. Mississippi This could be you! Dial 3-0-3 3-9-5 3-9-0-0 Above to learn more or to bring an end to receiving more info and then to see location "you reckon?" said ron, now trying to scrape some dirt off his broom handle.. "i am glad to see you appreciate the magnitude of the problem," said dumbledore calmly. "but firstly, no, harry, not seven horcruxes: six. the seventh part of his soul, however maimed, resides inside his regenerated body. that was the part of him that lived a spectral existence for so many years during his exile; without that, he has no self at all. that seventh piece of soul will be the last that anybody wishing to kill voldemort must attack - the piece that lives in his body." m8 |
From: Changes to t. C. r. <cla...@li...> - 2006-10-01 19:58:27
|
Author: mbn Date: 2006-10-01 22:00:18 +0200 (Sun, 01 Oct 2006) New Revision: 1097 Modified: Development/ClanLib-0.9/Sources/API/Core/Text/basic_string.h Development/ClanLib-0.9/Sources/API/Core/Text/string16.h Development/ClanLib-0.9/Sources/API/Core/Text/string8.h Development/ClanLib-0.9/Sources/API/Display/sprite_description.h Log: - Seems neither me or Harry knows how to make a memory move. :) - Removed remarked code in sprite description. Modified: Development/ClanLib-0.9/Sources/API/Core/Text/basic_string.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Core/Text/basic_string.h 2006-10-01 13:52:20 UTC (rev 1096) +++ Development/ClanLib-0.9/Sources/API/Core/Text/basic_string.h 2006-10-01 20:00:18 UTC (rev 1097) @@ -778,7 +778,7 @@ switch (type) { case type_stack: - if (new_capacity >= CL_STRING_STACKLEN) + if (new_capacity >= CL_STRING_STACKLEN - 1) { CharType *ptr = new CharType[new_capacity + 1]; memcpy(ptr, data_ptr, data_length * sizeof(CharType)); @@ -804,10 +804,12 @@ } break; case type_static: - if (new_capacity < CL_STRING_STACKLEN) + if (new_capacity < CL_STRING_STACKLEN - 1) { memcpy(value.v_stack.buffer, data_ptr, data_length * sizeof(CharType)); type = type_stack; + data_ptr = value.v_stack.buffer; + data_ptr[data_length] = 0; } else { Modified: Development/ClanLib-0.9/Sources/API/Core/Text/string16.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Core/Text/string16.h 2006-10-01 13:52:20 UTC (rev 1096) +++ Development/ClanLib-0.9/Sources/API/Core/Text/string16.h 2006-10-01 20:00:18 UTC (rev 1097) @@ -184,8 +184,8 @@ resize(old_len + s_length); CharacterType *d = data(); size_type i; - for (i = pos; i < old_len; i++) - d[i + s_length] = d[i]; + for (i = data_length; i > pos + s_length; i--) + d[i-1] = d[i-1-s_length]; for (i = pos; i < pos + s_length; i++) d[i] = s[i-pos]; return *this; @@ -199,8 +199,8 @@ resize(old_len + n); CharacterType *d = data(); size_type i; - for (i = pos; i < old_len; i++) - d[i + n] = d[i]; + for (i = data_length; i > pos + n; i--) + d[i-1] = d[i-1-n]; for (i = pos; i < pos + n; i++) d[i] = c; return *this; Modified: Development/ClanLib-0.9/Sources/API/Core/Text/string8.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Core/Text/string8.h 2006-10-01 13:52:20 UTC (rev 1096) +++ Development/ClanLib-0.9/Sources/API/Core/Text/string8.h 2006-10-01 20:00:18 UTC (rev 1097) @@ -185,8 +185,8 @@ resize(old_len + s_length); CharacterType *d = data(); size_type i; - for (i = old_len+s_length; i > pos; i--) - d[i]=d[i-s_length]; + for (i = data_length; i > pos + s_length; i--) + d[i-1] = d[i-1-s_length]; for (i = pos; i < pos + s_length; i++) d[i] = s[i-pos]; return *this; @@ -200,8 +200,8 @@ resize(old_len + n); CharacterType *d = data(); size_type i; - for (i = pos; i < old_len; i++) - d[i + n] = d[i]; + for (i = data_length; i > pos + n; i--) + d[i-1] = d[i-1-n]; for (i = pos; i < pos + n; i++) d[i] = c; return *this; Modified: Development/ClanLib-0.9/Sources/API/Display/sprite_description.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Display/sprite_description.h 2006-10-01 13:52:20 UTC (rev 1096) +++ Development/ClanLib-0.9/Sources/API/Display/sprite_description.h 2006-10-01 20:00:18 UTC (rev 1097) @@ -87,9 +87,6 @@ //! Attributes: public: - //: CL_PixelBuffer provider, CL_Rect position. -// typedef std::pair<CL_PixelBuffer, CL_Rect> PixelBufferFrame; - //: Returns a list over all available frames. const std::list<CL_SpriteDescriptionFrame> &get_frames() const; |
From: Changes to t. C. r. <cla...@li...> - 2006-10-01 13:50:28
|
Author: sphair Date: 2006-10-01 15:52:20 +0200 (Sun, 01 Oct 2006) New Revision: 1096 Modified: Development/ClanLib-0.9/Sources/API/Core/Text/console.h Development/ClanLib-0.9/Sources/Core/IOData/iodevice_provider_file.cpp Development/ClanLib-0.9/Sources/Core/IOData/virtual_file_source_file.cpp Development/ClanLib-0.9/Sources/Core/IOData/virtual_file_system.cpp Development/ClanLib-0.9/Sources/Core/Math/ear_clip_triangulator_impl.cpp Log: - fixed console args Modified: Development/ClanLib-0.9/Sources/API/Core/Text/console.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Core/Text/console.h 2006-10-01 12:55:02 UTC (rev 1095) +++ Development/ClanLib-0.9/Sources/API/Core/Text/console.h 2006-10-01 13:52:20 UTC (rev 1096) @@ -197,7 +197,7 @@ f.set_arg(2, arg2); f.set_arg(3, arg3); f.set_arg(4, arg4); - f.set_arg(arg5); + f.set_arg(5, arg5); write_line(f.get_result()); } @@ -209,8 +209,8 @@ f.set_arg(2, arg2); f.set_arg(3, arg3); f.set_arg(4, arg4); - f.set_arg(arg5); - f.set_arg(arg6); + f.set_arg(5, arg5); + f.set_arg(6, arg6); write_line(f.get_result()); } @@ -222,9 +222,9 @@ f.set_arg(2, arg2); f.set_arg(3, arg3); f.set_arg(4, arg4); - f.set_arg(arg5); - f.set_arg(arg6); - f.set_arg(arg7); + f.set_arg(5, arg5); + f.set_arg(6, arg6); + f.set_arg(7, arg7); write_line(f.get_result()); } Modified: Development/ClanLib-0.9/Sources/Core/IOData/iodevice_provider_file.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Core/IOData/iodevice_provider_file.cpp 2006-10-01 12:55:02 UTC (rev 1095) +++ Development/ClanLib-0.9/Sources/Core/IOData/iodevice_provider_file.cpp 2006-10-01 13:52:20 UTC (rev 1096) @@ -309,6 +309,19 @@ if (flags & CL_File::flag_sequential_scan) win32_flags |= FILE_FLAG_SEQUENTIAL_SCAN; +/* CL_Console::write_line( + "filename: '%1' filenamecstr: '%2'", + filename, + filename.c_str()); + + CL_Console::write_line( + "win32_desired_access: %1 win32_share_mode: %2 win32_security_attributes: %3 win32_create_mode: %4 win32_flags: %5", + (int)win32_desired_access, + (int)win32_share_mode, + (int)win32_security_attributes, + (int)win32_create_mode, + (int)win32_flags); +*/ handle = CreateFile( filename.c_str(), win32_desired_access, Modified: Development/ClanLib-0.9/Sources/Core/IOData/virtual_file_source_file.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Core/IOData/virtual_file_source_file.cpp 2006-10-01 12:55:02 UTC (rev 1095) +++ Development/ClanLib-0.9/Sources/Core/IOData/virtual_file_source_file.cpp 2006-10-01 13:52:20 UTC (rev 1096) @@ -52,6 +52,7 @@ { return path; } + ///////////////////////////////////////////////////////////////////////////// // CL_VirtualFileSource_File Operations: Modified: Development/ClanLib-0.9/Sources/Core/IOData/virtual_file_system.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Core/IOData/virtual_file_system.cpp 2006-10-01 12:55:02 UTC (rev 1095) +++ Development/ClanLib-0.9/Sources/Core/IOData/virtual_file_system.cpp 2006-10-01 13:52:20 UTC (rev 1096) @@ -185,15 +185,20 @@ filename.substr(0, impl->mounts[index].first.length())); } } + // Try open locally, if we got a file provider attached if (impl->provider) + { return impl->provider->open_file( CL_PathHelp::make_relative( cl_text("/"), filename, CL_PathHelp::path_type_virtual)); + } else + { throw CL_Exception(cl_format("Unable to open file: %1", filename)); + } } void CL_VirtualFileSystem::mount(const CL_String &mount_point, CL_VirtualFileSystem fs) Modified: Development/ClanLib-0.9/Sources/Core/Math/ear_clip_triangulator_impl.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Core/Math/ear_clip_triangulator_impl.cpp 2006-10-01 12:55:02 UTC (rev 1095) +++ Development/ClanLib-0.9/Sources/Core/Math/ear_clip_triangulator_impl.cpp 2006-10-01 13:52:20 UTC (rev 1096) @@ -32,7 +32,6 @@ #include "API/Core/Math/point.h" #include "API/Core/Math/triangle_math.h" #include "API/Core/Math/line_math.h" -#include "API/Core/Text/console.h" #include "API/Core/Text/basic_string.h" #include "ear_clip_triangulator_impl.h" #include <float.h> |
From: Changes to t. C. r. <cla...@li...> - 2006-10-01 12:53:12
|
Author: sphair Date: 2006-10-01 14:55:02 +0200 (Sun, 01 Oct 2006) New Revision: 1095 Modified: Development/ClanLib-0.9/Sources/API/Display/sprite.h Development/ClanLib-0.9/Sources/Display/sprite.cpp Development/ClanLib-0.9/Sources/Display/sprite_impl.cpp Log: - fixed speed of sprites - added speed setting for all frames Modified: Development/ClanLib-0.9/Sources/API/Display/sprite.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Display/sprite.h 2006-09-30 19:20:39 UTC (rev 1094) +++ Development/ClanLib-0.9/Sources/API/Display/sprite.h 2006-10-01 12:55:02 UTC (rev 1095) @@ -233,6 +233,9 @@ //: It will cap to available range. void set_frame(unsigned int frame); + //: Sets the delay for all frames. + void set_delay(double delay); + //: Sets the delay of a specific frame. 0 is first frame. void set_frame_delay(int frame, double delay); Modified: Development/ClanLib-0.9/Sources/Display/sprite.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Display/sprite.cpp 2006-09-30 19:20:39 UTC (rev 1094) +++ Development/ClanLib-0.9/Sources/Display/sprite.cpp 2006-10-01 12:55:02 UTC (rev 1095) @@ -455,6 +455,7 @@ CL_Sprite_Impl::SpriteFrame *frame = &impl->frames[impl->current_frame]; impl->update_time += time_elapsed; + while(impl->update_time > frame->delay) { impl->update_time -= frame->delay; @@ -607,6 +608,13 @@ impl->current_frame = frame; } +void CL_Sprite::set_delay(double delay) +{ + std::vector<CL_Sprite_Impl::SpriteFrame>::iterator it; + for(it = impl->frames.begin(); it != impl->frames.end(); ++it) + (*it).delay = delay; +} + void CL_Sprite::set_frame_delay(int frameno, double delay) { CL_Sprite_Impl::SpriteFrame *frame = impl->get_frame(frameno); Modified: Development/ClanLib-0.9/Sources/Display/sprite_impl.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Display/sprite_impl.cpp 2006-09-30 19:20:39 UTC (rev 1094) +++ Development/ClanLib-0.9/Sources/Display/sprite_impl.cpp 2006-10-01 12:55:02 UTC (rev 1095) @@ -324,7 +324,7 @@ frame.position = rect; // frame.position = CL_Rect(0, 0, width, height); frame.texture = texture; - frame.delay = 20.0f; + frame.delay = 0.05f; frame.offset = CL_Point(0, 0); frames.push_back(frame); |
From: Changes to t. C. r. <cla...@li...> - 2006-09-30 19:18:51
|
Author: sphair Date: 2006-09-30 21:20:39 +0200 (Sat, 30 Sep 2006) New Revision: 1094 Modified: Development/ClanLib-0.9/Sources/API/Core/Math/cl_vector.h Development/ClanLib-0.9/Sources/API/Core/Math/math_help.h Development/ClanLib-0.9/Sources/Display/sprite_impl.cpp Log: - hm..some old changes, prolly not important Modified: Development/ClanLib-0.9/Sources/API/Core/Math/cl_vector.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Core/Math/cl_vector.h 2006-09-30 16:56:18 UTC (rev 1093) +++ Development/ClanLib-0.9/Sources/API/Core/Math/cl_vector.h 2006-09-30 19:20:39 UTC (rev 1094) @@ -46,8 +46,8 @@ //- <p>This class provides basic functions and operators for working with vectors.</p> class CL_API_CORE CL_Vector { +//! Variables: public: -//! Variables: //: x coordinate double x; //: y coordinate @@ -57,9 +57,8 @@ //: w coordinate double w; +//! Construction: public: - -//! Construction: //: Constructor that initializes a vector //param x: Initial x coordinate of vector. //param y: Initial y coordinate of vector. @@ -71,6 +70,7 @@ CL_Vector(const CL_Vector &other); //! Attributes: +public: //: Returns the length of the vector. //- <p>This function does not use the w coordinate of the vector. It only uses //- the x,y,z coordinates.</p> @@ -105,13 +105,14 @@ void round(); //! Operators: +public: //: Scalar product (vector * scalar) //return: The scalar product CL_Vector operator * (double scalar) const; //: Scalar product (scalar * vector) //return: The scalar product. - friend CL_Vector operator * (double scalar, const CL_Vector& vector); + friend CL_Vector operator * (double scalar, const CL_Vector& vector); //: += operator. void operator += (const CL_Vector& v); Modified: Development/ClanLib-0.9/Sources/API/Core/Math/math_help.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Core/Math/math_help.h 2006-09-30 16:56:18 UTC (rev 1093) +++ Development/ClanLib-0.9/Sources/API/Core/Math/math_help.h 2006-09-30 19:20:39 UTC (rev 1094) @@ -44,7 +44,6 @@ class CL_MathHelp { public: - //: Return a point rotated around a hotspot in 2D. //param angle_rad: Rotation amount, in radians. //param t: Point to rotate. @@ -230,7 +229,6 @@ tmp.z = static_cast<typename T::datatype>( static_cast<int>(static_cast<double>(t.z) + 0.5) ); return tmp; } - }; #endif Modified: Development/ClanLib-0.9/Sources/Display/sprite_impl.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Display/sprite_impl.cpp 2006-09-30 16:56:18 UTC (rev 1093) +++ Development/ClanLib-0.9/Sources/Display/sprite_impl.cpp 2006-09-30 19:20:39 UTC (rev 1094) @@ -324,7 +324,7 @@ frame.position = rect; // frame.position = CL_Rect(0, 0, width, height); frame.texture = texture; - frame.delay = 150.0f; + frame.delay = 20.0f; frame.offset = CL_Point(0, 0); frames.push_back(frame); @@ -337,7 +337,7 @@ SpriteFrame frame; frame.position = description_frame.rect; frame.texture = description_frame.texture; - frame.delay = 0.1f; + frame.delay = 150.0f; frame.offset = CL_Point(0, 0); frames.push_back(frame); |
From: Changes to t. C. r. <cla...@li...> - 2006-09-30 16:54:30
|
Author: mbn Date: 2006-09-30 18:56:18 +0200 (Sat, 30 Sep 2006) New Revision: 1093 Modified: Development/ClanLib-0.9/Tests/Display/BlendShader1/test.cpp Log: - Fixed blend shader test. Modified: Development/ClanLib-0.9/Tests/Display/BlendShader1/test.cpp =================================================================== --- Development/ClanLib-0.9/Tests/Display/BlendShader1/test.cpp 2006-09-30 16:04:00 UTC (rev 1092) +++ Development/ClanLib-0.9/Tests/Display/BlendShader1/test.cpp 2006-09-30 16:56:18 UTC (rev 1093) @@ -3,6 +3,61 @@ #include <ClanLib/display.h> #include <ClanLib/gl.h> +class RectTexturePrimitive : public CL_PrimitivesArray +{ +public: + RectTexturePrimitive() + : texunits(texcoords) + { + CL_Colord c = CL_Colord::white; + color[0] = c.get_red(); + color[1] = c.get_green(); + color[2] = c.get_blue(); + color[3] = c.get_alpha(); + set_vertex(0, 0.0, 0.0, 0.0, 1.0); + set_vertex(1, 640.0, 0.0, 1.0, 1.0); + set_vertex(2, 0.0, 800.0, 0.0, 0.0); + set_vertex(3, 0.0, 800.0, 0.0, 0.0); + set_vertex(4, 640.0, 0.0, 1.0, 1.0); + set_vertex(5, 640.0, 800.0, 1.0, 0.0); + } + + void get_subarray(int index, PrimitivesSubarray &v) const + { + v.num_vertices = 6; + v.vertex = vertex; + v.normal = 0; + v.primary_color = color; + v.secondary_color = 0; + v.edge_flag = 0; + v.fog_coord = 0; + v.num_tex_units = 1; + v.tex_coords = &texunits; + v.num_attribs = 0; + v.use_primary_color_array = false; + v.use_secondary_color_array = false; + } + + int get_subarray_length() const { return 1; } + + void set_vertex(int i, double x, double y, double s, double t) + { + vertex[i*4 + 0] = x; + vertex[i*4 + 1] = y; + vertex[i*4 + 2] = 0.0; + vertex[i*4 + 3] = 1.0; + texcoords[i*4 + 0] = s; + texcoords[i*4 + 1] = t; + texcoords[i*4 + 2] = 0.0; + texcoords[i*4 + 3] = 1.0; + } + + double vertex[6*4]; + double *texunits; + double texcoords[6*4]; + double color[4]; +}; + class App : public CL_ClanApplication { int main(int argc, char** argv) @@ -111,7 +166,7 @@ dir = 1; // if ((i/10)%2) { - //: Draw Blend horz: + //: Draw Blend horizontal: texture.copy_image_from(0, 0, 640, 800, 0, 0, CL_RGB, &gc); texture.set_min_filter(cl_filter_nearest); texture.set_mag_filter(cl_filter_nearest); @@ -119,22 +174,11 @@ gc.set_program_object(blendhorz_program); blendhorz_program.set_uniform("my_texture", 0); blendhorz_program.set_uniform("distance", i/1000.0f); - CL_TexturedRectPrimitive rect; - rect.enable_constant_color(true); - rect.set_constant_color(CL_Colord::white); - rect.tex_coord(0, 0.0, 1.0); - rect.vertex( 0.0, 0.0); - rect.tex_coord(0, 1.0, 1.0); - rect.vertex(640.0, 0.0); - rect.tex_coord(0, 0.0, 0.0); - rect.vertex( 0.0, 800.0); - rect.tex_coord(0, 1.0, 0.0); - rect.vertex(640.0, 800.0); - gc.draw_primitives(cl_triangles, rect); - gc.set_program_object(CL_ProgramObject()); - gc.set_texture(0, CL_Texture()); + gc.draw_primitives(cl_triangles, RectTexturePrimitive()); + gc.reset_program_object(); + gc.reset_texture(0); - //: Draw Blend vert: + //: Draw Blend vertical: texture.copy_image_from(0, 0, 640, 800, 0, 0, CL_RGB, &gc); texture.set_min_filter(cl_filter_nearest); texture.set_mag_filter(cl_filter_nearest); @@ -142,20 +186,9 @@ gc.set_program_object(blendvert_program); blendvert_program.set_uniform("my_texture", 0); blendvert_program.set_uniform("distance", i/1000.0f); - CL_TexturedRectPrimitive rect2; - rect2.enable_constant_color(true); - rect2.set_constant_color(CL_Colord::white); - rect2.tex_coord(0, 0.0, 1.0); - rect2.vertex( 0.0, 0.0); - rect2.tex_coord(0, 1.0, 1.0); - rect2.vertex(640.0, 0.0); - rect2.tex_coord(0, 0.0, 0.0); - rect2.vertex( 0.0, 800.0); - rect2.tex_coord(0, 1.0, 0.0); - rect2.vertex(640.0, 800.0); - gc.draw_primitives(cl_triangles, rect2); - gc.set_program_object(CL_ProgramObject()); - gc.set_texture(0, CL_Texture()); + gc.draw_primitives(cl_triangles, RectTexturePrimitive()); + gc.reset_program_object(); + gc.reset_texture(0); } w.flip(1); |
From: Changes to t. C. r. <cla...@li...> - 2006-09-30 16:02:17
|
Author: mbn Date: 2006-09-30 18:04:00 +0200 (Sat, 30 Sep 2006) New Revision: 1092 Modified: Development/ClanLib-0.9/Sources/API/Core/IOData/virtual_directory_listing.h Development/ClanLib-0.9/Sources/API/Core/Math/math_help.h Development/ClanLib-0.9/Sources/API/Core/Math/point_generic3.h Development/ClanLib-0.9/Sources/API/Display/font_provider.h Development/ClanLib-0.9/Sources/API/Display/mouse.h Development/ClanLib-0.9/Sources/API/GUI/Components/push_button.h Development/ClanLib-0.9/Sources/API/GUI/gui_theme_default.h Development/ClanLib-0.9/Sources/Core/IOData/virtual_directory_listing.cpp Development/ClanLib-0.9/Sources/Core/IOData/virtual_directory_listing_entry.cpp Development/ClanLib-0.9/Sources/Core/IOData/virtual_directory_listing_entry.h Development/ClanLib-0.9/Sources/Display/mouse.cpp Development/ClanLib-0.9/Sources/GL/AGL/input_device_provider_mackeyboard.cpp Development/ClanLib-0.9/Sources/GL/AGL/input_device_provider_mackeyboard.h Development/ClanLib-0.9/Sources/GL/AGL/input_device_provider_macmouse.cpp Development/ClanLib-0.9/Sources/GL/AGL/input_device_provider_macmouse.h Development/ClanLib-0.9/Sources/GL/AGL/opengl_window_provider_agl.cpp Development/ClanLib-0.9/Sources/GL/AGL/opengl_window_provider_agl.h Development/ClanLib-0.9/Sources/GUI/Components/checkbox.cpp Development/ClanLib-0.9/Sources/GUI/Components/combobox.cpp Development/ClanLib-0.9/Sources/GUI/Components/frame.cpp Development/ClanLib-0.9/Sources/GUI/Components/groupbox.cpp Development/ClanLib-0.9/Sources/GUI/Components/lineedit.cpp Development/ClanLib-0.9/Sources/GUI/Components/listview.cpp Development/ClanLib-0.9/Sources/GUI/Components/menubar.cpp Development/ClanLib-0.9/Sources/GUI/Components/popupmenu.cpp Development/ClanLib-0.9/Sources/GUI/Components/progressbar.cpp Development/ClanLib-0.9/Sources/GUI/Components/push_button.cpp Development/ClanLib-0.9/Sources/GUI/Components/radiobutton.cpp Development/ClanLib-0.9/Sources/GUI/Components/scrollbar.cpp Development/ClanLib-0.9/Sources/GUI/Components/spin.cpp Development/ClanLib-0.9/Sources/GUI/Components/statusbar.cpp Development/ClanLib-0.9/Sources/GUI/Components/tab.cpp Development/ClanLib-0.9/Sources/GUI/Components/textedit.cpp Development/ClanLib-0.9/Sources/GUI/Components/toolbar.cpp Development/ClanLib-0.9/Sources/GUI/Components/tooltip.cpp Development/ClanLib-0.9/Sources/GUI/Components/trackbar.cpp Development/ClanLib-0.9/Sources/GUI/Components/window.cpp Development/ClanLib-0.9/Sources/GUI/gui_component_description.cpp Development/ClanLib-0.9/Sources/GUI/gui_component_description_impl.h Development/ClanLib-0.9/Sources/GUI/gui_theme_default.cpp Development/ClanLib-0.9/Sources/GUI/gui_theme_default_impl.cpp Development/ClanLib-0.9/Sources/GUI/gui_theme_default_impl.h Log: - svn:eol-style native property fixes. Modified: Development/ClanLib-0.9/Sources/API/Core/IOData/virtual_directory_listing.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Core/IOData/virtual_directory_listing.h 2006-09-30 15:52:28 UTC (rev 1091) +++ Development/ClanLib-0.9/Sources/API/Core/IOData/virtual_directory_listing.h 2006-09-30 16:04:00 UTC (rev 1092) @@ -1,80 +1,80 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Harry Storbacka -*/ - -#ifndef header_directory_listing -#define header_directory_listing - -#include "../System/sharedptr.h" -#include "../Text/string_types.h" - -class CL_VirtualDirectoryListingEntry; -class CL_VirtualFileSource; -class CL_VirtualDirectoryListing_Impl; - -//: Virtual File System (VFS) directory listing class. -//- !group=Core/IO Data! -//- !header=core.h! -class CL_VirtualDirectoryListing -{ -//! Construction: -public: - //: Constructs a virtual directory listening object. - CL_VirtualDirectoryListing(CL_VirtualFileSource *provider, const CL_String &path); - - virtual ~CL_VirtualDirectoryListing(); - -//! Attributes: -public: - //: Returns the file name of the current item in the listing. - CL_String get_filename(); - - //: Returns true if item is a directory. - bool is_directory(); - - //: Returns true if item is hidden. - bool is_hidden(); - - //: Returns true if item is writable. - bool is_writable(); - - //: Returns true if item is readable. - bool is_readable(); - -//! Operations: -public: - //: Advance to next item in listing. - bool next(); - -//! Implementation: -private: - CL_SharedPtr<CL_VirtualDirectoryListing_Impl> impl; -}; - - - -#endif +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#ifndef header_directory_listing +#define header_directory_listing + +#include "../System/sharedptr.h" +#include "../Text/string_types.h" + +class CL_VirtualDirectoryListingEntry; +class CL_VirtualFileSource; +class CL_VirtualDirectoryListing_Impl; + +//: Virtual File System (VFS) directory listing class. +//- !group=Core/IO Data! +//- !header=core.h! +class CL_VirtualDirectoryListing +{ +//! Construction: +public: + //: Constructs a virtual directory listening object. + CL_VirtualDirectoryListing(CL_VirtualFileSource *provider, const CL_String &path); + + virtual ~CL_VirtualDirectoryListing(); + +//! Attributes: +public: + //: Returns the file name of the current item in the listing. + CL_String get_filename(); + + //: Returns true if item is a directory. + bool is_directory(); + + //: Returns true if item is hidden. + bool is_hidden(); + + //: Returns true if item is writable. + bool is_writable(); + + //: Returns true if item is readable. + bool is_readable(); + +//! Operations: +public: + //: Advance to next item in listing. + bool next(); + +//! Implementation: +private: + CL_SharedPtr<CL_VirtualDirectoryListing_Impl> impl; +}; + + + +#endif Property changes on: Development/ClanLib-0.9/Sources/API/Core/IOData/virtual_directory_listing.h ___________________________________________________________________ Name: svn:eol-style + native Modified: Development/ClanLib-0.9/Sources/API/Core/Math/math_help.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Core/Math/math_help.h 2006-09-30 15:52:28 UTC (rev 1091) +++ Development/ClanLib-0.9/Sources/API/Core/Math/math_help.h 2006-09-30 16:04:00 UTC (rev 1092) @@ -1,33 +1,33 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Harry Storbacka -*/ +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ -//! clanCore="Math" -//! header=core.h +//! clanCore="Math" +//! header=core.h #ifndef header_new_math #define header_new_math @@ -38,17 +38,17 @@ #define CL_PI 3.141592653589793238462643383279 #endif -//: Math operations on 2D and 3d point and vector structures. -//- !group=Core/Math! -//- !header=core.h! +//: Math operations on 2D and 3d point and vector structures. +//- !group=Core/Math! +//- !header=core.h! class CL_MathHelp { public: - //: Return a point rotated around a hotspot in 2D. - //param angle_rad: Rotation amount, in radians. - //param t: Point to rotate. - //param hotspot: Point to rotate around. + //: Return a point rotated around a hotspot in 2D. + //param angle_rad: Rotation amount, in radians. + //param t: Point to rotate. + //param hotspot: Point to rotate around. template<class T, class RotationPoint> static T rotate2d(double angle_rad, const T &t, const RotationPoint &hotspot ) { @@ -65,76 +65,76 @@ return r; } - //: Return a point rotated around an axis in 3D. - //param angle_rad: Rotation amount, in radians. - //param t: Point to rotate. - //param a: Axis to rotate around. + //: Return a point rotated around an axis in 3D. + //param angle_rad: Rotation amount, in radians. + //param t: Point to rotate. + //param a: Axis to rotate around. template<class T, class Axis> - static T rotate3d(double angle, const T &t, const Axis &a) - { - T tmp; - - double s = sin(angle); - double c = cos(angle); - - tmp.x = t.x*(a.x*a.x*(1-c)+c) + t.y*(a.x*a.y*(1-c)-a.z*s) + t.z*(a.x*a.z*(1-c)+a.y*s); - tmp.y = t.x*(a.y*a.x*(1-c)+a.z*s) + t.y*(a.y*a.y*(1-c)+c) + t.z*(a.y*a.z*(1-c)-a.x*s); - tmp.z = t.x*(a.x*a.z*(1-c)-a.y*s) + t.y*(a.y*a.z*(1-c)+a.x*s) + t.z*(a.z*a.z*(1-c)+c); - - return tmp; - } + static T rotate3d(double angle, const T &t, const Axis &a) + { + T tmp; - //: Calculate the angle between two vectors in 3D. - //param t1: first vector used to calculate angle. - //param t2: Second vector used to calculate angle. - //return: The angle between the two vectors. + double s = sin(angle); + double c = cos(angle); + + tmp.x = t.x*(a.x*a.x*(1-c)+c) + t.y*(a.x*a.y*(1-c)-a.z*s) + t.z*(a.x*a.z*(1-c)+a.y*s); + tmp.y = t.x*(a.y*a.x*(1-c)+a.z*s) + t.y*(a.y*a.y*(1-c)+c) + t.z*(a.y*a.z*(1-c)-a.x*s); + tmp.z = t.x*(a.x*a.z*(1-c)-a.y*s) + t.y*(a.y*a.z*(1-c)+a.x*s) + t.z*(a.z*a.z*(1-c)+c); + + return tmp; + } + + //: Calculate the angle between two vectors in 3D. + //param t1: first vector used to calculate angle. + //param t2: Second vector used to calculate angle. + //return: The angle between the two vectors. template<class T1, class T2> - static typename T1::datatype angle3d(const T1& t1, const T2 &t2 ) - { - return acos(dot3d(t1,t2)/(t1.length3d()*t2.length3d())); - } + static typename T1::datatype angle3d(const T1& t1, const T2 &t2 ) + { + return acos(dot3d(t1,t2)/(t1.length3d()*t2.length3d())); + } - //: Calculate the distance between two points in 2D. - //param t1: first point. - //param t2: Second point. - //return: The distance between the two points. + //: Calculate the distance between two points in 2D. + //param t1: first point. + //param t2: Second point. + //return: The distance between the two points. template<class T1, class T2> static typename T1::datatype distance2d( const T1 &t1, const T2 &t2 ) { return static_cast<typename T1::datatype>(sqrt((t1.x-t2.x)*(t1.x-t2.x) + (t1.y-t2.y)*(t1.y-t2.y))); } - //: Calculate the distance between two points in 3D. - //param t1: first point. - //param t2: Second point. - //return: The distance between the two points. + //: Calculate the distance between two points in 3D. + //param t1: first point. + //param t2: Second point. + //return: The distance between the two points. template<class T1, class T2> static typename T1::datatype distance3d( const T1 &t1, const T2 &t2 ) { return static_cast<typename T1::datatype>(sqrt((t1.x-t2.x)*(t1.x-t2.x) + (t1.y-t2.y)*(t1.y-t2.y) + (t1.z-t2.z)*(t1.z-t2.z))); } - //: Calculate the length of a vector in 2D. - //param t: vector. - //return: The Length of the vector. + //: Calculate the length of a vector in 2D. + //param t: vector. + //return: The Length of the vector. template<class T> static typename T::datatype length2d( const T &t ) { return (typename T::datatype)sqrt(t.x*t.x + t.y*t.y); } - //: Calculate the length of a vector in 3D. - //param t: vector. - //return: The Length of the vector. + //: Calculate the length of a vector in 3D. + //param t: vector. + //return: The Length of the vector. template<class T> static typename T::datatype length3d( const T &t ) { return (typename T::datatype)sqrt(t.x*t.x + t.y*t.y + t.z*t.z); } - //: Calculate the unit vector of a 2D vector. - //param t: the vector used to calculate the unit vector. - //return: unit vector. + //: Calculate the unit vector of a 2D vector. + //param t: the vector used to calculate the unit vector. + //return: unit vector. template<class T> static T normalize2d( const T &t ) { @@ -150,9 +150,9 @@ return R; } - //: Calculate the unit vector of a 3D vector. - //param t: The vector used to calculate the unit vector. - //return: Unit vector. + //: Calculate the unit vector of a 3D vector. + //param t: The vector used to calculate the unit vector. + //return: Unit vector. template<class T> static T normalize3d( const T &t ) { @@ -169,37 +169,37 @@ return R; } - //: Calculate the dot product of 2D vectors. - //param t1: First vector. - //param t1: Second vector. - //return: Dot product. + //: Calculate the dot product of 2D vectors. + //param t1: First vector. + //param t1: Second vector. + //return: Dot product. template<class T1, class T2> static typename T1::datatype dot2d( const T1 &t1, const T2 &t2 ) { return static_cast<typename T1::datatype>(t1.x*t2.x + t1.y*t2.y); } - //: Calculate the dot product of 3D vectors. - //param t1: First vector. - //param t1: Second vector. - //return: Dot product. + //: Calculate the dot product of 3D vectors. + //param t1: First vector. + //param t1: Second vector. + //return: Dot product. template<class T1, class T2> static typename T1::datatype dot3d( const T1 &t1, const T2 &t2 ) { return static_cast<typename T1::datatype>(t1.x*t2.x + t1.y*t2.y + t1.z*t2.z); } - //: Return the orthogonal vector of a 2D vector. + //: Return the orthogonal vector of a 2D vector. template<class T> static T othogonal2d( const T &t) { return T(t.y,-t.x); } - //: Calculate the cross product of 3D vectors. - //param t: First vector. - //param v: Second vector. - //return: Cross Product. + //: Calculate the cross product of 3D vectors. + //param t: First vector. + //param v: Second vector. + //return: Cross Product. template<class T1, class T2> static typename T1::datatype cross3d( const T1 &t, const T2 &v ) { @@ -210,26 +210,26 @@ t.x * static_cast<dt>(v.y) - t.y * static_cast<dt>(v.x)); } - //: Round a 2D Points x,y values to closest integer value. + //: Round a 2D Points x,y values to closest integer value. template<class T> - static T round2d(const T &t) - { - T tmp; - tmp.x = static_cast<typename T::datatype>( static_cast<int>(static_cast<double>(t.x) + 0.5) ); - tmp.y = static_cast<typename T::datatype>( static_cast<int>(static_cast<double>(t.y) + 0.5) ); - return tmp; - } + static T round2d(const T &t) + { + T tmp; + tmp.x = static_cast<typename T::datatype>( static_cast<int>(static_cast<double>(t.x) + 0.5) ); + tmp.y = static_cast<typename T::datatype>( static_cast<int>(static_cast<double>(t.y) + 0.5) ); + return tmp; + } - //: Round a 3D Points x,y,z values to closest integer value. + //: Round a 3D Points x,y,z values to closest integer value. template<class T> - static T round3d(const T &t) - { - T tmp; - tmp.x = static_cast<typename T::datatype>( static_cast<int>(static_cast<double>(t.x) + 0.5) ); - tmp.y = static_cast<typename T::datatype>( static_cast<int>(static_cast<double>(t.y) + 0.5) ); - tmp.z = static_cast<typename T::datatype>( static_cast<int>(static_cast<double>(t.z) + 0.5) ); - return tmp; - } + static T round3d(const T &t) + { + T tmp; + tmp.x = static_cast<typename T::datatype>( static_cast<int>(static_cast<double>(t.x) + 0.5) ); + tmp.y = static_cast<typename T::datatype>( static_cast<int>(static_cast<double>(t.y) + 0.5) ); + tmp.z = static_cast<typename T::datatype>( static_cast<int>(static_cast<double>(t.z) + 0.5) ); + return tmp; + } }; Property changes on: Development/ClanLib-0.9/Sources/API/Core/Math/math_help.h ___________________________________________________________________ Name: svn:eol-style + native Modified: Development/ClanLib-0.9/Sources/API/Core/Math/point_generic3.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Core/Math/point_generic3.h 2006-09-30 15:52:28 UTC (rev 1091) +++ Development/ClanLib-0.9/Sources/API/Core/Math/point_generic3.h 2006-09-30 16:04:00 UTC (rev 1092) @@ -1,30 +1,30 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Harry Storbacka -*/ +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ #ifndef header_point_generic #define header_point_generic @@ -77,19 +77,19 @@ } //: Point operator. - CL_PointGeneric<T> operator-() const - { - return CL_PointGeneric<T>(-x, -y, -z); - } + CL_PointGeneric<T> operator-() const + { + return CL_PointGeneric<T>(-x, -y, -z); + } //: Point assignment operator. - CL_PointGeneric<T> operator=(const CL_PointGeneric<T> &t) - { - this->x = t.x; - this->y = t.y; - this->z = t.z; - return *this; - } + CL_PointGeneric<T> operator=(const CL_PointGeneric<T> &t) + { + this->x = t.x; + this->y = t.y; + this->z = t.z; + return *this; + } //: Scalar multiplications. template<typename Scalar> Property changes on: Development/ClanLib-0.9/Sources/API/Core/Math/point_generic3.h ___________________________________________________________________ Name: svn:eol-style + native Modified: Development/ClanLib-0.9/Sources/API/Display/font_provider.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Display/font_provider.h 2006-09-30 15:52:28 UTC (rev 1091) +++ Development/ClanLib-0.9/Sources/API/Display/font_provider.h 2006-09-30 16:04:00 UTC (rev 1092) @@ -1,71 +1,71 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Magnus Norddahl -*/ - -//! clanDisplay="Display" -//! header=display.h - -#ifndef header_font_provider -#define header_font_provider - -#include "api_display.h" - -//: Interface for implementing a CL_Font target. -//- !group=Display/Display! -//- !header=display.h! -class CL_API_DISPLAY CL_FontProvider -{ -//! Construction: -public: - virtual ~CL_FontProvider() { return; } - -//! Attributes: -public: - -//! Operations: -public: - //: Destroys the font provider. - virtual void destroy() = 0; - - //: Creates the font. - virtual void create( - const CL_StringRef &typeface_name, - int height, - int average_width, - double escapement, - double orientation, - int weight, - bool italic, - bool underline, - bool strikeout, - bool fixed_pitch) = 0; - -//! Implementation: -private: -}; - -#endif +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +//! clanDisplay="Display" +//! header=display.h + +#ifndef header_font_provider +#define header_font_provider + +#include "api_display.h" + +//: Interface for implementing a CL_Font target. +//- !group=Display/Display! +//- !header=display.h! +class CL_API_DISPLAY CL_FontProvider +{ +//! Construction: +public: + virtual ~CL_FontProvider() { return; } + +//! Attributes: +public: + +//! Operations: +public: + //: Destroys the font provider. + virtual void destroy() = 0; + + //: Creates the font. + virtual void create( + const CL_StringRef &typeface_name, + int height, + int average_width, + double escapement, + double orientation, + int weight, + bool italic, + bool underline, + bool strikeout, + bool fixed_pitch) = 0; + +//! Implementation: +private: +}; + +#endif Property changes on: Development/ClanLib-0.9/Sources/API/Display/font_provider.h ___________________________________________________________________ Name: svn:eol-style + native Modified: Development/ClanLib-0.9/Sources/API/Display/mouse.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Display/mouse.h 2006-09-30 15:52:28 UTC (rev 1091) +++ Development/ClanLib-0.9/Sources/API/Display/mouse.h 2006-09-30 16:04:00 UTC (rev 1092) @@ -1,103 +1,103 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Magnus Norddahl -** Kenneth Gangst (if your name is missing here, please add it) -*/ - -//! clanDisplay="Input" -//! header=display.h - -#ifndef header_mouse -#define header_mouse - -#if _MSC_VER > 1000 -#pragma once -#endif - -#include "api_display.h" -#include "../Core/Signals/signal_v2.h" - -class CL_InputEvent; -class CL_InputDevice; -class CL_Sprite; -class CL_InputState; - -//: Class for handling mouse device. -//- !group=Display/Input! -//- !header=display.h! -class CL_API_DISPLAY CL_Mouse -{ -//! Attributes: -public: - //: Returns the number of mice available. - static int get_device_count(); - - //: Returns a mouse device. - static CL_InputDevice &get_device(int mouse = 0); - - //: Returns the x position of a mouse device. - static int get_x(int mouse = 0); - - //: Returns the y position of a mouse device. - static int get_y(int mouse = 0); - - //: Returns true if the key with the specified key code is pressed. - static bool get_keycode(int keycode, int mouse = 0); - - //: Key name for specified identifier (Mouse Left, Mouse Right). - static CL_String get_key_name(int id); - -//! Operations: -public: - //: Sets the position of a mouse device. - static void set_position(int x, int y, int mouse = 0); - - //: Set a custom mouse cursor. -// static void set_cursor(const CL_Sprite &sprite); - - //: Shows the mouse cursor. - static void show(); - - //: Hides the mouse cursor. - static void hide(); - -//! Signals: -public: - //: Signal emitted when mouse is pressed on the specified mouse. - static CL_Signal_v2<const CL_InputEvent &, const CL_InputState &> &sig_key_down(int mouse = 0); - - //: Signal emitted when mouse is released on the specified mouse. - static CL_Signal_v2<const CL_InputEvent &, const CL_InputState &> &sig_key_up(int mouse = 0); - - //: Signal emitted when mouse is double-clicked on the specified mouse. - static CL_Signal_v2<const CL_InputEvent &, const CL_InputState &> &sig_key_dblclk(int mouse = 0); - - //: Signal emitted when specified mouse is moved. - static CL_Signal_v2<const CL_InputEvent &, const CL_InputState &> &sig_move(int mouse = 0); -}; - -#endif +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Kenneth Gangst (if your name is missing here, please add it) +*/ + +//! clanDisplay="Input" +//! header=display.h + +#ifndef header_mouse +#define header_mouse + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include "api_display.h" +#include "../Core/Signals/signal_v2.h" + +class CL_InputEvent; +class CL_InputDevice; +class CL_Sprite; +class CL_InputState; + +//: Class for handling mouse device. +//- !group=Display/Input! +//- !header=display.h! +class CL_API_DISPLAY CL_Mouse +{ +//! Attributes: +public: + //: Returns the number of mice available. + static int get_device_count(); + + //: Returns a mouse device. + static CL_InputDevice &get_device(int mouse = 0); + + //: Returns the x position of a mouse device. + static int get_x(int mouse = 0); + + //: Returns the y position of a mouse device. + static int get_y(int mouse = 0); + + //: Returns true if the key with the specified key code is pressed. + static bool get_keycode(int keycode, int mouse = 0); + + //: Key name for specified identifier (Mouse Left, Mouse Right). + static CL_String get_key_name(int id); + +//! Operations: +public: + //: Sets the position of a mouse device. + static void set_position(int x, int y, int mouse = 0); + + //: Set a custom mouse cursor. +// static void set_cursor(const CL_Sprite &sprite); + + //: Shows the mouse cursor. + static void show(); + + //: Hides the mouse cursor. + static void hide(); + +//! Signals: +public: + //: Signal emitted when mouse is pressed on the specified mouse. + static CL_Signal_v2<const CL_InputEvent &, const CL_InputState &> &sig_key_down(int mouse = 0); + + //: Signal emitted when mouse is released on the specified mouse. + static CL_Signal_v2<const CL_InputEvent &, const CL_InputState &> &sig_key_up(int mouse = 0); + + //: Signal emitted when mouse is double-clicked on the specified mouse. + static CL_Signal_v2<const CL_InputEvent &, const CL_InputState &> &sig_key_dblclk(int mouse = 0); + + //: Signal emitted when specified mouse is moved. + static CL_Signal_v2<const CL_InputEvent &, const CL_InputState &> &sig_move(int mouse = 0); +}; + +#endif Property changes on: Development/ClanLib-0.9/Sources/API/Display/mouse.h ___________________________________________________________________ Name: svn:eol-style + native Modified: Development/ClanLib-0.9/Sources/API/GUI/Components/push_button.h =================================================================== --- Development/ClanLib-0.9/Sources/API/GUI/Components/push_button.h 2006-09-30 15:52:28 UTC (rev 1091) +++ Development/ClanLib-0.9/Sources/API/GUI/Components/push_button.h 2006-09-30 16:04:00 UTC (rev 1092) @@ -1,101 +1,101 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Harry Storbacka -** Kenneth Gangstoe -** Magnus Norddahl -*/ - -//! clanGUI="Components" -//! header=gui.h - -#ifndef header_button -#define header_button - -#include "../api_gui.h" -#include "../gui_component.h" -#include "../../Core/Signals/callback_v0.h" -#include "../../Display/graphic_context.h" - -class CL_Sprite; -class CL_PushButton_Impl; - -//: Push button component. -//- !group=GUI/Components! -//- !header=gui.h! -class CL_API_GUI CL_PushButton : public CL_GUIComponent -{ -//! Construction: -public: - CL_PushButton(const CL_Rect &geometry, const CL_GUIComponentDescription &desc, CL_ComponentParent *parent); - virtual ~CL_PushButton(); - -//! Attributes: -public: - bool is_pushed() const; - - bool is_toggle() const; - - bool is_flat() const; - - CL_Sprite get_icon() const; - - enum IconPosition - { - icon_left, icon_top, icon_right, icon_bottom - }; - - IconPosition get_icon_position() const; - - bool is_default() const; - - const CL_String &get_text() const; - -//! Operations: -public: - void set_pushed(bool enable); - - void set_toggle(bool enable); - - void set_flat(bool enable); - - void set_icon(const CL_Sprite &icon); - - void set_icon_position(IconPosition pos); - - void set_default(bool enable); - - void set_text(const CL_StringRef &text); - -//! Events: -public: - CL_Callback_v0 &func_clicked(); - -//! Implementation: -private: - CL_SharedPtr<CL_PushButton_Impl> impl; -}; - -#endif +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +** Kenneth Gangstoe +** Magnus Norddahl +*/ + +//! clanGUI="Components" +//! header=gui.h + +#ifndef header_button +#define header_button + +#include "../api_gui.h" +#include "../gui_component.h" +#include "../../Core/Signals/callback_v0.h" +#include "../../Display/graphic_context.h" + +class CL_Sprite; +class CL_PushButton_Impl; + +//: Push button component. +//- !group=GUI/Components! +//- !header=gui.h! +class CL_API_GUI CL_PushButton : public CL_GUIComponent +{ +//! Construction: +public: + CL_PushButton(const CL_Rect &geometry, const CL_GUIComponentDescription &desc, CL_ComponentParent *parent); + virtual ~CL_PushButton(); + +//! Attributes: +public: + bool is_pushed() const; + + bool is_toggle() const; + + bool is_flat() const; + + CL_Sprite get_icon() const; + + enum IconPosition + { + icon_left, icon_top, icon_right, icon_bottom + }; + + IconPosition get_icon_position() const; + + bool is_default() const; + + const CL_String &get_text() const; + +//! Operations: +public: + void set_pushed(bool enable); + + void set_toggle(bool enable); + + void set_flat(bool enable); + + void set_icon(const CL_Sprite &icon); + + void set_icon_position(IconPosition pos); + + void set_default(bool enable); + + void set_text(const CL_StringRef &text); + +//! Events: +public: + CL_Callback_v0 &func_clicked(); + +//! Implementation: +private: + CL_SharedPtr<CL_PushButton_Impl> impl; +}; + +#endif Property changes on: Development/ClanLib-0.9/Sources/API/GUI/Components/push_button.h ___________________________________________________________________ Name: svn:eol-style + native Modified: Development/ClanLib-0.9/Sources/API/GUI/gui_theme_default.h =================================================================== --- Development/ClanLib-0.9/Sources/API/GUI/gui_theme_default.h 2006-09-30 15:52:28 UTC (rev 1091) +++ Development/ClanLib-0.9/Sources/API/GUI/gui_theme_default.h 2006-09-30 16:04:00 UTC (rev 1092) @@ -1,106 +1,106 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Harry Storbacka -** Kenneth Gangst - -//! clanGUI="System" -//! header=gui.h - -#ifndef header_gui_theme_default -#define header_gui_theme_default - -#include "api_gui.h" -#include "../Core/System/sharedptr.h" -#include "gui_theme.h" - -class CL_GUIThemePart; -class CL_GraphicContext; -class CL_Rect; -class CL_GUIThemeDefault_Impl; - -//: Default GUI theme. -//- !group=GUI/System! -//- !header=gui.h! -class CL_GUIThemeDefault : public CL_GUITheme -{ -//! Construction: -public: - //: Constructs a default GUI theme. - CL_GUIThemeDefault(); - - virtual ~CL_GUIThemeDefault(); - -//! Attributes: -public: - //: Allows the theme to alter GUI part properties. - //- <p>When a component queries a theme part for a property, the property - //- is searched in the CSS document and then passed to get_property. If - //- the theme does not wish to alter the value of the property, it simply - //- returns the css_value parameter. The string returned by this function - //- is the result of CL_GUIThemePart::get_property.</p> - virtual CL_StringRef get_property( - const CL_GUIThemePart &part, - const CL_StringRef &name, - const CL_StringRef &css_value); - - //: Returns the resource manager associated with the theme. - virtual CL_ResourceManager get_resources() const; - - //: Retrieves the minimum geometry size allowed by a theme part. - virtual CL_Size get_minimum_size(const CL_GUIThemePart &part) const; - - //: Retrieves the maximum geometry size allowed by a theme part. - virtual CL_Size get_maximum_size(const CL_GUIThemePart &part) const; - - //: Retrieves the preferred geometry size of a theme part. - virtual CL_Size get_preferred_size(const CL_GUIThemePart &part) const; - - //: Returns the content box for a given render box. - virtual CL_Rect get_content_box(const CL_GUIThemePart &part, const CL_Rect &render_box_rect) const; - - //: Returns the render box for a given content box. - virtual CL_Rect get_render_box(const CL_GUIThemePart &part, const CL_Rect &content_box_rect) const; - -//! Operations: -public: - //: Sets the resource manager to be used to retrieve resources. - virtual void set_resources(CL_ResourceManager resources); - - //: Renders a background box for the given theme part. - virtual void render_box(CL_GUIThemePart &part, CL_GraphicContext &gc, const CL_Rect &rect, const CL_Rect &clip_rect); - - //: Notifies the theme that a component has been destroyed. - //- <p>This notification allows a theme to clean up cached theme part - //- resources used by the component.</p> - virtual void component_destroyed(CL_GUIComponent *component); - -//! Implementation: -private: - CL_SharedPtr<CL_GUIThemeDefault_Impl> impl; -}; - -#endif +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +** Kenneth Gangst + +//! clanGUI="System" +//! header=gui.h + +#ifndef header_gui_theme_default +#define header_gui_theme_default + +#include "api_gui.h" +#include "../Core/System/sharedptr.h" +#include "gui_theme.h" + +class CL_GUIThemePart; +class CL_GraphicContext; +class CL_Rect; +class CL_GUIThemeDefault_Impl; + +//: Default GUI theme. +//- !group=GUI/System! +//- !header=gui.h! +class CL_GUIThemeDefault : public CL_GUITheme +{ +//! Construction: +public: + //: Constructs a default GUI theme. + CL_GUIThemeDefault(); + + virtual ~CL_GUIThemeDefault(); + +//! Attributes: +public: + //: Allows the theme to alter GUI part properties. + //- <p>When a component queries a theme part for a property, the property + //- is searched in the CSS document and then passed to get_property. If + //- the theme does not wish to alter the value of the property, it simply + //- returns the css_value parameter. The string returned by this function + //- is the result of CL_GUIThemePart::get_property.</p> + virtual CL_StringRef get_property( + const CL_GUIThemePart &part, + const CL_StringRef &name, + const CL_StringRef &css_value); + + //: Returns the resource manager associated with the theme. + virtual CL_ResourceManager get_resources() const; + + //: Retrieves the minimum geometry size allowed by a theme part. + virtual CL_Size get_minimum_size(const CL_GUIThemePart &part) const; + + //: Retrieves the maximum geometry size allowed by a theme part. + virtual CL_Size get_maximum_size(const CL_GUIThemePart &part) const; + + //: Retrieves the preferred geometry size of a theme part. + virtual CL_Size get_preferred_size(const CL_GUIThemePart &part) const; + + //: Returns the content box for a given render box. + virtual CL_Rect get_content_box(const CL_GUIThemePart &part, const CL_Rect &render_box_rect) const; + + //: Returns the render box for a given content box. + virtual CL_Rect get_render_box(const CL_GUIThemePart &part, const CL_Rect &content_box_rect) const; + +//! Operations: +public: + //: Sets the resource manager to be used to retrieve resources. + virtual void set_resources(CL_ResourceManager resources); + + //: Renders a background box for the given theme part. + virtual void render_box(CL_GUIThemePart &part, CL_GraphicContext &gc, const CL_Rect &rect, const CL_Rect &clip_rect); + + //: Notifies the theme that a component has been destroyed. + //- <p>This notification allows a theme to clean up cached theme part + //- resources used by the component.</p> + virtual void component_destroyed(CL_GUIComponent *component); + +//! Implementation: +private: + CL_SharedPtr<CL_GUIThemeDefault_Impl> impl; +}; + +#endif Property changes on: Development/ClanLib-0.9/Sources/API/GUI/gui_theme_default.h ___________________________________________________________________ Name: svn:eol-style + native Modified: Development/ClanLib-0.9/Sources/Core/IOData/virtual_directory_listing.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Core/IOData/virtual_directory_listing.cpp 2006-09-30 15:52:28 UTC (rev 1091) +++ Development/ClanLib-0.9/Sources/Core/IOData/virtual_directory_listing.cpp 2006-09-30 16:04:00 UTC (rev 1092) @@ -1,140 +1,140 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Harry Storbacka -*/ - -#include "Core/precomp.h" -#include "API/Core/IOData/virtual_directory_listing.h" -#include "API/Core/IOData/virtual_file_source.h" -#include "virtual_directory_listing_entry.h" - - -///////////////////////////////////////////////////////////////////////////// -// CL_VirtualDirectoryListing_Impl Class: - -class CL_VirtualDirectoryListing_Impl -{ -//! Construction: -public: - CL_VirtualDirectoryListing_Impl(CL_VirtualFileSource *provider, const CL_String &path) : provider(provider) - { - provider->initialize_directory_listing(path); - } - - ~CL_VirtualDirectoryListing_Impl() - { - } - - -//! Attributes: - CL_String get_filename() - { - return dir_entry.get_filename(); - } - - bool is_hidden() - { - return dir_entry.is_hidden(); - } - - bool is_readable() - { - return dir_entry.is_readable(); - } - - bool is_writable() - { - return dir_entry.is_writable(); - } - - bool is_directory() - { - return dir_entry.is_directory(); - } -//! Operations: -public: - bool next() - { - return provider->next_file(dir_entry); - } - -//! Implementation: -private: - CL_VirtualDirectoryListingEntry dir_entry; - - CL_VirtualFileSource *provider; -}; - -///////////////////////////////////////////////////////////////////////////// -// CL_VirtualDirectoryListing Construction: - -CL_VirtualDirectoryListing::CL_VirtualDirectoryListing(CL_VirtualFileSource *provider, const CL_String &path) -: impl(new CL_VirtualDirectoryListing_Impl(provider, path)) -{ -} - -CL_VirtualDirectoryListing::~CL_VirtualDirectoryListing() -{ -} - -///////////////////////////////////////////////////////////////////////////// -// CL_VirtualDirectoryListing Attributes: - -CL_String CL_VirtualDirectoryListing::get_filename() -{ - return impl->get_filename(); -} - -bool CL_VirtualDirectoryListing::is_directory() -{ - return impl->is_directory(); -} - -bool CL_VirtualDirectoryListing::is_hidden() -{ - return impl->is_hidden(); -} - -bool CL_VirtualDirectoryListing::is_writable() -{ - return impl->is_writable(); -} - -bool CL_VirtualDirectoryListing::is_readable() -{ - return impl->is_readable(); -} - -///////////////////////////////////////////////////////////////////////////// -// CL_VirtualDirectoryListing Operations: - -bool CL_VirtualDirectoryListing::next() -{ - return impl->next(); -} - -///////////////////////////////////////////////////////////////////////////// -// CL_VirtualDirectoryListing Implementation: +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#include "Core/precomp.h" +#include "API/Core/IOData/virtual_directory_listing.h" +#include "API/Core/IOData/virtual_file_source.h" +#include "virtual_directory_listing_entry.h" + + +///////////////////////////////////////////////////////////////////////////// +// CL_VirtualDirectoryListing_Impl Class: + +class CL_VirtualDirectoryListing_Impl +{ +//! Construction: +public: + CL_VirtualDirectoryListing_Impl(CL_VirtualFileSource *provider, const CL_String &path) : provider(provider) + { + provider->initialize_directory_listing(path); + } + + ~CL_VirtualDirectoryListing_Impl() + { + } + + +//! Attributes: + CL_String get_filename() + { + return dir_entry.get_filename(); + } + + bool is_hidden() + { + return dir_entry.is_hidden(); + } + + bool is_readable() + { + return dir_entry.is_readable(); + } + + bool is_writable() + { + return dir_entry.is_writable(); + } + + bool is_directory() + { + return dir_entry.is_directory(); + } +//! Operations: +public: + bool next() + { + return provider->next_file(dir_entry); + } + +//! Implementation: +private: + CL_VirtualDirectoryListingEntry dir_entry; + + CL_VirtualFileSource *provider; +}; + +///////////////////////////////////////////////////////////////////////////// +// CL_VirtualDirectoryListing Construction: + +CL_VirtualDirectoryListing::CL_VirtualDirectoryListing(CL_VirtualFileSource *provider, const CL_String &path) +: impl(new CL_VirtualDirectoryListing_Impl(provider, path)) +{ +} + +CL_VirtualDirectoryListing::~CL_VirtualDirectoryListing() +{ +} + +///////////////////////////////////////////////////////////////////////////// +// CL_VirtualDirectoryListing Attributes: + +CL_String CL_VirtualDirectoryListing::get_filename() +{ + return impl->get_filename(); +} + +bool CL_VirtualDirectoryListing::is_directory() +{ + return impl->is_directory(); +} + +bool CL_VirtualDirectoryListing::is_hidden() +{ + return impl->is_hidden(); +} + +bool CL_VirtualDirectoryListing::is_writable() +{ + return impl->is_writable(); +} + +bool CL_VirtualDirectoryListing::is_readable() +{ + return impl->is_readable(); +} + +///////////////////////////////////////////////////////////////////////////// +// CL_VirtualDirectoryListing Operations: + +bool CL_VirtualDirectoryListing::next() +{ + return impl->next(); +} + +///////////////////////////////////////////////////////////////////////////// +// CL_VirtualDirectoryListing Implementation: Property changes on: Development/ClanLib-0.9/Sources/Core/IOData/virtual_directory_listing.cpp ___________________________________________________________________ Name: svn:eol-style + native Modified: Development/ClanLib-0.9/Sources/Core/IOData/virtual_directory_listing_entry.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Core/IOData/virtual_directory_listing_entry.cpp 2006-09-30 15:52:28 UTC (rev 1091) +++ Development/ClanLib-0.9/Sources/Core/IOData/virtual_directory_listing_entry.cpp 2006-09-30 16:04:00 UTC (rev 1092) @@ -1,181 +1,181 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Harry Storbacka -*/ - -#include "Core/precomp.h" -#include "virtual_directory_listing_entry.h" - -///////////////////////////////////////////////////////////////////////////// -// CL_VirtualDirectoryListingEntry_Impl Class: - -class CL_VirtualDirectoryListingEntry_Impl -{ -//! Construction: -public: - CL_VirtualDirectoryListingEntry_Impl() - { - } - - ~CL_VirtualDirectoryListingEntry_Impl() - { - } - -//! Attributes: -public: - CL_String get_filename() - { - return filename; - } - - bool is_directory() - { - return directory; - } - - bool is_hidden() - { - return hidden; - } - - bool is_writable() - { - return writable; - } - - bool is_readable() - { - return readable; - } - -//! Operations: -public: - void set_filename(const CL_String &value) - { - filename = value; - } - - void set_directory(bool value) - { - directory = value; - } - - void set_hidden(bool value) - { - hidden = value; - } - - void set_writable(bool value) - { - writable = value; - } - - void set_readable(bool value) - { - readable = value; - } - - -//! Implementation: -private: - CL_String filename; - bool directory; - bool hidden; - bool writable; - bool readable; -}; - -///////////////////////////////////////////////////////////////////////////// -// CL_VirtualDirectoryListingEntry Construction: - -CL_VirtualDirectoryListingEntry::CL_VirtualDirectoryListingEntry() -: impl(new CL_VirtualDirectoryListingEntry_Impl) -{ -} - -CL_VirtualDirectoryListingEntry::~CL_VirtualDirectoryListingEntry() -{ - -} - -///////////////////////////////////////////////////////////////////////////// -// CL_VirtualDirectoryListingEntry Attributes: - -CL_String CL_VirtualDirectoryListingEntry::get_filename() -{ - return impl->get_filename(); -} - -bool CL_VirtualDirectoryListingEntry::is_directory() -{ - return impl->is_directory(); -} - -bool CL_VirtualDirectoryListingEntry::is_hidden() -{ - return impl->is_hidden(); -} - -bool CL_VirtualDirectoryListingEntry::is_writable() -{ - return impl->is_writable(); -} - -bool CL_VirtualDirectoryListingEntry::is_readable() -{ - return impl->is_readable(); -} - -///////////////////////////////////////////////////////////////////////////// -// CL_VirtualDirectoryListingEntry Operations: - -void CL_VirtualDirectoryListingEntry::set_filename(const CL_String &filename) -{ - impl->set_filename(filename); -} - -void CL_VirtualDirectoryListingEntry::set_directory(bool value) -{ - impl->set_directory(value); -} - -void CL_VirtualDirectoryListingEntry::set_hidden(bool value) -{ - impl->set_hidden(value); -} - -void CL_VirtualDirectoryListingEntry::set_writable(bool value) -{ - impl->set_writable(value); -} - -void CL_VirtualDirectoryListingEntry::set_readable(bool value) -{ - impl->set_readable(value); -} - -///////////////////////////////////////////////////////////////////////////// -// CL_VirtualDirectoryListingEntry Implementation: +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this so... [truncated message content] |
From: Changes to t. C. r. <cla...@li...> - 2006-09-30 15:50:43
|
Author: mbn Date: 2006-09-30 17:52:28 +0200 (Sat, 30 Sep 2006) New Revision: 1091 Added: Development/ClanLib-0.9/Sources/GL/GLX/ Development/ClanLib-0.9/Sources/GL/GLX/input_device_x11keyboard.cpp Development/ClanLib-0.9/Sources/GL/GLX/input_device_x11keyboard.h Development/ClanLib-0.9/Sources/GL/GLX/opengl_window_provider_glx.cpp Development/ClanLib-0.9/Sources/GL/GLX/opengl_window_provider_glx.h Modified: Development/ClanLib-0.9/Sources/API/Display/texture_provider.h Development/ClanLib-0.9/Sources/API/GL/opengl_state.h Development/ClanLib-0.9/Sources/GL/Makefile.am Development/ClanLib-0.9/Sources/GL/opengl_canvas_provider.cpp Development/ClanLib-0.9/Sources/GL/opengl_font_provider.cpp Development/ClanLib-0.9/Sources/GL/opengl_font_provider.h Development/ClanLib-0.9/Sources/GL/opengl_graphic_context_provider.cpp Development/ClanLib-0.9/Sources/GL/opengl_graphic_context_provider.h Development/ClanLib-0.9/Sources/GL/opengl_state_impl.h Development/ClanLib-0.9/Sources/GL/opengl_target_provider.cpp Development/ClanLib-0.9/Sources/Makefile.am Log: - Applied Trigve's GLX patch. Modified: Development/ClanLib-0.9/Sources/API/Display/texture_provider.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Display/texture_provider.h 2006-09-30 15:40:31 UTC (rev 1090) +++ Development/ClanLib-0.9/Sources/API/Display/texture_provider.h 2006-09-30 15:52:28 UTC (rev 1091) @@ -33,6 +33,7 @@ #ifndef header_texture_provider #define header_texture_provider +#include "texture.h" #include "api_display.h" #include "../Core/System/sharedptr.h" #include "../Core/Text/string_types.h" Modified: Development/ClanLib-0.9/Sources/API/GL/opengl_state.h =================================================================== --- Development/ClanLib-0.9/Sources/API/GL/opengl_state.h 2006-09-30 15:40:31 UTC (rev 1090) +++ Development/ClanLib-0.9/Sources/API/GL/opengl_state.h 2006-09-30 15:52:28 UTC (rev 1091) @@ -39,6 +39,7 @@ #include "api_gl.h" #include "../Core/System/sharedptr.h" +#include "../Display/texture.h" class CL_GraphicContext; class CL_OpenGLGraphicContextProvider; Added: Development/ClanLib-0.9/Sources/GL/GLX/input_device_x11keyboard.cpp =================================================================== --- Development/ClanLib-0.9/Sources/GL/GLX/input_device_x11keyboard.cpp 2006-09-30 15:40:31 UTC (rev 1090) +++ Development/ClanLib-0.9/Sources/GL/GLX/input_device_x11keyboard.cpp 2006-09-30 15:52:28 UTC (rev 1091) @@ -0,0 +1,348 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** (if your name is missing here, please add it) +*/ + +#include <cstdio> +#include "API/Display/input_device.h" +#include "API/Display/input_event.h" +#include "API/Display/keys.h" +#include "input_device_x11keyboard.h" +#include "opengl_window_provider_glx.h" + +///////////////////////////////////////////////////////////////////////////// +// CL_InputDevice_X11Keyboard construction: + +CL_InputDevice_X11Keyboard::CL_InputDevice_X11Keyboard(CL_OpenGLWindowProvider_GLX *owner) : + owner(owner), sig_provider_event(0) +{ +// type = CL_InputDevice::keyboard; + +// slot_xevent = owner->sig_xevent.connect( +// this, &CL_InputDevice_X11Keyboard::on_xevent); + + current_keys_down.clear(); +} + +CL_InputDevice_X11Keyboard::~CL_InputDevice_X11Keyboard() +{ +} + +///////////////////////////////////////////////////////////////////////////// +// CL_InputDevice_X11Keyboard attributes: + + +///////////////////////////////////////////////////////////////////////////// +// CL_InputDevice_X11Keyboard operations: + +CL_String CL_InputDevice_X11Keyboard::get_key_name(int virtual_key) const +{ + // Look up key name: + char *name = XKeysymToString(virtual_key); + if (name && name[0] != 0) return name; + + // Unknown. Return something at least :) + char buffer[256]; + snprintf(buffer, 256, "Unknown %d", virtual_key); + return buffer; +} + +bool CL_InputDevice_X11Keyboard::get_keycode(int keysym) const +{ + // Ignore all key events when we don't have focus + if(!owner->has_focus()) + return false; + + char keyboard_state[32]; + + KeyCode code = XKeysymToKeycode(owner->get_display(), keysym); + XQueryKeymap(owner->get_display(), keyboard_state); + + return keyboard_state[code/8] & (1 << code%8); +} + +float CL_InputDevice_X11Keyboard::get_axis(int index) const +{ + return 0.0f; +} + +CL_String CL_InputDevice_X11Keyboard::get_name() const +{ + return "System Keyboard"; +} + +CL_String CL_InputDevice_X11Keyboard::get_device_name() const +{ + return "x11:CoreKeyboard"; +} + +int CL_InputDevice_X11Keyboard::get_axis_count() const +{ + return 0; +} + +int CL_InputDevice_X11Keyboard::get_button_count() const +{ + return -1; +} + +///////////////////////////////////////////////////////////////////////////// +// CL_InputDevice_X11Keyboard implementation: +/* +void CL_InputDevice_X11Keyboard::on_xevent(XEvent &event) +{ + // Only handle keyboard events. + if (event.type != KeyPress && event.type != KeyRelease) return; + + // Figure out what key it was: + KeySym sym = XLookupKeysym(&event.xkey, 0); + + // set state of modifier keys + bool key_state = false; + if (event.type == KeyPress) + key_state = true; + + switch(sym) + { + case CL_KEY_LCONTROL: owner->left_ctrl_down = key_state; break; + case CL_KEY_LMENU: owner->left_alt_down = key_state; break; + case CL_KEY_LSHIFT: owner->left_shift_down = key_state; break; + case CL_KEY_RCONTROL: owner->right_ctrl_down = key_state; break; + case CL_KEY_RMENU: owner->right_alt_down = key_state; break; + case CL_KEY_RSHIFT: owner->right_shift_down = key_state; break; + } + + // Setup event structure for ClanLib: + CL_InputEvent key; + key.type = CL_InputEvent::released; + if (event.type == KeyPress) key.type = CL_InputEvent::pressed; + key.id = sym; + key.device = owner->keyboard; + if(current_keys_down.find(sym) == current_keys_down.end()) + { + key.repeat_count = 0; + current_keys_down.insert(KeyDownCounter(sym,0)); + } + else + { + current_keys_down[sym]++; + key.repeat_count = current_keys_down[sym]; + } + + // Need to somehow get proper character sequence from X11. This code + // wont keep proper track of deadkeys: + char buf[11]; + buf[10] = 0; + XLookupString(&event.xkey, buf, 10, 0, 0); + if (strlen(buf) > 0) key.str = std::string(buf, 1); + + // Emit it. + if (key.type == CL_InputEvent::pressed) + { + owner->keyboard.sig_key_down().call(key); + } + else + { + owner->keyboard.sig_key_up().call(key); + current_keys_down.erase(sym); + } +} +*/ +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** (if your name is missing here, please add it) +*/ + +#include <cstdio> +#include "API/Display/input_device.h" +#include "API/Display/input_event.h" +#include "API/Display/keys.h" +#include "input_device_x11keyboard.h" +#include "opengl_window_provider_glx.h" + +///////////////////////////////////////////////////////////////////////////// +// CL_InputDevice_X11Keyboard construction: + +CL_InputDevice_X11Keyboard::CL_InputDevice_X11Keyboard(CL_OpenGLWindowProvider_GLX *owner) : + owner(owner), sig_provider_event(0) +{ +// type = CL_InputDevice::keyboard; + +// slot_xevent = owner->sig_xevent.connect( +// this, &CL_InputDevice_X11Keyboard::on_xevent); + + current_keys_down.clear(); +} + +CL_InputDevice_X11Keyboard::~CL_InputDevice_X11Keyboard() +{ +} + +///////////////////////////////////////////////////////////////////////////// +// CL_InputDevice_X11Keyboard attributes: + + +///////////////////////////////////////////////////////////////////////////// +// CL_InputDevice_X11Keyboard operations: + +CL_String CL_InputDevice_X11Keyboard::get_key_name(int virtual_key) const +{ + // Look up key name: + char *name = XKeysymToString(virtual_key); + if (name && name[0] != 0) return name; + + // Unknown. Return something at least :) + char buffer[256]; + snprintf(buffer, 256, "Unknown %d", virtual_key); + return buffer; +} + +bool CL_InputDevice_X11Keyboard::get_keycode(int keysym) const +{ + // Ignore all key events when we don't have focus + if(!owner->has_focus()) + return false; + + char keyboard_state[32]; + + KeyCode code = XKeysymToKeycode(owner->get_display(), keysym); + XQueryKeymap(owner->get_display(), keyboard_state); + + return keyboard_state[code/8] & (1 << code%8); +} + +float CL_InputDevice_X11Keyboard::get_axis(int index) const +{ + return 0.0f; +} + +CL_String CL_InputDevice_X11Keyboard::get_name() const +{ + return "System Keyboard"; +} + +CL_String CL_InputDevice_X11Keyboard::get_device_name() const +{ + return "x11:CoreKeyboard"; +} + +int CL_InputDevice_X11Keyboard::get_axis_count() const +{ + return 0; +} + +int CL_InputDevice_X11Keyboard::get_button_count() const +{ + return -1; +} + +///////////////////////////////////////////////////////////////////////////// +// CL_InputDevice_X11Keyboard implementation: +/* +void CL_InputDevice_X11Keyboard::on_xevent(XEvent &event) +{ + // Only handle keyboard events. + if (event.type != KeyPress && event.type != KeyRelease) return; + + // Figure out what key it was: + KeySym sym = XLookupKeysym(&event.xkey, 0); + + // set state of modifier keys + bool key_state = false; + if (event.type == KeyPress) + key_state = true; + + switch(sym) + { + case CL_KEY_LCONTROL: owner->left_ctrl_down = key_state; break; + case CL_KEY_LMENU: owner->left_alt_down = key_state; break; + case CL_KEY_LSHIFT: owner->left_shift_down = key_state; break; + case CL_KEY_RCONTROL: owner->right_ctrl_down = key_state; break; + case CL_KEY_RMENU: owner->right_alt_down = key_state; break; + case CL_KEY_RSHIFT: owner->right_shift_down = key_state; break; + } + + // Setup event structure for ClanLib: + CL_InputEvent key; + key.type = CL_InputEvent::released; + if (event.type == KeyPress) key.type = CL_InputEvent::pressed; + key.id = sym; + key.device = owner->keyboard; + if(current_keys_down.find(sym) == current_keys_down.end()) + { + key.repeat_count = 0; + current_keys_down.insert(KeyDownCounter(sym,0)); + } + else + { + current_keys_down[sym]++; + key.repeat_count = current_keys_down[sym]; + } + + // Need to somehow get proper character sequence from X11. This code + // wont keep proper track of deadkeys: + char buf[11]; + buf[10] = 0; + XLookupString(&event.xkey, buf, 10, 0, 0); + if (strlen(buf) > 0) key.str = std::string(buf, 1); + + // Emit it. + if (key.type == CL_InputEvent::pressed) + { + owner->keyboard.sig_key_down().call(key); + } + else + { + owner->keyboard.sig_key_up().call(key); + current_keys_down.erase(sym); + } +} +*/ Property changes on: Development/ClanLib-0.9/Sources/GL/GLX/input_device_x11keyboard.cpp ___________________________________________________________________ Name: svn:eol-style + native Added: Development/ClanLib-0.9/Sources/GL/GLX/input_device_x11keyboard.h =================================================================== --- Development/ClanLib-0.9/Sources/GL/GLX/input_device_x11keyboard.h 2006-09-30 15:40:31 UTC (rev 1090) +++ Development/ClanLib-0.9/Sources/GL/GLX/input_device_x11keyboard.h 2006-09-30 15:52:28 UTC (rev 1091) @@ -0,0 +1,224 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** (if your name is missing here, please add it) +*/ + +#ifndef header_input_device_x11keyboard +#define header_input_device_x11keyboard + +#if _MSC_VER > 1000 +#pragma once +#endif + +//#include "Display/input_device_generic.h" +//#include "API/signals.h" +#include "API/Display/input_device.h" +#include "API/Display/input_device_provider.h" + +#include <X11/Xlib.h> +#include <X11/Xutil.h> + +#include <map> + +class CL_OpenGLWindowProvider_GLX; + +class CL_InputDevice_X11Keyboard : public CL_InputDeviceProvider +{ +//!Construction: +public: + CL_InputDevice_X11Keyboard(CL_OpenGLWindowProvider_GLX *owner); + + virtual ~CL_InputDevice_X11Keyboard(); + +//!Attributes: +public: + +//!Operations: +public: + //: Returns the input device type. + CL_InputDevice::Type get_type() const + { + return CL_InputDevice::keyboard; + } + + //: Key name for specified identifier (A, B, C, Space, Enter, Backspace). + CL_String get_key_name(int id) const; + + //: Returns true if the passed key code is down for this device. + bool get_keycode(int keycode) const; + + //: Returns the the current position of a joystick axis. + virtual float get_axis(int index) const; + + //: Returns the name of the device (i.e. 'Microsoft Sidewinder 3D'). + virtual CL_String get_name() const; + + //: Return the hardware id/device for this device (i.e. '/dev/input/js0') + virtual CL_String get_device_name() const; + + //: Returns the number of axes available on this device. + virtual int get_axis_count() const; + + //: Returns the number of buttons available on this device. + //- <p>If used on a keyboard, this function returns -1.</p> + virtual int get_button_count() const; + + //: Initialize input device provider. + //- <p>The device field of CL_InputEvent should not be set when emitting events.</p> + void init(CL_Signal_v1<const CL_InputEvent &> *new_sig_provider_event) + { + sig_provider_event = new_sig_provider_event; + } + +//!Implementation: +private: + void on_xevent(XEvent &event); + + CL_OpenGLWindowProvider_GLX *owner; +// CL_Slot slot_xevent; + CL_Signal_v1<const CL_InputEvent &> *sig_provider_event; + + + + std::map<KeySym,int> current_keys_down; + typedef std::pair<KeySym,int> KeyDownCounter; + +}; + +#endif +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** (if your name is missing here, please add it) +*/ + +#ifndef header_input_device_x11keyboard +#define header_input_device_x11keyboard + +#if _MSC_VER > 1000 +#pragma once +#endif + +//#include "Display/input_device_generic.h" +//#include "API/signals.h" +#include "API/Display/input_device.h" +#include "API/Display/input_device_provider.h" + +#include <X11/Xlib.h> +#include <X11/Xutil.h> + +#include <map> + +class CL_OpenGLWindowProvider_GLX; + +class CL_InputDevice_X11Keyboard : public CL_InputDeviceProvider +{ +//!Construction: +public: + CL_InputDevice_X11Keyboard(CL_OpenGLWindowProvider_GLX *owner); + + virtual ~CL_InputDevice_X11Keyboard(); + +//!Attributes: +public: + +//!Operations: +public: + //: Returns the input device type. + CL_InputDevice::Type get_type() const + { + return CL_InputDevice::keyboard; + } + + //: Key name for specified identifier (A, B, C, Space, Enter, Backspace). + CL_String get_key_name(int id) const; + + //: Returns true if the passed key code is down for this device. + bool get_keycode(int keycode) const; + + //: Returns the the current position of a joystick axis. + virtual float get_axis(int index) const; + + //: Returns the name of the device (i.e. 'Microsoft Sidewinder 3D'). + virtual CL_String get_name() const; + + //: Return the hardware id/device for this device (i.e. '/dev/input/js0') + virtual CL_String get_device_name() const; + + //: Returns the number of axes available on this device. + virtual int get_axis_count() const; + + //: Returns the number of buttons available on this device. + //- <p>If used on a keyboard, this function returns -1.</p> + virtual int get_button_count() const; + + //: Initialize input device provider. + //- <p>The device field of CL_InputEvent should not be set when emitting events.</p> + void init(CL_Signal_v1<const CL_InputEvent &> *new_sig_provider_event) + { + sig_provider_event = new_sig_provider_event; + } + +//!Implementation: +private: + void on_xevent(XEvent &event); + + CL_OpenGLWindowProvider_GLX *owner; +// CL_Slot slot_xevent; + CL_Signal_v1<const CL_InputEvent &> *sig_provider_event; + + + + std::map<KeySym,int> current_keys_down; + typedef std::pair<KeySym,int> KeyDownCounter; + +}; + +#endif Property changes on: Development/ClanLib-0.9/Sources/GL/GLX/input_device_x11keyboard.h ___________________________________________________________________ Name: svn:eol-style + native Added: Development/ClanLib-0.9/Sources/GL/GLX/opengl_window_provider_glx.cpp =================================================================== --- Development/ClanLib-0.9/Sources/GL/GLX/opengl_window_provider_glx.cpp 2006-09-30 15:40:31 UTC (rev 1090) +++ Development/ClanLib-0.9/Sources/GL/GLX/opengl_window_provider_glx.cpp 2006-09-30 15:52:28 UTC (rev 1091) @@ -0,0 +1,2174 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#include "GL/precomp.h" +#include "opengl_window_provider_glx.h" +#include "API/Core/Math/rect.h" +#include "API/Display/display_window_description.h" +#include "API/Display/input_event.h" +#include "API/GL/opengl.h" +#include "API/GL/opengl_wrap.h" +#include "API/GL/opengl_state.h" +#include "API/Core/Text/logger.h" +#include "../opengl_window_description_impl.h" +#include "../opengl_graphic_context_provider.h" +//#include "input_device_provider_win32keyboard.h" +//#include "input_device_provider_win32mouse.h" +//#include "input_device_provider_win32tablet.h" +//#include "input_device_provider_directinput.h" +/* +#ifndef WM_MOUSEWHEEL +#define WM_MOUSEWHEEL 0x020A +#endif +#ifndef WM_XBUTTONDOWN +#define WM_XBUTTONDOWN 0x020B +#define WM_XBUTTONUP 0x020C +#define WM_XBUTTONDBLCLK 0x020D +#endif +#ifndef WS_EX_LAYERED +#define WS_EX_LAYERED 0x00080000 +#endif +#ifndef AC_SRC_ALPHA +#define AC_SRC_ALPHA 1 +#endif +#ifndef ULW_OPAQUE +#define ULW_OPAQUE 0 +#endif +#ifndef ULW_COLORKEY +#define ULW_COLORKEY 1 +#endif +#ifndef ULW_ALPHA +#define ULW_ALPHA 2 +#endif +*/ + +GLXContext CL_OpenGLWindowProvider_GLX::share_context; +std::map<Window, CL_OpenGLWindowProvider_GLX *> CL_OpenGLWindowProvider_GLX::window_map; + +///////////////////////////////////////////////////////////////////////////// +// CL_OpenGLWindowProvider_WGL Construction: + +CL_OpenGLWindowProvider_GLX::CL_OpenGLWindowProvider_GLX() +: window(0), fullscreen(false), allow_resize(false), layered(false), bpp(0), + saved_position(0, 0, 0, 0), mouse_pos(-1,-1), disp(0), context(0) +{ +// keyboard = new CL_InputDeviceProvider_Win32Keyboard(this); +// mouse = new CL_InputDeviceProvider_Win32Mouse(this); + + gc = CL_GraphicContext(new CL_OpenGLGraphicContextProvider(this)); +} + +CL_OpenGLWindowProvider_GLX::~CL_OpenGLWindowProvider_GLX() +{ + if(context) + { + if (!glXMakeCurrent(disp, None, NULL)) + { + printf("Could not release drawing context.\n"); + } + + glXDestroyContext(disp, context); + context = NULL; + } + +// keyboard = CL_InputDevice(); +// mouse = CL_InputDevice(); +// get_ic()->clear(); + + if(window) + XDestroyWindow(disp, window); + + window = 0; + +// if (disp_ref_count > 0) +// { +// disp_ref_count--; +// if (disp_ref_count == 0) +// { + XCloseDisplay(disp); +// disp = 0; +// } +// } + +} + +///////////////////////////////////////////////////////////////////////////// +// CL_OpenGLWindowProvider_WGL Attributes: + +//std::list<HGLRC> CL_OpenGLWindowProvider_WGL::opengl_contexts; +//std::map<HWND, CL_OpenGLWindowProvider_WGL *> CL_OpenGLWindowProvider_WGL::window_map; + +static std::list<GLXContext> opengl_contexts; +static std::map<Window, CL_OpenGLWindowProvider_GLX *> window_map; + +CL_Rect CL_OpenGLWindowProvider_GLX::get_geometry() const +{ +// RECT rect; +// GetWindowRect(hwnd, &rect); + Window *new_window; + int x, y; + unsigned int width, height; + unsigned int temp; + XGetGeometry(disp, window, new_window, &x, &y, &width, &height, &temp, &temp); + return CL_Rect(x, y, x + width, y + height); +} + +CL_Rect CL_OpenGLWindowProvider_GLX::get_viewport() const +{ +// if (layered) +// return layered_position; +// RECT rect; +// GetClientRect(hwnd, &rect); +// return CL_Rect(rect.left, rect.top, rect.right, rect.bottom); + XWindowAttributes attr; + XGetWindowAttributes(disp, window, &attr); + return CL_Rect(attr.x, attr.y, attr.x + attr.width, attr.y + attr.height); +} + +bool CL_OpenGLWindowProvider_GLX::is_fullscreen() const +{ + return fullscreen; +} + +bool CL_OpenGLWindowProvider_GLX::has_focus() const +{ + return focus; +} + +///////////////////////////////////////////////////////////////////////////// +// CL_OpenGLWindowProvider_WGL Operations: + +void CL_OpenGLWindowProvider_GLX::create(CL_DisplayWindowSite *new_site, const CL_DisplayWindowDescription &desc) +{ + site = new_site; + create_new_window(desc); +} + +/* +void CL_OpenGLWindowProvider_GLX::modify_window(const CL_DisplayWindowDescription &desc) +{ + bool clientSize = true; + + if (!fullscreen) + { + RECT rect; + GetWindowRect(hwnd, &rect); + saved_position.left = rect.left; + saved_position.top = rect.top; + saved_position.right = rect.right; + saved_position.bottom = rect.bottom; + } + + title = desc.get_title(); + fullscreen = desc.is_fullscreen(); + layered = desc.is_layered(); + layered_position = desc.get_position(); + allow_resize = desc.get_allow_resize(); + + int x = 0; + int y = 0; + int width = desc.get_size().width; + int height = desc.get_size().height; + + if (desc.is_fullscreen()) + { + width = GetSystemMetrics(SM_CXSCREEN); + height = GetSystemMetrics(SM_CYSCREEN); + } + else + { + int scr_width = GetSystemMetrics(SM_CXSCREEN); + int scr_height = GetSystemMetrics(SM_CYSCREEN); + + x = scr_width/2 - width/2; + y = scr_height/2 - height/2; + } + + if (width == 0 && height == 0) + { + x = saved_position.left; + y = saved_position.top; + width = saved_position.get_width(); + height = saved_position.get_height(); + clientSize = false; + } + + int style; + if (desc.is_fullscreen()) + { + style = WS_POPUP; + } + else if (allow_resize) + { + style = WS_POPUP | WS_SYSMENU | WS_SIZEBOX | WS_MAXIMIZEBOX | WS_MINIMIZEBOX; + if (desc.has_caption()) + style |= WS_CAPTION; + } + else + { + style = WS_POPUPWINDOW | WS_MINIMIZEBOX; + if (desc.has_caption()) + style |= WS_CAPTION; + } + + int ex_style = 0; + if (desc.is_layered()) + { + ex_style = WS_EX_LAYERED; + } + + // get size of window with decorations to pass to CreateWindow + RECT window_rect = { x, y, x+width, y+height }; + if (clientSize) + AdjustWindowRectEx( &window_rect, style, FALSE, ex_style ); + + SetWindowLong(hwnd, GWL_STYLE, style); + SetWindowLong(hwnd, GWL_EXSTYLE, ex_style); + + if (desc.is_fullscreen()) + { + // Make always on top + SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, width, height, SWP_FRAMECHANGED); + } + else + { + // Clear always on top flag; size as requested by description struct. + SetWindowPos( + hwnd, + HWND_TOP, + window_rect.left, + window_rect.top, + window_rect.right-window_rect.left, + window_rect.bottom-window_rect.top, + SWP_FRAMECHANGED); + } + + ShowWindow(hwnd, SW_SHOW); + UpdateWindow(hwnd); + RedrawWindow(0, 0, 0, RDW_ALLCHILDREN|RDW_INVALIDATE|RDW_UPDATENOW); +} +*/ + +void CL_OpenGLWindowProvider_GLX::create_new_window(const CL_DisplayWindowDescription &desc) +{ + const CL_OpenGLWindowDescription_Impl *gl_desc = 0; +// gl_desc = dynamic_cast<const CL_OpenGLWindowDescription_Impl*>(desc.impl.get()); + +// fullscreen_width = desc.get_size().width; +// fullscreen_height = desc.get_size().height; + + XVisualInfo *vi; + Colormap cmap; + + if (disp == 0) + { + disp = XOpenDisplay(0); + if (disp == 0) + throw CL_Exception("Could not open X11 display!"); + } +// disp_ref_count++; + + + int gl_attribs_single[] = + { + GLX_RGBA, + GLX_RED_SIZE, 4, + GLX_GREEN_SIZE, 4, + GLX_BLUE_SIZE, 4, + GLX_DEPTH_SIZE, 16, + None + }; + + int gl_attribs[32]; + int i = 0; + + if( gl_desc ) + { + if( gl_desc->rgba ) gl_attribs[i++] = GLX_RGBA; + if( gl_desc->doublebuffer ) gl_attribs[i++] = GLX_DOUBLEBUFFER; + if( gl_desc->stereo ) gl_attribs[i++] = GLX_STEREO; + gl_attribs[i++] = GLX_BUFFER_SIZE; + gl_attribs[i++] = gl_desc->buffer_size; + gl_attribs[i++] = GLX_LEVEL; + gl_attribs[i++] = gl_desc->level; + gl_attribs[i++] = GLX_AUX_BUFFERS; + gl_attribs[i++] = gl_desc->aux_buffers; + gl_attribs[i++] = GLX_RED_SIZE; + gl_attribs[i++] = gl_desc->red_size; + gl_attribs[i++] = GLX_GREEN_SIZE; + gl_attribs[i++] = gl_desc->green_size; + gl_attribs[i++] = GLX_BLUE_SIZE; + gl_attribs[i++] = gl_desc->blue_size; + gl_attribs[i++] = GLX_DEPTH_SIZE; + gl_attribs[i++] = gl_desc->depth_size; + gl_attribs[i++] = GLX_STENCIL_SIZE; + gl_attribs[i++] = gl_desc->stencil_size; + gl_attribs[i++] = GLX_ACCUM_RED_SIZE; + gl_attribs[i++] = gl_desc->accum_red_size; + gl_attribs[i++] = GLX_ACCUM_GREEN_SIZE; + gl_attribs[i++] = gl_desc->accum_green_size; + gl_attribs[i++] = GLX_ACCUM_BLUE_SIZE; + gl_attribs[i++] = gl_desc->accum_blue_size; + gl_attribs[i++] = GLX_ACCUM_ALPHA_SIZE; + gl_attribs[i++] = gl_desc->accum_alpha_size; + gl_attribs[i++] = GLX_ACCUM_RED_SIZE; + gl_attribs[i++] = gl_desc->accum_red_size; + gl_attribs[i++] = None; + } + else + { + gl_attribs[i++] = GLX_RGBA; + gl_attribs[i++] = GLX_DOUBLEBUFFER; + gl_attribs[i++] = GLX_RED_SIZE; + gl_attribs[i++] = 4; + gl_attribs[i++] = GLX_GREEN_SIZE; + gl_attribs[i++] = 4; + gl_attribs[i++] = GLX_BLUE_SIZE; + gl_attribs[i++] = 4; + gl_attribs[i++] = GLX_DEPTH_SIZE; + gl_attribs[i++] = 16; + gl_attribs[i++] = None; + } + + // get an appropriate visual + vi = glXChooseVisual(disp, DefaultScreen(disp), gl_attribs); + + if (vi == NULL) + { + vi = glXChooseVisual(disp, window, gl_attribs_single); + printf("Requested visual not supported by your OpenGL implementation. Falling back on singlebuffered Visual!\n"); + } + + // create a GLX context + context = glXCreateContext(disp, vi, share_context, True); + if(context == NULL) + throw CL_Exception("glXCreateContext failed"); + + if( share_context == NULL ) + share_context = context; + + glXGetConfig(disp, vi, GLX_BUFFER_SIZE, &bpp); + + // create a color map + cmap = XCreateColormap( disp, RootWindow(disp, vi->screen), vi->visual, AllocNone); + + attributes.colormap = cmap; + attributes.border_pixel = 0; + attributes.override_redirect = False; + + // create a window in window mode + attributes.event_mask = + ExposureMask | + KeyPressMask | + KeyReleaseMask | + ButtonPressMask | + ButtonReleaseMask | + StructureNotifyMask | + PointerMotionMask | + EnterWindowMask | + LeaveWindowMask | + FocusChangeMask; + + window = XCreateWindow(disp, RootWindow(disp, vi->screen), + 0, 0, desc.get_size().width, desc.get_size().height, 0, vi->depth, InputOutput, vi->visual, + CWBorderPixel | CWColormap | CWOverrideRedirect | CWEventMask, &attributes); + + window_map[window] = this; + + XSelectInput(disp, window, + FocusChangeMask | KeyPressMask | KeyReleaseMask + | PropertyChangeMask | StructureNotifyMask | + KeymapStateMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask); + + // set title of window: + set_title(desc.get_title()); + + // setup size hints: + XSizeHints size_hints; + memset(&size_hints, 0, sizeof(XSizeHints)); + size_hints.width = desc.get_size().width; + size_hints.height = desc.get_size().height; + size_hints.base_width = desc.get_size().width; + size_hints.base_height = desc.get_size().height; + size_hints.min_width = size_hints.width; + size_hints.min_height = size_hints.height; + size_hints.max_width = size_hints.width; + size_hints.max_height = size_hints.height; + size_hints.flags = PSize|PBaseSize; + if (!desc.get_allow_resize()) size_hints.flags |= PMinSize | PMaxSize; + XSetWMNormalHints(disp, window, &size_hints); + + // handle wm_delete_events if in windowed mode: + Atom wm_delete = XInternAtom(disp, "WM_DELETE_WINDOW", True); + XSetWMProtocols(disp, window, &wm_delete, 1); + + // make window visible: + XMapRaised(disp, window); + + if (!glXIsDirect(disp, context)) + printf("No hardware acceleration available. I hope you got a really fast machine..\n"); + + // Create input devices for window: +// keyboard = CL_InputDevice(new CL_InputDevice_X11Keyboard(this)); +// mouse = CL_InputDevice(new CL_InputDevice_X11Mouse(this)); + +// get_ic()->clear(); +// get_ic()->add_keyboard(keyboard); +// get_ic()->add_mouse(mouse); + +// setup_joysticks(); +// setup_usb_mice(); +// setup_xinput(); +// setup_event(); + + XSync(disp, True); + + focus = true; + + system_cursor = XCreateFontCursor(disp, XC_left_ptr); + char *data = (char*)malloc(64); // 8x8 + memset(data, 0, 64); + + XColor black_color; + memset(&black_color, 0, sizeof(black_color)); + + cursor_bitmap = XCreateBitmapFromData(disp, window, data, 8, 8); + hidden_cursor = XCreatePixmapCursor(disp, cursor_bitmap, cursor_bitmap, &black_color, &black_color, 0,0 ); + + if (desc.is_fullscreen()) + set_fullscreen(desc.get_size().width, desc.get_size().height, desc.get_bpp(), desc.get_refresh_rate()); +} + +void CL_OpenGLWindowProvider_GLX::set_fullscreen(int width, int height, int bpp_local, int refresh_rate) +{ + if(fullscreen) + return; + + // Vid-mode Switching + XF86VidModeModeLine cur_mode; + + XF86VidModeGetModeLine(disp, 0, &dotclock, &cur_mode); + + old_mode.dotclock = dotclock; + old_mode.hdisplay = cur_mode.hdisplay; + old_mode.hsyncstart = cur_mode.hsyncstart; + old_mode.hsyncend = cur_mode.hsyncend; + old_mode.htotal = cur_mode.htotal; + old_mode.vdisplay = cur_mode.vdisplay; + old_mode.vsyncstart = cur_mode.vsyncstart; + old_mode.vsyncend = cur_mode.vsyncend; + old_mode.vtotal = cur_mode.vtotal; + old_mode.flags = cur_mode.flags; + old_mode.privsize = 0; + + int num_modes; + XF86VidModeModeInfo **modes; + XF86VidModeGetAllModeLines(disp, 0, &num_modes, &modes); + + std::list<XF86VidModeModeInfo *> usable_modes; + for(int i = 0; i < num_modes; i++) + { + if(modes[i]->hdisplay == width && modes[i]->vdisplay == height) + { + cl_log_event("debug", "Useable fullscreen mode found: %1x%2", width, height); + usable_modes.push_back(modes[i]); + } + } + + if (usable_modes.empty()) + { + cl_log_event("debug", "No useable fullscreen modes available!"); + } + else + { + if(!width) + width = get_viewport().get_width(); + + if(!height) + height = get_viewport().get_height(); + + if(!bpp_local) + bpp_local = bpp; + + //Hide Window + if (0) + { // FIXME: allow_override doesn't play together with + // GrabPointer, not sure what is wrong but it simply doesn't + // work. + // + // The code outside the 'if(0)' as it is now, works mostly, + // however it doesn't work when the window or a part of it is + // outside of the screen, since the window isn't moved + // fullscreen will only show half the window, shouldn't be a + // problem for most of the time, but will be tricky if the + // window has equal size as the desktop. + + // Move the window into the right position, this must happen + // BEFORE we remove control from the window manager + XMoveResizeWindow(disp, window, 0, 0, width, height); + + // Move the mouse and switch moves + XWarpPointer(disp, None, None, 0, 0, 0, 0, width/2, height/2); + + XUnmapWindow(disp, window); + { // Wait for window to disapear + XEvent event; + do { + XMaskEvent(disp, StructureNotifyMask, &event); + } while ( (event.type != UnmapNotify) || (event.xunmap.event != window) ); + } + // Turn off WM control + attributes.override_redirect = True; + XChangeWindowAttributes(disp, window, CWBorderPixel | CWColormap | CWOverrideRedirect, &attributes); + + // Re-appear window + XMapRaised(disp, window); + } + + // Get input focus + //XSetInputFocus(disp,window, RevertToNone, CurrentTime); + while (1) + { + int result = XGrabPointer(disp, window, True, 0, + GrabModeAsync, GrabModeAsync, window, None, CurrentTime); + if ( result == GrabSuccess ) { + break; + } + CL_System::sleep(100); + } + + XF86VidModeGetViewPort(disp, DefaultScreen(disp), &old_x, &old_y); + + XF86VidModeSwitchToMode(disp, 0, *(usable_modes.begin())); + Window child_window; + int x, y; + // Get the windows absolute position (aka relative to + // the root window) + XTranslateCoordinates(disp, window, DefaultRootWindow(disp), + 0, 0, &x, &y, &child_window); + + XF86VidModeSetViewPort(disp, DefaultScreen(disp), x, y); + + XSync(disp, True); + + fullscreen = true; + } +} +/* +BOOL CL_OpenGLWindowProvider_GLX::enum_devices_callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef) +{ + CL_OpenGLWindowProvider_WGL *self = (CL_OpenGLWindowProvider_WGL *) pvRef; + try + { + CL_InputDevice device(new CL_InputDeviceProvider_DirectInput(self, lpddi)); + self->ic.add_joystick(device); + } + catch (CL_Exception error) + { + cl_log_event("debug", "Could not setup game controller: %1", error.message); + } + return TRUE; +} +*/ +/* +LONG WINAPI CL_OpenGLWindowProvider_WGL::message_handler( + HWND hWnd, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + // Lookup window and call its event handler: + std::map<HWND, CL_OpenGLWindowProvider_WGL *>::iterator it = window_map.find(hWnd); + if (it != window_map.end()) + { + bool handled = it->second->received_event(uMsg, wParam, lParam); + if (handled) return TRUE; + } + + // Do default window processing if our event handler didnt handle it: + return DefWindowProc(hWnd, uMsg, wParam, lParam); +} +*/ +/* +bool CL_OpenGLWindowProvider_WGL::received_event(UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_KEYDOWN: + case WM_SYSKEYDOWN: + case WM_KEYUP: + case WM_SYSKEYUP: + received_keyboard_input(uMsg, wParam, lParam); + return true; + + case WM_LBUTTONDOWN: + case WM_LBUTTONUP: + case WM_LBUTTONDBLCLK: + case WM_RBUTTONDOWN: + case WM_RBUTTONUP: + case WM_RBUTTONDBLCLK: + case WM_MBUTTONDOWN: + case WM_MBUTTONUP: + case WM_MBUTTONDBLCLK: + case WM_MOUSEWHEEL: + case WM_XBUTTONDOWN: + case WM_XBUTTONUP: + case WM_XBUTTONDBLCLK: + received_mouse_input(uMsg, wParam, lParam); + return true; + + case WM_MOUSEMOVE: + received_mouse_move(uMsg, wParam, lParam); + return true; + + case WM_SIZE: + ((CL_OpenGLGraphicContextProvider *) gc.get_provider())->sig_update_viewport.invoke(); + if (site) + site->sig_resize->invoke(LOWORD(lParam), HIWORD(lParam)); + return true; + + case WM_ACTIVATE: + if (site) + { + if (LOWORD(wParam) == WA_INACTIVE) + site->sig_lost_focus->invoke(); + else + site->sig_got_focus->invoke(); + } + return true; + + case WM_CLOSE: + if (site) + site->sig_window_close->invoke(); + return true; + + case WM_PAINT: + { +// HDC hdc = (HDC) wParam; + RECT rect; + if (GetUpdateRect(hwnd, &rect, FALSE)) + { + PAINTSTRUCT paint; + BeginPaint(hwnd, &paint); + + CL_Rect cl_rect; + cl_rect.left = rect.left; + cl_rect.top = rect.top; + cl_rect.right = rect.right; + cl_rect.bottom = rect.bottom; + + if (site) + site->sig_paint->invoke(cl_rect); + + EndPaint(hwnd, &paint); + } + else + { + if (site) + site->sig_paint->invoke(get_viewport()); + } + } + return true; + + case WM_DESTROY: + if (opengl_context) + { + wglMakeCurrent(0, 0); + wglDeleteContext(opengl_context); + opengl_context = 0; + opengl_contexts.remove(opengl_context); + } + window_map.erase(window_map.find(hwnd)); + return true; + + case WM_SYSCOMMAND: + // Do not allow screensaver to start. + if (wParam == SC_SCREENSAVE) return true; + break; + } + + return false; +} +*/ + +void CL_OpenGLWindowProvider_GLX::set_videomode(int width, int height, int bpp, int refresh_rate) +{ + +/* + DEVMODE devmode; + memset(&devmode, 0, sizeof(DEVMODE)); + + // Default to 32 bit BPP: + if (bpp == 0) bpp = 32; + + int index = 0; + + // User wants a specific refresh-rate: + if (refresh_rate != 0) + { + while (true) + { + DEVMODE cur_devmode; + memset(&cur_devmode, 0, sizeof(DEVMODE)); + cur_devmode.dmSize = sizeof(DEVMODE); + if (EnumDisplaySettings(0, index++, &cur_devmode) == 0) break; + + if ( + cur_devmode.dmPelsWidth == width && + cur_devmode.dmPelsHeight == height && + cur_devmode.dmBitsPerPel == bpp && + cur_devmode.dmDisplayFrequency == refresh_rate) + { + devmode = cur_devmode; + } + } + } + + // If specific mode not found, try to find the highest possible refresh-rate mode: + if (devmode.dmFields == 0) + { + while (true) + { + DEVMODE cur_devmode; + memset(&cur_devmode, 0, sizeof(DEVMODE)); + cur_devmode.dmSize = sizeof(DEVMODE); + if (EnumDisplaySettings(0, index++, &cur_devmode) == 0) break; + + if ( + cur_devmode.dmPelsWidth == width && + cur_devmode.dmPelsHeight == height && + cur_devmode.dmBitsPerPel == bpp && + cur_devmode.dmDisplayFrequency > devmode.dmDisplayFrequency) + { + devmode = cur_devmode; + } + } + } + + // If the mode wasnt found, try anyway but without refresh mode info: + if (devmode.dmFields == 0) + { + devmode.dmSize = sizeof(DEVMODE); + devmode.dmPelsWidth = width; + devmode.dmPelsHeight = height; + devmode.dmBitsPerPel = bpp; + devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; + } + + //saved_window_positions.clear(); + //EnumWindows(&CL_OpenGLWindowProvider_WGL::enum_windows_callback_save, (LPARAM) this); + + LONG err = ChangeDisplaySettings(&devmode, CDS_FULLSCREEN); + + if (err != DISP_CHANGE_SUCCESSFUL) + { + switch (err) + { + case DISP_CHANGE_RESTART: + throw CL_Exception("This OS sucks! It wants you to restart your computer to change to fullscreen!!!"); + + case DISP_CHANGE_FAILED: + throw CL_Exception("The display driver failed the specified graphics mode."); + + case DISP_CHANGE_BADMODE: + throw CL_Exception("The graphics mode is not supported."); + + default: + throw CL_Exception(cl_format("Could not change videomode, error %1", (int) err)); + } + } +*/ +} + +void CL_OpenGLWindowProvider_GLX::restore_videomode() +{ +// ChangeDisplaySettings(NULL, 0); + //EnumWindows(&CL_OpenGLWindowProvider_WGL::enum_windows_callback_restore, (LPARAM) this); + //saved_window_positions.clear(); +} + +void CL_OpenGLWindowProvider_GLX::show_system_cursor() +{ + XDefineCursor(disp, window, system_cursor); +} + +void CL_OpenGLWindowProvider_GLX::hide_system_cursor() +{ + XDefineCursor(disp, window, hidden_cursor); +} + +void CL_OpenGLWindowProvider_GLX::set_title(const CL_StringRef &new_title) +{ + XSetStandardProperties(disp, window, new_title.c_str(), new_title.c_str(), None, NULL, 0, NULL); +} + +void CL_OpenGLWindowProvider_GLX::set_position(const CL_Rect &pos) +{ +// set_position(pos.left, pos.top); + XResizeWindow(disp, window, pos.get_width(), pos.get_height()); +// set_size(pos.get_width(), pos.get_height()); +} + +void CL_OpenGLWindowProvider_GLX::set_size(int width, int height) +{ +// fullscreen_width = width; +// fullscreen_height = height; +// sig_resize(width, height); + XResizeWindow(disp, window, width, height); +} + +void CL_OpenGLWindowProvider_GLX::minimize() +{ +// ShowWindow(hwnd, SW_MINIMIZE); +} + +void CL_OpenGLWindowProvider_GLX::restore() +{ +// ShowWindow(hwnd, SW_RESTORE); +} + +void CL_OpenGLWindowProvider_GLX::maximize() +{ +// ShowWindow(hwnd, SW_MAXIMIZE); +} + +void CL_OpenGLWindowProvider_GLX::show(bool activate) +{ +// ShowWindow(hwnd, activate ? SW_SHOW : SW_SHOWNA); +} + +void CL_OpenGLWindowProvider_GLX::hide() +{ +// ShowWindow(hwnd, SW_HIDE); +} + +void CL_OpenGLWindowProvider_GLX::flip(int interval) +{ +// CL_GLStateChecker::from_gc(get_gc())->flush(); + + if (interval != -1) + { + typedef int (*ptr_glXSwapIntervalSGI)(int interval); + ptr_glXSwapIntervalSGI glXSwapIntervalSGI = (ptr_glXSwapIntervalSGI) CL_OpenGL::get_proc_address("glXSwapIntervalSGI"); + if (glXSwapIntervalSGI) + { + glXSwapIntervalSGI(interval); + } + } + + XSync(disp,False); + glXSwapBuffers(disp, window); +} + +void CL_OpenGLWindowProvider_GLX::update(const CL_Rect &rect) +{ + CL_GraphicContext gc_local = get_gc(); + CL_OpenGLState state(gc_local); + state.set_active(); + state.setup_2d(true); + + CLboolean isDoubleBuffered = CL_TRUE; + clGetBooleanv(CL_DOUBLEBUFFER, &isDoubleBuffered); + if (isDoubleBuffered) + { + clReadBuffer(CL_BACK); + clDrawBuffer(CL_FRONT); + +// int width = get_viewport().get_width(); + int height = get_viewport().get_height(); + + clRasterPos2i(rect.left, height-rect.bottom); + clPixelZoom(1.0f, 1.0f); + clCopyPixels(rect.left, height-rect.bottom, rect.get_width(), rect.get_height(), CL_COLOR); + + clDrawBuffer(CL_BACK); + clFlush(); + } + +// repaint_layered(); +} + +///////////////////////////////////////////////////////////////////////////// +// CL_OpenGLWindowProvider_WGL Implementation: + +/* +void CL_OpenGLWindowProvider_GLX::received_keyboard_input(UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + // Is message a down or up event? + bool keydown; + switch (uMsg) + { + case WM_KEYDOWN: + case WM_SYSKEYDOWN: + keydown = true; + break; + + case WM_KEYUP: + case WM_SYSKEYUP: + keydown = false; + break; + + default: + return; + } + + // Check for Alt+F4 and translate it into a WM_CLOSE event. + if (wParam == VK_F4 && (uMsg == WM_SYSKEYDOWN || uMsg == WM_SYSKEYUP)) + { + if ((lParam & (1 << 29)) && uMsg == WM_SYSKEYDOWN) // context code. Bit 29 is set if ALT key is down. + SendMessage(get_hwnd(), WM_CLOSE, 0, 0); + return; + } + +// int scancode = (lParam & 0xff0000) >> 16; +// bool extended_key = (lParam & 0x1000000) != 0; + + // Update the ctrl/alt/shift hints: + int key_id = wParam; + + // Add to repeat count + if(keydown) + { + if( repeat_count.find(key_id) == repeat_count.end() ) + repeat_count[key_id] = 0; + else + repeat_count[key_id]++; + } + + // Prepare event to be emitted: + CL_InputEvent key; + if (keydown) + key.type = CL_InputEvent::pressed; + else + key.type = CL_InputEvent::released; + key.mouse_pos = mouse_pos; + key.id = key_id; + key.repeat_count = repeat_count[key_id]; + + if( !keydown ) + { + repeat_count[key_id] = -1; + } + + unsigned char keys_down[256]; + GetKeyboardState(keys_down); + + // Figure out what character sequence this maps to: + char buf[4]; + int result = ToAscii( + (UINT) key_id, + MapVirtualKey((UINT) key_id, 0), + keys_down, + (LPWORD) buf, + 0); + if (result == 1 || result == 2) key.str = CL_String8(buf, result); + + // Emit message: + keyboard->sig_provider_event->invoke(key); +} +*/ +/* +void CL_OpenGLWindowProvider_GLX::received_mouse_input(UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + // Map windows events to something more interesting: + int id; + bool up = false; + bool down = false; + + switch (uMsg) + { + case WM_LBUTTONDOWN: id = 0; down = true; break; + case WM_LBUTTONUP: id = 0; up = true; break; + case WM_LBUTTONDBLCLK: id = 0; break; + case WM_RBUTTONDOWN: id = 1; down = true; break; + case WM_RBUTTONUP: id = 1; up = true; break; + case WM_RBUTTONDBLCLK: id = 1; break; + case WM_MBUTTONDOWN: id = 2; down = true; break; + case WM_MBUTTONUP: id = 2; up = true; break; + case WM_MBUTTONDBLCLK: id = 2; break; + case WM_MOUSEWHEEL: id = ((short)HIWORD(wParam) > 0) ? 3 : 4; up = true; down = true; break; + case WM_XBUTTONDOWN: id = 4 + HIWORD(wParam); down = true; break; + case WM_XBUTTONUP: id = 4 + HIWORD(wParam); up = true; break; + case WM_XBUTTONDBLCLK: id = 4 + HIWORD(wParam); break; + default: + return; + } + + // Prepare event to be emitted: + CL_InputEvent key; + key.mouse_pos = mouse_pos; + key.id = id; + if (down) + key.type = CL_InputEvent::pressed; + else if (up) + key.type = CL_InputEvent::released; + + // Emit message: + mouse->sig_provider_event->invoke(key); +} +*/ +/* +void CL_OpenGLWindowProvider_GLX::received_mouse_move(UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + // Fetch coordinates + int x = LOWORD(lParam); + int y = HIWORD(lParam); + + if(mouse_pos.x != x || mouse_pos.y != y) + { + mouse_pos.x = x; + mouse_pos.y = y; + + // Prepare event to be emitted: + CL_InputEvent key; + key.type = CL_InputEvent::pointer_moved; + key.mouse_pos = mouse_pos; + + // Fire off signal + mouse->sig_provider_event->invoke(key); + } +} +*/ + +void CL_OpenGLWindowProvider_GLX::process_messages() +{ +// MSG msg; +// while (PeekMessage(&msg, get_hwnd(), 0, 0, PM_REMOVE)) +// { +// TranslateMessage(&msg); +// DispatchMessage(&msg); +// } + + get_ic().process_messages(); +} + +/* +void CL_OpenGLWindowProvider_GLX::setup_tablet() +{ + // todo: move tablet init somewhere else? + tablet = new CL_InputDeviceProvider_Win32Tablet(this); + + if( tablet->device_present() ) + { + ic.add_tablet(tablet); // tablet will be deleted by input context + } + else + { + delete tablet; + tablet = 0; + } +} +*/ +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#include "GL/precomp.h" +#include "opengl_window_provider_glx.h" +#include "API/Core/Math/rect.h" +#include "API/Display/display_window_description.h" +#include "API/Display/input_event.h" +#include "API/GL/opengl.h" +#include "API/GL/opengl_wrap.h" +#include "API/GL/opengl_state.h" +#include "API/Core/Text/logger.h" +#include "../opengl_window_description_impl.h" +#include "../opengl_graphic_context_provider.h" +//#include "input_device_provider_win32keyboard.h" +//#include "input_device_provider_win32mouse.h" +//#include "input_device_provider_win32tablet.h" +//#include "input_device_provider_directinput.h" +/* +#ifndef WM_MOUSEWHEEL +#define WM_MOUSEWHEEL 0x020A +#endif +#ifndef WM_XBUTTONDOWN +#define WM_XBUTTONDOWN 0x020B +#define WM_XBUTTONUP 0x020C +#define WM_XBUTTONDBLCLK 0x020D +#endif +#ifndef WS_EX_LAYERED +#define WS_EX_LAYERED 0x00080000 +#endif +#ifndef AC_SRC_ALPHA +#define AC_SRC_ALPHA 1 +#endif +#ifndef ULW_OPAQUE +#define ULW_OPAQUE 0 +#endif +#ifndef ULW_COLORKEY +#define ULW_COLORKEY 1 +#endif +#ifndef ULW_ALPHA +#define ULW_ALPHA 2 +#endif +*/ + +GLXContext CL_OpenGLWindowProvider_GLX::share_context; +std::map<Window, CL_OpenGLWindowProvider_GLX *> CL_OpenGLWindowProvider_GLX::window_map; + +///////////////////////////////////////////////////////////////////////////// +// CL_OpenGLWindowProvider_WGL Construction: + +CL_OpenGLWindowProvider_GLX::CL_OpenGLWindowProvider_GLX() +: window(0), fullscreen(false), allow_resize(false), layered(false), bpp(0), + saved_position(0, 0, 0, 0), mouse_pos(-1,-1), disp(0), context(0) +{ +// keyboard = new CL_InputDeviceProvider_Win32Keyboard(this); +// mouse = new CL_InputDeviceProvider_Win32Mouse(this); + + gc = CL_GraphicContext(new CL_OpenGLGraphicContextProvider(this)); +} + +CL_OpenGLWindowProvider_GLX::~CL_OpenGLWindowProvider_GLX() +{ + if(context) + { + if (!glXMakeCurrent(disp, None, NULL)) + { + printf("Could not release drawing context.\n"); + } + + glXDestroyContext(disp, context); + context = NULL; + } + +// keyboard = CL_InputDevice(); +// mouse = CL_InputDevice(); +// get_ic()->clear(); + + if(window) + XDestroyWindow(disp, window); + + window = 0; + +// if (disp_ref_count > 0) +// { +// disp_ref_count--; +// if (disp_ref_count == 0) +// { + XCloseDisplay(disp); +// disp = 0; +// } +// } + +} + +///////////////////////////////////////////////////////////////////////////// +// CL_OpenGLWindowProvider_WGL Attributes: + +//std::list<HGLRC> CL_OpenGLWindowProvider_WGL::opengl_contexts; +//std::map<HWND, CL_OpenGLWindowProvider_WGL *> CL_OpenGLWindowProvider_WGL::window_map; + +static std::list<GLXContext> opengl_contexts; +static std::map<Window, CL_OpenGLWindowProvider_GLX *> window_map; + +CL_Rect CL_OpenGLWindowProvider_GLX::get_geometry() const +{ +// RECT rect; +// GetWindowRect(hwnd, &rect); + Window *new_window; + int x, y; + unsigned int width, height; + unsigned int temp; + XGetGeometry(disp, window, new_window, &x, &y, &width, &height, &temp, &temp); + return CL_Rect(x, y, x + width, y + height); +} + +CL_Rect CL_OpenGLWindowProvider_GLX::get_viewport() const +{ +// if (layered) +// return layered_position; +// RECT rect; +// GetClientRect(hwnd, &rect); +// return CL_Rect(rect.left, rect.top, rect.right, rect.bottom); + XWindowAttributes attr; + XGetWindowAttributes(disp, window, &attr); + return CL_Rect(attr.x, attr.y, attr.x + attr.width, attr.y + attr.height); +} + +bool CL_OpenGLWindowProvider_GLX::is_fullscreen() const +{ + return fullscreen; +} + +bool CL_OpenGLWindowProvider_GLX::has_focus() const +{ + return focus; +} + +///////////////////////////////////////////////////////////////////////////// +// CL_OpenGLWindowProvider_WGL Operations: + +void CL_OpenGLWindowProvider_GLX::create(CL_DisplayWindowSite *new_site, const CL_DisplayWindowDescription &desc) +{ + site = new_site; + create_new_window(desc); +} + +/* +void CL_OpenGLWindowProvider_GLX::modify_window(const CL_DisplayWindowDescription &desc) +{ + bool clientSize = true; + + if (!fullscreen) + { + RECT rect; + GetWindowRect(hwnd, &rect); + saved_position.left = rect.left; + saved_position.top = rect.top; + saved_position.right = rect.right; + saved_position.bottom = rect.bottom; + } + + title = desc.get_title(); + fullscreen = desc.is_fullscreen(); + layered = desc.is_layered(); + layered_position = desc.get_position(); + allow_resize = desc.get_allow_resize(); + + int x = 0; + int y = 0; + int width = desc.get_size().width; + int height = desc.get_size().height; + + if (desc.is_fullscreen()) + { + width = GetSystemMetrics(SM_CXSCREEN); + height = GetSystemMetrics(SM_CYSCREEN); + } + else + { + int scr_width = GetSystemMetrics(SM_CXSCREEN); + int scr_height = GetSystemMetrics(SM_CYSCREEN); + + x = scr_width/2 - width/2; + y = scr_height/2 - height/2; + } + + if (width == 0 && height == 0) + { + x = saved_position.left; + y = saved_position.top; + width = saved_position.get_width(); + height = saved_position.get_height(); + clientSize = false; + } + + int style; + if (desc.is_fullscreen()) + { + style = WS_POPUP; + } + else if (allow_resize) + { + style = WS_POPUP | WS_SYSMENU | WS_SIZEBOX | WS_MAXIMIZEBOX | WS_MINIMIZEBOX; + if (desc.has_caption()) + style |= WS_CAPTION; + } + else + { + style = WS_POPUPWINDOW | WS_MINIMIZEBOX; + if (desc.has_caption()) + style |= WS_CAPTION; + } + + int ex_style = 0; + if (desc.is_layered()) + { + ex_style = WS_EX_LAYERED; + } + + // get size of window with decorations to pass to CreateWindow + RECT window_rect = { x, y, x+width, y+height }; + if (clientSize) + AdjustWindowRectEx( &window_rect, style, FALSE, ex_style ); + + SetWindowLong(hwnd, GWL_STYLE, style); + SetWindowLong(hwnd, GWL_EXSTYLE, ex_style); + + if (desc.is_fullscreen()) + { + // Make always on top + SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, width, height, SWP_FRAMECHANGED); + } + else + { + // Clear always on top flag; size as requested by description struct. + SetWindowPos( + hwnd, + HWND_TOP, + window_rect.left, + window_rect.top, + window_rect.right-window_rect.left, + window_rect.bottom-window_rect.top, + SWP_FRAMECHANGED); + } + + ShowWindow(hwnd, SW_SHOW); + UpdateWindow(hwnd); + RedrawWindow(0, 0, 0, RDW_ALLCHILDREN|RDW_INVALIDATE|RDW_UPDATENOW); +} +*/ + +void CL_OpenGLWindowProvider_GLX::create_new_window(const CL_DisplayWindowDescription &desc) +{ + const CL_OpenGLWindowDescription_Impl *gl_desc = 0; +// gl_desc = dynamic_cast<const CL_OpenGLWindowDescription_Impl*>(desc.impl.get()); + +// fullscreen_width = desc.get_size().width; +// fullscreen_height = desc.get_size().height; + + XVisualInfo *vi; + Colormap cmap; + + if (disp == 0) + { + disp = XOpenDisplay(0); + if (disp == 0) + throw CL_Exception("Could not open X11 display!"); + } +// disp_ref_count++; + + + int gl_attribs_single[] = + { + GLX_RGBA, + GLX_RED_SIZE, 4, + GLX_GREEN_SIZE, 4, + GLX_BLUE_SIZE, 4, + GLX_DEPTH_SIZE, 16, + None + }; + + int gl_attribs[32]; + int i = 0; + + if( gl_desc ) + { + if( gl_desc->rgba ) gl_attribs[i++] = GLX_RGBA; + if( gl_desc->doublebuffer ) gl_attribs[i++] = GLX_DOUBLEBUFFER; + if( gl_desc->stereo ) gl_attribs[i++] = GLX_STEREO; + gl_attribs[i++] = GLX_BUFFER_SIZE; + gl_attribs[i++] = gl_desc->buffer_size; + gl_attribs[i++] = GLX_LEVEL; + gl_attribs[i++] = gl_desc->level; + gl_attribs[i++] = GLX_AUX_BUFFERS; + gl_attribs[i++] = gl_desc->aux_buffers; + gl_attribs[i++] = GLX_RED_SIZE; + gl_attribs[i++] = gl_desc->red_size; + gl_attribs[i++] = GLX_GREEN_SIZE; + gl_attribs[i++] = gl_desc->green_size; + gl_attribs[i++] = GLX_BLUE_SIZE; + gl_attribs[i++] = gl_desc->blue_size; + gl_attribs[i++] = GLX_DEPTH_SIZE; + gl_attribs[i++] = gl_desc->depth_size; + gl_attribs[i++] = GLX_STENCIL_SIZE; + gl_attribs[i++] = gl_desc->stencil_size; + gl_attribs[i++] = GLX_ACCUM_RED_SIZE; + gl_attribs[i++] = gl_desc->accum_red_size; + gl_attribs[i++] = GLX_ACCUM_GREEN_SIZE; + gl_attribs[i++] = gl_desc->accum_green_size; + gl_attribs[i++] = GLX_ACCUM_BLUE_SIZE; + gl_attribs[i++] = gl_desc->accum_blue_size; + gl_attribs[i++] = GLX_ACCUM_ALPHA_SIZE; + gl_attribs[i++] = gl_desc->accum_alpha_size; + gl_attribs[i++] = GLX_ACCUM_RED_SIZE; + gl_attribs[i++] = gl_desc->accum_red_size; + gl_attribs[i++] = None; + } + else + { + gl_attribs[i++] = GLX_RGBA; + gl_attribs[i++] = GLX_DOUBLEBUFFER; + gl_attribs[i++] = GLX_RED_SIZE; + gl_attribs[i++] = 4; + gl_attribs[i++] = GLX_GREEN_SIZE; + gl_attribs[i++] = 4; + gl_attribs[i++] = GLX_BLUE_SIZE; + gl_attribs[i++] = 4; + gl_attribs[i++] = GLX_DEPTH_SIZE; + gl_attribs[i++] = 16; + gl_attribs[i++] = None; + } + + // get an appropriate visual + vi = glXChooseVisual(disp, DefaultScreen(disp), gl_attribs); + + if (vi == NULL) + { + vi = glXChooseVisual(disp, window, gl_attribs_single); + printf("Requested visual not supported by your OpenGL implementation. Falling back on singlebuffered Visual!\n"); + } + + // create a GLX context + context = glXCreateContext(disp, vi, share_context, True); + if(context == NULL) + throw CL_Exception("glXCreateContext failed"); + + if( share_context == NULL ) + share_context = context; + + glXGetConfig(disp, vi, GLX_BUFFER_SIZE, &bpp); + + // create a color map + cmap = XCreateColormap( disp, RootWindow(disp, vi->screen), vi->visual, AllocNone); + + attributes.colormap = cmap; + attributes.border_pixel = 0; + attributes.override_redirect = False; + + // create a window in window mode + attributes.event_mask = + ExposureMask | + KeyPressMask | + KeyReleaseMask | + ButtonPressMask | + ButtonReleaseMask | + StructureNotifyMask | + PointerMotionMask | + EnterWindowMask | + LeaveWindowMask | + FocusChangeMask; + + window = XCreateWindow(disp, RootWindow(disp, vi->screen), + 0, 0, desc.get_size().width, desc.get_size().height, 0, vi->depth, InputOutput, vi->visual, + CWBorderPixel | CWColormap | CWOverrideRedirect | CWEventMask, &attributes); + + window_map[window] = this; + + XSelectInput(d... [truncated message content] |
From: Changes to t. C. r. <cla...@li...> - 2006-09-30 15:50:17
|
Author: mbn Date: 2006-09-30 17:40:31 +0200 (Sat, 30 Sep 2006) New Revision: 1090 Modified: Development/ClanLib-0.9/Sources/API/Makefile.am Development/ClanLib-0.9/Sources/Core/Text/string_help.cpp Development/ClanLib-0.9/Utilities/ReferenceDocs/reference_docs.cpp Log: - Applied string_help_tofloat.patch Modified: Development/ClanLib-0.9/Sources/API/Makefile.am =================================================================== --- Development/ClanLib-0.9/Sources/API/Makefile.am 2006-09-30 15:16:25 UTC (rev 1089) +++ Development/ClanLib-0.9/Sources/API/Makefile.am 2006-09-30 15:40:31 UTC (rev 1090) @@ -148,7 +148,6 @@ Core/Math/line_math.h \ Core/Math/math.h \ Core/Math/matrix4x4.h \ - Core/Math/number_pool.h \ Core/Math/origin.h \ Core/Math/outline_triangulator.h \ Core/Math/point.h \ @@ -158,8 +157,6 @@ Core/Math/size.h \ Core/Math/sha1.h \ Core/Math/triangle_math.h \ - Core/Math/vector2.h \ - Core/Math/vector2.inl \ Core/Resources/resource_data_session.h \ Core/Resources/resource.h \ Core/Resources/resource_manager.h \ Modified: Development/ClanLib-0.9/Sources/Core/Text/string_help.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Core/Text/string_help.cpp 2006-09-30 15:16:25 UTC (rev 1089) +++ Development/ClanLib-0.9/Sources/Core/Text/string_help.cpp 2006-09-30 15:40:31 UTC (rev 1090) @@ -243,12 +243,16 @@ float CL_StringHelp::local8_to_float(const CL_StringRef8 &value) { - return 0.0f; + float result = 0.0; + sscanf(value.c_str(), "%f", &result); + return result; } float CL_StringHelp::ucs2_to_float(const CL_StringRef16 &value) { - return 0.0f; + float result = 0.0; + swscanf(value.c_str(), L"%f", &result); + return result; } CL_String CL_StringHelp::double_to_text(double value) Modified: Development/ClanLib-0.9/Utilities/ReferenceDocs/reference_docs.cpp =================================================================== --- Development/ClanLib-0.9/Utilities/ReferenceDocs/reference_docs.cpp 2006-09-30 15:16:25 UTC (rev 1089) +++ Development/ClanLib-0.9/Utilities/ReferenceDocs/reference_docs.cpp 2006-09-30 15:40:31 UTC (rev 1090) @@ -473,7 +473,7 @@ if (prot == "private") return text; - CL_String type, name, definition, argsstring, brief, detail; + CL_String type, type_formatted, name, definition, argsstring, brief, detail; CL_String params_description; std::vector<CL_String> params; @@ -488,6 +488,7 @@ if (tag_name == "type") { type = cur_element.get_text(); + type_formatted = get_formatted(cur_element); } else if (tag_name == "definition") { @@ -528,6 +529,11 @@ { } } + + if (definition.substr(0, type.length()) == type) + { + definition = type_formatted + definition.substr(type.length()); + } // Group functions: std::map<CL_String, int>::iterator it = member_map.find(name); |
From: Changes to t. C. r. <cla...@li...> - 2006-09-30 15:14:39
|
Author: mbn Date: 2006-09-30 17:16:25 +0200 (Sat, 30 Sep 2006) New Revision: 1089 Added: Development/ClanLib-0.9/Sources/Display/rect_primitive.h Development/ClanLib-0.9/Sources/Display/static_lines_array.h Development/ClanLib-0.9/Sources/Display/static_triangles_array.h Removed: Development/ClanLib-0.9/Sources/API/Display/rect_primitive.h Development/ClanLib-0.9/Sources/API/Display/static_lines_array.h Development/ClanLib-0.9/Sources/API/Display/static_triangles_array.h Modified: Development/ClanLib-0.9/Sources/API/display.h Development/ClanLib-0.9/Sources/Display/draw.cpp Development/ClanLib-0.9/Sources/Display/glyph_outline.h Development/ClanLib-0.9/Sources/Display/rounded_rect_impl.h Development/ClanLib-0.9/Sources/Display/sprite.cpp Development/ClanLib-0.9/Sources/Display/vector_font.cpp Development/ClanLib-0.9/Sources/Display/vector_font_impl.cpp Log: - Moved a few classes out of API space. Deleted: Development/ClanLib-0.9/Sources/API/Display/rect_primitive.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Display/rect_primitive.h 2006-09-30 13:13:21 UTC (rev 1088) +++ Development/ClanLib-0.9/Sources/API/Display/rect_primitive.h 2006-09-30 15:16:25 UTC (rev 1089) @@ -1,414 +0,0 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Magnus Norddahl -** Harry Storbacka -** Ken Hirsch -*/ - -#ifndef header_textured_rect_primitive -#define header_textured_rect_primitive - -//: Primitives array helper for creating a non-textured rectangle. -//- !group=Display/Display! -//- !header=display.h! -class CL_API_DISPLAY CL_RectPrimitive : public CL_PrimitivesArray -{ -//! Construction: -public: - CL_RectPrimitive() - : _index(0), constant_color_enabled(false) - { - constant_color[0] = 1.0; - constant_color[1] = 0.5; - constant_color[2] = 1.0; - constant_color[3] = 1.0; - } - -//! Attributes: -public: - void get_subarray(int index, PrimitivesSubarray &v) const - { - v.num_vertices = 6; - v.vertex = _vertex; - v.normal = 0; - v.primary_color = constant_color_enabled ? constant_color : _color; - v.secondary_color = 0; - v.edge_flag = 0; - v.fog_coord = 0; - v.num_tex_units = 0; - v.tex_coords = 0; - v.num_attribs = 0; - v.use_primary_color_array = !constant_color_enabled; - } - - int get_subarray_length() const - { - return 1; - } - -//! Operations: -public: - void vertex(double x, double y, double z = 0.0, double w = 1.0) - { - _vertex[_index*4 + 0] = x; - _vertex[_index*4 + 1] = y; - _vertex[_index*4 + 2] = z; - _vertex[_index*4 + 3] = w; - _index++; - if (_index == 3) - { - // vertices are as a triangle_strip, but we generate normal triangles - _vertex[3*4 + 0 ] = _vertex[1*4 + 0]; - _vertex[3*4 + 1 ] = _vertex[1*4 + 1]; - _vertex[3*4 + 2 ] = _vertex[1*4 + 2]; - _vertex[3*4 + 3 ] = _vertex[1*4 + 3]; - _vertex[4*4 + 0 ] = _vertex[2*4 + 0]; - _vertex[4*4 + 1 ] = _vertex[2*4 + 1]; - _vertex[4*4 + 2 ] = _vertex[2*4 + 2]; - _vertex[4*4 + 3 ] = _vertex[2*4 + 3]; - _color[3*4 + 0 ] = _color[1*4 + 0]; - _color[3*4 + 1 ] = _color[1*4 + 1]; - _color[3*4 + 2 ] = _color[1*4 + 2]; - _color[3*4 + 3 ] = _color[1*4 + 3]; - _color[4*4 + 0 ] = _color[2*4 + 0]; - _color[4*4 + 1 ] = _color[2*4 + 1]; - _color[4*4 + 2 ] = _color[2*4 + 2]; - _color[4*4 + 3 ] = _color[2*4 + 3]; - _index += 2; - } - } - - void color(double r, double g, double b, double a = 1.0) - { - _color[_index*4 + 0] = r; - _color[_index*4 + 1] = g; - _color[_index*4 + 2] = b; - _color[_index*4 + 3] = a; - } - - void enable_constant_color(bool value) - { - constant_color_enabled = value; - } - - void set_constant_color(const CL_Colord &color) - { - constant_color[0] = color.get_red(); - constant_color[1] = color.get_green(); - constant_color[2] = color.get_blue() ; - constant_color[3] = color.get_alpha(); - } - -//! Implementation: -private: - double _vertex[6*4]; - - double _color[6*4]; - - int _index; - - bool constant_color_enabled; - - double constant_color[4]; -}; - -//: Primitives array helper for creating a textured rectangle. -//- !group=Display/Display! -//- !header=display.h! -class CL_API_DISPLAY CL_TexturedRectPrimitive : public CL_PrimitivesArray -{ -//! Construction: -public: - CL_TexturedRectPrimitive() - : _index(0), ptr_tex_coord(_tex_coord), constant_color_enabled(false) - { - constant_color[0] = 1.0; - constant_color[1] = 0.5; - constant_color[2] = 1.0; - constant_color[3] = 1.0; - } - -//! Attributes: -public: - void get_subarray(int index, PrimitivesSubarray &v) const - { - v.num_vertices = 6; - v.vertex = _vertex; - v.normal = 0; - v.primary_color = constant_color_enabled ? constant_color : _color; - v.secondary_color = 0; - v.edge_flag = 0; - v.fog_coord = 0; - v.num_tex_units = 1; - v.tex_coords = &ptr_tex_coord; - v.num_attribs = 0; - v.use_primary_color_array = !constant_color_enabled; - } - - int get_subarray_length() const - { - return 1; - } - -//! Operations: -public: - void vertex(double x, double y, double z = 0.0, double w = 1.0) - { - _vertex[_index*4 + 0] = x; - _vertex[_index*4 + 1] = y; - _vertex[_index*4 + 2] = z; - _vertex[_index*4 + 3] = w; - _index++; - if (_index == 3) - { - // vertices are as a triangle_strip, but we generate normal triangles - _vertex[3*4 + 0 ] = _vertex[1*4 + 0]; - _vertex[3*4 + 1 ] = _vertex[1*4 + 1]; - _vertex[3*4 + 2 ] = _vertex[1*4 + 2]; - _vertex[3*4 + 3 ] = _vertex[1*4 + 3]; - _vertex[4*4 + 0 ] = _vertex[2*4 + 0]; - _vertex[4*4 + 1 ] = _vertex[2*4 + 1]; - _vertex[4*4 + 2 ] = _vertex[2*4 + 2]; - _vertex[4*4 + 3 ] = _vertex[2*4 + 3]; - _color[3*4 + 0 ] = _color[1*4 + 0]; - _color[3*4 + 1 ] = _color[1*4 + 1]; - _color[3*4 + 2 ] = _color[1*4 + 2]; - _color[3*4 + 3 ] = _color[1*4 + 3]; - _color[4*4 + 0 ] = _color[2*4 + 0]; - _color[4*4 + 1 ] = _color[2*4 + 1]; - _color[4*4 + 2 ] = _color[2*4 + 2]; - _color[4*4 + 3 ] = _color[2*4 + 3]; - _tex_coord[3*4 + 0 ] = _tex_coord[1*4 + 0]; - _tex_coord[3*4 + 1 ] = _tex_coord[1*4 + 1]; - _tex_coord[3*4 + 2 ] = _tex_coord[1*4 + 2]; - _tex_coord[3*4 + 3 ] = _tex_coord[1*4 + 3]; - _tex_coord[4*4 + 0 ] = _tex_coord[2*4 + 0]; - _tex_coord[4*4 + 1 ] = _tex_coord[2*4 + 1]; - _tex_coord[4*4 + 2 ] = _tex_coord[2*4 + 2]; - _tex_coord[4*4 + 3 ] = _tex_coord[2*4 + 3]; - _index += 2; - } - } - - void color(double r, double g, double b, double a = 1.0) - { - _color[_index*4 + 0] = r; - _color[_index*4 + 1] = g; - _color[_index*4 + 2] = b; - _color[_index*4 + 3] = a; - } - - void tex_coord(int unit, double s, double t = 0.0, double r = 0.0, double q = 1.0) - { - _tex_coord[_index*4 + 0] = s; - _tex_coord[_index*4 + 1] = t; - _tex_coord[_index*4 + 2] = r; - _tex_coord[_index*4 + 3] = q; - } - - void enable_constant_color(bool value) - { - constant_color_enabled = value; - } - - void set_constant_color(const CL_Colord &color) - { - constant_color[0] = color.get_red(); - constant_color[1] = color.get_green(); - constant_color[2] = color.get_blue() ; - constant_color[3] = color.get_alpha(); - } - -//! Implementation: -private: - double _vertex[6*4]; - - double _color[6*4]; - - double _tex_coord[6*4]; - - double *ptr_tex_coord; - - int _index; - - bool constant_color_enabled; - - double constant_color[4]; -}; - -//: Primitives array helper for creating a multi-textured rectangle. -//- !group=Display/Display! -//- !header=display.h! -class CL_API_DISPLAY CL_MultiTexturedRectPrimitive : public CL_PrimitivesArray -{ -//! Construction: -public: - CL_MultiTexturedRectPrimitive(int unit_count) - : num_tex_units(unit_count), _index(0), constant_color_enabled(false) - { - constant_color[0] = 1.0; - constant_color[1] = 0.5; - constant_color[2] = 1.0; - constant_color[3] = 1.0; - - tex_coords = new double*[unit_count]; - - for (int i=0; i<num_tex_units; ++i) - { - tex_coords[i] = new double[6*4]; - } - } - - ~CL_MultiTexturedRectPrimitive() - { - for (int i=0; i<num_tex_units; ++i) - { - delete tex_coords[i]; - } - - delete tex_coords; - } - -//! Attributes: -public: - void get_subarray(int index, PrimitivesSubarray &v) const - { - v.num_vertices = 6; - v.vertex = _vertex; - v.normal = 0; - v.primary_color = constant_color_enabled ? constant_color : _color; - v.secondary_color = 0; - v.edge_flag = 0; - v.fog_coord = 0; - v.num_tex_units = num_tex_units; - v.tex_coords = tex_coords; - v.num_attribs = 0; - v.use_primary_color_array = !constant_color_enabled; - } - - int get_subarray_length() const - { - return 1; - } - -//! Operations: -public: - void vertex(double x, double y, double z = 0.0, double w = 1.0) - { - _vertex[_index*4 + 0] = x; - _vertex[_index*4 + 1] = y; - _vertex[_index*4 + 2] = z; - _vertex[_index*4 + 3] = w; - _index++; - if (_index == 3) - { - // vertices are as a triangle_strip, but we generate normal triangles - _vertex[3*4 + 0 ] = _vertex[1*4 + 0]; - _vertex[3*4 + 1 ] = _vertex[1*4 + 1]; - _vertex[3*4 + 2 ] = _vertex[1*4 + 2]; - _vertex[3*4 + 3 ] = _vertex[1*4 + 3]; - _vertex[4*4 + 0 ] = _vertex[2*4 + 0]; - _vertex[4*4 + 1 ] = _vertex[2*4 + 1]; - _vertex[4*4 + 2 ] = _vertex[2*4 + 2]; - _vertex[4*4 + 3 ] = _vertex[2*4 + 3]; - _color[3*4 + 0 ] = _color[1*4 + 0]; - _color[3*4 + 1 ] = _color[1*4 + 1]; - _color[3*4 + 2 ] = _color[1*4 + 2]; - _color[3*4 + 3 ] = _color[1*4 + 3]; - _color[4*4 + 0 ] = _color[2*4 + 0]; - _color[4*4 + 1 ] = _color[2*4 + 1]; - _color[4*4 + 2 ] = _color[2*4 + 2]; - _color[4*4 + 3 ] = _color[2*4 + 3]; - - for( int i=0; i<num_tex_units; ++i ) - { - tex_coords[i][3*4 + 0 ] = tex_coords[i][1*4 + 0]; - tex_coords[i][3*4 + 1 ] = tex_coords[i][1*4 + 1]; - tex_coords[i][3*4 + 2 ] = tex_coords[i][1*4 + 2]; - tex_coords[i][3*4 + 3 ] = tex_coords[i][1*4 + 3]; - tex_coords[i][4*4 + 0 ] = tex_coords[i][2*4 + 0]; - tex_coords[i][4*4 + 1 ] = tex_coords[i][2*4 + 1]; - tex_coords[i][4*4 + 2 ] = tex_coords[i][2*4 + 2]; - tex_coords[i][4*4 + 3 ] = tex_coords[i][2*4 + 3]; - } - - _index += 2; - } - } - - void color(double r, double g, double b, double a = 1.0) - { - _color[_index*4 + 0] = r; - _color[_index*4 + 1] = g; - _color[_index*4 + 2] = b; - _color[_index*4 + 3] = a; - } - - void tex_coord(int unit, double s, double t = 0.0, double r = 0.0, double q = 1.0) - { - tex_coords[unit][_index*4 + 0] = s; - tex_coords[unit][_index*4 + 1] = t; - tex_coords[unit][_index*4 + 2] = r; - tex_coords[unit][_index*4 + 3] = q; - } - - void set_texture_unit_count(int unit_count) - { - num_tex_units = unit_count; - tex_coords = new double*[unit_count]; - } - - void enable_constant_color(bool value) - { - constant_color_enabled = value; - } - - void set_constant_color(const CL_Colord &color) - { - constant_color[0] = color.get_red(); - constant_color[1] = color.get_green(); - constant_color[2] = color.get_blue() ; - constant_color[3] = color.get_alpha(); - } - -//! Implementation: -private: - double _vertex[6*4]; - - double _color[6*4]; - - double **tex_coords; - - int num_tex_units; - - int _index; - - bool constant_color_enabled; - - double constant_color[4]; -}; - -#endif Deleted: Development/ClanLib-0.9/Sources/API/Display/static_lines_array.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Display/static_lines_array.h 2006-09-30 13:13:21 UTC (rev 1088) +++ Development/ClanLib-0.9/Sources/API/Display/static_lines_array.h 2006-09-30 15:16:25 UTC (rev 1089) @@ -1,150 +0,0 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Harry Storbacka -*/ - -#ifndef header_static_lines_array -#define header_static_lines_array - -//! clanDisplay="Display" -//! header=display.h - -#include "../Display/primitives_array.h" -#include "../Display/color.h" -#include "../Core/Math/ear_clip_triangulator.h" - -//: Primitives array helper for creating lines. -//- !group=Display/Display! -//- !header=display.h! -class CL_StaticLinesArray : public CL_PrimitivesArray -{ -//! Construction: -public: - CL_StaticLinesArray(int num_lines) - : _index(0), constant_color_enabled(true), num_subarrays(1) - { - vertex_counts.push_back(num_lines+1); - - vertex_bufs.push_back( CL_DataBuffer(sizeof(double)*(num_lines+1)*4) ); - color_bufs.push_back( CL_DataBuffer(sizeof(double)*(num_lines+1)*4) ); - - _vertex = (double*)vertex_bufs.back().get_data(); - _color = (double*)color_bufs.back().get_data(); - - constant_color[0] = 1.0; - constant_color[1] = 0.5; - constant_color[2] = 1.0; - constant_color[3] = 1.0; - } - - virtual ~CL_StaticLinesArray() - { - } - -//! Attributes: -public: - void get_subarray(int index, PrimitivesSubarray &v) const - { - v.num_vertices = vertex_counts[index]; - v.vertex = (double*)(vertex_bufs[index].get_data()); - v.normal = 0; - v.primary_color = constant_color_enabled ? constant_color : (double*)(color_bufs[index].get_data()); - v.secondary_color = 0; - v.edge_flag = 0; - v.fog_coord = 0; - v.num_tex_units = 0; - v.tex_coords = 0; - v.num_attribs = 0; - v.use_primary_color_array = !constant_color_enabled; - } - - int get_subarray_length() const - { - return num_subarrays; - } - -//! Operations: -public: - - void color(double r, double g, double b, double a = 1.0) - { - _color[_index*4 + 0] = r; - _color[_index*4 + 1] = g; - _color[_index*4 + 2] = b; - _color[_index*4 + 3] = a; - } - - void vertex(double x, double y, double z = 0.0, double w = 1.0) - { - _vertex[_index*4 + 0] = x; - _vertex[_index*4 + 1] = y; - _vertex[_index*4 + 2] = z; - _vertex[_index*4 + 3] = w; - _index++; - } - - void set_constant_color(const CL_Colord &color) - { - constant_color[0] = color.get_red(); - constant_color[1] = color.get_green(); - constant_color[2] = color.get_blue() ; - constant_color[3] = color.get_alpha(); - } - - void enable_constant_color(bool value) - { - constant_color_enabled = value; - } - - void new_subarray(int num_lines) - { - vertex_counts.push_back(num_lines+1); - - vertex_bufs.push_back( CL_DataBuffer(sizeof(double)*(num_lines+1)*4) ); - color_bufs.push_back( CL_DataBuffer(sizeof(double)*(num_lines+1)*4) ); - - _vertex = (double*)vertex_bufs.back().get_data(); - _color = (double*)color_bufs.back().get_data(); - _index = 0; - - num_subarrays++; - } - -//! Implementation: -private: - std::vector<CL_DataBuffer> vertex_bufs; - std::vector<CL_DataBuffer> color_bufs; - - double *_vertex; - double *_color; - double constant_color[4]; - bool constant_color_enabled; - int _index; - int num_subarrays; - std::vector<int> vertex_counts; -}; - -#endif Deleted: Development/ClanLib-0.9/Sources/API/Display/static_triangles_array.h =================================================================== --- Development/ClanLib-0.9/Sources/API/Display/static_triangles_array.h 2006-09-30 13:13:21 UTC (rev 1088) +++ Development/ClanLib-0.9/Sources/API/Display/static_triangles_array.h 2006-09-30 15:16:25 UTC (rev 1089) @@ -1,183 +0,0 @@ -/* -** ClanLib SDK -** Copyright (c) 1997-2005 The ClanLib Team -** -** This software is provided 'as-is', without any express or implied -** warranty. In no event will the authors be held liable for any damages -** arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, -** including commercial applications, and to alter it and redistribute it -** freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not -** claim that you wrote the original software. If you use this software -** in a product, an acknowledgment in the product documentation would be -** appreciated but is not required. -** 2. Altered source versions must be plainly marked as such, and must not be -** misrepresented as being the original software. -** 3. This notice may not be removed or altered from any source distribution. -** -** Note: Some of the libraries ClanLib may link to may have additional -** requirements or restrictions. -** -** File Author(s): -** -** Harry Storbacka -** Ken Hirsch -*/ - -#ifndef header_static_triangles_array -#define header_static_triangles_array - -//! clanDisplay="Display" -//! header=display.h - -#include "../Display/primitives_array.h" -#include "../Display/color.h" -#include "../Core/Math/ear_clip_triangulator.h" -#include "../Core/System/databuffer.h" - -//: Primitives array helper for creating triangles. -//- !group=Display/Display! -//- !header=display.h! -class CL_StaticTrianglesArray : public CL_PrimitivesArray -{ -//! Construction: -public: - CL_StaticTrianglesArray(int num_triangles) - : num_triangles(num_triangles), _vertex(0), _index(0), _tex_coord(0), constant_color_enabled(true), ptr_tex_coord(_tex_coord) - { - vertex_buf = CL_DataBuffer(sizeof(double)*(int)num_triangles*3*4); - color_buf = CL_DataBuffer(sizeof(double)*(int)num_triangles*3*4); - tex_coord_buf = CL_DataBuffer(sizeof(double)*(int)num_triangles*3*4); - - _vertex = (double*)vertex_buf.get_data(); - _color = (double*)color_buf.get_data(); - _tex_coord = (double*)tex_coord_buf.get_data(); - - constant_color[0] = 1.0; - constant_color[1] = 0.5; - constant_color[2] = 1.0; - constant_color[3] = 1.0; - } - - CL_StaticTrianglesArray(std::vector<CL_EarClipTriangulator_Triangle> &triangles) - : num_triangles((int)triangles.size()), _vertex(0), _index(0), _tex_coord(0), constant_color_enabled(true) - { - vertex_buf = CL_DataBuffer(sizeof(double)*(int)triangles.size()*3*4); - color_buf = CL_DataBuffer(sizeof(double)*(int)triangles.size()*3*4); - tex_coord_buf = CL_DataBuffer(sizeof(double)*(int)triangles.size()*3*4); - - _vertex = (double*)vertex_buf.get_data(); - _color = (double*)color_buf.get_data(); - _tex_coord = (double*)tex_coord_buf.get_data(); - - std::vector<CL_EarClipTriangulator_Triangle>::iterator it; - - constant_color[0] = 1.0; - constant_color[2] = 1.0; - constant_color[3] = 1.0; - - for( it=triangles.begin(); it!=triangles.end(); ++it ) - { - color(1.0,1.0,1.0); - tex_coord(0, 0.0); - vertex((*it).x1, (*it).y1); - - color(1.0,1.0,1.0); - tex_coord(0, 0.0); - vertex((*it).x2, (*it).y2); - - color(1.0,1.0,1.0); - tex_coord(0, 0.0); - vertex((*it).x3, (*it).y3); - } - } - - virtual ~CL_StaticTrianglesArray() - { - } - -//! Attributes: -public: - void get_subarray(int index, PrimitivesSubarray &v) const - { - v.num_vertices = num_triangles*3; - v.vertex = _vertex; - v.normal = 0; - v.primary_color = constant_color_enabled ? constant_color : _color; - v.secondary_color = 0; - v.edge_flag = 0; - v.fog_coord = 0; - v.num_tex_units = 1; - v.tex_coords = &ptr_tex_coord; - v.num_attribs = 0; - v.use_primary_color_array = !constant_color_enabled; - } - - int get_subarray_length() const - { - return 1; - } - -//! Operations: -public: - - void color(double r, double g, double b, double a = 1.0) - { - _color[_index*4 + 0] = r; - _color[_index*4 + 1] = g; - _color[_index*4 + 2] = b; - _color[_index*4 + 3] = a; - } - - void vertex(double x, double y, double z = 0.0, double w = 1.0) - { - _vertex[_index*4 + 0] = x; - _vertex[_index*4 + 1] = y; - _vertex[_index*4 + 2] = z; - _vertex[_index*4 + 3] = w; - _index++; - } - - void tex_coord(int unit, double s, double t = 0.0, double r = 0.0, double q = 1.0) - { - _tex_coord[_index*4 + 0] = s; - _tex_coord[_index*4 + 1] = t; - _tex_coord[_index*4 + 2] = r; - _tex_coord[_index*4 + 3] = q; - } - - void set_constant_color(const CL_Colord &color) - { - constant_color[0] = color.get_red(); - constant_color[1] = color.get_green(); - constant_color[2] = color.get_blue() ; - constant_color[3] = color.get_alpha(); - } - - void enable_constant_color(bool value) - { - constant_color_enabled = value; - } - -//! Implementation: -private: - CL_DataBuffer vertex_buf; - CL_DataBuffer color_buf; - CL_DataBuffer tex_coord_buf; - double constant_color[4]; - double *_vertex; - double *_color; - double *_tex_coord; - - double *ptr_tex_coord; - - int num_triangles; - bool constant_color_enabled; - - int _index; -}; - -#endif Modified: Development/ClanLib-0.9/Sources/API/display.h =================================================================== --- Development/ClanLib-0.9/Sources/API/display.h 2006-09-30 13:13:21 UTC (rev 1088) +++ Development/ClanLib-0.9/Sources/API/display.h 2006-09-30 15:16:25 UTC (rev 1089) @@ -50,7 +50,6 @@ #include "Display/display_window_description.h" #include "Display/display_window_provider.h" #include "Display/draw.h" -#include "Display/static_triangles_array.h" #include "Display/font.h" #include "Display/font_provider.h" #include "Display/font_metrics.h" @@ -77,7 +76,6 @@ #include "Display/program_attribute.h" #include "Display/program_object.h" #include "Display/program_uniform.h" -#include "Display/rect_primitive.h" #include "Display/rounded_rect.h" #include "Display/setup_display.h" #include "Display/shader_object.h" Modified: Development/ClanLib-0.9/Sources/Display/draw.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Display/draw.cpp 2006-09-30 13:13:21 UTC (rev 1088) +++ Development/ClanLib-0.9/Sources/Display/draw.cpp 2006-09-30 15:16:25 UTC (rev 1089) @@ -34,8 +34,8 @@ #include "API/Display/gradient.h" #include "API/Display/primitives_array.h" #include "API/Display/pen.h" -#include "API/Display/static_triangles_array.h" -#include "API/Display/rect_primitive.h" +#include "static_triangles_array.h" +#include "rect_primitive.h" #include "draw_impl.h" ///////////////////////////////////////////////////////////////////////////// Modified: Development/ClanLib-0.9/Sources/Display/glyph_outline.h =================================================================== --- Development/ClanLib-0.9/Sources/Display/glyph_outline.h 2006-09-30 13:13:21 UTC (rev 1088) +++ Development/ClanLib-0.9/Sources/Display/glyph_outline.h 2006-09-30 15:16:25 UTC (rev 1089) @@ -30,10 +30,10 @@ #define header_glyph_outline #include "Display/precomp.h" -#include "API/Display/static_triangles_array.h" -#include "API/Display/static_lines_array.h" +#include "static_triangles_array.h" +#include "static_lines_array.h" +#include "glyph_contour.h" #include <vector> -#include "glyph_contour.h" typedef CL_StaticTrianglesArray CL_GlyphPrimitivesArray; typedef CL_StaticLinesArray CL_GlyphPrimitivesArrayOutline; Copied: Development/ClanLib-0.9/Sources/Display/rect_primitive.h (from rev 1087, Development/ClanLib-0.9/Sources/API/Display/rect_primitive.h) Modified: Development/ClanLib-0.9/Sources/Display/rounded_rect_impl.h =================================================================== --- Development/ClanLib-0.9/Sources/Display/rounded_rect_impl.h 2006-09-30 13:13:21 UTC (rev 1088) +++ Development/ClanLib-0.9/Sources/Display/rounded_rect_impl.h 2006-09-30 15:16:25 UTC (rev 1089) @@ -35,10 +35,10 @@ #include "API/Core/Math/point.h" #include "API/Core/Math/size.h" -#include "API/Display/static_triangles_array.h" #include "API/Display/graphic_context.h" #include "API/Display/gradient.h" #include "API/Display/color.h" +#include "static_triangles_array.h" #include <vector> class CL_Gradient; Modified: Development/ClanLib-0.9/Sources/Display/sprite.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Display/sprite.cpp 2006-09-30 13:13:21 UTC (rev 1088) +++ Development/ClanLib-0.9/Sources/Display/sprite.cpp 2006-09-30 15:16:25 UTC (rev 1089) @@ -40,7 +40,7 @@ #include "API/Display/ImageProviders/provider_factory.h" #include "API/Display/ImageProviders/targa_provider.h" #include "API/Display/ImageProviders/png_provider.h" -#include "API/Display/rect_primitive.h" +#include "rect_primitive.h" #include "sprite_impl.h" ///////////////////////////////////////////////////////////////////////////// Copied: Development/ClanLib-0.9/Sources/Display/static_lines_array.h (from rev 1087, Development/ClanLib-0.9/Sources/API/Display/static_lines_array.h) =================================================================== --- Development/ClanLib-0.9/Sources/API/Display/static_lines_array.h 2006-09-24 02:44:00 UTC (rev 1087) +++ Development/ClanLib-0.9/Sources/Display/static_lines_array.h 2006-09-30 15:16:25 UTC (rev 1089) @@ -0,0 +1,150 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#ifndef header_static_lines_array +#define header_static_lines_array + +//! clanDisplay="Display" +//! header=display.h + +#include "API/Display/primitives_array.h" +#include "API/Display/color.h" +#include "API/Core/Math/ear_clip_triangulator.h" + +//: Primitives array helper for creating lines. +//- !group=Display/Display! +//- !header=display.h! +class CL_StaticLinesArray : public CL_PrimitivesArray +{ +//! Construction: +public: + CL_StaticLinesArray(int num_lines) + : _index(0), constant_color_enabled(true), num_subarrays(1) + { + vertex_counts.push_back(num_lines+1); + + vertex_bufs.push_back( CL_DataBuffer(sizeof(double)*(num_lines+1)*4) ); + color_bufs.push_back( CL_DataBuffer(sizeof(double)*(num_lines+1)*4) ); + + _vertex = (double*)vertex_bufs.back().get_data(); + _color = (double*)color_bufs.back().get_data(); + + constant_color[0] = 1.0; + constant_color[1] = 0.5; + constant_color[2] = 1.0; + constant_color[3] = 1.0; + } + + virtual ~CL_StaticLinesArray() + { + } + +//! Attributes: +public: + void get_subarray(int index, PrimitivesSubarray &v) const + { + v.num_vertices = vertex_counts[index]; + v.vertex = (double*)(vertex_bufs[index].get_data()); + v.normal = 0; + v.primary_color = constant_color_enabled ? constant_color : (double*)(color_bufs[index].get_data()); + v.secondary_color = 0; + v.edge_flag = 0; + v.fog_coord = 0; + v.num_tex_units = 0; + v.tex_coords = 0; + v.num_attribs = 0; + v.use_primary_color_array = !constant_color_enabled; + } + + int get_subarray_length() const + { + return num_subarrays; + } + +//! Operations: +public: + + void color(double r, double g, double b, double a = 1.0) + { + _color[_index*4 + 0] = r; + _color[_index*4 + 1] = g; + _color[_index*4 + 2] = b; + _color[_index*4 + 3] = a; + } + + void vertex(double x, double y, double z = 0.0, double w = 1.0) + { + _vertex[_index*4 + 0] = x; + _vertex[_index*4 + 1] = y; + _vertex[_index*4 + 2] = z; + _vertex[_index*4 + 3] = w; + _index++; + } + + void set_constant_color(const CL_Colord &color) + { + constant_color[0] = color.get_red(); + constant_color[1] = color.get_green(); + constant_color[2] = color.get_blue() ; + constant_color[3] = color.get_alpha(); + } + + void enable_constant_color(bool value) + { + constant_color_enabled = value; + } + + void new_subarray(int num_lines) + { + vertex_counts.push_back(num_lines+1); + + vertex_bufs.push_back( CL_DataBuffer(sizeof(double)*(num_lines+1)*4) ); + color_bufs.push_back( CL_DataBuffer(sizeof(double)*(num_lines+1)*4) ); + + _vertex = (double*)vertex_bufs.back().get_data(); + _color = (double*)color_bufs.back().get_data(); + _index = 0; + + num_subarrays++; + } + +//! Implementation: +private: + std::vector<CL_DataBuffer> vertex_bufs; + std::vector<CL_DataBuffer> color_bufs; + + double *_vertex; + double *_color; + double constant_color[4]; + bool constant_color_enabled; + int _index; + int num_subarrays; + std::vector<int> vertex_counts; +}; + +#endif Copied: Development/ClanLib-0.9/Sources/Display/static_triangles_array.h (from rev 1087, Development/ClanLib-0.9/Sources/API/Display/static_triangles_array.h) =================================================================== --- Development/ClanLib-0.9/Sources/API/Display/static_triangles_array.h 2006-09-24 02:44:00 UTC (rev 1087) +++ Development/ClanLib-0.9/Sources/Display/static_triangles_array.h 2006-09-30 15:16:25 UTC (rev 1089) @@ -0,0 +1,183 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2005 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +** Ken Hirsch +*/ + +#ifndef header_static_triangles_array +#define header_static_triangles_array + +//! clanDisplay="Display" +//! header=display.h + +#include "API/Display/primitives_array.h" +#include "API/Display/color.h" +#include "API/Core/Math/ear_clip_triangulator.h" +#include "API/Core/System/databuffer.h" + +//: Primitives array helper for creating triangles. +//- !group=Display/Display! +//- !header=display.h! +class CL_StaticTrianglesArray : public CL_PrimitivesArray +{ +//! Construction: +public: + CL_StaticTrianglesArray(int num_triangles) + : num_triangles(num_triangles), _vertex(0), _index(0), _tex_coord(0), constant_color_enabled(true), ptr_tex_coord(_tex_coord) + { + vertex_buf = CL_DataBuffer(sizeof(double)*(int)num_triangles*3*4); + color_buf = CL_DataBuffer(sizeof(double)*(int)num_triangles*3*4); + tex_coord_buf = CL_DataBuffer(sizeof(double)*(int)num_triangles*3*4); + + _vertex = (double*)vertex_buf.get_data(); + _color = (double*)color_buf.get_data(); + _tex_coord = (double*)tex_coord_buf.get_data(); + + constant_color[0] = 1.0; + constant_color[1] = 0.5; + constant_color[2] = 1.0; + constant_color[3] = 1.0; + } + + CL_StaticTrianglesArray(std::vector<CL_EarClipTriangulator_Triangle> &triangles) + : num_triangles((int)triangles.size()), _vertex(0), _index(0), _tex_coord(0), constant_color_enabled(true) + { + vertex_buf = CL_DataBuffer(sizeof(double)*(int)triangles.size()*3*4); + color_buf = CL_DataBuffer(sizeof(double)*(int)triangles.size()*3*4); + tex_coord_buf = CL_DataBuffer(sizeof(double)*(int)triangles.size()*3*4); + + _vertex = (double*)vertex_buf.get_data(); + _color = (double*)color_buf.get_data(); + _tex_coord = (double*)tex_coord_buf.get_data(); + + std::vector<CL_EarClipTriangulator_Triangle>::iterator it; + + constant_color[0] = 1.0; + constant_color[2] = 1.0; + constant_color[3] = 1.0; + + for( it=triangles.begin(); it!=triangles.end(); ++it ) + { + color(1.0,1.0,1.0); + tex_coord(0, 0.0); + vertex((*it).x1, (*it).y1); + + color(1.0,1.0,1.0); + tex_coord(0, 0.0); + vertex((*it).x2, (*it).y2); + + color(1.0,1.0,1.0); + tex_coord(0, 0.0); + vertex((*it).x3, (*it).y3); + } + } + + virtual ~CL_StaticTrianglesArray() + { + } + +//! Attributes: +public: + void get_subarray(int index, PrimitivesSubarray &v) const + { + v.num_vertices = num_triangles*3; + v.vertex = _vertex; + v.normal = 0; + v.primary_color = constant_color_enabled ? constant_color : _color; + v.secondary_color = 0; + v.edge_flag = 0; + v.fog_coord = 0; + v.num_tex_units = 1; + v.tex_coords = &ptr_tex_coord; + v.num_attribs = 0; + v.use_primary_color_array = !constant_color_enabled; + } + + int get_subarray_length() const + { + return 1; + } + +//! Operations: +public: + + void color(double r, double g, double b, double a = 1.0) + { + _color[_index*4 + 0] = r; + _color[_index*4 + 1] = g; + _color[_index*4 + 2] = b; + _color[_index*4 + 3] = a; + } + + void vertex(double x, double y, double z = 0.0, double w = 1.0) + { + _vertex[_index*4 + 0] = x; + _vertex[_index*4 + 1] = y; + _vertex[_index*4 + 2] = z; + _vertex[_index*4 + 3] = w; + _index++; + } + + void tex_coord(int unit, double s, double t = 0.0, double r = 0.0, double q = 1.0) + { + _tex_coord[_index*4 + 0] = s; + _tex_coord[_index*4 + 1] = t; + _tex_coord[_index*4 + 2] = r; + _tex_coord[_index*4 + 3] = q; + } + + void set_constant_color(const CL_Colord &color) + { + constant_color[0] = color.get_red(); + constant_color[1] = color.get_green(); + constant_color[2] = color.get_blue() ; + constant_color[3] = color.get_alpha(); + } + + void enable_constant_color(bool value) + { + constant_color_enabled = value; + } + +//! Implementation: +private: + CL_DataBuffer vertex_buf; + CL_DataBuffer color_buf; + CL_DataBuffer tex_coord_buf; + double constant_color[4]; + double *_vertex; + double *_color; + double *_tex_coord; + + double *ptr_tex_coord; + + int num_triangles; + bool constant_color_enabled; + + int _index; +}; + +#endif Modified: Development/ClanLib-0.9/Sources/Display/vector_font.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Display/vector_font.cpp 2006-09-30 13:13:21 UTC (rev 1088) +++ Development/ClanLib-0.9/Sources/Display/vector_font.cpp 2006-09-30 15:16:25 UTC (rev 1089) @@ -30,10 +30,10 @@ #include "Display/precomp.h" #include "API/Display/vector_font.h" #include "API/Display/font_metrics.h" -#include "API/Display/static_triangles_array.h" -#include "API/Display/static_lines_array.h" #include "API/Core/IOData/virtual_file_system.h" #include "API/Core/IOData/virtual_directory.h" +#include "static_triangles_array.h" +#include "static_lines_array.h" #include "vector_font_impl.h" typedef CL_StaticTrianglesArray CL_GlyphPrimitivesArray; Modified: Development/ClanLib-0.9/Sources/Display/vector_font_impl.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Display/vector_font_impl.cpp 2006-09-30 13:13:21 UTC (rev 1088) +++ Development/ClanLib-0.9/Sources/Display/vector_font_impl.cpp 2006-09-30 15:16:25 UTC (rev 1089) @@ -33,9 +33,9 @@ #include "API/Core/System/databuffer.h" #include "API/Core/IOData/iodevice.h" #include "API/Display/font_metrics.h" -#include "API/Display/static_triangles_array.h" -#include "API/Display/static_lines_array.h" #include "API/Display/texture.h" +#include "static_triangles_array.h" +#include "static_lines_array.h" ///////////////////////////////////////////////////////////////////////////// // CL_VectorFont_Impl Construction: |
From: Changes to t. C. r. <cla...@li...> - 2006-09-30 13:11:37
|
Author: mbn Date: 2006-09-30 15:13:21 +0200 (Sat, 30 Sep 2006) New Revision: 1088 Modified: Development/ClanLib-0.9/Sources/GUI/Components/lineedit.cpp Development/ClanLib-0.9/Sources/Network/Socket/iodevice_provider_tcp_connection.cpp Log: - Minor linger update. Modified: Development/ClanLib-0.9/Sources/GUI/Components/lineedit.cpp =================================================================== --- Development/ClanLib-0.9/Sources/GUI/Components/lineedit.cpp 2006-09-24 02:44:00 UTC (rev 1087) +++ Development/ClanLib-0.9/Sources/GUI/Components/lineedit.cpp 2006-09-30 13:13:21 UTC (rev 1088) @@ -50,7 +50,7 @@ { public: CL_LineEdit_Impl() : - alignment(CL_LineEdit::Alignment::align_left), + alignment(CL_LineEdit::align_left), cursor_pos(0), max_length(-1), lowercase(false), Modified: Development/ClanLib-0.9/Sources/Network/Socket/iodevice_provider_tcp_connection.cpp =================================================================== --- Development/ClanLib-0.9/Sources/Network/Socket/iodevice_provider_tcp_connection.cpp 2006-09-24 02:44:00 UTC (rev 1087) +++ Development/ClanLib-0.9/Sources/Network/Socket/iodevice_provider_tcp_connection.cpp 2006-09-30 13:13:21 UTC (rev 1088) @@ -328,13 +328,15 @@ if (close_socket) { // Simulate SO_LINGER functionality to avoid a reset: - // todo: Make API entries to allow application to control this better. + // to do: Make API entries to allow application to control this better. HANDLE event_object = WSACreateEvent(); if (event_object != WSA_INVALID_EVENT) { - shutdown(handle, SD_SEND); if (WSAEventSelect(handle, event_object, FD_CLOSE) != SOCKET_ERROR) - WSAWaitForMultipleEvents(1, &event_object, FALSE, 60*1000, FALSE); + { + shutdown(handle, SD_SEND); + WSAWaitForMultipleEvents(1, &event_object, FALSE, 10*1000, FALSE); + } WSACloseEvent(event_object); } closesocket(handle); |
From: Changes to t. C. r. <cla...@li...> - 2006-09-27 12:12:30
|
Completely CreditCardDebtFree Overnight http://www.productive-serv.com/75/ |
From: Changes to t. C. r. <cla...@li...> - 2006-09-24 02:43:03
|
Author: mrfun Date: 2006-09-24 04:44:00 +0200 (Sun, 24 Sep 2006) New Revision: 1087 Modified: Development/ClanLib-0.8/Sources/API/Sound/soundbuffer_session.h Development/ClanLib-0.8/Sources/Sound/SoundFilters/fadefilter_generic.cpp Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp Log: * the fade filter optimized to not waste CPU cycles after fading up to full volume * added remove_all_filters() function to CL_SoundBuffer_Session Modified: Development/ClanLib-0.8/Sources/API/Sound/soundbuffer_session.h =================================================================== --- Development/ClanLib-0.8/Sources/API/Sound/soundbuffer_session.h 2006-09-22 04:00:38 UTC (rev 1086) +++ Development/ClanLib-0.8/Sources/API/Sound/soundbuffer_session.h 2006-09-24 02:44:00 UTC (rev 1087) @@ -161,12 +161,15 @@ //: Adds the sound filter to the session. See CL_SoundFilter for details. //param filter: Sound filter to pass sound through. - //param delete_filter: If true, the filter will be deleted when the session is destroyed + //param delete_filter: If true, the filter will be deleted when removed or the session is destroyed void add_filter(CL_SoundFilter *filter, bool delete_filter = false); //: Remove the sound filter from the session. See CL_SoundFilter for details. void remove_filter(CL_SoundFilter *filter); + //: Removes all filters from the session. + void remove_all_filters(); + //! Implementation: private: CL_SoundBuffer_Session(const CL_MutexSharedPtr<CL_SoundBuffer_Session_Generic> &impl); Modified: Development/ClanLib-0.8/Sources/Sound/SoundFilters/fadefilter_generic.cpp =================================================================== --- Development/ClanLib-0.8/Sources/Sound/SoundFilters/fadefilter_generic.cpp 2006-09-22 04:00:38 UTC (rev 1086) +++ Development/ClanLib-0.8/Sources/Sound/SoundFilters/fadefilter_generic.cpp 2006-09-24 02:44:00 UTC (rev 1087) @@ -84,6 +84,11 @@ void CL_FadeFilter::filter(int **sample_data, int num_samples, int channels) { + if (impl->speed == 0 && impl->cur_volume == 1) + { + return; //no reason to waste processor power here, we've already faded to our target + } + float &cur_volume = impl->cur_volume; float &new_volume = impl->new_volume; float &speed = impl->speed; Modified: Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp =================================================================== --- Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp 2006-09-22 04:00:38 UTC (rev 1086) +++ Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp 2006-09-24 02:44:00 UTC (rev 1087) @@ -195,6 +195,21 @@ impl->delete_filters.push_back(delete_filter); } + +void CL_SoundBuffer_Session::remove_all_filters() +{ + if (!impl) return; + + CL_MutexSection mutex_lock(&impl->mutex); + for (std::vector<CL_SoundFilter *>::size_type i=0; i<impl->filters.size(); i++) + { + if (impl->delete_filters[i]) delete impl->filters[i]; + } + + impl->filters.clear(); + impl->delete_filters.clear(); +} + void CL_SoundBuffer_Session::remove_filter(CL_SoundFilter *filter) { CL_MutexSection mutex_lock(&impl->mutex); |
From: Changes to t. C. r. <cla...@li...> - 2006-09-22 03:59:26
|
Author: mrfun Date: 2006-09-22 06:00:38 +0200 (Fri, 22 Sep 2006) New Revision: 1086 Modified: Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.h Log: Fixed the build on Mac/linux Modified: Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp =================================================================== --- Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp 2006-09-22 03:06:11 UTC (rev 1085) +++ Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp 2006-09-22 04:00:38 UTC (rev 1086) @@ -33,6 +33,7 @@ #include "API/Sound/soundfilter.h" #include "soundbuffer_session_generic.h" #include "soundoutput_generic.h" +#include <cmath> ///////////////////////////////////////////////////////////////////////////// // CL_SoundBuffer_Session construction: Modified: Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.h =================================================================== --- Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.h 2006-09-22 03:06:11 UTC (rev 1085) +++ Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.h 2006-09-22 04:00:38 UTC (rev 1086) @@ -67,12 +67,12 @@ float pan; - float speedfactor; - bool looping; bool playing; + float speedfactor; + std::vector<CL_SoundFilter *> filters; std::vector<bool> delete_filters; |
From: Changes to t. C. r. <cla...@li...> - 2006-09-22 03:05:02
|
Author: mrfun Date: 2006-09-22 05:06:11 +0200 (Fri, 22 Sep 2006) New Revision: 1085 Modified: Development/ClanLib-0.8/Sources/API/Display/input_device.h Development/ClanLib-0.8/Sources/API/Sound/soundbuffer_session.h Development/ClanLib-0.8/Sources/Display/input_context_generic.cpp Development/ClanLib-0.8/Sources/Display/input_device.cpp Development/ClanLib-0.8/Sources/Display/input_device_generic.h Development/ClanLib-0.8/Sources/Display/key_binding.cpp Development/ClanLib-0.8/Sources/Network/NetSession/netcomputer_generic.cpp Development/ClanLib-0.8/Sources/Network/NetSession/netsession_generic.cpp Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.cpp Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.h Log: >From Barna: (note: Magnus ok'ed the net related patches) 1. ClanLib-0.8.0_NetSession_NetComputer_SetNoDelay.patch Calls set_nodelay on all sockets created by NetSession and NetComputer. This is needed for probably every game because in a typical game environment data should be sent as soon as possible. 2. ClanLib-0.8.0_SoundBuffer_Session_Speedfactor.patch This is a patch for a feature which is currently being used in our game Peng2illa. It allows a SoundBuffer_Session to have its own speed factor which is applied regardless of the underlying SoundProvider. This is not to be confused with the frequency (which isn't implemented in any of the SoundProvider's anyway). 3. ClanLib-0.8.0_KeyBinding_Compare_InputDevice_id.patch This are actually 2 patches. The first one enables the KeyBinding's == operator to compare not only on the Key-ID but also on the device. The second one adds an id to the InputDevice class which is the same id as when you use CL_InputContext->get_device(id). These 2 features are used by one of the newer projects from us where we offer a (more) flexible control scheme. 4. ClanLib-0.8.0_NetSocket_RemoveStopAndWaitToSend.patch As you see in the patch file it only removes new 0.8.0 stuff. It's probably not correct but even CL_NetSession can't be constructed anymore when this part is enabled in CL_Socket_Generic. We tested this on Win2000 and WinXP and could not find any problems with disconnecting sockets, but did not analyze this any further... So this patch should just ask the developer who changed this from 0.7.8 to 0.8.0 to recheck it. Modified: Development/ClanLib-0.8/Sources/API/Display/input_device.h =================================================================== --- Development/ClanLib-0.8/Sources/API/Display/input_device.h 2006-09-22 02:43:59 UTC (rev 1084) +++ Development/ClanLib-0.8/Sources/API/Display/input_device.h 2006-09-22 03:06:11 UTC (rev 1085) @@ -91,6 +91,9 @@ //: Return the hardware id/device for this device (i.e. /dev/input/js0) std::string get_device_name() const; + //: Returns the input device id. + int get_id() const; + //: Returns the input device type. Type get_type() const; @@ -162,7 +165,6 @@ public: CL_InputDevice(CL_InputDevice_Generic *impl); -private: CL_InputDevice_Generic *impl; }; Modified: Development/ClanLib-0.8/Sources/API/Sound/soundbuffer_session.h =================================================================== --- Development/ClanLib-0.8/Sources/API/Sound/soundbuffer_session.h 2006-09-22 02:43:59 UTC (rev 1084) +++ Development/ClanLib-0.8/Sources/API/Sound/soundbuffer_session.h 2006-09-22 03:06:11 UTC (rev 1085) @@ -101,6 +101,9 @@ //- and 1 means the soundeffect is only playing in the right speaker.</p> float get_pan() const; + //: Returns the current speedfactor. + float get_speedfactor() const; + //: Returns true if the session is playing bool is_playing(); @@ -139,6 +142,10 @@ //return: Returns true if the operation completed sucecsfully. void set_pan(float new_pan); + //: Sets the speedfactor of the session. + //param new_speedfactor: New speedfactor of session. + void set_speedfactor(float new_speedfactor); + //: Starts playback of the session. void play(); Modified: Development/ClanLib-0.8/Sources/Display/input_context_generic.cpp =================================================================== --- Development/ClanLib-0.8/Sources/Display/input_context_generic.cpp 2006-09-22 02:43:59 UTC (rev 1084) +++ Development/ClanLib-0.8/Sources/Display/input_context_generic.cpp 2006-09-22 03:06:11 UTC (rev 1085) @@ -29,6 +29,7 @@ #include "Display/display_precomp.h" #include "input_context_generic.h" +#include "input_device_generic.h" ///////////////////////////////////////////////////////////////////////////// // CL_InputContext_Generic construction: @@ -69,16 +70,19 @@ void CL_InputContext_Generic::add_keyboard(const CL_InputDevice &keyboard) { + keyboard.impl->id = joysticks.size(); keyboards.push_back(keyboard); } void CL_InputContext_Generic::add_mouse(const CL_InputDevice &mouse) { + mouse.impl->id = joysticks.size(); mice.push_back(mouse); } void CL_InputContext_Generic::add_joystick(const CL_InputDevice &joystick) { + joystick.impl->id = joysticks.size(); joysticks.push_back(joystick); } Modified: Development/ClanLib-0.8/Sources/Display/input_device.cpp =================================================================== --- Development/ClanLib-0.8/Sources/Display/input_device.cpp 2006-09-22 02:43:59 UTC (rev 1084) +++ Development/ClanLib-0.8/Sources/Display/input_device.cpp 2006-09-22 03:06:11 UTC (rev 1085) @@ -53,6 +53,11 @@ ///////////////////////////////////////////////////////////////////////////// // CL_InputDevice attributes: +int CL_InputDevice::get_id() const +{ + return impl->id; +} + CL_InputDevice::Type CL_InputDevice::get_type() const { return impl->type; Modified: Development/ClanLib-0.8/Sources/Display/input_device_generic.h =================================================================== --- Development/ClanLib-0.8/Sources/Display/input_device_generic.h 2006-09-22 02:43:59 UTC (rev 1084) +++ Development/ClanLib-0.8/Sources/Display/input_device_generic.h 2006-09-22 03:06:11 UTC (rev 1085) @@ -56,6 +56,9 @@ //! Attributes: public: + //: The input device id. + int id; + //: The input device type. CL_InputDevice::Type type; Modified: Development/ClanLib-0.8/Sources/Display/key_binding.cpp =================================================================== --- Development/ClanLib-0.8/Sources/Display/key_binding.cpp 2006-09-22 02:43:59 UTC (rev 1084) +++ Development/ClanLib-0.8/Sources/Display/key_binding.cpp 2006-09-22 03:06:11 UTC (rev 1085) @@ -58,20 +58,17 @@ bool CL_KeyBinding::operator ==(const CL_KeyBinding &other) const { - // TODO: Check if inputdevices also match - return other.get_keycode() == get_keycode(); + return ((other.get_device().impl == get_device().impl) && (other.get_keycode() == get_keycode())); } bool CL_KeyBinding::operator <(const CL_KeyBinding &other) const { - // TODO: Check if inputdevices also match - return other.get_keycode() < get_keycode(); + return ((other.get_device().impl == get_device().impl) && (other.get_keycode() < get_keycode())); } bool CL_KeyBinding::operator >(const CL_KeyBinding &other) const { - // TODO: Check if inputdevices also match - return other.get_keycode() > get_keycode(); + return ((other.get_device().impl == get_device().impl) && (other.get_keycode() > get_keycode())); } CL_InputDevice &CL_KeyBinding::get_device() const Modified: Development/ClanLib-0.8/Sources/Network/NetSession/netcomputer_generic.cpp =================================================================== --- Development/ClanLib-0.8/Sources/Network/NetSession/netcomputer_generic.cpp 2006-09-22 02:43:59 UTC (rev 1084) +++ Development/ClanLib-0.8/Sources/Network/NetSession/netcomputer_generic.cpp 2006-09-22 03:06:11 UTC (rev 1085) @@ -50,6 +50,8 @@ send_pos(0), ref(0), async_boot(false), async_port(""), channel_id_counter(0), shutdown(false), server(server), server_port(server_port) { + tcp_sock.set_nonblocking(false); + tcp_sock.set_nodelay(); address = tcp_sock.get_dest_address(); netsession->new_connections.push(CL_NetComputer(this)); @@ -64,6 +66,8 @@ ref(0), async_boot(true), async_hostname(hostname), async_port(port), channel_id_counter(0), shutdown(false), server(false) { + tcp_sock.set_nonblocking(false); + tcp_sock.set_nodelay(); netsession->new_connections.push(CL_NetComputer(this)); thread = CL_Thread(new CL_ThreadFunc_Runnable_v0<CL_NetComputer_Generic>(this, &CL_NetComputer_Generic::worker_thread), true); Modified: Development/ClanLib-0.8/Sources/Network/NetSession/netsession_generic.cpp =================================================================== --- Development/ClanLib-0.8/Sources/Network/NetSession/netsession_generic.cpp 2006-09-22 02:43:59 UTC (rev 1084) +++ Development/ClanLib-0.8/Sources/Network/NetSession/netsession_generic.cpp 2006-09-22 03:06:11 UTC (rev 1085) @@ -87,6 +87,8 @@ { // Connect to server: CL_Socket sock(CL_Socket::tcp); + sock.set_nonblocking(false); + sock.set_nodelay(); sock.connect(address); // Establish clanlib netcomputer protocol communication over it: @@ -116,6 +118,7 @@ accept_shutdown_trigger.reset(); accept_tcp_socket = CL_Socket(CL_Socket::tcp); accept_tcp_socket.set_nonblocking(false); + accept_tcp_socket.set_nodelay(); accept_tcp_socket.bind(CL_IPAddress(port)); accept_udp_socket = CL_Socket(CL_Socket::udp); accept_udp_socket.bind(CL_IPAddress(port)); @@ -302,6 +305,8 @@ // Incoming TCP connection: CL_Socket sock = accept_tcp_socket.accept(); + sock.set_nonblocking(false); + sock.set_nodelay(); CL_MutexSection mutex_section(&mutex); CL_NetComputer_Generic *comp = @@ -338,6 +343,8 @@ } accept_tcp_socket = CL_Socket(CL_Socket::tcp); + accept_tcp_socket.set_nonblocking(false); + accept_tcp_socket.set_nodelay(); } catch (CL_Error err) { Modified: Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp =================================================================== --- Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp 2006-09-22 02:43:59 UTC (rev 1084) +++ Development/ClanLib-0.8/Sources/Sound/soundbuffer_session.cpp 2006-09-22 03:06:11 UTC (rev 1085) @@ -96,6 +96,12 @@ return impl->pan; } +float CL_SoundBuffer_Session::get_speedfactor() const +{ + CL_MutexSection mutex_lock(&impl->mutex); + return impl->speedfactor; +} + bool CL_SoundBuffer_Session::is_playing() { if (!impl) return false; @@ -142,6 +148,12 @@ impl->pan = new_pan; } +void CL_SoundBuffer_Session::set_speedfactor(float new_speedfactor) +{ + CL_MutexSection mutex_lock(&impl->mutex); + impl->speedfactor = fabs(new_speedfactor); +} + void CL_SoundBuffer_Session::play() { CL_MutexSection mutex_lock(&impl->mutex); Modified: Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.cpp =================================================================== --- Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.cpp 2006-09-22 02:43:59 UTC (rev 1084) +++ Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.cpp 2006-09-22 03:06:11 UTC (rev 1085) @@ -45,7 +45,7 @@ CL_SoundOutput_Generic *output) : soundbuffer(soundbuffer), provider_session(0), output(output), volume(1.0f), - pan(0.0f), looping(looping), playing(false) + pan(0.0f), looping(looping), playing(false), speedfactor(1.0f) { volume = soundbuffer->volume; pan = soundbuffer->pan; @@ -97,7 +97,7 @@ // This is done by copying data from the temporary session buffers (buffer_data) to // the temporary mixing buffers (temp_data), and if buffer_data is exhausted, calling // get_data() to fill it with new data from the soundprovider session object. - double speed = provider_session->get_frequency() / double(output->mixing_frequency); + double speed = (provider_session->get_frequency() / double(output->mixing_frequency)) * double(speedfactor); for (int i = 0; i < num_samples; i++) { if (buffer_position < buffer_samples_written) Modified: Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.h =================================================================== --- Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.h 2006-09-22 02:43:59 UTC (rev 1084) +++ Development/ClanLib-0.8/Sources/Sound/soundbuffer_session_generic.h 2006-09-22 03:06:11 UTC (rev 1085) @@ -66,6 +66,8 @@ float volume; float pan; + + float speedfactor; bool looping; |
From: Changes to t. C. r. <cla...@li...> - 2006-09-22 02:43:03
|
Author: mrfun Date: 2006-09-22 04:43:59 +0200 (Fri, 22 Sep 2006) New Revision: 1084 Modified: Development/ClanLib-0.8/Examples/CTalk/chat.cpp Development/ClanLib-0.8/Examples/CTalk/chatview.cpp Development/ClanLib-0.8/Sources/Network/Socket/socket_generic.cpp Log: CTalk IRC example changes: -Enabled /nick command -Fixed crash if /admin with no parms is typed -Fixed "slow GUI update" problem that made it appear laggy -Removed code that made it send a packet on every keypress (!) In socket_generic.cpp, did workaround for problem where it took 1 minute to init a socket in windows (mutex problem when kiling on the copy constructor..) , better fix coming later from Magnus in 0.9 Modified: Development/ClanLib-0.8/Examples/CTalk/chat.cpp =================================================================== --- Development/ClanLib-0.8/Examples/CTalk/chat.cpp 2006-09-20 22:17:50 UTC (rev 1083) +++ Development/ClanLib-0.8/Examples/CTalk/chat.cpp 2006-09-22 02:43:59 UTC (rev 1084) @@ -78,7 +78,11 @@ { scroll->set_max_value(scroll->get_max_value()+1); if (scroll->get_value() == scroll->get_max_value()-1) scroll->set_value(scroll->get_max_value()); + + //signal that we want to be repainted + update(); } + } ///////////////////////////////////////////////////////////////////////////// Modified: Development/ClanLib-0.8/Examples/CTalk/chatview.cpp =================================================================== --- Development/ClanLib-0.8/Examples/CTalk/chatview.cpp 2006-09-20 22:17:50 UTC (rev 1083) +++ Development/ClanLib-0.8/Examples/CTalk/chatview.cpp 2006-09-22 02:43:59 UTC (rev 1084) @@ -78,7 +78,10 @@ if (args[0] == "/nick") { - // void send_nick(const std::string &nick, int hopcount = -1); + if (args.size() > 1) + { + connection->send_nick(args[1]); + } } else if (args[0] == "/oper") { @@ -339,7 +342,7 @@ { if (args.size() == 1) { - connection->send_admin(); + connection->send_admin(""); } else if (args.size() == 2) { @@ -589,7 +592,8 @@ void ChatView::on_inputbox_changed(const std::string &text) { - connection->send_type_packet(chat->get_filter(), text); + //why was this sending a packet on every keystroke? No need. --mrfun Sep 22 2006 + //connection->send_type_packet(chat->get_filter(), text); } void ChatView::on_userlist_activated(int item_id) Modified: Development/ClanLib-0.8/Sources/Network/Socket/socket_generic.cpp =================================================================== --- Development/ClanLib-0.8/Sources/Network/Socket/socket_generic.cpp 2006-09-20 22:17:50 UTC (rev 1083) +++ Development/ClanLib-0.8/Sources/Network/Socket/socket_generic.cpp 2006-09-22 02:43:59 UTC (rev 1084) @@ -283,6 +283,15 @@ if(sock != -1) { #ifdef WIN32 + + //the code below causes a one minute deadlock when closing a socket - (might be only sockets + //that are not bound yet, this happens with the copy constructor when initializing + //in CTalk. Maybe we should set a flag for when a socket is actually bound? And even in that case, + //build a blocking thread to do this so we can return right away? + //Let's keep it disabled for now, Magnus has said he has a fix coming in 0.9 that we can backport. + //-mrfun Sept 22 2006 + + /* // Must stop and wait for all send data to be sent (thanks Microsoft): HANDLE event_object = WSACreateEvent(); if (event_object != WSA_INVALID_EVENT) @@ -291,6 +300,7 @@ WSAWaitForMultipleEvents(1, &event_object, FALSE, 60*1000, FALSE); WSACloseEvent(event_object); } + */ closesocket(sock); #else close(sock); |
From: Changes to t. C. r. <cla...@li...> - 2006-09-20 22:16:44
|
Author: harry Date: 2006-09-21 00:17:50 +0200 (Thu, 21 Sep 2006) New Revision: 1083 Modified: Development/ClanLib-0.9/Tests/GUI/Images/lineedit_normal.png Log: - Hm, seems i've modified Images/lineedit_normal.png. Modified: Development/ClanLib-0.9/Tests/GUI/Images/lineedit_normal.png =================================================================== (Binary files differ) |
From: Changes to t. C. r. <cla...@li...> - 2006-09-20 22:15:04
|
Author: harry Date: 2006-09-21 00:16:09 +0200 (Thu, 21 Sep 2006) New Revision: 1082 Modified: Development/ClanLib-0.9/Tests/GUI/LineEdit1/test.cpp Development/ClanLib-0.9/Tests/GUI/LineEdit1/theme.css Log: - Updated LineEdit test. Modified: Development/ClanLib-0.9/Tests/GUI/LineEdit1/test.cpp =================================================================== --- Development/ClanLib-0.9/Tests/GUI/LineEdit1/test.cpp 2006-09-20 21:52:26 UTC (rev 1081) +++ Development/ClanLib-0.9/Tests/GUI/LineEdit1/test.cpp 2006-09-20 22:16:09 UTC (rev 1082) @@ -1,4 +1,4 @@ -#include <ClanLib/core.h> +#include <ClanLib/core.h> #include <ClanLib/gui.h> #include <ClanLib/application.h> #include <ClanLib/display.h> @@ -10,19 +10,19 @@ { CL_ConsoleWindow console("Console"); - try + try { CL_SetupCore setup_core; CL_SetupDisplay setup_display; CL_SetupGL setup_gl; CL_OpenGLTarget display_target; - CL_ResourceManager resources; + CL_ResourceManager resources; resources.load("resources.xml"); - CL_GUIManager gui; + CL_GUIManager gui; gui.set_resources(resources); - + CL_GUIThemeDefault theme; theme.set_resources(resources); @@ -30,20 +30,21 @@ CL_File file("theme.css", CL_File::open_existing); CL_CSSDocument css; - css.load(file); - file.close(); + css.load(file); + file.close(); gui.set_css_document(css); - + CL_GUIComponentDescription desc; - desc.set_property("window-title", "GUI2 Test"); + desc.set_property("window-title", "GUI2 Test"); CL_Window root(CL_Rect(200,200,600,600), desc, &gui); root.func_close().set(this, &App::on_close, &root); - + CL_GUIComponentDescription desc_xp; desc_xp.set_class_name("xp"); CL_LineEdit lineedit1(CL_Rect(20, 20, 200, 50), desc_xp, &root); - lineedit1.set_text("y and t don't render correctly"); +// lineedit1.set_text("Random text, random text, random random text... Ok, that wasn't very random."); + lineedit1.set_text("Random text, random text"); gui.exec(); } @@ -54,10 +55,10 @@ } return 0; - } - + } + void on_close(CL_Window *win) { win->exit_with_code(0); } -} app; +} app; Modified: Development/ClanLib-0.9/Tests/GUI/LineEdit1/theme.css =================================================================== --- Development/ClanLib-0.9/Tests/GUI/LineEdit1/theme.css 2006-09-20 21:52:26 UTC (rev 1081) +++ Development/ClanLib-0.9/Tests/GUI/LineEdit1/theme.css 2006-09-20 22:16:09 UTC (rev 1082) @@ -1,15 +1,23 @@ window { - background-color: #e0dfe3; + bg-color: #e0dfe3; } lineedit.xp { - bg-image-sizing-left:8; - bg-image-sizing-right:8; - bg-image-sizing-top:9; - bg-image-sizing-bottom:9; + bg-image-sizing-left:3; + bg-image-sizing-right:4; + bg-image-sizing-top:4; + bg-image-sizing-bottom:4; bg-image-sizing:stretch; + + border-top:4; + border-left:3; + border-right:4; + border-bottom:4; + + padding-top:5; + padding-bottom:5; padding-left:5; } @@ -28,12 +36,55 @@ bg-image:LineEditDisabled; } + lineedit.xp cursor { - + padding-top:4; + padding-bottom:0; + padding-left:0; + border-top:0; + border-left:0; + border-right:0; + border-bottom:0; + preferred-width:1; + bg-color: black; + blink-time-on:1000; + blink-time-off:1000; + bg-image:; } +lineedit.xp cursor:blink_on +{ + bg-color: black; +} +lineedit.xp cursor:blink_off +{ + bg-color: white; +} + +lineedit.xp selection +{ + bg-image:; + bg-color: #7070dd88; + border-top:-2; + border-left:0; + border-right:0; + border-bottom:-3; + padding-top:0; + padding-bottom:0; +} + +lineedit.xp selection:normal +{ + bg-image:LineEditSelection; +} + +lineedit.xp selection:hot +{ + bg-image:LineEditSelectionNotFocused; +} + lineedit.possible_css_values { margin-top:0; |