[gtkmm] Gtk::PaperSize: Define the paper name constants in the .cc file



commit 29ce3676c33db2a9f8562926dbfdf7172b891a2b
Author: BenoƮt Dejean <bdejean gmail com>
Date:   Mon Mar 2 13:07:26 2015 +0100

    Gtk::PaperSize: Define the paper name constants in the .cc file
    
    * gtk/src/papersize.hg: Declare the paper name constants extern.
    * gtk/src/papersize.ccg: Initialize the paper name constants. If they are
    initialized in the header file, they are local to each compilation unit,
    and many copies of them can be included in the executable file. Bug #745345.

 gtk/src/papersize.ccg |    8 ++++++++
 gtk/src/papersize.hg  |   15 +++++++--------
 2 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/gtk/src/papersize.ccg b/gtk/src/papersize.ccg
index bdc4009..73ce6f9 100644
--- a/gtk/src/papersize.ccg
+++ b/gtk/src/papersize.ccg
@@ -21,6 +21,14 @@
 
 namespace Gtk
 {
+// Initialize external constants.
+const Glib::ustring PAPER_NAME_A3 = GTK_PAPER_NAME_A3;
+const Glib::ustring PAPER_NAME_A4 = GTK_PAPER_NAME_A4;
+const Glib::ustring PAPER_NAME_A5 = GTK_PAPER_NAME_A5;
+const Glib::ustring PAPER_NAME_B5 = GTK_PAPER_NAME_B5;
+const Glib::ustring PAPER_NAME_LETTER = GTK_PAPER_NAME_LETTER;
+const Glib::ustring PAPER_NAME_EXECUTIVE = GTK_PAPER_NAME_EXECUTIVE;
+const Glib::ustring PAPER_NAME_LEGAL = GTK_PAPER_NAME_LEGAL;
 
 //PaperSize::PaperSize()
 //:
diff --git a/gtk/src/papersize.hg b/gtk/src/papersize.hg
index f4b0909..7760a7b 100644
--- a/gtk/src/papersize.hg
+++ b/gtk/src/papersize.hg
@@ -28,15 +28,14 @@ struct PaperSizeTraits;
 #endif
 
 /** Common paper names, from PWG 5101.1-2002 PWG: Standard for Media Standardized Names
- *
  */
-const Glib::ustring PAPER_NAME_A3 = "iso_a3";
-const Glib::ustring PAPER_NAME_A4 = "iso_a4";
-const Glib::ustring PAPER_NAME_A5 = "iso_a5";
-const Glib::ustring PAPER_NAME_B5 = "iso_b5";
-const Glib::ustring PAPER_NAME_LETTER = "na_letter";
-const Glib::ustring PAPER_NAME_EXECUTIVE = "na_executive";
-const Glib::ustring PAPER_NAME_LEGAL = "na_legal";
+extern const Glib::ustring PAPER_NAME_A3;
+extern const Glib::ustring PAPER_NAME_A4;
+extern const Glib::ustring PAPER_NAME_A5;
+extern const Glib::ustring PAPER_NAME_B5;
+extern const Glib::ustring PAPER_NAME_LETTER;
+extern const Glib::ustring PAPER_NAME_EXECUTIVE;
+extern const Glib::ustring PAPER_NAME_LEGAL;
 
 _WRAP_ENUM(Unit, GtkUnit)
 


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