[gtkmm] RGBA: Added individual color setters that take doubles.



commit 69847e56d5bf5b8a9eeb7af32d4c52d386dcfb24
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Dec 8 11:40:43 2010 +0100

    RGBA: Added individual color setters that take doubles.
    
    	* gdk/src/rgba.[hg|ccg]: Added set_red/green/blue/alpha(double).

 ChangeLog        |   10 +++++++++-
 NEWS             |   37 +++++++++++++++++++++++++++++++++++++
 configure.ac     |    4 ++--
 gdk/src/rgba.ccg |   21 +++++++++++++++++++++
 gdk/src/rgba.hg  |   24 ++++++++++++++++++++++++
 5 files changed, 93 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 18beba7..de6a8bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2.91.6:
+
+2010-12-08  Murray Cumming  <murrayc murrayc com>
+
+	RGBA: Added individual color setters that take doubles.
+
+	* gdk/src/rgba.[hg|ccg]: Added set_red/green/blue/alpha(double).
+
 2010-12-08  Murray Cumming  <murrayc murrayc com>
 
 	Gdk::Color: Rename the setters and getters.
@@ -240,7 +248,7 @@
 	* gdk/gdkmm/general.[h|cc]:
 	* gdk/src/display.hg:
   * gdk/src/pixbuf.hg: Adapt the includes.
-  
+
 2010-12-02  Murray Cumming  <murrayc murrayc com>
 
 	Revert the previous commit's removal of newer ComboBox methods.
diff --git a/NEWS b/NEWS
index 6992f1a..1c20fd3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,40 @@
+2.91.6 (unstable):
+
+Gtk:
+* Added the StyleContext, StyleProvider, and CssProvider classes, 
+  removing the Style and RC classes.
+* Added Gdk::Cairo::set_source_rgba().
+* Widget: Added get_style_context().
+* Cellrenderer, Cellrenderertext, Cellview, Colorbutton, TextTag:
+  Added RGBA versions of color properties. We expect to remove Gdk::Color 
+  in future, maybe then renaming all uses of RGBA to Color.
+* ColorSelection: Added get/set_current_rgba() and get/set_previous_rgba().
+* ComboBoxText:
+  - Renamed append_text(), prepend_text() and insert_text() to append(), 
+  prepend() and insert().
+  - Added extra append()/prepend()/insert() overloads that also take an id.
+  - Added get/set_id_column(), get/set_active_id() and properties.
+* Widget:
+  - Removed the style_changed signal because it used GtkStyle, though 
+  we might bring this back when the GTK+ code is completely ported to 
+  GtkStyleContext.
+  - Added get_path(), removing path().
+  - Removed the no_expose_event signal.
+* Added WidgetPath.
+* Window: get_geometry(): Removed the depth parameter.
+
+Gdk:
+* Removed Drawable.
+* RGBA: Rename set_rgb_p(double) to set_rgba(dobule) and rename the old 
+  set_rgb(gushort) to set_rgb_u(gushort). Likewise for other methods. 
+  This makes it more like GdkRGBA, which uses double instead of the gushort 
+  that GdkColor used.
+* Window:
+  - Added set_background(RGBA) and renamed  set_background_pattern() to 
+  set_background(Pattern).
+	- Added set_clip_region() and get_visible_region() and create_cairo_context(),
+	which were previously in the (now removed) base Drawable class.
+	
 2.91.5.1 (unstable):
 
 Fix the build with GTK+ 2.91.5 by removing some newer GtkComboBox methods.
diff --git a/configure.ac b/configure.ac
index 6a9911a..d6a52ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,7 +15,7 @@
 ## You should have received a copy of the GNU Lesser General Public License
 ## along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT([gtkmm], [2.91.5.1],
+AC_INIT([gtkmm], [2.91.6],
         [http://bugzilla.gnome.org/enter_bug.cgi?product=gtkmm],
         [gtkmm], [http://www.gtkmm.org/])
 AC_PREREQ([2.59])
@@ -54,7 +54,7 @@ AS_IF([test "x$enable_static" = xyes],
 
 # gdkmm really does need GTK+, because part of Gdk::DragContext is in GTK+.
 # The extra cairomm check is because gdkmm requires a newer cairomm than pangomm requires.
-AC_SUBST([GDKMM_MODULES], ['giomm-2.4 >= 2.27.0 pangomm-1.4 >= 2.26 gtk+-3.0 >= 2.91.5 cairomm-1.0 >= 1.9.2'])
+AC_SUBST([GDKMM_MODULES], ['giomm-2.4 >= 2.27.0 pangomm-1.4 >= 2.26 gtk+-3.0 >= 2.91.6 cairomm-1.0 >= 1.9.2'])
 
 AS_IF([test "x$gtkmm_host_windows" = xyes],
       [GTKMM_MODULES=$GDKMM_MODULES],
diff --git a/gdk/src/rgba.ccg b/gdk/src/rgba.ccg
index f2d832e..c77095d 100644
--- a/gdk/src/rgba.ccg
+++ b/gdk/src/rgba.ccg
@@ -183,6 +183,27 @@ void RGBA::set_alpha_u(gushort value)
   gobject_->alpha = value / MULTIPLIER;
 }
 
+void RGBA::set_red(double value)
+{
+  gobject_->red = value;
+}
+
+void RGBA::set_green(double value)
+{
+  gobject_->green = value;
+}
+
+void RGBA::set_blue(double value)
+{
+  gobject_->blue = value;
+}
+
+void RGBA::set_alpha(double value)
+{
+  gobject_->alpha = value;
+}
+
+
 
 double RGBA::get_red() const
 {
diff --git a/gdk/src/rgba.hg b/gdk/src/rgba.hg
index ad201dd..32a4b33 100644
--- a/gdk/src/rgba.hg
+++ b/gdk/src/rgba.hg
@@ -130,6 +130,30 @@ public:
    * @result The alpha component of the color, as a percentage.
    */
   double get_alpha() const;
+  
+  /** Set the red component of the color, as a percentage.
+   * @param value The red component of the color.
+   */
+  void set_red(double value);
+
+  /** Set the green component of the color, as a percentage.
+   * @param value The green component of the color.
+   */
+  void set_green(double value);
+
+  /** Set the blue component of the color, as a percentage.
+   * @param value The blue component of the color.
+   */
+  void set_blue(double value);
+  
+  /** Set the alpha component of the color, as a percentage.
+   * @param value The blue component of the color.
+   */
+  void set_alpha(double value);
+  
+  /** Set the alpha component of the color.
+   * @param value The alpha component of the color.
+   */
 
   _WRAP_METHOD(Glib::ustring to_string() const, gdk_rgba_to_string)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]