[gnome-calculator] GCalc: cleaning up API for interface implementations



commit f151cc3155ab8fa8f65b613d399e7cd3ec3db405
Author: Daniel Espinosa <esodan gmail com>
Date:   Thu Oct 17 09:08:44 2019 -0500

    GCalc: cleaning up API for interface implementations

 gcalc/gcalc-constant.vala               |  1 +
 gcalc/gcalc-function-acos.vala          |  5 ++++-
 gcalc/gcalc-function-acosh.vala         |  2 +-
 gcalc/gcalc-function-asin.vala          |  2 +-
 gcalc/gcalc-function-asinh.vala         |  2 +-
 gcalc/gcalc-function-atan.vala          |  2 +-
 gcalc/gcalc-function-atanh.vala         |  2 +-
 gcalc/gcalc-function-cos.vala           |  2 +-
 gcalc/gcalc-function-cosh.vala          |  2 +-
 gcalc/gcalc-function-exp.vala           |  2 +-
 gcalc/gcalc-function-log.vala           |  2 +-
 gcalc/gcalc-function-sin.vala           |  2 +-
 gcalc/gcalc-function-sinh.vala          |  2 +-
 gcalc/gcalc-function-sqrt.vala          |  2 +-
 gcalc/gcalc-function-tan.vala           |  2 +-
 gcalc/gcalc-function-tanh.vala          |  2 +-
 gcalc/gcalc-function.vala               | 27 +++++++++++++++++++++++++++
 gcalc/gcalc-gassign.vala                |  4 ++--
 gcalc/gcalc-gconstant.vala              | 24 ++++++++++++------------
 gcalc/gcalc-gdivision.vala              |  2 +-
 gcalc/gcalc-gexpression.vala            |  8 ++++----
 gcalc/gcalc-gfunction.vala              | 10 +++++-----
 gcalc/gcalc-ggroup.vala                 |  6 +++---
 gcalc/gcalc-gmath-equation-manager.vala |  4 ++--
 gcalc/gcalc-gmath-equation.vala         |  4 ++--
 gcalc/gcalc-gminus.vala                 |  2 +-
 gcalc/gcalc-gmultiply.vala              |  2 +-
 gcalc/gcalc-gplus.vala                  |  2 +-
 gcalc/gcalc-gpolynomial.vala            |  2 +-
 gcalc/gcalc-gpow.vala                   |  2 +-
 gcalc/gcalc-gresult.vala                |  4 ++--
 gcalc/gcalc-gsolver.vala                |  4 ++--
 gcalc/gcalc-gterm.vala                  |  2 +-
 gcalc/gcalc-gvariable.vala              |  2 +-
 34 files changed, 88 insertions(+), 57 deletions(-)
