nobody at rubyforge.org
2007-Mar-21 10:20 UTC
[Wxruby-development] [904] branches/wxruby2/wxwidgets_282: Changes in Wx::Colour API 2.6 -> 2.8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:'':'';} #msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; } #msg ul, pre { overflow: auto; } #header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[904] branches/wxruby2/wxwidgets_282: Changes in Wx::Colour API 2.6 -> 2.8</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>904</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2007-03-21 06:20:07 -0400 (Wed, 21 Mar 2007)</dd> </dl> <h3>Log Message</h3> <pre>Changes in Wx::Colour API 2.6 -> 2.8</pre> <h3>Modified Paths</h3> <ul> <li><a href="#brancheswxruby2wxwidgets_282doctextilecolourtxtl">branches/wxruby2/wxwidgets_282/doc/textile/colour.txtl</a></li> <li><a href="#brancheswxruby2wxwidgets_282libwxclassescolourrb">branches/wxruby2/wxwidgets_282/lib/wx/classes/colour.rb</a></li> <li><a href="#brancheswxruby2wxwidgets_282swigclassesColouri">branches/wxruby2/wxwidgets_282/swig/classes/Colour.i</a></li> <li><a href="#brancheswxruby2wxwidgets_282swigclassesincludewxColourh">branches/wxruby2/wxwidgets_282/swig/classes/include/wxColour.h</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="brancheswxruby2wxwidgets_282doctextilecolourtxtl"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/doc/textile/colour.txtl (903 => 904)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/doc/textile/colour.txtl        2007-03-20 00:03:40 UTC (rev 903) +++ branches/wxruby2/wxwidgets_282/doc/textile/colour.txtl        2007-03-21 10:20:07 UTC (rev 904) </span><span class="lines">@@ -37,10 +37,12 @@ </span><span class="cx"> h2. Methods </span><span class="cx"> </span><span class="cx"> * "Colour.new":#Colour_new </span><ins>+* "Colour#alpha":#Colour_alpha </ins><span class="cx"> * "Colour#blue":#Colour_blue </span><span class="cx"> * "Colour#get_pixel":#Colour_getpixel </span><ins>+* "Colour#get_as_string":#Colour_getasstring </ins><span class="cx"> * "Colour#green":#Colour_green </span><del>-* "Colour#ok":#Colour_ok </del><ins>+* "Colour#is_ok":#Colour_isok </ins><span class="cx"> * "Colour#red":#Colour_red </span><span class="cx"> * "Colour#set":#Colour_set </span><span class="cx"> </span><span class="lines">@@ -48,40 +50,50 @@ </span><span class="cx"> </span><span class="cx"> h3(#Colour_constr). Colour.new </span><span class="cx"> </span><del>- *Colour.new*(%(arg-type)Integer% red, %(arg-type)Integer% green, %(arg-type)Integer% blue) </del><ins>+ *Colour.new*(%(arg-type)Integer% red, %(arg-type)Integer% green, %(arg-type)Integer% blue, %(arg-type)Integer% alpha = 255) </ins><span class="cx"> </span><del>-Constructs a colour from red, green and blue values. Each value should -be between 0 and 255. </del><ins>+Constructs a colour from red, green and blue values and an optional +alpha value for transparency. Each value should +be between 0 and 255; the default value for alpha is 255, which is +completely opaque. </ins><span class="cx"> </span><del>- *Colour.new*(%(arg-type)String% colourNname) </del><ins>+ *Colour.new*(%(arg-type)String% colour_name) </ins><span class="cx"> </span><del>-Constructs a colour object using a colour name listed in the global -colour database *Wx::TheColourDatabase*. </del><ins>+Constructs a colour object using the colour named @colour_name@, listed +in the global colour database *Wx::TheColourDatabase*. </ins><span class="cx"> </span><del>-h4. Parameters - -* _red_ The red value. -* _green_ The green value. -* _blue_ The blue value. -* _colourName_ The colour name. - </del><span class="cx"> h4. See also </span><span class="cx"> </span><span class="cx"> "ColourDatabase":colourdatabase.html </span><span class="cx"> </span><ins>+h3(#Colour_alpha). Colour#alpha + + Integer *alpha*() + +Returns the alpha value, or opacity, for the colour. + </ins><span class="cx"> h3(#Colour_blue). Colour#blue </span><span class="cx"> </span><span class="cx"> Integer *blue*() </span><span class="cx"> </span><span class="cx"> Returns the blue intensity. </span><span class="cx"> </span><ins>+h3(#Colour_getasstring). Colour#get_as_string </ins><span class="cx"> </span><ins>+ String *get_as_string*(%(arg-type)Integer% format) + +Returns a string representation of this colour, in the format +@format@. Format should be one of the constants: + +* @Wx::C2S_HTML_SYNTAX@ to obtain the colour as "#" followed by 6 hexadecimal digits (e.g. wxColour(255,0,0) -> "#FF0000"). +* @Wx::C2S_CSS_SYNTAX@ to obtain the colour in the "rgb(r,g,b)" syntax (e.g. wxColour(255,0,0) -> "rgb(255,0,0)") +* @Wx::C2S_NAME@ to obtain the colour name (e.g. wxColour(255,0,0) -> "red"), where possible </ins><span class="cx"> h3(#Colour_getpixel). Colour#get_pixel </span><span class="cx"> </span><span class="cx"> Integer *get_pixel*() </span><span class="cx"> </span><del>-Returns a pixel value which is platform-dependent. On Windows, a COLORREF is returned. -On X, an allocated pixel value is returned. </del><ins>+Returns a pixel value which is platform-dependent. On Windows, a +COLORREF is returned. On X, an allocated pixel value is returned. </ins><span class="cx"> </span><span class="cx"> -1 is returned if the pixel is invalid (on X, unallocated). </span><span class="cx"> </span><span class="lines">@@ -93,11 +105,12 @@ </span><span class="cx"> Returns the green intensity. </span><span class="cx"> </span><span class="cx"> </span><del>-h3(#Colour_ok). Colour#ok </del><ins>+h3(#Colour_isok). Colour#is_ok </ins><span class="cx"> </span><del>- Boolean *ok*() </del><ins>+ Boolean *is_ok*() </ins><span class="cx"> </span><del>-Returns if the colour object is valid (the colour has been initialised with RGB values). </del><ins>+Returns if the colour object is valid (the colour has been initialised +with valid RGB values). </ins><span class="cx"> </span><span class="cx"> </span><span class="cx"> h3(#Colour_red). Colour#red </span></span></pre></div> <a id="brancheswxruby2wxwidgets_282libwxclassescolourrb"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/lib/wx/classes/colour.rb (903 => 904)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/lib/wx/classes/colour.rb        2007-03-20 00:03:40 UTC (rev 903) +++ branches/wxruby2/wxwidgets_282/lib/wx/classes/colour.rb        2007-03-21 10:20:07 UTC (rev 904) </span><span class="lines">@@ -11,7 +11,7 @@ </span><span class="cx"> Kernel.raise ArgumentError, "Invalid colour values #{args.inspect}" </span><span class="cx"> end </span><span class="cx"> </span><del>- if not ok </del><ins>+ if not is_ok </ins><span class="cx"> Kernel.raise ArgumentError, "Invalid colour values #{args.inspect}" </span><span class="cx"> end </span><span class="cx"> end </span><span class="lines">@@ -31,16 +31,17 @@ </span><span class="cx"> Wx::LIGHT_GREY = new(192, 192, 192) </span><span class="cx"> </span><span class="cx"> # Colours are equal to one another if they have the same red, green </span><del>- # and blue intensity. </del><ins>+ # and blue intensity, and the same alpha </ins><span class="cx"> def ==(other) </span><span class="cx"> if not other.is_a?(self.class) </span><span class="cx"> raise ArgumentError, "No comparison of #{self} to #{other}" </span><span class="cx"> end </span><del>- [ red, green, blue ] == [ other.red, other.green, other.blue ] </del><ins>+ [ red, green, blue, alpha ] == + [ other.red, other.green, other.blue, other.alpha ] </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # More informative output for inspect etc </span><span class="cx"> def to_s </span><del>- "#<Wx::Colour: (#{red}, #{green}, #{blue})>" </del><ins>+ "#<Wx::Colour: (#{red}, #{green}, #{blue} *#{alpha})>" </ins><span class="cx"> end </span><span class="cx"> end </span></span></pre></div> <a id="brancheswxruby2wxwidgets_282swigclassesColouri"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/swig/classes/Colour.i (903 => 904)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/swig/classes/Colour.i        2007-03-20 00:03:40 UTC (rev 903) +++ branches/wxruby2/wxwidgets_282/swig/classes/Colour.i        2007-03-21 10:20:07 UTC (rev 904) </span><span class="lines">@@ -5,6 +5,11 @@ </span><span class="cx"> </span><span class="cx"> %module(directors="1") wxColour </span><span class="cx"> </span><ins>+// flags for wxColour -> wxString conversion (see wxColour::GetAsString) +#define wxC2S_NAME 1 // return colour name, when possible +#define wxC2S_CSS_SYNTAX 2 // return colour in rgb(r,g,b) syntax +#define wxC2S_HTML_SYNTAX 4 // return colour in #rrggbb syntax + </ins><span class="cx"> %import "include/wxObject.h" </span><span class="cx"> </span><span class="cx"> %include "include/wxColour.h" </span></span></pre></div> <a id="brancheswxruby2wxwidgets_282swigclassesincludewxColourh"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/swig/classes/include/wxColour.h (903 => 904)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/swig/classes/include/wxColour.h        2007-03-20 00:03:40 UTC (rev 903) +++ branches/wxruby2/wxwidgets_282/swig/classes/include/wxColour.h        2007-03-21 10:20:07 UTC (rev 904) </span><span class="lines">@@ -1,6 +1,5 @@ </span><del>-// wxColour.h -// This file was automatically generated -// by extractxml.rb, part of the wxRuby project </del><ins>+// Copyright 2007 by Kevin Smith +// released under the MIT-style wxruby2 license </ins><span class="cx"> // Do not make changes directly to this file! </span><span class="cx"> </span><span class="cx"> #if !defined(_wxColour_h_) </span><span class="lines">@@ -8,67 +7,17 @@ </span><span class="cx"> class wxColour : public wxObject </span><span class="cx"> { </span><span class="cx"> public: </span><del>-        /** -         * \brief Default constructor. -        */ - </del><span class="cx"> wxColour() ; </span><del>-        /** -         * \brief Constructs a colour from red, green and blue values. -         * \param const unsigned char -         * \param const unsigned char -         * \param const unsigned char -        */ - - wxColour(const unsigned char red , const unsigned char green , const unsigned char blue ) ; -        /** -         * \brief Constructs a colour object using a colour name -listed in . -         * \param const wxString& -        */ - </del><ins>+ wxColour(const unsigned char red , const unsigned char green , const unsigned char blue, const unsigned char alpha = wxALPHA_OPAQUE ); </ins><span class="cx"> wxColour(const wxString& colourNname ) ; </span><del>-        /** -         * \brief -         * \param const wxColour& -        */ - </del><span class="cx"> wxColour(const wxColour& colour ) ; </span><del>-        /** -         * \brief Returns the blue intensity. -        */ - </del><ins>+ unsigned char Alpha() const; </ins><span class="cx"> unsigned char Blue() const; </span><del>-        /** -         * \brief Returns a pixel value which is platform-dependent. On Windows, a COLORREF is returned. -On X, an allocated pixel value is returned. - --1 is returned if the pixel is invalid (on X, unallocated). -        */ - </del><ins>+ wxString GetAsString(long flags) const; </ins><span class="cx"> long GetPixel() const; </span><del>-        /** -         * \brief Returns the green intensity. -        */ - </del><span class="cx"> unsigned char Green() const; </span><del>-        /** -         * \brief Returns true if the colour object is valid (the colour has been initialised with RGB values). -        */ - - bool Ok() const; -        /** -         * \brief Returns the red intensity. -        */ - </del><ins>+ bool IsOk() const; </ins><span class="cx"> unsigned char Red() const; </span><del>-        /** -         * \brief Sets the RGB intensity values. -         * \param const unsigned char -         * \param const unsigned char -         * \param const unsigned char -        */ - </del><span class="cx"> void Set(const unsigned char red , const unsigned char green , const unsigned char blue ) ; </span><span class="cx"> }; </span><span class="cx"> </span></span></pre> </div> </div> </body> </html>
Possibly Parallel Threads
- [883] branches/wxruby2/wxwidgets_282/swig: API changes for move to WxWidgets 2.8
- [922] branches/wxruby2/wxwidgets_282: Changes, additions and deprecations 2.6 -> 2.8 Wx API
- [905] branches/wxruby2/wxwidgets_282/swig/classes/include/wxColour.h: Wx::Colour API 2.6 -> 2.8 - one more place alpha argument is needed
- [917] branches/wxruby2/wxwidgets_282/swig/classes/include/wxAuiDockArt.h: Fix spelling mistake from wxWidgets headers
- [950] branches/wxruby2/wxwidgets_282: Changes in GenericDirCtrl API 2.6->2.8, fix TreeItemId mapping, remove cruft