nit.git
8 years agomisc/vim: do not show the preview window when using the omnifunc
Alexis Laferrière [Tue, 15 Mar 2016 15:57:12 +0000 (11:57 -0400)]
misc/vim: do not show the preview window when using the omnifunc

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: lib/android: intro WiFi services wrapper
Jean Privat [Mon, 14 Mar 2016 18:45:19 +0000 (14:45 -0400)]
Merge: lib/android: intro WiFi services wrapper

Intro a simple wrapper for Android WiFi services. It allows to list WiFi networks in range, and could be extended with more features in the future.

It was partially generated by jwrapper (with the included command) and completed by hand. As usual with generated wrapper, the client of the library should refer to the corresponding Java/Android documentation to know more about these services.

Pull-Request: #1984
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: http_request: intro an attribute to delay sending the request
Jean Privat [Mon, 14 Mar 2016 18:45:18 +0000 (14:45 -0400)]
Merge: http_request: intro an attribute to delay sending the request

Move up the delay service from Tnitter to AsyncHttpRequest. It can be useful for other apps, for regular polling or to avoid to overwhelm the server on errors.

Pull-Request: #1983
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Android service support: reliably run Nit code in the background
Jean Privat [Mon, 14 Mar 2016 18:45:16 +0000 (14:45 -0400)]
Merge: Android service support: reliably run Nit code in the background

Add support to create Android services in Nit, working alongside activities implemented in Nit. The service can be launched on demande or at the device boot. Only one Nit service at a time can run per package. However the same service can be started more than once and you can do pretty much anything on the Nit side since it shares the same process as the activities.

Uses a broadcast receiver to launch service at boot. This receiver could be used to catch other broadcast, but it currently does not preserve the original intent.

Also updates most Android related modules to use `native_context` instead of `native_activity` so they can be called from services, when the Android API allows it. Some services had to be modified sightly, like the default `SharedPreferences` which is now named (instead of using the one attached to the activity). It should not break any clients as most use `data_store` which was already named.

Pull-Request: #1982
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agocontrib/jwrapper: add command to wrap wifi services to the examples
Alexis Laferrière [Wed, 25 Nov 2015 13:05:14 +0000 (08:05 -0500)]
contrib/jwrapper: add command to wrap wifi services to the examples

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: intro the `wifi` module
Alexis Laferrière [Thu, 11 Sep 2014 18:46:42 +0000 (14:46 -0400)]
lib/android: intro the `wifi` module

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: if there is no activities, run UI code on the caller thread
Alexis Laferrière [Fri, 11 Mar 2016 18:55:55 +0000 (13:55 -0500)]
lib/android: if there is no activities, run UI code on the caller thread

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: intro support for launching service at device boot
Alexis Laferrière [Fri, 19 Feb 2016 23:39:40 +0000 (18:39 -0500)]
lib/android: intro support for launching service at device boot

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: intro service support
Alexis Laferrière [Thu, 18 Feb 2016 04:08:17 +0000 (23:08 -0500)]
lib/android: intro service support

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: update other modules to use android_context
Alexis Laferrière [Sat, 12 Mar 2016 18:42:00 +0000 (13:42 -0500)]
lib/android: update other modules to use android_context

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android/shared_prefs: use `native_context` and change to a named prefs set
Alexis Laferrière [Sat, 12 Mar 2016 18:58:17 +0000 (13:58 -0500)]
lib/android/shared_prefs: use `native_context` and change to a named prefs set

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android/toast: remove some callbacks
Alexis Laferrière [Fri, 11 Mar 2016 18:54:09 +0000 (13:54 -0500)]
lib/android/toast: remove some callbacks

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: intro `app::native_context` and use in `dalvik`
Alexis Laferrière [Fri, 11 Mar 2016 18:50:47 +0000 (13:50 -0500)]
lib/android: intro `app::native_context` and use in `dalvik`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/app: move up the delay services to AsyncHttpRequest
Alexis Laferrière [Sat, 21 Nov 2015 21:58:52 +0000 (16:58 -0500)]
lib/app: move up the delay services to AsyncHttpRequest

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Interpreter FFI: support the pkgconfig annotation
Jean Privat [Fri, 11 Mar 2016 20:05:52 +0000 (15:05 -0500)]
Merge: Interpreter FFI: support the pkgconfig annotation

