[gcalctool] Rename DisplayFormat enum



commit 29132cfead52bcb96cb527c405c51f804f83ae78
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Nov 29 17:51:28 2010 +1100

    Rename DisplayFormat enum

 src/gcalctool.c        |    2 +-
 src/math-equation.c    |    8 ++++----
 src/math-equation.h    |    4 ++--
 src/math-preferences.c |    8 ++++----
 src/mp-serializer.c    |   16 ++++++++--------
 src/mp-serializer.h    |   12 ++++++------
 6 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/src/gcalctool.c b/src/gcalctool.c
index 8cb8f94..f0f3467 100644
--- a/src/gcalctool.c
+++ b/src/gcalctool.c
@@ -209,7 +209,7 @@ main(int argc, char **argv)
     MathEquation *equation;
     int accuracy = 9, word_size = 64, base = 10;
     gboolean show_tsep = FALSE, show_zeroes = FALSE;
-    DisplayFormat number_format;
+    MpDisplayFormat number_format;
     MPAngleUnit angle_units;
     ButtonMode button_mode;
     gchar *source_currency, *target_currency;
diff --git a/src/math-equation.c b/src/math-equation.c
index 2d8da54..0a431ce 100644
--- a/src/math-equation.c
+++ b/src/math-equation.c
@@ -563,9 +563,9 @@ math_equation_get_show_trailing_zeroes(MathEquation *equation)
 
 
 void
-math_equation_set_number_format(MathEquation *equation, DisplayFormat format)
+math_equation_set_number_format(MathEquation *equation, MpDisplayFormat format)
 {
-    DisplayFormat old_format = mp_serializer_get_number_format(equation->priv->serializer);
+    MpDisplayFormat old_format = mp_serializer_get_number_format(equation->priv->serializer);
     if (old_format == format)
         return;
 
@@ -575,7 +575,7 @@ math_equation_set_number_format(MathEquation *equation, DisplayFormat format)
 }
 
 
-DisplayFormat
+MpDisplayFormat
 math_equation_get_number_format(MathEquation *equation)
 {
     return mp_serializer_get_number_format(equation->priv->serializer);
@@ -1637,7 +1637,7 @@ math_equation_class_init(MathEquationClass *klass)
                                                       "number-format",
                                                       "Display format",
                                                       number_format_type,
-                                                      FIX,
+                                                      MP_DISPLAY_FORMAT_FIXED,
                                                       G_PARAM_READWRITE));
     g_object_class_install_property(object_class,
                                     PROP_BASE,
diff --git a/src/math-equation.h b/src/math-equation.h
index 697324a..5ee13c3 100644
--- a/src/math-equation.h
+++ b/src/math-equation.h
@@ -79,8 +79,8 @@ gboolean math_equation_get_show_thousands_separators(MathEquation *equation);
 void math_equation_set_show_trailing_zeroes(MathEquation *equation, gboolean visible);
 gboolean math_equation_get_show_trailing_zeroes(MathEquation *equation);
 
-void math_equation_set_number_format(MathEquation *equation, DisplayFormat format);
-DisplayFormat math_equation_get_number_format(MathEquation *equation);
+void math_equation_set_number_format(MathEquation *equation, MpDisplayFormat format);
+MpDisplayFormat math_equation_get_number_format(MathEquation *equation);
 
 void math_equation_set_base(MathEquation *equation, gint base);
 gint math_equation_get_base(MathEquation *equation);
diff --git a/src/math-preferences.c b/src/math-preferences.c
index c63bb53..74b2316 100644
--- a/src/math-preferences.c
+++ b/src/math-preferences.c
@@ -66,7 +66,7 @@ G_MODULE_EXPORT
 void
 number_format_combobox_changed_cb(GtkWidget *combo, MathPreferencesDialog *dialog)
 {
-    DisplayFormat value;
+    MpDisplayFormat value;
     GtkTreeModel *model;
     GtkTreeIter iter;
 
@@ -269,15 +269,15 @@ create_gui(MathPreferencesDialog *dialog)
     gtk_list_store_append(GTK_LIST_STORE(model), &iter);
     gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0,
                        /* Number display mode combo: Fixed, e.g. 1234 */
-                       _("Fixed"), 1, FIX, -1);
+                       _("Fixed"), 1, MP_DISPLAY_FORMAT_FIXED, -1);
     gtk_list_store_append(GTK_LIST_STORE(model), &iter);
     gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0,
                        /* Number display mode combo: Scientific, e.g. 1.234Ã?10^3 */
