Skip to content
Commits on Source (426)
Overview of changes in gnome-calculator 43.alpha
* Updated translations
* Fixed broken undo/redo #266 (Robert Roth)
* Make sure variable name definitions work with whitespace too (Robert Roth)
* Fix translatable strings !116 (Maximiliano)
* Fixed missing implicit multiplication with variable and root #279 (Robert Roth)
* meson warning fixes (Robert Roth)
Overview of changes in gnome-calculator 42.2
* Updated translations
* Fixed incorrect history with bits toggling #281 (Robert Roth)
......
......@@ -71,6 +71,19 @@
<translation type="gettext">gnome-calculator</translation>
<content_rating type="oars-1.1" />
<releases>
<release version="43.alpha" date="2022-07-08" type="development">
<description>
<p>Overview of changes in gnome-calculator 43.alpha</p>
<ul>
<li>Updated translations</li>
<li>Fixed broken undo/redo #266 (Robert Roth)</li>
<li>Make sure variable name definitions work with whitespace too (Robert Roth)</li>
<li>Fix translatable strings !116 (Maximiliano)</li>
<li>Fixed missing implicit multiplication with variable and root #279 (Robert Roth)</li>
<li>meson warning fixes (Robert Roth)</li>
</ul>
</description>
</release>
<release version="42.2" date="2022-07-01" type="stable">
<description>
<p>Overview of changes in gnome-calculator 42.2</p>
......
valadoc = find_program ('valadoc', required: false)
if valadoc.found()
if get_option('gcalc')
gtkdoc_outdir = CAMEL_CASE_NAME+'-'+API_VERSION
docsdir = join_paths (get_option ('datadir'), 'devhelp','books')
custom_target ('libgcalc_valadocs',
input : gcalc_sources,
output : CAMEL_CASE_NAME+'-'+API_VERSION,
......@@ -13,6 +14,7 @@ if valadoc.found()
'--package-version='+meson.project_version(),
'--vapidir='+gcalc_sources_dir,
'--vapidir='+gcalc_build_dir,
'--vapidir='+libmpfr_vapi_dir,
'--pkg=glib-2.0',
'--pkg=gio-2.0',
'--pkg=gee-0.8',
......@@ -27,6 +29,9 @@ if valadoc.found()
install_dir : docsdir,
depends: libgcalc
)
endif
if not get_option('disable-ui') and get_option('gci') and get_option('gcalc')
gtkdoc_outdir = GCI_CAMEL_CASE_NAME+'-'+GCI_API_VERSION
docsdir = join_paths (get_option ('datadir'), 'devhelp','books')
......@@ -54,3 +59,5 @@ if valadoc.found()
depends: libgcalc
)
endif
endif
/* gcalc-calculator.vala
*
* Copyright (C) 2022 Daniel Espinosa <esodan@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* 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/>.
*
* Authors:
* Daniel Espinosa <esodan@gmail.com>
*/
/**
* A constant calculator for different operations.
*/
public class GCalc.Calculator : GLib.Object {
public static MathConstant add (MathConstant c1, MathConstant c2) {
var c = new Constant.assign (c1);
return c.add (c2);
}
/**
* Substract C2 to C1 operation (c1 - c2)
*/
public static MathConstant subtract (MathConstant c1, MathConstant c2) {
var c = new Constant.assign (c1);
return c.subtract (c2);
}
public static MathConstant multiply (MathConstant c1, MathConstant c2) {
var c = new Constant.assign (c1);
return c.multiply (c2);
}
/**
* Divide c1/c2
*/
public static MathConstant divide (MathConstant c1, MathConstant c2) {
var c = new Constant.assign (c1);
c.divide (c2);
return c;
}
/**
* Calculates the negative value of c
*/
public static MathConstant neg (MathConstant c) {
var rc = new Constant.assign (c);
return rc.neg ();
}
/**
* Calculates c raised to p
*/
public static MathConstant pow (MathConstant c, MathConstant p) {
var rc = new Constant.assign (c);
return rc.pow (p);
}
/**
* Calculates square root of c
*/
public static MathConstant sqrt (MathConstant c) {
var rc = new Constant.assign (c);
rc.get_complex ().get_real ().val.sqrt (rc.get_complex ().get_real ().val);
return rc;
}
/**
* Creates a constant with the value of constant PI
*/
public static MathConstant pi () {
var rc = new Constant ();
rc.get_complex ().get_real ().val.const_pi ();
return rc;
}
/**
* Creates a constant with the value of constant logarithm of 2
*/
public static MathConstant log2 () {
var rc = new Constant ();
rc.get_complex ().get_real ().val.const_log2 ();
return rc;
}
/**
* Creates a constant with the value of constant EULER
*/
public static MathConstant euler () {
var rc = new Constant ();
rc.get_complex ().get_real ().val.const_euler ();
return rc;
}
/**
* Creates a constant with the value of constant CATALAN
*/
public static MathConstant catalan () {
var rc = new Constant ();
rc.get_complex ().get_real ().val.const_catalan ();
return rc;
}
/**
* Operator c1 = c2 (equal)
*/
public static bool eq (MathConstant c1, MathConstant c2) {
if (!(c1 is Constant) || !(c2 is Constant)) {
return false;
}
return ((Constant) c1).get_complex ().cmp (((Constant) c2).get_complex ()) == 0 ? true : false;
}
/**
* Operator c1 > c2
*/
public static bool gt (MathConstant c1, MathConstant c2) {
if (!(c1 is Constant) || !(c2 is Constant)) {
return false;
}
return ((Constant) c1).get_complex ().cmp (((Constant) c2).get_complex ()) > 0 ? true : false;
}
/**
* Operator c1 < c2
*/
public static bool lt (MathConstant c1, MathConstant c2) {
if (!(c1 is Constant) || !(c2 is Constant)) {
return false;
}
return ((Constant) c1).get_complex ().cmp (((Constant) c2).get_complex ()) < 0 ? true : false;
}
/**
* Calculates the cosine of c1 angle at the given units
*/
public static MathConstant cos (MathConstant c1, GCalc.AngleUnit units = GCalc.AngleUnit.RADIANS) {
var a = new Constant.assign (c1);
if (units != GCalc.AngleUnit.RADIANS) {
a = (Constant) UnitConverter.angle (c1, units, GCalc.AngleUnit.RADIANS);
}
var rc = new Constant ();
rc.get_complex ().get_real ().val.cos (a.get_complex ().get_real ().val);
return rc;
}
/**
* Calculates the sine of c1 angle at the given units
*/
public static MathConstant sin (MathConstant c1, GCalc.AngleUnit units = GCalc.AngleUnit.RADIANS) {
var a = new Constant.assign (c1);
if (units != GCalc.AngleUnit.RADIANS) {
a = (Constant) UnitConverter.angle (c1, units, GCalc.AngleUnit.RADIANS);
}
var rc = new Constant ();
rc.get_complex ().get_real ().val.sin (a.get_complex ().get_real ().val);
return rc;
}
/**
* Calculates the tangent of c1 angle at the given units
*/
public static MathConstant tan (MathConstant c1, GCalc.AngleUnit units = GCalc.AngleUnit.RADIANS) {
var a = new Constant.assign (c1);
if (units != GCalc.AngleUnit.RADIANS) {
a = (Constant) UnitConverter.angle (c1, units, GCalc.AngleUnit.RADIANS);
}
var rc = new Constant ();
rc.get_complex ().get_real ().val.tan (a.get_complex ().get_real ().val);
return rc;
}
/**
* Calculates the arc, in the given units, represented by the cosine of c1
*/
public static MathConstant acos (MathConstant c1, GCalc.AngleUnit units = GCalc.AngleUnit.RADIANS) {
if (!(c1 is Constant)) {
return new Constant ();
}
var rc = new Constant ();
rc.get_complex ().get_real ().val.acos (((Constant) c1).get_complex ().get_real ().val);
if (units != GCalc.AngleUnit.RADIANS) {
return (Constant) UnitConverter.angle (rc, GCalc.AngleUnit.RADIANS, units);
}
return rc;
}
/**
* Calculates the arc, in the given units, represented by the sine of c1
*/
public static MathConstant asin (MathConstant c1, GCalc.AngleUnit units = GCalc.AngleUnit.RADIANS) {
if (!(c1 is Constant)) {
return new Constant ();
}
var rc = new Constant ();
rc.get_complex ().get_real ().val.acos (((Constant) c1).get_complex ().get_real ().val);
if (units != GCalc.AngleUnit.RADIANS) {
return (Constant) UnitConverter.angle (rc, GCalc.AngleUnit.RADIANS, units);
}
return rc;
}
/**
* Calculates the arc, with the given units, represented by the tangent of c1
*/
public static MathConstant atan (MathConstant c1, GCalc.AngleUnit units = GCalc.AngleUnit.RADIANS) {
if (!(c1 is Constant)) {
return new Constant ();
}
var rc = new Constant ();
rc.get_complex ().get_real ().val.atan (((Constant) c1).get_complex ().get_real ().val);
if (units != GCalc.AngleUnit.RADIANS) {
return (Constant) UnitConverter.angle (rc, GCalc.AngleUnit.RADIANS, units);
}
return rc;
}
/**
* Calculates the logarithm base 10 of given c1
*/
public static MathConstant log10 (MathConstant c1) {
var rc = new Constant ();
rc.get_complex ().get_real ().val.log10 (((Constant) c1).get_complex ().get_real ().val);
return rc;
}
/**
* Calculates the the exponential of iven c1
*/
public static MathConstant exp (MathConstant c1) {
var rc = new Constant ();
rc.get_complex ().get_real ().val.exp (((Constant) c1).get_complex ().get_real ().val);
return rc;
}
}
......@@ -24,14 +24,15 @@
public class GCalc.Constant : Expression,
MathConstant,
MathConstantNumber,
MathConstantComplex
MathConstantComplex,
MathConstantVector
{
private MPC.Complex _complex = MPC.Complex (1000);
internal unowned MPC.Complex get_complex () { return _complex; }
construct {
_complex.set_double (0.0);
_complex.set_double (0.0, 0.0);
}
internal Constant.internal_complex (MPC.Complex complex) {
_complex.set (complex);
......@@ -49,6 +50,12 @@ public class GCalc.Constant : Expression,
_complex.set_double (real, imag);
}
public Constant.assign (MathConstant c) {
if (!(c is Constant)) {
return;
}
_complex.set (((Constant) c).get_complex ());
}
// MathConstantComplex Interface
internal double real () {
return _complex.get_real_double ();
......@@ -124,6 +131,30 @@ public class GCalc.Constant : Expression,
return new Constant.internal_complex (res);
}
internal MathConstant mag () {
var x = this.x ();
var y = this.y ();
x = x.pow (new Constant.@double (2.0));
y = y.pow (new Constant.@double (2.0));
var a = x.add (y);
return Calculator.sqrt (a);
}
internal MathConstant ang () {
var x = this.x ();
var y = this.y ();
return Calculator.atan (y.divide (x));
}
internal MathConstant x () {
var rc = new Constant ();
rc.get_complex ().get_real ().val.set (_complex.get_real ().val);
return rc;
}
internal MathConstant y () {
var rc = new Constant ();
rc.get_complex ().get_real ().val.set (_complex.get_real ().val);
return rc;
}
// Expression interface
internal override string to_string () {
string s = "";
......
/* gcalc-math-constant-vector.vala
*
* Copyright (C) 2022 Daniel Espinosa <esodan@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* 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/>.
*
* Authors:
* Daniel Espinosa <esodan@gmail.com>
*/
/**
* A constant as a complex number with real and imaginary parts
*/
public interface GCalc.MathConstantVector : Object, MathExpression, MathConstant {
/**
* Vector's magnitud
*/
public abstract MathConstant mag ();
/**
* Vector's angle in radians
*/
public abstract MathConstant ang ();
/**
* Magnitud on x axis
*/
public abstract MathConstant x ();
/**
* Magnitud on y axis
*/
public abstract MathConstant y ();
}
/* gcalc-units.vala
*
* Copyright (C) 2022 Daniel Espinosa <esodan@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* 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/>.
*
* Authors:
* Daniel Espinosa <esodan@gmail.com>
*/
public enum GCalc.AngleUnit
{
RADIANS,
DEGREES,
GRADIANS
}
public class GCalc.UnitConverter : GLib.Object {
public static MathConstant angle (MathConstant c, AngleUnit ori, AngleUnit dst) {
Constant rc = new Constant.assign (c);
if (ori == dst) {
return rc;
}
var pi = Calculator.pi ();
if (Calculator.gt (rc, pi.multiply (new Constant.@double (2.0)))) {
var t = rc.divide (pi);
rc = (Constant) rc.subtract (pi.multiply (t));
}
if (ori == AngleUnit.DEGREES && dst == AngleUnit.RADIANS) {
var d = new Constant.@double (180.0);
var g = pi.divide (d);
return rc.multiply (g);
}
if (ori == AngleUnit.GRADIANS && dst == AngleUnit.RADIANS) {
var d = new Constant.@double (400.0);
var grd = pi.divide (d);
return rc.multiply (grd);
}
if (ori == AngleUnit.DEGREES && dst == AngleUnit.GRADIANS) {
var d = new Constant.@double (9.0);
var g = new Constant.@double (10.0);
var grd = g.divide (d);
return rc.multiply (grd);
}
if (ori == AngleUnit.GRADIANS && dst == AngleUnit.DEGREES) {
var d = new Constant.@double (9.0);
var g = new Constant.@double (10.0);
var dg = d.divide (g);
return rc.multiply (dg);
}
return rc;
}
}
......@@ -38,25 +38,9 @@ confh.set_quoted('GETTEXT_PACKAGE', 'GCalc')
configure_file(output : 'config.h',
configuration : confh)
lib_mpfrg_sources = files([
'mpfr-glue.vala'
])
lib_mpfrg = static_library ('mpfrg',
lib_mpfrg_sources,
vala_header: 'mpfrg.h',
vala_vapi: 'mpfrg.vapi',
dependencies: [
gio,
mpc,
mpfr,
],
install: false,
)
gcalc_sources = files([
'gcalc-assign.vala',
'gcalc-calculator.vala',
'gcalc-constant.vala',
'gcalc-division.vala',
'gcalc-equation.vala',
......@@ -88,6 +72,7 @@ gcalc_sources = files([
'gcalc-math-constant.vala',
'gcalc-math-constant-complex.vala',
'gcalc-math-constant-number.vala',
'gcalc-math-constant-vector.vala',
'gcalc-math-division.vala',
'gcalc-math-equation.vala',
'gcalc-math-equation-manager.vala',
......@@ -115,6 +100,7 @@ gcalc_sources = files([
'gcalc-result.vala',
'gcalc-solver.vala',
'gcalc-term.vala',
'gcalc-units.vala',
'gcalc-variable.vala',
])
......@@ -133,6 +119,7 @@ gcalc_exported_deps = [
gee,
inc_rooth_dep,
gcalc_inc_libh_dep,
libmpfr_inc_libh_dep,
]
gcalc_deps = [
......@@ -161,7 +148,6 @@ libgcalc = library(VERSIONED_PROJECT_NAME,
vala_gir : GIR_NAME,
dependencies : gcalc_deps,
vala_args: [
'--use-header',
'--vapidir='+gcalc_vapi_dir,
'--pkg=mpc',
'--pkg=mpfr'
......
......@@ -83,7 +83,6 @@ libgci = library(GCI_VERSIONED_PROJECT_NAME,
vala_gir : GCI_GIR_NAME,
dependencies : gci_deps,
vala_args: [
'--use-header',
],
c_args : [
'-include',
......
......@@ -16,6 +16,7 @@ it
ja
ko
lv
nl
oc
pl
pt
......
......@@ -4,15 +4,14 @@
#
msgid ""
msgstr "Project-Id-Version: gcalctool_help.HEAD\n"
"POT-Creation-Date: 2021-01-10 15:29+0000\n"
"PO-Revision-Date: 2021-02-06 10:00+0100\n"
"POT-Creation-Date: 2022-05-06 20:19+0000\n"
"PO-Revision-Date: 2022-07-04 10:00+0100\n"
"Last-Translator: Asier Sarasua Garmendia <asiersarasua@ni.eus>\n"
"Language-Team: Basque <librezale@librezale.eus>\n"
"Language: eu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. Put one translator per line, in the form NAME <EMAIL>, YEAR1, YEAR2
......@@ -148,106 +147,106 @@ msgstr ""
#. (itstool) path: td/p
#: C/complex.page:18
msgid "Re"
msgstr ""
msgstr "Re"
#. (itstool) path: td/p
#: C/complex.page:19
msgid "Returns the real part of a complex number. For example:"
msgstr ""
msgstr "Zenbaki konplexu baten zati erreala itzultzen du. Adibidez:"
#. (itstool) path: example/p
#: C/complex.page:21
msgid "Re (2-5i) = 2"
msgstr ""
msgstr "Re (2-5i) = 2"
#. (itstool) path: td/p
#: C/complex.page:29
msgid "Im"
msgstr ""
msgstr "Im"
#. (itstool) path: td/p
#: C/complex.page:30
msgid "Returns the imaginary part of a complex number. For example:"
msgstr ""
msgstr "Zenbaki konplexu baten zati irudikaria itzultzen du. Adibidez:"
#. (itstool) path: example/p
#: C/complex.page:32
msgid "Im (2-5i) = -5"
msgstr ""
msgstr "Im (2-5i) = -5"
#. (itstool) path: td/p
#: C/complex.page:40
msgid "conj"
msgstr ""
msgstr "conj"
#. (itstool) path: td/p
#: C/complex.page:41
msgid "Returns the conjugate of a complex number. For example:"
msgstr ""
msgstr "Zenbaki konplexu baten konjugatua itzultzen du. Adibidez:"
#. (itstool) path: example/p
#: C/complex.page:43
msgid "conj (2-5i) = 2+5i"
msgstr ""
msgstr "conj (2-5i) = 2+5i"
#. (itstool) path: td/p
#: C/complex.page:51
msgid "Arg"
msgstr ""
msgstr "Arg"
#. (itstool) path: td/p
#: C/complex.page:52
msgid "Returns the argument of a complex number. For example:"
msgstr ""
msgstr "Zenbaki konplexu baten argumentua itzultzen du. Adibidez:"
#. (itstool) path: example/p
#: C/complex.page:54
msgid "Arg (2-5i) = -68.1986"
msgstr ""
msgstr "Arg (2-5i) = -68.1986"
#. (itstool) path: page/p
#: C/conv-base.page:11
msgid ""
"To convert the number to a different base representation use the <em>in</em> "
"operator."
msgstr ""
msgstr "Zenbakia beste oinarri-adierazpen batera bihurtzeko, erabili <em>in</em> eragilea."
#. (itstool) path: example/p
#: C/conv-base.page:15
msgid "12 in hex"
msgstr ""
msgstr "12 in hex"
#. (itstool) path: example/p
#: C/conv-base.page:18
msgid "5 in binary"
msgstr ""
msgstr "5 in binary"
#. (itstool) path: example/p
#: C/conv-base.page:21
msgid "1A₁₆ in dec"
msgstr ""
msgstr "1A₁₆ in dec"
#. (itstool) path: example/p
#: C/conv-base.page:24
msgid "1010₂ in octal"
msgstr ""
msgstr "1010₂ in octal"
#. (itstool) path: note/p
#: C/conv-base.page:29
msgid "Number Base conversions must be performed using the keyboard."
msgstr ""
msgstr "Zenbaki-oinarriaren bihurketak teklatuaren bidez gauzatu behar dira."
#. (itstool) path: page/title
#: C/conv-character.page:9
msgid "Character Codes"
msgstr ""
msgstr "Karaktere-kodeak"
#. (itstool) path: page/p
#: C/conv-character.page:11
msgid ""
"When in <link xref=\"mouse\">programming mode</link> the <gui>á</gui> button "
"opens a dialog to convert characters to character codes."
msgstr ""
msgstr "<link xref=\"mouse\">Programazio moduan</link>, <gui>á</gui> botoiak karaktereak karaktere-kode bihurtzeko erabili daitekeen elkarrizketa-koadro bat irekitzen du."
#. (itstool) path: note/p
#: C/conv-character.page:15
......@@ -255,7 +254,7 @@ msgid "Characters cannot be converted using the keyboard."
msgstr "Karaktereak ezin dira bihurtu teklatua erabilita."
#. (itstool) path: credit/name
#: C/conv-currency.page:10 C/index.page:8
#: C/conv-currency.page:10 C/index.page:11
msgid "Robert Ancell"
msgstr "Robert Ancell"
......@@ -289,12 +288,12 @@ msgstr "Moneta"
msgid ""
"To convert currencies, enter the <link xref=\"financial\">financial mode</"
"link>, and use the currency controls."
msgstr ""
msgstr "Monetak bihurtzeko, sartu <link xref=\"financial\">modu finantzarioan</link> eta erabili moneta-kontrolak."
#. (itstool) path: item/p
#: C/conv-currency.page:34
msgid "Enter the amount which you want to convert."
msgstr ""
msgstr "Sartu bihurtu nahi duzun kopurua."
#. (itstool) path: item/p
#: C/conv-currency.page:37
......@@ -308,7 +307,7 @@ msgstr ""
msgid ""
"Currency information is approximate and should not be used for making "
"financial decisions."
msgstr ""
msgstr "Monetari buruzko informazioa ez da zehatza eta ez litzateke erabili beharko erabaki finantzarioak hartzeko."
#. (itstool) path: page/title
#: C/conv-length.page:9
......@@ -325,92 +324,92 @@ msgstr "Luzerako, areako eta bolumeneko unitateak bihurtzeko, erabili <em>in</em
#. (itstool) path: example/p
#: C/conv-length.page:15
msgid "6 meters in inches"
msgstr ""
msgstr "6 meters in inches"
#. (itstool) path: example/p
#: C/conv-length.page:18
msgid "1 acre in cm²"
msgstr ""
msgstr "1 acre in cm²"
#. (itstool) path: example/p
#: C/conv-length.page:21
msgid "1 pint in mL"
msgstr ""
msgstr "1 pint in mL"
#. (itstool) path: note/p
#: C/conv-length.page:26
msgid "Length/Area/Volume conversions must be performed using the keyboard."
msgstr ""
msgstr "Luzeraren/arearen/bolumenaren bihurketak teklatuaren bidez gauzatu behar dira."
#. (itstool) path: page/title
#: C/conv-time.page:9
msgid "Time"
msgstr ""
msgstr "Denbora"
#. (itstool) path: page/p
#: C/conv-time.page:11
msgid "To convert between time use the <em>in</em> operator."
msgstr ""
msgstr "Denborako unitateak bihurtzeko, erabili <em>in</em> eragilea."
#. (itstool) path: example/p
#: C/conv-time.page:15
msgid "3 years in hours"
msgstr ""
msgstr "3 years in hours"
#. (itstool) path: note/p
#: C/conv-time.page:20
msgid "Time conversions must be performed using the keyboard."
msgstr ""
msgstr "Denboraren bihurketak teklatuaren bidez gauzatu behar dira."
#. (itstool) path: page/title
#: C/conv-weight.page:9
msgid "Mass"
msgstr ""
msgstr "Masa"
#. (itstool) path: page/p
#: C/conv-weight.page:11
msgid "To convert between mass use the <em>in</em> operator."
msgstr ""
msgstr "Masako unitateak bihurtzeko, erabili <em>in</em> eragilea."
#. (itstool) path: example/p
#: C/conv-weight.page:15
msgid "1kg in pounds"
msgstr ""
msgstr "1kg in pounds"
#. (itstool) path: note/p
#: C/conv-weight.page:20
msgid "Mass conversions must be performed using the keyboard."
msgstr ""
msgstr "Masaren bihurketak teklatuaren bidez gauzatu behar dira."
#. (itstool) path: info/title
#: C/equation.page:7
msgctxt "sort"
msgid "0"
msgstr ""
msgstr "0"
#. (itstool) path: page/title
#: C/equation.page:11
msgid "Basic Equations"
msgstr ""
msgstr "Oinarrizko ekuazioak"
#. (itstool) path: page/p
#: C/equation.page:13
msgid ""
"Equations are entered in standard mathematical form. For example to add 7 "
"and 2 enter the following:"
msgstr ""
msgstr "Ekuazioak forma matematiko estandarrean sartzen dira. Adibidez, 7 eta 2 zenbakien batuketa egiteko, sartu honakoa:"
#. (itstool) path: example/p
#: C/equation.page:18
msgid "7+2"
msgstr ""
msgstr "7+2"
#. (itstool) path: page/p
#: C/equation.page:22
msgid ""
"To solve, press the <gui>=</gui> button with your mouse or the <key>Enter</"
"key> key on your keyboard."
msgstr ""
msgstr "Ebazteko, sakatu <gui>=</gui> botoia saguarekin edo <key>Enter</key> tekla teklatuan."
#. (itstool) path: page/p
#: C/equation.page:25
......@@ -423,19 +422,19 @@ msgstr ""
#. (itstool) path: example/p
#: C/equation.page:30
msgid "7−3×2"
msgstr ""
msgstr "7−3×2"
#. (itstool) path: page/p
#: C/equation.page:34
msgid ""
"To change the order of calculation use parenthesis. The following equation "
"solves to 8 (7−3 = 4, 4×2 = 8)."
msgstr ""
msgstr "Kalkuluen ordena aldatzeko, erabili parentesiak. Hurrengo ekuazioak 8 ematen du (7−3 = 4, 4×2 = 8)."
#. (itstool) path: example/p
#: C/equation.page:39
msgid "(7−3)×2"
msgstr ""
msgstr "(7−3)×2"
#. (itstool) path: page/p
#: C/equation.page:43
......@@ -446,7 +445,7 @@ msgstr ""
#. (itstool) path: page/title
#: C/factorial.page:9
msgid "Factorials"
msgstr ""
msgstr "Faktorialak"
#. (itstool) path: page/p
#: C/factorial.page:11
......@@ -458,12 +457,12 @@ msgstr ""
#. (itstool) path: example/p
#: C/factorial.page:16
msgid "6!"
msgstr ""
msgstr "6!"
#. (itstool) path: page/title
#: C/factorize.page:9
msgid "Factorization"
msgstr ""
msgstr "Faktorizazioa"
#. (itstool) path: page/p
#: C/factorize.page:11
......@@ -476,12 +475,12 @@ msgstr ""
#. (itstool) path: page/title
#: C/financial.page:9
msgid "Financial Functions"
msgstr ""
msgstr "Funtzio finantzarioak"
#. (itstool) path: page/p
#: C/financial.page:10
msgid "When in financial mode the following buttons are available."
msgstr ""
msgstr "Modu finantzarioan, honako botoiak daude erabilgarri."
#. (itstool) path: td/p
#: C/financial.page:15
......@@ -615,7 +614,7 @@ msgstr ""
#. (itstool) path: note/p
#: C/financial.page:56
msgid "Financial functions cannot be performed using the keyboard."
msgstr ""
msgstr "Funtzio finantzarioak ezin dira gauzatu teklatuaren bidez."
#. (itstool) path: page/title
#: C/functions.page:9
......@@ -840,33 +839,51 @@ msgid ""
"up in the list for you to use."
msgstr ""
#. (itstool) path: info/title
#: C/index.page:7
msgctxt "link:trail"
msgid "Calculator Help"
msgstr "Kalkulagailuaren laguntza"
#. (itstool) path: info/title
#: C/index.page:8
msgctxt "text"
msgid "Calculator Help"
msgstr "Kalkulagailuaren laguntza"
#. (itstool) path: info/title
#: C/index.page:9
msgctxt "link"
msgid "Calculator Help"
msgstr "Kalkulagailuaren laguntza"
#. (itstool) path: page/title
#: C/index.page:14
#: C/index.page:17
msgid "<_:media-1/> Calculator Help"
msgstr ""
msgstr "<_:media-1/> Kalkulagailuaren laguntza"
#. (itstool) path: section/title
#: C/index.page:17
#: C/index.page:20
msgid "User Interface"
msgstr "Erabiltzaile-interfazea"
#. (itstool) path: section/title
#: C/index.page:21
#: C/index.page:24
msgid "Equations"
msgstr "Ekuazioak"
#. (itstool) path: section/title
#: C/index.page:25
#: C/index.page:28
msgid "Numbers"
msgstr "Zenbakiak"
#. (itstool) path: section/title
#: C/index.page:29
#: C/index.page:32
msgid "Conversions"
msgstr "Bihurketak"
#. (itstool) path: section/title
#: C/index.page:33
#: C/index.page:36
msgid "Financial Calculations"
msgstr "Finantza-kalkuluak"
......@@ -953,7 +970,7 @@ msgstr "Creative Commons Attribution-Share Alike 3.0 Unported lizentzia"
#. (itstool) path: license/p
#: C/legal.xml:3
msgid "This work is licensed under a <_:link-1/>."
msgstr ""
msgstr "Lan honen lizentzia <_:link-1/> da."
#. (itstool) path: license/p
#: C/legal.xml:6
......@@ -961,7 +978,7 @@ msgid ""
"As a special exception, the copyright holders give you permission to copy, "
"modify, and distribute the example code contained in this document under the "
"terms of your choosing, without restriction."
msgstr ""
msgstr "Salbuespen berezi gisa, copyright jabeek baimena ematen dizute dokumentu honetan dagoen kodea kopiatu, aldatu eta banatzeko zuk aukeratzen duzun lizentziaren arabera, inolako mugarik gabe."
#. (itstool) path: page/title
#: C/logarithm.page:9
......@@ -973,7 +990,7 @@ msgstr "Logaritmoak"
msgid ""
"Logarithms can be calculated using the log <link xref=\"function\">function</"
"link>."
msgstr ""
msgstr "Logaritmoak kalkulatzeko, erabili log <link xref=\"function\">funtzioa</link>."
#. (itstool) path: example/p
#: C/logarithm.page:15
......@@ -1050,7 +1067,7 @@ msgstr "Oinarrizkoa"
#: C/mouse.page:18
msgid ""
"Provides buttons suitable for <link xref=\"equation\">basic equations</link>"
msgstr ""
msgstr "<link xref=\"equation\">Oinarrizko ekuazioak</link> kalkulatzeko botoiak eskaintzen ditu"
#. (itstool) path: td/p
#: C/mouse.page:21
......@@ -1084,7 +1101,7 @@ msgstr "Programazioa"
#. (itstool) path: td/p
#: C/mouse.page:30
msgid "Provides buttons suitable for computer programmers"
msgstr ""
msgstr "Programatzaileentzako egokiak diren botoiak eskaintzen ditu"
#. (itstool) path: page/title
#: C/number-display.page:9
......@@ -1119,7 +1136,7 @@ msgstr "<gui>Finkoa</gui>"
#. (itstool) path: td/p
#: C/number-display.page:23
msgid "Results are always displayed as decimal numbers"
msgstr ""
msgstr "Emaitzak beti zenbaki hamartar gisa bistaratzen dira"
#. (itstool) path: td/p
#: C/number-display.page:26
......@@ -1130,7 +1147,7 @@ msgstr "<gui>Zientifikoa</gui>"
#: C/number-display.page:27
msgid ""
"Results are displayed in <link xref=\"scientific\">scientific notation</link>"
msgstr ""
msgstr "Emaitzak <link xref=\"scientific\">notazio zientifikoan</link> bistaratzen dira"
#. (itstool) path: td/p
#: C/number-display.page:30
......@@ -1199,12 +1216,12 @@ msgstr "Sebastian Rasmussen"
#. (itstool) path: info/desc
#: C/power.page:21
msgid "Learn to enter roots and powers into the calculator."
msgstr ""
msgstr "Ikasi kalkulagailuan erroak eta berreturak sartzen."
#. (itstool) path: page/title
#: C/power.page:24
msgid "Powers and Roots"
msgstr ""
msgstr "Berreturak eta erroak"
#. (itstool) path: page/p
#: C/power.page:26
......@@ -1247,14 +1264,14 @@ msgstr "5^(6−2)"
msgid ""
"If your keyboard does not have a <key>^</key> key you can use <key>*</key> "
"twice."
msgstr ""
msgstr "Zure teklatuak ez badu <key>^</key> tekla, erabili <key>*</key> bi aldiz."
#. (itstool) path: page/p
#: C/power.page:50
msgid ""
"Square roots can be calculated using the √ symbol (<keyseq><key>Ctrl</"
"key><key>R</key></keyseq>)."
msgstr ""
msgstr "Erro karratuak kalkulatzeko, erabili √ ikurra (<keyseq><key>Ctrl</key><key>R</key></keyseq>)."
#. (itstool) path: example/p
#: C/power.page:54
......@@ -1276,7 +1293,7 @@ msgstr "₃√2"
#. (itstool) path: page/title
#: C/scientific.page:9
msgid "Scientific Notation"
msgstr ""
msgstr "Notazio zientifikoa"
#. (itstool) path: page/p
#: C/scientific.page:11
......@@ -1290,14 +1307,14 @@ msgstr ""
#. (itstool) path: example/p
#: C/scientific.page:17
msgid "2"
msgstr "2"
msgstr "22"
#. (itstool) path: page/p
#: C/scientific.page:21
msgid ""
"Then press the scientific notation button (or press <keyseq><key>Ctrl</"
"key><key>E</key></keyseq>):"
msgstr ""
msgstr "Ondoren, sakatu notazio zientifikoaren botoia (edo sakatu <keyseq><key>Ctrl</key><key>E</key></keyseq>):"
#. (itstool) path: example/p
#: C/scientific.page:25
......@@ -1307,12 +1324,12 @@ msgstr "2×10"
#. (itstool) path: page/p
#: C/scientific.page:29
msgid "Then enter the exponent (100):"
msgstr ""
msgstr "Ondoren, sartu berretzailea (100):"
#. (itstool) path: example/p
#: C/scientific.page:33
msgid "2×10¹⁰⁰"
msgstr ""
msgstr "2×10¹⁰⁰"
#. (itstool) path: page/p
#: C/scientific.page:37
......@@ -1325,12 +1342,12 @@ msgstr ""
#: C/superscript.page:15
msgctxt "sort"
msgid "_"
msgstr ""
msgstr "_"
#. (itstool) path: page/title
#: C/superscript.page:19
msgid "Superscript and Subscript"
msgstr ""
msgstr "Goi-indizeak eta azpiindizeak"
#. (itstool) path: page/p
#: C/superscript.page:21
......@@ -1342,7 +1359,7 @@ msgstr ""
#. (itstool) path: example/p
#: C/superscript.page:25
msgid "x³+2x²−5"
msgstr ""
msgstr "x³+2x²−5"
#. (itstool) path: page/p
#: C/superscript.page:29
......@@ -1371,19 +1388,19 @@ msgstr ""
#. (itstool) path: page/title
#: C/trigonometry.page:9
msgid "Trigonometry"
msgstr ""
msgstr "Trigonometria"
#. (itstool) path: page/p
#: C/trigonometry.page:11
msgid ""
"Trigonometry can be performed using the sin, cos, and tan <link xref="
"\"function\">function</link>."
msgstr ""
msgstr "Eragiketa trigonometrikoak gauzatzeko, erabili sin, cos eta tan <link xref=\"function\">funtzioak</link>."
#. (itstool) path: example/p
#: C/trigonometry.page:15
msgid "sin 45"
msgstr ""
msgstr "sin 45"
#. (itstool) path: page/p
#: C/trigonometry.page:19
......@@ -1403,7 +1420,7 @@ msgstr ""
#. (itstool) path: example/p
#: C/trigonometry.page:28
msgid "sinh 0.34"
msgstr ""
msgstr "sinh 0.34"
#. (itstool) path: page/p
#: C/trigonometry.page:32
......@@ -1416,12 +1433,12 @@ msgstr ""
#. (itstool) path: example/p
#: C/trigonometry.page:37
msgid "sin⁻¹ 0.5"
msgstr ""
msgstr "sin⁻¹ 0.5"
#. (itstool) path: example/p
#: C/trigonometry.page:40
msgid "asin 0.5"
msgstr ""
msgstr "asin 0.5"
#. (itstool) path: page/p
#: C/trigonometry.page:44
......@@ -1433,7 +1450,7 @@ msgstr ""
#. (itstool) path: page/title
#: C/variables.page:9
msgid "Variables"
msgstr ""
msgstr "Aldagaiak"
#. (itstool) path: page/p
#: C/variables.page:11
......@@ -1447,12 +1464,12 @@ msgstr ""
#. (itstool) path: example/p
#: C/variables.page:16
msgid "x=5"
msgstr ""
msgstr "x=5"
#. (itstool) path: example/p
#: C/variables.page:19
msgid "example=82"
msgstr ""
msgstr "adibidea=82"
#. (itstool) path: page/p
#: C/variables.page:23
......@@ -1464,27 +1481,27 @@ msgstr ""
#. (itstool) path: example/p
#: C/variables.page:28
msgid "6x+3"
msgstr ""
msgstr "6x+3"
#. (itstool) path: example/p
#: C/variables.page:31
msgid "xy−3x+7y−21"
msgstr ""
msgstr "xy−3x+7y−21"
#. (itstool) path: page/p
#: C/variables.page:35
msgid "The following variables are always defined."
msgstr ""
msgstr "Hurrengo aldagaiak beti daude definituta."
#. (itstool) path: td/p
#: C/variables.page:40
msgid "_"
msgstr ""
msgstr "_"
#. (itstool) path: td/p
#: C/variables.page:41
msgid "Result of previous calculation"
msgstr ""
msgstr "Aurreko kalkuluaren emaitza."
#. (itstool) path: td/p
#: C/variables.page:44
......@@ -1494,32 +1511,32 @@ msgstr "e"
#. (itstool) path: td/p
#: C/variables.page:45
msgid "<link xref=\"logarithm\">Euler's Number</link>"
msgstr ""
msgstr "<link xref=\"logarithm\">Eulerren zenbakia</link>"
#. (itstool) path: td/p
#: C/variables.page:49
msgid "<link xref=\"trigonometry\">Pi</link>"
msgstr ""
msgstr "<link xref=\"trigonometry\">Pi</link>"
#. (itstool) path: td/p
#: C/variables.page:52
msgid "τ"
msgstr ""
msgstr "τ"
#. (itstool) path: td/p
#: C/variables.page:53
msgid "<link xref=\"trigonometry\">Tau</link>"
msgstr ""
msgstr "<link xref=\"trigonometry\">Tau</link>"
#. (itstool) path: td/p
#: C/variables.page:56
msgid "rand"
msgstr ""
msgstr "rand"
#. (itstool) path: td/p
#: C/variables.page:57
msgid "Random value in the range [0,1] (changes on each read)"
msgstr ""
msgstr "[0,1] barrutiko ausazko balioa (irakurketa bakoitzean aldatzen da)"
#~ msgid ""
#~ "@@image: 'figures/gcalctool_basic_window.png'; "
......@@ -1765,9 +1782,6 @@ msgstr ""
#~ msgid "gcalctool"
#~ msgstr "gcalctool"
#~ msgid "Calculator"
#~ msgstr "Kalkulagailua"
#~ msgid "Introduction"
#~ msgstr "Sarrera"
......
This diff is collapsed.
......@@ -2155,14 +2155,12 @@ public class Parser
if (token.type == LexerTokenType.PL_EOS || token.type == LexerTokenType.ASSIGN)
return true;
if (token.type == LexerTokenType.VARIABLE)
if (token.type == LexerTokenType.FUNCTION || token.type == LexerTokenType.VARIABLE || token.type == LexerTokenType.SUB_NUMBER || token.type == LexerTokenType.ROOT || token.type == LexerTokenType.ROOT_3 || token.type == LexerTokenType.ROOT_4)
{
/* Insert multiply in between two distinct (variable). */
/* Insert multiply in between variable and (function, variable, root) */
insert_into_tree (new MultiplyNode (this, null, make_precedence_p (Precedence.MULTIPLY), get_associativity_p (Precedence.MULTIPLY)));
if (!term ())
if (!variable ())
return false;
return true;
}
else
......
......@@ -34,7 +34,7 @@ libcalculator_deps = [
mpc,
mpfr,
posix,
gcalc_inc_libh_dep
libmpfr_inc_libh_dep
]
libcalculator = static_library('calculator', libcalculator_sources,
......
......@@ -38,7 +38,7 @@ public enum AngleUnit
}
/* Object for a high precision floating point number representation */
public class Number : Object
public class Number : GLib.Object
{
/* real and imaginary part of a Number */
private Complex num = Complex (precision);
......
lib_mpfrg_sources = files([
'mpfr-glue.vala'
])
libmpfr_inc_libh = include_directories ('.')
libmpfr_inc_libh_dep = declare_dependency (include_directories : libmpfr_inc_libh)
libmpfr_vapi_dir = meson.current_build_dir()
lib_mpfrg = static_library ('mpfrg',
lib_mpfrg_sources,
vala_header: 'mpfrg.h',
vala_vapi: 'mpfrg.vapi',
dependencies: [
gio,
mpc,
mpfr,
],
install: false,
)
project('gnome-calculator', ['c', 'vala'],
version: '42.2',
version: '43.alpha',
meson_version: '>= 0.57.0',
license: 'GPLv3+',
)
......@@ -24,7 +24,7 @@ endif
# Some variables
libexec_dir = join_paths(get_option('prefix'), get_option('libexecdir'))
locale_dir = join_paths(get_option('prefix'), get_option('localedir'))
po_dir = join_paths(meson.source_root(), 'po')
po_dir = join_paths(meson.project_source_root(), 'po')
gcalc_vapi_dir = join_paths(meson.current_source_dir(), 'vapi')
# Dependencies
......@@ -80,26 +80,40 @@ conf.set10('DEVELOPMENT_BUILD', get_option('development'))
configure_file(output: 'config.h', configuration: conf)
config_h_dir = include_directories('.')
# Extra scripts
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
)
# Subdirs
subdir('po')
subdir('vapi')
subdir('libmpfr')
if get_option ('gcalc')
subdir('gcalc')
endif
if not get_option ('disable-ui')
gtk = dependency('gtk4', version: '>= 4.4.1')
libadwaita = dependency('libadwaita-1', version: '>= 1.0.0')
if get_option('gci') and get_option('gcalc')
subdir('gci')
endif
if get_option('app')
# Extra scripts
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
)
libadwaita = dependency('libadwaita-1', version: '>= 1.0.0')
gtksourceview = dependency('gtksourceview-5', version: '>= 5.3.0')
subdir('data')
subdir('lib')
subdir('src')
subdir('search-provider')
subdir('help')
endif
endif
if get_option('doc')
subdir('doc')
subdir('po')
endif
subdir('tests')
......@@ -4,3 +4,7 @@ option('disable-introspection', type : 'boolean', value : false, description : '
option('ui-tests', type : 'boolean', value : false, description : 'Execute UI tests: requires X/Wayland/Broadway/Windows server')
option('libpath', type: 'string', value : '', description : 'Used to add search path for libraries like mpc')
option('development', type: 'boolean', value: false, description: 'If this is a development build')
option('gcalc', type: 'boolean', value: true, description: 'Build GCalc library')
option('gci', type: 'boolean', value: true, description: 'Build GCalc UI library')
option('app', type: 'boolean', value: true, description: 'Build GNOME Calculator Application')
option('doc', type: 'boolean', value: true, description: 'Build GCalc and/or GCi documentation')
......@@ -86,6 +86,7 @@
"buildsystem" : "meson",
"config-opts" : [
"-Ddisable-introspection=true",
"-Dgcalc=false",
"-Ddevelopment=true"
],
"sources" : [
......