Pull-Request: #1980
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agotests: skip lots_of_refs test with niti and nitvm
Alexis Laferrière [Fri, 11 Mar 2016 14:31:17 +0000 (09:31 -0500)]
tests: skip lots_of_refs test with niti and nitvm

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Benitlux: Minor improvements to the server
Jean Privat [Fri, 11 Mar 2016 05:10:42 +0000 (00:10 -0500)]
Merge: Benitlux: Minor improvements to the server

This is in preparation to the introduction of all the social network features.

I expect to have some .sav to update because of the commit removing the check of NIT_TESTING.

Pull-Request: #1981
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoniti FFI: do not attempt to run extern methods returning a non-primitive type
Alexis Laferrière [Thu, 10 Mar 2016 15:09:34 +0000 (10:09 -0500)]
niti FFI: do not attempt to run extern methods returning a non-primitive type

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolibevent: protect callbacks for compatibility with the light FFI
Alexis Laferrière [Thu, 10 Mar 2016 15:02:30 +0000 (10:02 -0500)]
libevent: protect callbacks for compatibility with the light FFI

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: nitcc open class
Jean Privat [Thu, 10 Mar 2016 04:55:52 +0000 (23:55 -0500)]
Merge: nitcc open class

Accept open classes in regular expression in nitcc.

I thought that the feature was already here, since it is in SableCC4 and already handled by the current nitcc engine.

For information, this allows to indicate an open range of accepted characters.

~~~
a = 'A'...; // `a` can match "A", "B" or "䕫" and a lot other character
~~~

It is basically equivalent to