-                       _("Scientific"), 1, SCI, -1);
+                       _("Scientific"), 1, MP_DISPLAY_FORMAT_SCIENTIFIC, -1);
     gtk_list_store_append(GTK_LIST_STORE(model), &iter);
     gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0,
                        /* Number display mode combo: Engineering, e.g. 1.234k */
-                       _("Engineering"), 1, ENG, -1);
+                       _("Engineering"), 1, MP_DISPLAY_FORMAT_ENGINEERING, -1);
     renderer = gtk_cell_renderer_text_new();
     gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(widget), renderer, TRUE);
     gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(widget), renderer, "text", 0);
diff --git a/src/mp-serializer.c b/src/mp-serializer.c
index 0dc3fdb..79eb942 100644
--- a/src/mp-serializer.c
+++ b/src/mp-serializer.c
@@ -39,7 +39,7 @@ static GType number_format_type;
 struct MpSerializerPrivate
 {
     gint accuracy;            /* Number of digits to show */
-    DisplayFormat format;     /* Number display mode. */
+    MpDisplayFormat format;   /* Number display mode. */
     gint show_tsep;           /* Set if the thousands separator should be shown. */
     gint show_zeroes;         /* Set if trailing zeroes should be shown. */
 
@@ -295,11 +295,11 @@ mp_serializer_to_string(MpSerializer *serializer, const MPNumber *x)
 {
     switch(serializer->priv->format) {
     default:
-    case FIX:
+    case MP_DISPLAY_FORMAT_FIXED:
         return mp_cast_to_string(serializer, x);
-    case SCI:
+    case MP_DISPLAY_FORMAT_SCIENTIFIC:
         return mp_cast_to_exponential_string(serializer, x, FALSE);
-    case ENG:
+    case MP_DISPLAY_FORMAT_ENGINEERING:
         return mp_cast_to_exponential_string(serializer, x, TRUE);
     }
 }
@@ -403,7 +403,7 @@ mp_serializer_set_accuracy(MpSerializer *serializer, int accuracy)
 }
 
 
-DisplayFormat
+MpDisplayFormat
 mp_serializer_get_number_format(MpSerializer *serializer)
 {
     return serializer->priv->format;
@@ -411,7 +411,7 @@ mp_serializer_get_number_format(MpSerializer *serializer)
 
 
 void
-mp_serializer_set_number_format(MpSerializer *serializer, DisplayFormat format)
+mp_serializer_set_number_format(MpSerializer *serializer, MpDisplayFormat format)
 {
     serializer->priv->format = format;
 }
@@ -505,7 +505,7 @@ mp_serializer_class_init(MpSerializerClass *klass)
                                                       "number-format",
                                                       "Display format",
                                                       number_format_type,
-                                                      FIX,
+                                                      MP_DISPLAY_FORMAT_FIXED,
                                                       G_PARAM_READWRITE));
 }
 
@@ -529,5 +529,5 @@ mp_serializer_init(MpSerializer *serializer)
     serializer->priv->accuracy = 9;
     serializer->priv->show_zeroes = FALSE;
     serializer->priv->show_tsep = FALSE;
-    serializer->priv->format = FIX;
+    serializer->priv->format = MP_DISPLAY_FORMAT_FIXED;
 }
diff --git a/src/mp-serializer.h b/src/mp-serializer.h
index 2998b94..5e2fd28 100644
--- a/src/mp-serializer.h
+++ b/src/mp-serializer.h
@@ -42,10 +42,10 @@ typedef struct {
 
 /* Number display mode. */
 typedef enum {
-  FIX,
-  SCI,
-  ENG
-} DisplayFormat;
+    MP_DISPLAY_FORMAT_FIXED,
+    MP_DISPLAY_FORMAT_SCIENTIFIC,
+    MP_DISPLAY_FORMAT_ENGINEERING
+} MpDisplayFormat;
 
 GType mp_serializer_get_type(void);
 
@@ -60,8 +60,8 @@ int mp_serializer_get_base(MpSerializer *serializer);
 void mp_serializer_set_accuracy(MpSerializer *serializer, int accuracy);
 int mp_serializer_get_accuracy(MpSerializer *serializer);
 
-void mp_serializer_set_number_format(MpSerializer *serializer, DisplayFormat format);
-DisplayFormat mp_serializer_get_number_format(MpSerializer *serializer);
+void mp_serializer_set_number_format(MpSerializer *serializer, MpDisplayFormat format);
+MpDisplayFormat mp_serializer_get_number_format(MpSerializer *serializer);
 
 void mp_serializer_set_radix(MpSerializer *serializer, gunichar radix);
 gunichar mp_serializer_get_radix(MpSerializer *serializer);



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