[gtkmm/gtkmm-2-22] AlignmentEnum: Add ALIGN_START and ALIGN_END to match gtkmm 3.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-2-22] AlignmentEnum: Add ALIGN_START and ALIGN_END to match gtkmm 3.
- Date: Wed, 15 Sep 2010 20:19:37 +0000 (UTC)
commit d5a1517bab10555699fa73884c703259442bdb0d
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Sep 15 21:14:38 2010 +0200
AlignmentEnum: Add ALIGN_START and ALIGN_END to match gtkmm 3.
* gtk/src/enums.[hg|ccg]: AlignmentEnum: Added ALIGN_START and ALIGN_END,
deprecating the LEFT/RIGHT/TOP/BOTTOM equivalents. This will help existing
code when porting to gtkmm 3, which has the Align enum instead of AlignmentEnum.
* gtk/src/enums.hg:
* gtk/src/misc.hg: Adapted.
ChangeLog | 10 ++++++++++
gtk/src/enums.ccg | 10 +++-------
gtk/src/enums.hg | 15 ++++++++++-----
gtk/src/misc.hg | 2 +-
4 files changed, 24 insertions(+), 13 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7d0f373..ca49415 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-15 Murray Cumming <murrayc murrayc com>
+
+ AlignmentEnum: Add ALIGN_START and ALIGN_END to match gtkmm 3.
+
+ * gtk/src/enums.[hg|ccg]: AlignmentEnum: Added ALIGN_START and ALIGN_END,
+ deprecating the LEFT/RIGHT/TOP/BOTTOM equivalents. This will help existing
+ code when porting to gtkmm 3, which has the Align enum instead of AlignmentEnum.
+ * gtk/src/enums.hg:
+ * gtk/src/misc.hg: Adapted.
+
2.21.8:
2010-09-14 Murray Cumming <murrayc murrayc com>
diff --git a/gtk/src/enums.ccg b/gtk/src/enums.ccg
index dd2e7bb..330dcac 100644
--- a/gtk/src/enums.ccg
+++ b/gtk/src/enums.ccg
@@ -36,18 +36,14 @@ float _gtkmm_align_float_from_enum(AlignmentEnum value)
//Choose the float alignment value appropriate for this human-readable enum value:
switch(value)
{
- case ALIGN_LEFT:
+ case ALIGN_START:
return 0.0; break;
case ALIGN_CENTER:
return 0.5; break;
- case ALIGN_RIGHT:
+ case ALIGN_END:
return 1.0; break;
- case ALIGN_TOP:
- return _gtkmm_align_float_from_enum(ALIGN_LEFT); break;
- case ALIGN_BOTTOM:
- return _gtkmm_align_float_from_enum(ALIGN_RIGHT); break;
default:
- return _gtkmm_align_float_from_enum(ALIGN_LEFT); break;
+ return _gtkmm_align_float_from_enum(ALIGN_START); break;
}
}
diff --git a/gtk/src/enums.hg b/gtk/src/enums.hg
index d40cd03..94dcfe8 100644
--- a/gtk/src/enums.hg
+++ b/gtk/src/enums.hg
@@ -230,11 +230,16 @@ namespace Gtk
*/
enum AlignmentEnum
{
- ALIGN_LEFT, /**< Same as 0.0 */
- ALIGN_CENTER, /**< Same as 0.5 */
- ALIGN_RIGHT, /**< Same as 1.0 */
- ALIGN_TOP, /**< Same as ALIGN_LEFT */
- ALIGN_BOTTOM /**< Same as ALIGN_RIGHT */
+ ALIGN_START, /**< Same as 0.0. */
+ ALIGN_CENTER, /**< Same as 0.5. */
+ ALIGN_END /**< Same as 1.0. */
+_DEPRECATE_IFDEF_START
+ ,
+ ALIGN_LEFT = ALIGN_START, /**< @deprecated Use ALIGN_START. */
+ ALIGN_RIGHT = ALIGN_END, /**< @deprecated Use ALIGN_END. */
+ ALIGN_TOP = ALIGN_START, /**< @deprecated Use ALIGN_START. */
+ ALIGN_BOTTOM = ALIGN_END /**< @deprecated Use ALIGN_END. */
+_DEPRECATE_IFDEF_END
};
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/gtk/src/misc.hg b/gtk/src/misc.hg
index 057b8df..1e639d9 100644
--- a/gtk/src/misc.hg
+++ b/gtk/src/misc.hg
@@ -44,7 +44,7 @@ protected:
public:
_WRAP_METHOD(void set_alignment(float xalign = 0.0, float yalign = 0.5), gtk_misc_set_alignment)
- _WRAP_METHOD(void set_alignment(AlignmentEnum xalign = Gtk::ALIGN_LEFT, AlignmentEnum yalign = Gtk::ALIGN_CENTER), gtk_misc_set_alignment)
+ _WRAP_METHOD(void set_alignment(AlignmentEnum xalign = Gtk::ALIGN_START, AlignmentEnum yalign = Gtk::ALIGN_CENTER), gtk_misc_set_alignment)
_WRAP_METHOD(void get_alignment(float& xalign, float& yalign) const, gtk_misc_get_alignment)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]