~~~
a = Any - (#0 .. '@');
~~~

It is also used by the grammar to extends the range of possible literals and enable language description with phoenician keyword and complex emoji-based regular expressions.

Pull-Request: #1979
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: app.nit UI: Intro an attribute to toggle password entry on TextFields
Jean Privat [Thu, 10 Mar 2016 04:55:45 +0000 (23:55 -0500)]
Merge: app.nit UI: Intro an attribute to toggle password entry on TextFields

The attribute `TextField::is_password` toggles hiding the content of the field using platform specific services. So on Android, not only is the text hidden but it also notifies the soft keyboard to behave accordingly.

In the future, we could add alternative modes for email entry and more.

Pull-Request: #1978
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Misc text: some improvement on `join` and `to_base`
Jean Privat [Thu, 10 Mar 2016 04:55:35 +0000 (23:55 -0500)]
Merge: Misc text: some improvement on `join` and `to_base`

Pull-Request: #1977
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Interpreter FFI: custom compile_dir, use /tmp/ by default, and delete after...
Jean Privat [Thu, 10 Mar 2016 04:55:19 +0000 (23:55 -0500)]
Merge: Interpreter FFI: custom compile_dir, use /tmp/ by default, and delete after execution

Generate native files in the `/tmp/` directory and delete them after execution. The directory can be customized using `--compile-dir`.

This should fix #1974 and #1975.

To support some other OS, we will need to use something other than `getpid` and `/tmp/`. We could also improve upon this by reusing the generated libraries between executions.

Pull-Request: #1976
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agolib/core/text: move `to_base` to the main base module and remove the useless `signed...
Jean Privat [Mon, 7 Mar 2016 17:07:06 +0000 (12:07 -0500)]
lib/core/text: move `to_base` to the main base module and remove the useless `signed` parameter

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/core/text: add a last_separator to `Collection::join`
Jean Privat [Mon, 7 Mar 2016 16:02:58 +0000 (11:02 -0500)]
lib/core/text: add a last_separator to `Collection::join`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcc: test open class
Jean Privat [Wed, 9 Mar 2016 04:57:44 +0000 (23:57 -0500)]
nitcc: test open class

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcc: do not limit accepted literal char to `~`
Jean Privat [Wed, 9 Mar 2016 05:00:30 +0000 (00:00 -0500)]
nitcc: do not limit accepted literal char to `~`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcc: add open-class regexp for tokens.
Jean Privat [Wed, 9 Mar 2016 04:59:36 +0000 (23:59 -0500)]
nitcc: add open-class regexp for tokens.

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocontrib: do not check for NIT_TESTING, nitcorn already checks
Alexis Laferrière [Wed, 9 Mar 2016 18:15:52 +0000 (13:15 -0500)]
contrib: do not check for NIT_TESTING, nitcorn already checks

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/benitlux: use result based rules to compose the server rule
Alexis Laferrière [Mon, 2 Nov 2015 20:33:20 +0000 (15:33 -0500)]
contrib/benitlux: use result based rules to compose the server rule

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/benitlux: move the iface declaration to the toplevel for use with -D
Alexis Laferrière [Sun, 1 Nov 2015 15:34:15 +0000 (10:34 -0500)]
contrib/benitlux: move the iface declaration to the toplevel for use with -D

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/benitlux: add `Beer::id`
Alexis Laferrière [Sun, 25 Oct 2015 17:30:47 +0000 (13:30 -0400)]
contrib/benitlux: add `Beer::id`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoniti FFI: support the pkgconfig annotation
Alexis Laferrière [Wed, 9 Mar 2016 17:57:17 +0000 (12:57 -0500)]
niti FFI: support the pkgconfig annotation

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/ios: implement `TextInput::is_password`
Alexis Laferrière [Thu, 3 Mar 2016 16:11:21 +0000 (11:11 -0500)]
lib/ios: implement `TextInput::is_password`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: implement `TextInput::is_password`
Alexis Laferrière [Thu, 3 Mar 2016 16:11:04 +0000 (11:11 -0500)]
lib/android: implement `TextInput::is_password`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoniti FFI: create compile_dir with permissions 0o700
Alexis Laferrière [Mon, 7 Mar 2016 19:34:46 +0000 (14:34 -0500)]
niti FFI: create compile_dir with permissions 0o700

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/core: add optional mode parameter to mkdir
Alexis Laferrière [Mon, 7 Mar 2016 19:23:05 +0000 (14:23 -0500)]
lib/core: add optional mode parameter to mkdir

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: FFI: use more c_name and protect some macros for global compilation
Jean Privat [Sat, 5 Mar 2016 23:14:34 +0000 (18:14 -0500)]
Merge: FFI: use more c_name and protect some macros for global compilation

Pull-Request: #1967
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoniti FFI: delete the nit_compile directory after execution
Alexis Laferrière [Fri, 4 Mar 2016 19:21:05 +0000 (14:21 -0500)]
niti FFI: delete the nit_compile directory after execution

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoniti FFI: cmd line option to change the nit_compile dir and default to /tmp/
Alexis Laferrière [Fri, 4 Mar 2016 19:19:05 +0000 (14:19 -0500)]
niti FFI: cmd line option to change the nit_compile dir and default to /tmp/

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Faster text get
Jean Privat [Fri, 4 Mar 2016 14:01:34 +0000 (09:01 -0500)]
Merge: Faster text get

Try to improve the efficiency of the FlatText[] method by shortcuting some common and easy cases.

using benchmarks/json:

![bench_json](https://cloud.githubusercontent.com/assets/135828/13518437/bc07c954-e19b-11e5-9ddf-8f69307fcd0a.png)

Ping @R4PaSs for review

Pull-Request: #1973

8 years agoMerge: lib/markdown: improve performance a bit
Jean Privat [Fri, 4 Mar 2016 14:00:28 +0000 (09:00 -0500)]
Merge: lib/markdown: improve performance a bit

Using benchmarks/markdown:

* nitmd_master is before
* nitmd_md is this now
* nitmd_md_fast is with #1973 in addition
* the 3 same avain with with --semi-global
* 2 Java libs: txtmark, markdown4j

![bench_markdown](https://cloud.githubusercontent.com/assets/135828/13517453/b008a7fe-e191-11e5-80c8-d17cd85df6be.png)

There is still a lot of performance improvements to do anyway.

Pull-Request: #1972
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agotests: update sav//test_text_stat.res
Jean Privat [Fri, 4 Mar 2016 06:24:48 +0000 (01:24 -0500)]
tests: update sav//test_text_stat.res

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/markdown: allow to ignore the MDlocation on Tokens
Jean Privat [Fri, 4 Mar 2016 06:22:51 +0000 (01:22 -0500)]
lib/markdown: allow to ignore the MDlocation on Tokens

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotext/flat: FlatText::[] handle statistically common cases first
Jean Privat [Fri, 4 Mar 2016 02:47:09 +0000 (21:47 -0500)]
text/flat: FlatText::[] handle statistically common cases first

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotext/flat: FlatText::char_to_byte_index shortcut length_of_char_at if possible
Jean Privat [Fri, 4 Mar 2016 02:40:57 +0000 (21:40 -0500)]
text/flat: FlatText::char_to_byte_index shortcut length_of_char_at if possible

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotext/flat: FlatText::char_to_byte_index do the +1 first (and 0 last)
Jean Privat [Fri, 4 Mar 2016 02:40:27 +0000 (21:40 -0500)]
text/flat: FlatText::char_to_byte_index do the +1 first (and 0 last)

Because stats!

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotext/flat: FlatText::char_to_byte_index factorize `item` accessor
Jean Privat [Fri, 4 Mar 2016 02:39:44 +0000 (21:39 -0500)]
text/flat: FlatText::char_to_byte_index factorize `item` accessor

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotext/flat: faster NativeString::set_char_at
Jean Privat [Fri, 4 Mar 2016 02:38:34 +0000 (21:38 -0500)]
text/flat: faster NativeString::set_char_at

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/markdown: use a break label instead of a local flag
Jean Privat [Fri, 4 Mar 2016 02:30:44 +0000 (21:30 -0500)]
lib/markdown: use a break label instead of a local flag

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/markdown: avoid useless `to_s` on Chars
Jean Privat [Thu, 3 Mar 2016 21:15:27 +0000 (16:15 -0500)]
lib/markdown: avoid useless `to_s` on Chars

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocontrib/benitlux: use the latest entry as reference for the current offering
Alexis Laferrière [Sat, 22 Aug 2015 21:35:18 +0000 (17:35 -0400)]
contrib/benitlux: use the latest entry as reference for the current offering

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/benitlux: accept more date formats
Alexis Laferrière [Sat, 22 Aug 2015 21:34:26 +0000 (17:34 -0400)]
contrib/benitlux: accept more date formats

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/app & linux: intro `TextInput::is_password`
Alexis Laferrière [Wed, 25 Nov 2015 21:18:14 +0000 (16:18 -0500)]
lib/app & linux: intro `TextInput::is_password`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: fix Int::is_prime
Jean Privat [Thu, 3 Mar 2016 07:35:26 +0000 (02:35 -0500)]
Merge: fix Int::is_prime

Primality test should also test the sqrt of the number.

Pull-Request: #1970
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: nitc: don't crash when checking if a broken method can be inlined
Jean Privat [Thu, 3 Mar 2016 07:35:23 +0000 (02:35 -0500)]
Merge: nitc: don't crash when checking if a broken method can be inlined

Pull-Request: #1968

8 years agoMerge: New `optional` annotation on attributes
Jean Privat [Thu, 3 Mar 2016 07:35:09 +0000 (02:35 -0500)]
Merge: New `optional` annotation on attributes

As requested at #1843 by @R4PaSs, a new annotation `optional` is now available on attributes.

~~~nit
class A
    var x: Int = 99 is optional
   # Because of `optional`, the automatic signature of the A constructor is `init(x: nullable Int)`
end

var a = new A
print a.x # outputs 99
var b = new A(4)
print b.x # output 4
~~~

In the model, the `optional` annotation only affects the signature and the behavior of the setter.
It transforms the argument to a `nullable` one and use the provided value if `null` is given as a parameter.

The `nullable` parameter is then propagated to the automatic constructors in the usual way.

Basically, the previous example is equivalent to having written:

~~~
class A
    var x: Int is noautoinit
    fun x=(x: nullable Int) is autoinit do if x != null then self.x = x else self.x = 99
end
~~~

Pull-Request: #1965
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: typing: include a hook to enable more precise error information on 'expected...
Jean Privat [Thu, 3 Mar 2016 07:35:01 +0000 (02:35 -0500)]
Merge: typing: include a hook to enable more precise error information on 'expected expression' errors

The point is to help to solve the second part of #1392

Before:

~~~
print (-1).to_s
^
test.nit:2,1--10: Error: expected an expression.
~~~

After:

~~~
print (-1).to_s
^
test.nit:2,1--10: Error: expected an expression to be the receiver of `to_s`
~~~

Pull-Request: #1963
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agofix Int::is_prime
Jean Privat [Wed, 2 Mar 2016 20:24:38 +0000 (15:24 -0500)]
fix Int::is_prime

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitc: don't crash when checking if a broken method can be inlined
Alexis Laferrière [Sat, 17 Oct 2015 15:17:41 +0000 (11:17 -0400)]
nitc: don't crash when checking if a broken method can be inlined

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agosrc/ffi: protect friendly macro names in type check and casts for global comp
Alexis Laferrière [Sat, 17 Oct 2015 15:16:52 +0000 (11:16 -0400)]
src/ffi: protect friendly macro names in type check and casts for global comp

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agosrc/ffi: fix use of c_name for mangled names
Alexis Laferrière [Sat, 17 Oct 2015 15:16:21 +0000 (11:16 -0400)]
src/ffi: fix use of c_name for mangled names

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agotests: add base_attr_optional.nit
Jean Privat [Fri, 26 Feb 2016 21:06:56 +0000 (16:06 -0500)]
tests: add base_attr_optional.nit

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoengine: handle new attribute annotation `is_optional`
Jean Privat [Fri, 26 Feb 2016 21:01:29 +0000 (16:01 -0500)]
engine: handle new attribute annotation `is_optional`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agomodelize: new attribute annotation `is optional`
Jean Privat [Fri, 26 Feb 2016 21:00:58 +0000 (16:00 -0500)]
modelize: new attribute annotation `is optional`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agomodelize: use the signature of the setter in the initializer
Jean Privat [Fri, 26 Feb 2016 21:00:26 +0000 (16:00 -0500)]
modelize: use the signature of the setter in the initializer

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: examples/calculator: fix missing icon in Android
Jean Privat [Fri, 26 Feb 2016 13:34:56 +0000 (08:34 -0500)]
Merge: examples/calculator: fix missing icon in Android

Pull-Request: #1964
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agotyping: include a hook to enable more precise error information on 'expected expressi...
Jean Privat [Thu, 25 Feb 2016 19:11:57 +0000 (14:11 -0500)]
typing: include a hook to enable more precise error information on 'expected expression' errors

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoexamples/calculator: fix missing icon in Android
Alexis Laferrière [Thu, 25 Feb 2016 21:16:09 +0000 (16:16 -0500)]
examples/calculator: fix missing icon in Android

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: core/list: fix `List::clear` so it resets `length` to 0
Jean Privat [Thu, 25 Feb 2016 14:02:28 +0000 (09:02 -0500)]
Merge: core/list: fix `List::clear` so it resets `length` to 0

This bug lead to segmentation faults when iterating over the items of a list after a call to `clear`.

Pull-Request: #1962
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: contrib/opportunity: fix usage of % format, now indexed from 0
Jean Privat [Thu, 25 Feb 2016 14:02:25 +0000 (09:02 -0500)]
Merge: contrib/opportunity: fix usage of % format, now indexed from 0

http://xymus.net/opportunity/ has already been updated with the fix.

Pull-Request: #1961
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: lib/sdl: workaround to avoid constructor callback bug
Jean Privat [Thu, 25 Feb 2016 14:02:23 +0000 (09:02 -0500)]
Merge: lib/sdl: workaround to avoid constructor callback bug

This was first a temporary fix for #1941 to repair Nit games on the deskop. But it is also a nice cleanup, it brings to Nit the instantiation and the implicit cast to a more general and nullable type. The casts themselves were not very pretty using FFI callbacks.

Pull-Request: #1960
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Opportunity and Tnitter logos
Jean Privat [Thu, 25 Feb 2016 14:02:19 +0000 (09:02 -0500)]
Merge: Opportunity and Tnitter logos

This PR intro 2 logos for Opportunity (in English and French) and a new wide icon for Tnitter. These news icons are already in use on http://xymus.net/opportunity.

Note that even if the large Opportunity logo on the landing page is vectorial, it should not be the file included in the `art/` directory for a production server. That file has both logos, more assets and uses fonts, all of which should be stripped for a production server. It is still good enough for local debugging.

Pull-Request: #1959
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: Minor fix to atan2 and triangulate
Jean Privat [Thu, 25 Feb 2016 14:02:17 +0000 (09:02 -0500)]
Merge: Minor fix to atan2 and triangulate

Fix reversed axes in `atan2`, but since it is actually just a change in the name of the variables (and doc) it should not break the clients.

Also sorting points of a polygon in `triangulate` completely invalidated some complex polygons.

Pull-Request: #1958
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>

8 years agoMerge: Minor tweaks and fixes for Android
Jean Privat [Thu, 25 Feb 2016 14:02:13 +0000 (09:02 -0500)]
Merge: Minor tweaks and fixes for Android

Pull-Request: #1957
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agolib/core: fix `List::clear` not setting `length` to 0
Alexis Laferrière [Thu, 25 Feb 2016 04:08:42 +0000 (23:08 -0500)]
lib/core: fix `List::clear` not setting `length` to 0

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/opportunity: fix usage of % format indexed at 0
Alexis Laferrière [Tue, 23 Feb 2016 20:06:17 +0000 (15:06 -0500)]
contrib/opportunity: fix usage of % format indexed at 0

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Reported-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoxymus.net: point to subfolders instead of subdomains to share the cache
Alexis Laferrière [Mon, 15 Feb 2016 13:34:30 +0000 (08:34 -0500)]
xymus.net: point to subfolders instead of subdomains to share the cache

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoxymus.net: track more pages with google analytics
Alexis Laferrière [Sun, 14 Feb 2016 21:32:13 +0000 (16:32 -0500)]
xymus.net: track more pages with google analytics

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoxymus.net: use opportunity and tnitter branding in header
Alexis Laferrière [Sun, 14 Feb 2016 03:32:27 +0000 (22:32 -0500)]
xymus.net: use opportunity and tnitter branding in header

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/tnitter: intro wide icon for the web client
Alexis Laferrière [Sun, 14 Feb 2016 14:29:42 +0000 (09:29 -0500)]
contrib/tnitter: intro wide icon for the web client

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/opportunity: revamp style of welcome page and use branding
Alexis Laferrière [Sun, 14 Feb 2016 02:25:21 +0000 (21:25 -0500)]
contrib/opportunity: revamp style of welcome page and use branding

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/opportunity: intro branding source file
Alexis Laferrière [Sun, 14 Feb 2016 02:16:34 +0000 (21:16 -0500)]
contrib/opportunity: intro branding source file

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/core: fix order of the params of `atan(y, x)`
Alexis Laferrière [Tue, 23 Feb 2016 16:20:04 +0000 (11:20 -0500)]
lib/core: fix order of the params of `atan(y, x)`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/geometry: do not sort points as it invalidates the shape of the polygon
Alexis Laferrière [Mon, 22 Feb 2016 17:39:03 +0000 (12:39 -0500)]
lib/geometry: do not sort points as it invalidates the shape of the polygon

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Recover `recover_with`
Jean Privat [Mon, 22 Feb 2016 13:54:40 +0000 (08:54 -0500)]
Merge: Recover `recover_with`

close #1767

Pull-Request: #1956
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: more work on nitcc
Jean Privat [Mon, 22 Feb 2016 13:54:38 +0000 (08:54 -0500)]
Merge: more work on nitcc

Random nitpicks

Pull-Request: #1955
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agotest_regex_check.nit: use the shorter `join`
Jean Privat [Mon, 22 Feb 2016 13:51:49 +0000 (08:51 -0500)]
test_regex_check.nit: use the shorter `join`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/core/collection: improve the default `has_all` for basic cases
Jean Privat [Fri, 19 Feb 2016 15:34:15 +0000 (10:34 -0500)]
lib/core/collection: improve the default `has_all` for basic cases

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcc: improve perf by caching the result of cmangle
Jean Privat [Fri, 19 Feb 2016 15:33:02 +0000 (10:33 -0500)]
nitcc: improve perf by caching the result of cmangle

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcc: fixup the .lr.out file
Jean Privat [Fri, 19 Feb 2016 15:32:36 +0000 (10:32 -0500)]
nitcc: fixup the .lr.out file

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/sdl: fix for constructor callback bug
Alexis Laferrière [Sat, 20 Feb 2016 16:47:24 +0000 (11:47 -0500)]
lib/sdl: fix for constructor callback bug

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib: use add_all instead of recover_with
Jean Privat [Sun, 21 Feb 2016 15:03:52 +0000 (10:03 -0500)]
contrib: use add_all instead of recover_with

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitc: do not define be32toh when it exists on Android
Alexis Laferrière [Thu, 18 Feb 2016 17:34:09 +0000 (12:34 -0500)]
nitc: do not define be32toh when it exists on Android

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: use the more general NativeContext with annotations
Alexis Laferrière [Fri, 19 Feb 2016 23:41:36 +0000 (18:41 -0500)]
lib/android: use the more general NativeContext with annotations

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: pin Nit buttons from Java callbacks
Alexis Laferrière [Wed, 25 Nov 2015 21:36:10 +0000 (16:36 -0500)]
lib/android: pin Nit buttons from Java callbacks

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: fix ListLayout by pinning the adapter in the Java GC
Alexis Laferrière [Tue, 24 Nov 2015 14:48:19 +0000 (09:48 -0500)]
lib/android: fix ListLayout by pinning the adapter in the Java GC

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocode: update clients of the former `recover_with`
Jean Privat [Fri, 19 Feb 2016 15:56:52 +0000 (10:56 -0500)]
code: update clients of the former `recover_with`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/core: rename `recover_with` as `add_all`
Jean Privat [Fri, 19 Feb 2016 15:56:19 +0000 (10:56 -0500)]
lib/core: rename `recover_with` as `add_all`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: OSX: disable non-working tests, and tests cocoa
Jean Privat [Thu, 18 Feb 2016 23:31:15 +0000 (18:31 -0500)]
Merge: OSX: disable non-working tests, and tests cocoa

Pull-Request: #1954
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>