---
diff --git a/gcalc/gcalc-constant.vala b/gcalc/gcalc-constant.vala
index 15d1c644..e830b4d3 100644
--- a/gcalc/gcalc-constant.vala
+++ b/gcalc/gcalc-constant.vala
@@ -23,6 +23,7 @@ public interface GCalc.Constant : Object, Expression {
   public abstract double imag ();
   public abstract void zero ();
   public abstract Constant add (Constant c);
+  public abstract Constant subtract (Constant c);
   public abstract Constant multiply (Constant c);
   public abstract Constant divide (Constant c);
   public abstract Constant neg ();
diff --git a/gcalc/gcalc-function-acos.vala b/gcalc/gcalc-function-acos.vala
index 4cdeac66..24828a36 100644
--- a/gcalc/gcalc-function-acos.vala
+++ b/gcalc/gcalc-function-acos.vala
@@ -18,6 +18,9 @@
  * Authors:
  *      Daniel Espinosa <esodan gmail com>
  */
+/**
+ * Function to calculate arc cosine of a {@link Constant} in radians
+ */
 public class GCalc.GFunctionAcos : GFunction {
 
   construct {
@@ -26,7 +29,7 @@ public class GCalc.GFunctionAcos : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-acosh.vala b/gcalc/gcalc-function-acosh.vala
index 00d39d0d..7e5af3a5 100644
--- a/gcalc/gcalc-function-acosh.vala
+++ b/gcalc/gcalc-function-acosh.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionAcosh : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-asin.vala b/gcalc/gcalc-function-asin.vala
index a8d9ce27..62f88948 100644
--- a/gcalc/gcalc-function-asin.vala
+++ b/gcalc/gcalc-function-asin.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionAsin : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-asinh.vala b/gcalc/gcalc-function-asinh.vala
index 4bcbf877..6e81ca55 100644
--- a/gcalc/gcalc-function-asinh.vala
+++ b/gcalc/gcalc-function-asinh.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionAsinh : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-atan.vala b/gcalc/gcalc-function-atan.vala
index 5af108b5..53f97f50 100644
--- a/gcalc/gcalc-function-atan.vala
+++ b/gcalc/gcalc-function-atan.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionAtan : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-atanh.vala b/gcalc/gcalc-function-atanh.vala
index 2bc32229..8c95f933 100644
--- a/gcalc/gcalc-function-atanh.vala
+++ b/gcalc/gcalc-function-atanh.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionAtanh : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-cos.vala b/gcalc/gcalc-function-cos.vala
index ab5828e1..43cb6c81 100644
--- a/gcalc/gcalc-function-cos.vala
+++ b/gcalc/gcalc-function-cos.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionCos : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-cosh.vala b/gcalc/gcalc-function-cosh.vala
index e051ce82..75b33c92 100644
--- a/gcalc/gcalc-function-cosh.vala
+++ b/gcalc/gcalc-function-cosh.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionCosh : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-exp.vala b/gcalc/gcalc-function-exp.vala
index 1cf135b1..9367f214 100644
--- a/gcalc/gcalc-function-exp.vala
+++ b/gcalc/gcalc-function-exp.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionExp : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-log.vala b/gcalc/gcalc-function-log.vala
index de57efe8..413606d7 100644
--- a/gcalc/gcalc-function-log.vala
+++ b/gcalc/gcalc-function-log.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionLog : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-sin.vala b/gcalc/gcalc-function-sin.vala
index 5a288a0b..2a716462 100644
--- a/gcalc/gcalc-function-sin.vala
+++ b/gcalc/gcalc-function-sin.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionSin : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-sinh.vala b/gcalc/gcalc-function-sinh.vala
index 92c796ef..3380bc19 100644
--- a/gcalc/gcalc-function-sinh.vala
+++ b/gcalc/gcalc-function-sinh.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionSinh : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-sqrt.vala b/gcalc/gcalc-function-sqrt.vala
index 0291cd8f..c4fa63b3 100644
--- a/gcalc/gcalc-function-sqrt.vala
+++ b/gcalc/gcalc-function-sqrt.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionSqrt : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-tan.vala b/gcalc/gcalc-function-tan.vala
index 3793076b..e5021e2d 100644
--- a/gcalc/gcalc-function-tan.vala
+++ b/gcalc/gcalc-function-tan.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionTan : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function-tanh.vala b/gcalc/gcalc-function-tanh.vala
index 831157ba..ae862f83 100644
--- a/gcalc/gcalc-function-tanh.vala
+++ b/gcalc/gcalc-function-tanh.vala
@@ -26,7 +26,7 @@ public class GCalc.GFunctionTanh : GFunction {
     param_types.add (new GConstant ());
   }
 
-  public override Expression evaluate () throws GLib.Error
+  internal override Expression evaluate () throws GLib.Error
   {
     verify_params ();
     GConstant c = null;
diff --git a/gcalc/gcalc-function.vala b/gcalc/gcalc-function.vala
index 9c6f9f8a..995ff582 100644
--- a/gcalc/gcalc-function.vala
+++ b/gcalc/gcalc-function.vala
@@ -18,12 +18,39 @@
  * Authors:
  *      Daniel Espinosa <esodan gmail com>
  */
+/**
+ * A Function as part of a {@link Expression}
+ */
 public interface GCalc.Function : Object, Expression {
+  /**
+   * Parameters used by the function, objects representing
+   * the expected types. See {@link verify_params}
+   */
   public abstract ExpressionContainer param_types { get; }
+  /**
+   * Function's name
+   */
   public abstract string name { get; construct set; }
+  /**
+   * Number of parameters required by this function
+   */
   public abstract uint n_params { get; construct set; }
+  /**
+   * A condition used while parsing, as a flag when the function
+   * has been closed or finished and no more parameters should
+   * be parsed.
+   */
   public abstract bool closed { get; set; }
+  /**
+   * Evaluate the function returning a resulting {@link Expression}.
+   *
+   * In some cases return is a {@link Constant}
+   */
   public abstract Expression evaluate () throws GLib.Error;
+  /**
+   * Check the paratemeters given to the function agains {@link param_types}
+   * and number of parameters using {@link n_params}
+   */
   public virtual bool verify_params () throws GLib.Error {
     if (expressions.get_n_items () != n_params) {
       throw new FunctionError.INVALID_PARAMETERS_ERROR ("Invalid number of parameters. Required %u, 
provided: %u",
diff --git a/gcalc/gcalc-gassign.vala b/gcalc/gcalc-gassign.vala
index 91bf4bd9..cf222dd1 100644
--- a/gcalc/gcalc-gassign.vala
+++ b/gcalc/gcalc-gassign.vala
@@ -19,7 +19,7 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 public class GCalc.GAssign : GExpression, Operator, BinaryOperator, Assign {
-  public override string to_string () {
+  internal override string to_string () {
     if (expressions.get_n_items () != 2) {
       return "Invalid Assigment structure";
     }
@@ -33,7 +33,7 @@ public class GCalc.GAssign : GExpression, Operator, BinaryOperator, Assign {
     }
     return v.to_string ()+"="+e.to_string ();
   }
-  public override Result solve () {
+  internal override Result solve () {
     Result res = null;
     try {
       res = new GResult (evaluate ());
diff --git a/gcalc/gcalc-gconstant.vala b/gcalc/gcalc-gconstant.vala
index 0a60c536..fba34032 100644
--- a/gcalc/gcalc-gconstant.vala
+++ b/gcalc/gcalc-gconstant.vala
@@ -26,7 +26,7 @@ public class GCalc.GConstant : GExpression, Constant {
   construct {
     _complex.set_double (0.0);
   }
-  internal GConstant.internal_complex (MPC.Complex complex) {
+  public GConstant.internal_complex (MPC.Complex complex) {
     _complex.set (complex);
   }
   public GConstant.integer (int val) {
@@ -43,19 +43,19 @@ public class GCalc.GConstant : GExpression, Constant {
   }
 
   // Constant Interface
-  public double real () {
+  internal double real () {
     return _complex.get_real_double ();
   }
-  public double imag () {
+  internal double imag () {
     return _complex.get_imag_double ();
   }
-  public void zero () {
+  internal void zero () {
     MPFR.Real r = MPFR.Real (1000);
     r.set_zero ();
     _complex.set_mpreal (r);
   }
 
-  public Constant add (Constant c)
+  internal Constant add (Constant c)
     requires (c is GConstant)
   {
     var res = MPC.Complex (1000);
@@ -65,7 +65,7 @@ public class GCalc.GConstant : GExpression, Constant {
     return new GConstant.internal_complex (res);
   }
 
-  public Constant subtract (Constant c)
+  internal Constant subtract (Constant c)
     requires (c is GConstant)
   {
     var res = MPC.Complex (1000);
@@ -75,7 +75,7 @@ public class GCalc.GConstant : GExpression, Constant {
     return new GConstant.internal_complex (res);
   }
 
-  public Constant multiply (Constant c)
+  internal Constant multiply (Constant c)
     requires (c is GConstant)
   {
     var res = MPC.Complex (1000);
@@ -85,7 +85,7 @@ public class GCalc.GConstant : GExpression, Constant {
     return new GConstant.internal_complex (res);
   }
 
-  public Constant divide (Constant c)
+  internal Constant divide (Constant c)
     requires (c is GConstant)
   {
     var res = MPC.Complex (1000);
@@ -95,14 +95,14 @@ public class GCalc.GConstant : GExpression, Constant {
     return new GConstant.internal_complex (res);
   }
 
-  public Constant neg ()
+  internal Constant neg ()
   {
     var res = MPC.Complex (1000);
     res.neg (_complex);
     return new GConstant.internal_complex (res);
   }
 
-  public Constant pow (Constant c)
+  internal Constant pow (Constant c)
     requires (c is GConstant)
   {
     var res = MPC.Complex (1000);
@@ -113,14 +113,14 @@ public class GCalc.GConstant : GExpression, Constant {
   }
 
   // Expression interface
-  public override string to_string () {
+  internal override string to_string () {
     if (imag () != 0.0) {
       return MPC.Complex.to_string (10, 10, _complex);
     }
     return "%g".printf (real ());
   }
 
-  public override Result solve () {
+  internal override Result solve () {
     return new GResult (this);
   }
 }
diff --git a/gcalc/gcalc-gdivision.vala b/gcalc/gcalc-gdivision.vala
index 9832cd0b..9657d0c1 100644
--- a/gcalc/gcalc-gdivision.vala
+++ b/gcalc/gcalc-gdivision.vala
@@ -19,7 +19,7 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 public class GCalc.GDivision : GExpression, Operator, BinaryOperator, Division {
-  public override string to_string () {
+  internal override string to_string () {
     return "/";
   }
 }
diff --git a/gcalc/gcalc-gexpression.vala b/gcalc/gcalc-gexpression.vala
index 43752606..51b3f395 100644
--- a/gcalc/gcalc-gexpression.vala
+++ b/gcalc/gcalc-gexpression.vala
@@ -24,16 +24,16 @@ public class GCalc.GExpression : Object, Expression {
     exps.parent = this;
   }
   // Expression
-  public weak Expression parent { get; set; }
-  public ExpressionContainer expressions { get { return exps; } }
-  public virtual string to_string () {
+  internal weak Expression parent { get; set; }
+  internal ExpressionContainer expressions { get { return exps; } }
+  internal virtual string to_string () {
     string s = "";
     foreach (Expression e in expressions) {
       s += e.to_string ();
     }
     return s;
   }
-  public virtual Result solve () {
+  internal virtual Result solve () {
     return new GErrorResult ("Invalid expression");
   }
 }
diff --git a/gcalc/gcalc-gfunction.vala b/gcalc/gcalc-gfunction.vala
index 5b6bbe3c..22fa1675 100644
--- a/gcalc/gcalc-gfunction.vala
+++ b/gcalc/gcalc-gfunction.vala
@@ -21,10 +21,10 @@
 public class GCalc.GFunction : GExpression, Function, Hashable {
   ExpressionContainer _param_types = new ExpressionContainer ();
 
-  public ExpressionContainer param_types { get { return _param_types; } }
+  internal ExpressionContainer param_types { get { return _param_types; } }
   public uint n_params { get; construct set; }
   public string name { get; construct set; }
-  public bool closed { get; set; }
+  internal bool closed { get; set; }
 
   construct {
     name = "NoName";
@@ -33,7 +33,7 @@ public class GCalc.GFunction : GExpression, Function, Hashable {
     this.name = name;
     n_params = nparams;
   }
-  public override string to_string () {
+  internal override string to_string () {
     string s = name + "(";
     for (uint i = 0; i < expressions.get_n_items (); i++) {
       var e = expressions.get_item (i) as Expression;
@@ -49,11 +49,11 @@ public class GCalc.GFunction : GExpression, Function, Hashable {
     return s;
   }
 
-  public virtual Expression evaluate () throws GLib.Error {
+  internal virtual Expression evaluate () throws GLib.Error {
     return new GErrorExpression ();
   }
   // Hashable
-  public uint hash () {
+  internal uint hash () {
     return name.hash ();
   }
 }
diff --git a/gcalc/gcalc-ggroup.vala b/gcalc/gcalc-ggroup.vala
index b9e7b074..14f8d64b 100644
--- a/gcalc/gcalc-ggroup.vala
+++ b/gcalc/gcalc-ggroup.vala
@@ -19,9 +19,9 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 public class GCalc.GGroup : GExpression, Group {
-  public Group.Level level { get; set; }
-  public bool closed { get; set; }
-  public override string to_string () {
+  internal Group.Level level { get; set; }
+  internal bool closed { get; set; }
+  internal override string to_string () {
     string s = "";
     switch (level) {
       case ONE:
diff --git a/gcalc/gcalc-gmath-equation-manager.vala b/gcalc/gcalc-gmath-equation-manager.vala
index c0733d35..38ecced0 100644
--- a/gcalc/gcalc-gmath-equation-manager.vala
+++ b/gcalc/gcalc-gmath-equation-manager.vala
@@ -21,8 +21,8 @@
 public class GCalc.GMathEquationManager : Object, MathEquationManager {
   ExpressionContainer _equations = new ExpressionContainer ();
   ExpressionContainer _functions = new ExpressionContainer ();
-  public ExpressionContainer equations { get { return _equations; } }
-  public ExpressionContainer functions { get { return _functions; } }
+  internal ExpressionContainer equations { get { return _equations; } }
+  internal ExpressionContainer functions { get { return _functions; } }
 
   construct {
     // Initialize default Functions
diff --git a/gcalc/gcalc-gmath-equation.vala b/gcalc/gcalc-gmath-equation.vala
index 50d1157f..48749743 100644
--- a/gcalc/gcalc-gmath-equation.vala
+++ b/gcalc/gcalc-gmath-equation.vala
@@ -20,8 +20,8 @@
  */
 public class GCalc.GMathEquation : GExpression, MathEquation {
   ExpressionHashMap _variables = new ExpressionHashMap ();
-  public ExpressionHashMap variables { get { return _variables; } }
-  public override Result solve () {
+  internal ExpressionHashMap variables { get { return _variables; } }
+  internal override Result solve () {
     Result res = null;
     if (expressions.get_n_items () == 0) {
       return new GErrorResult ("No expressions found in equation");
diff --git a/gcalc/gcalc-gminus.vala b/gcalc/gcalc-gminus.vala
index 0cc90ea3..6a2c1561 100644
--- a/gcalc/gcalc-gminus.vala
+++ b/gcalc/gcalc-gminus.vala
@@ -19,7 +19,7 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 public class GCalc.GMinus : GExpression, Operator, BinaryOperator, Minus {
-  public override string to_string () {
+  internal override string to_string () {
     return "-";
   }
 }
diff --git a/gcalc/gcalc-gmultiply.vala b/gcalc/gcalc-gmultiply.vala
index 384b092c..fab49f98 100644
--- a/gcalc/gcalc-gmultiply.vala
+++ b/gcalc/gcalc-gmultiply.vala
@@ -19,7 +19,7 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 public class GCalc.GMultiply : GExpression, Operator, BinaryOperator, Multiply {
-  public override string to_string () {
+  internal override string to_string () {
     return "*";
   }
 }
diff --git a/gcalc/gcalc-gplus.vala b/gcalc/gcalc-gplus.vala
index 86ba9443..563a7a0e 100644
--- a/gcalc/gcalc-gplus.vala
+++ b/gcalc/gcalc-gplus.vala
@@ -19,7 +19,7 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 public class GCalc.GPlus : GExpression, Operator, BinaryOperator, Plus {
-  public override string to_string () {
+  internal override string to_string () {
     return "+";
   }
 }
diff --git a/gcalc/gcalc-gpolynomial.vala b/gcalc/gcalc-gpolynomial.vala
index aa232263..cbfc35e9 100644
--- a/gcalc/gcalc-gpolynomial.vala
+++ b/gcalc/gcalc-gpolynomial.vala
@@ -19,7 +19,7 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 public class GCalc.GPolynomial : GExpression, Polynomial {
-  public override Result solve () {
+  internal override Result solve () {
     Result res = null;
     try {
       var e = evaluate ();
diff --git a/gcalc/gcalc-gpow.vala b/gcalc/gcalc-gpow.vala
index c21cb561..9d67aae3 100644
--- a/gcalc/gcalc-gpow.vala
+++ b/gcalc/gcalc-gpow.vala
@@ -19,7 +19,7 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 public class GCalc.GPow : GExpression, Operator, Pow {
-  public override string to_string () {
+  internal override string to_string () {
     return "^";
   }
 }
diff --git a/gcalc/gcalc-gresult.vala b/gcalc/gcalc-gresult.vala
index 20bd8369..64c8af96 100644
--- a/gcalc/gcalc-gresult.vala
+++ b/gcalc/gcalc-gresult.vala
@@ -24,9 +24,9 @@ public class GCalc.GResult : Object, Result {
     _expression = exp;
   }
   // Result
-  public string to_string () {
+  internal string to_string () {
     return expression.to_string ();
   }
-  public Expression expression { get { return _expression; } }
+  internal Expression expression { get { return _expression; } }
 }
 
diff --git a/gcalc/gcalc-gsolver.vala b/gcalc/gcalc-gsolver.vala
index 6694b8f5..e5b17d8d 100644
--- a/gcalc/gcalc-gsolver.vala
+++ b/gcalc/gcalc-gsolver.vala
@@ -25,8 +25,8 @@ public class GCalc.GSolver : Object, Solver {
     equation_manager = new GMathEquationManager ();
   }
   // Sover
-  public MathEquationManager equation_manager { get; set; }
-  public Result solve (string str) throws GLib.Error {
+  internal MathEquationManager equation_manager { get; set; }
+  internal Result solve (string str) throws GLib.Error {
     var p = new GParser ();
     Result res;
     try {
diff --git a/gcalc/gcalc-gterm.vala b/gcalc/gcalc-gterm.vala
index 1402273c..b09e52dc 100644
--- a/gcalc/gcalc-gterm.vala
+++ b/gcalc/gcalc-gterm.vala
@@ -19,7 +19,7 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 public class GCalc.GTerm : GExpression, Term {
-  public override Result solve () {
+  internal override Result solve () {
     Result res = null;
     try {
       var e = evaluate ();
diff --git a/gcalc/gcalc-gvariable.vala b/gcalc/gcalc-gvariable.vala
index 72c202f4..e0f4de46 100644
--- a/gcalc/gcalc-gvariable.vala
+++ b/gcalc/gcalc-gvariable.vala
@@ -27,7 +27,7 @@ public class GCalc.GVariable : GExpression, Variable, Hashable {
   construct {
     _value = new GConstant.@double (0.0);
   }
-  public GVariable (string name) {
+  internal GVariable (string name) {
     this.name = name;
   }
   // Expression


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